angle.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Harry Storbacka
00027 */
00028 
00031 
00032 #pragma once
00033 
00034 #include "../api_core.h"
00035 #include "../System/sharedptr.h"
00036 
00037 class CL_Angle_Impl;
00038 
00042 enum CL_AngleUnit
00043 {
00044         cl_degrees,
00045         cl_radians
00046 };
00047 
00051 class CL_API_CORE CL_Angle
00052 {
00055 public:
00057         CL_Angle();
00058 
00060         CL_Angle(float value, CL_AngleUnit unit);
00061 
00067         static CL_Angle from_radians(float value);
00068 
00074         static CL_Angle from_degrees(float value);
00075 
00079 public:
00081         float to_degrees() const;
00082 
00084         float to_radians() const;
00085 
00089 public:
00091         void set_degrees(float degrees);
00092 
00094         void set_radians(float radians);
00095 
00097         void normalize();
00098 
00100         void normalize_180();
00101 
00105 public:
00107         void operator += (const CL_Angle &angle);
00108 
00110         void operator -= (const CL_Angle &angle);
00111 
00113         void operator *= (const CL_Angle &angle);
00114 
00116         void operator /= (const CL_Angle &angle);
00117 
00119         CL_Angle operator + (const CL_Angle &angle) const;
00120 
00122         CL_Angle operator - (const CL_Angle &angle) const;
00123 
00125         CL_Angle operator * (const CL_Angle &angle) const;
00126 
00128         CL_Angle operator * (float value) const;
00129 
00131         CL_Angle operator / (const CL_Angle &angle) const;
00132 
00134         CL_Angle operator / (float value) const;
00135 
00137         bool operator < (const CL_Angle &angle) const;
00138 
00140         bool operator <= (const CL_Angle &angle) const;
00141 
00143         bool operator > (const CL_Angle &angle) const;
00144 
00146         bool operator >= (const CL_Angle &angle) const;
00147 
00149         bool operator== (const CL_Angle &angle) const;
00150 
00152         bool operator!= (const CL_Angle &angle) const;
00153 
00157 private:
00158         float value_rad;
00159 
00161 };
00162 

Generated on Thu Dec 3 02:39:28 2009 for ClanLib by  doxygen 1.4.6