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 core{
00018         namespace function{
00019         namespace common{ 
00020 
00023 
00028         template <typename genFIType> 
00029         genFIType abs(genFIType const & x);
00030 
00035         template <typename genFIType> 
00036         genFIType sign(genFIType const & x);
00037 
00042         template <typename genType> 
00043         genType floor(genType const & x);
00044 
00050         template <typename genType> 
00051         genType trunc(genType const & x);
00052 
00061         template <typename genType> 
00062         genType round(genType const & x);
00063 
00070         template <typename genType> 
00071         genType roundEven(genType const & x);
00072 
00078     template <typename genType> 
00079         genType ceil(genType const & x);
00080 
00085     template <typename genType> 
00086         genType fract(genType const & x);
00087 
00093     template <typename genType> 
00094         genType mod(
00095                 genType const & x, 
00096                 genType const & y);
00097 
00103     template <typename genType> 
00104         genType mod(
00105                 genType const & x, 
00106                 typename genType::value_type const & y);
00107 
00115         template <typename genType> 
00116         genType modf(
00117                 genType const & x, 
00118                 genType & i);
00119 
00124         template <typename genType> 
00125         genType min(
00126                 genType const & x, 
00127                 genType const & y);
00128 
00129         template <typename genType> 
00130         genType min(
00131                 genType const & x, 
00132                 typename genType::value_type const & y);
00133 
00138         template <typename genType> 
00139         genType max(
00140                 genType const & x, 
00141                 genType const & y);
00142 
00143         template <typename genType> 
00144         genType max(
00145                 genType const & x, 
00146                 typename genType::value_type const & y);
00147 
00153         template <typename genType> 
00154         genType clamp(
00155                 genType const & x, 
00156                 genType const & minVal, 
00157                 genType const & maxVal); 
00158 
00159         template <typename genType> 
00160         genType clamp(
00161                 genType const & x, 
00162                 typename genType::value_type const & minVal, 
00163                 typename genType::value_type const & maxVal); 
00164 
00189         // \todo Test when 'a' is a boolean.
00190         template <typename genTypeT, typename genTypeU> 
00191         genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);
00192 
00197         template <typename genType> 
00198         genType step(
00199                 genType const & edge, 
00200                 genType const & x);
00201 
00202         template <typename genType> 
00203         genType step(
00204                 typename genType::value_type const & edge, 
00205                 genType const & x);
00206 
00219         template <typename genType> 
00220         genType smoothstep(
00221                 genType const & edge0, 
00222                 genType const & edge1, 
00223                 genType const & x);
00224 
00225         template <typename genType> 
00226         genType smoothstep(
00227                 typename genType::value_type const & edge0, 
00228                 typename genType::value_type const & edge1, 
00229                 genType const & x);
00230 
00239         template <typename genType> 
00240         typename genType::bool_type isnan(genType const & x);
00241 
00250         template <typename genType> 
00251         typename genType::bool_type isinf(genType const & x);
00252 
00259         template <typename genType, typename genIType>
00260         genIType floatBitsToInt(genType const & value);
00261 
00268         template <typename genType, typename genUType>
00269         genUType floatBitsToUint(genType const & value);
00270 
00279         template <typename genType, typename genIType>
00280         genType intBitsToFloat(genIType const & value);
00281         
00290     template <typename genType, typename genUType>
00291     genType uintBitsToFloat(genUType const & value);
00292         
00297         template <typename genType>
00298         genType fma(genType const & a, genType const & b, genType const & c);
00299 
00312         template <typename genType, typename genIType>
00313         genType frexp(genType const & x, genIType & exp);
00314 
00324         template <typename genType, typename genIType>
00325         genType ldexp(genType const & x, genIType const & exp);
00326 
00328         }//namespace common
00329         }//namespace function
00330         }//namespace core
00331 
00332         using namespace core::function::common;
00333 }//namespace glm
00334 
00335 #include "func_common.inl"
00336 
00337 #endif//glm_core_func_common