GLM Version 0.9.0

func_common.hpp

00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2008-03-08
00005 // Updated : 2010-01-26
00006 // Licence : This source is under MIT License
00007 // File    : glm/core/func_common.hpp
00009 
00010 #ifndef glm_core_func_common
00011 #define glm_core_func_common
00012 
00013 namespace glm
00014 {
00015         namespace test{
00016                 void main_core_func_common();
00017         }//namespace test
00018 
00019         namespace core{
00020         namespace function{
00022         namespace common{
00023 
00026         template <typename genFIType> 
00027         genFIType abs(genFIType const & x);
00028 
00031         template <typename genFIType> 
00032         genFIType sign(genFIType const & x);
00033 
00036         template <typename genType> 
00037         genType floor(genType const & x);
00038 
00042         template <typename genType> 
00043         genType trunc(genType const & x);
00044 
00051         template <typename genType> 
00052         genType round(genType const & x);
00053 
00058         template <typename genType> 
00059         genType roundEven(genType const & x);
00060 
00064     template <typename genType> 
00065         genType ceil(genType const & x);
00066 
00069     template <typename genType> 
00070         genType fract(genType const & x);
00071 
00075     template <typename genType> 
00076         genType mod(
00077                 genType const & x, 
00078                 genType const & y);
00079 
00083     template <typename genType> 
00084         genType mod(
00085                 genType const & x, 
00086                 typename genType::value_type const & y);
00087 
00093         template <typename genType> 
00094         genType modf(
00095                 genType const & x, 
00096                 genType & i);
00097 
00100         template <typename genType> 
00101         genType min(
00102                 genType const & x, 
00103                 genType const & y);
00104 
00105         template <typename genType> 
00106         genType min(
00107                 genType const & x, 
00108                 typename genType::value_type const & y);
00109 
00112         template <typename genType> 
00113         genType max(
00114                 genType const & x, 
00115                 genType const & y);
00116 
00117         template <typename genType> 
00118         genType max(
00119                 genType const & x, 
00120                 typename genType::value_type const & y);
00121 
00125         template <typename genType> 
00126         genType clamp(
00127                 genType const & x, 
00128                 genType const & minVal, 
00129                 genType const & maxVal); 
00130 
00131         template <typename genType> 
00132         genType clamp(
00133                 genType const & x, 
00134                 typename genType::value_type const & minVal, 
00135                 typename genType::value_type const & maxVal); 
00136 
00160         // \todo Test when 'a' is a boolean.
00161         template <typename genTypeT, typename genTypeU> 
00162         genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);
00163 
00166         template <typename genType> 
00167         genType step(
00168                 genType const & edge, 
00169                 genType const & x);
00170 
00171         template <typename genType> 
00172         genType step(
00173                 typename genType::value_type const & edge, 
00174                 genType const & x);
00175 
00186         template <typename genType> 
00187         genType smoothstep(
00188                 genType const & edge0, 
00189                 genType const & edge1, 
00190                 genType const & x);
00191 
00192         template <typename genType> 
00193         genType smoothstep(
00194                 typename genType::value_type const & edge0, 
00195                 typename genType::value_type const & edge1, 
00196                 genType const & x);
00197 
00204         template <typename genType> 
00205         typename genType::bool_type isnan(genType const & x);
00206 
00213         template <typename genType> 
00214         typename genType::bool_type isinf(genType const & x);
00215 
00220         template <typename genType, typename genIType>
00221         genIType floatBitsToInt(genType const & value);
00222 
00227         template <typename genType, typename genUType>
00228         genUType floatBitsToInt(genType const & value);
00229 
00236         template <typename genType, typename genIUType>
00237         genType intBitsToFloat(genIUType const & value);
00238 
00241         template <typename genType>
00242         genType fma(genType const & a, genType const & b, genType const & c);
00243 
00253         template <typename genType, typename genIType>
00254         genType frexp(genType const & x, genIType & exp);
00255 
00262         template <typename genType, typename genIType>
00263         genType ldexp(genType const & x, genIType const & exp);
00264 
00265         }//namespace common
00266         }//namespace function
00267         }//namespace core
00268 
00269         using namespace core::function::common;
00270 }//namespace glm
00271 
00272 #include "func_common.inl"
00273 
00274 #endif//glm_core_func_common