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 #include "_fixes.hpp"
00014 
00015 namespace glm
00016 {
00017         namespace test{
00018                 void main_core_func_common();
00019         }//namespace test
00020 
00021         namespace core{
00022         namespace function{
00024         namespace common{
00025 
00028 
00033         template <typename genFIType> 
00034         genFIType abs(genFIType const & x);
00035 
00040         template <typename genFIType> 
00041         genFIType sign(genFIType const & x);
00042 
00047         template <typename genType> 
00048         genType floor(genType const & x);
00049 
00055         template <typename genType> 
00056         genType trunc(genType const & x);
00057 
00066         template <typename genType> 
00067         genType round(genType const & x);
00068 
00075         template <typename genType> 
00076         genType roundEven(genType const & x);
00077 
00083     template <typename genType> 
00084         genType ceil(genType const & x);
00085 
00090     template <typename genType> 
00091         genType fract(genType const & x);
00092 
00098     template <typename genType> 
00099         genType mod(
00100                 genType const & x, 
00101                 genType const & y);
00102 
00108     template <typename genType> 
00109         genType mod(
00110                 genType const & x, 
00111                 typename genType::value_type const & y);
00112 
00120         template <typename genType> 
00121         genType modf(
00122                 genType const & x, 
00123                 genType & i);
00124 
00129         template <typename genType> 
00130         genType min(
00131                 genType const & x, 
00132                 genType const & y);
00133 
00134         template <typename genType> 
00135         genType min(
00136                 genType const & x, 
00137                 typename genType::value_type const & y);
00138 
00143         template <typename genType> 
00144         genType max(
00145                 genType const & x, 
00146                 genType const & y);
00147 
00148         template <typename genType> 
00149         genType max(
00150                 genType const & x, 
00151                 typename genType::value_type const & y);
00152 
00158         template <typename genType> 
00159         genType clamp(
00160                 genType const & x, 
00161                 genType const & minVal, 
00162                 genType const & maxVal); 
00163 
00164         template <typename genType> 
00165         genType clamp(
00166                 genType const & x, 
00167                 typename genType::value_type const & minVal, 
00168                 typename genType::value_type const & maxVal); 
00169 
00194         // \todo Test when 'a' is a boolean.
00195         template <typename genTypeT, typename genTypeU> 
00196         genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);
00197 
00202         template <typename genType> 
00203         genType step(
00204                 genType const & edge, 
00205                 genType const & x);
00206 
00207         template <typename genType> 
00208         genType step(
00209                 typename genType::value_type const & edge, 
00210                 genType const & x);
00211 
00224         template <typename genType> 
00225         genType smoothstep(
00226                 genType const & edge0, 
00227                 genType const & edge1, 
00228                 genType const & x);
00229 
00230         template <typename genType> 
00231         genType smoothstep(
00232                 typename genType::value_type const & edge0, 
00233                 typename genType::value_type const & edge1, 
00234                 genType const & x);
00235 
00244         template <typename genType> 
00245         typename genType::bool_type isnan(genType const & x);
00246 
00255         template <typename genType> 
00256         typename genType::bool_type isinf(genType const & x);
00257 
00264         template <typename genType, typename genIType>
00265         genIType floatBitsToInt(genType const & value);
00266 
00273         template <typename genType, typename genUType>
00274         genUType floatBitsToUint(genType const & value);
00275 
00284         template <typename genType, typename genIType>
00285         genType intBitsToFloat(genIType const & value);
00286         
00295     template <typename genType, typename genUType>
00296     genType uintBitsToFloat(genUType const & value);
00297         
00302         template <typename genType>
00303         genType fma(genType const & a, genType const & b, genType const & c);
00304 
00317         template <typename genType, typename genIType>
00318         genType frexp(genType const & x, genIType & exp);
00319 
00329         template <typename genType, typename genIType>
00330         genType ldexp(genType const & x, genIType const & exp);
00331 
00333 
00334         }//namespace common
00335         }//namespace function
00336         }//namespace core
00337 
00338         using namespace core::function::common;
00339 }//namespace glm
00340 
00341 #include "func_common.inl"
00342 
00343 #endif//glm_core_func_common