CrossFramework Library
|
00001 00006 #if defined(XBASE_INCLUDED_MATH_HPP) 00007 #else 00008 #define XBASE_INCLUDED_MATH_HPP 00009 00010 //------------------------------------------------------------ 00011 #include <XBase/BuiltInTypes.hpp> 00012 00013 //------------------------------------------------------------ 00014 namespace XBase { 00015 class Angle; 00016 } 00017 00018 //------------------------------------------------------------ 00019 namespace XBase { 00021 00022 00026 struct Math 00027 { 00028 //============================================================ 00030 00031 00033 template< typename T > 00034 static const T Min( const T aA1 , const T aA2 ) 00035 { 00036 return aA1 < aA2 ? aA1 : aA2; 00037 } 00038 00040 template< typename T > 00041 static const T Max( const T aA1 , const T aA2 ) 00042 { 00043 return aA1 < aA2 ? aA2 : aA1; 00044 } 00045 00047 00048 //============================================================ 00050 00051 00058 static const f32 ClampF32( f32 aMin , f32 aValue , f32 aMax ); 00059 00064 static bool IsInRangeF32( f32 aMin , f32 aValue , f32 aMax ); 00066 00067 //============================================================ 00069 00070 static bool IsEqualsF32( f32 value1 , f32 value2 ); 00071 static bool IsLessEqualsF32( const f32 lhs , const f32 rhs ); 00072 static bool IsLessF32( const f32 lhs , const f32 rhs ); 00073 static bool IsZeroF32( const f32 ); 00074 00075 00076 //============================================================ 00078 00079 static const f32 SinF32( const Angle& ); 00080 static const f32 CosF32( const Angle& ); 00081 static const f32 TanF32( const Angle& ); 00082 static const f32 CecF32( const Angle& ); 00083 static const f32 SecF32( const Angle& ); 00084 static const f32 CotF32( const Angle& ); 00085 00086 00087 //============================================================ 00089 00090 static const f32 SqrtF32( f32 val ); 00091 00092 }; 00094 00095 } 00096 //------------------------------------------------------------ 00097 #endif 00098 // EOF