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 
00031         template <typename genFIType> 
00032         genFIType abs(genFIType const & x);
00033 
00036         template <typename genFIType> 
00037         genFIType sign(genFIType const & x);
00038 
00041         template <typename genType> 
00042         genType floor(genType const & x);
00043 
00047         template <typename genType> 
00048         genType trunc(genType const & x);
00049 
00056         template <typename genType> 
00057         genType round(genType const & x);
00058 
00063         template <typename genType> 
00064         genType roundEven(genType const & x);
00065 
00069     template <typename genType> 
00070         genType ceil(genType const & x);
00071 
00074     template <typename genType> 
00075         genType fract(genType const & x);
00076 
00080     template <typename genType> 
00081         genType mod(
00082                 genType const & x, 
00083                 genType const & y);
00084 
00088     template <typename genType> 
00089         genType mod(
00090                 genType const & x, 
00091                 typename genType::value_type const & y);
00092 
00098         template <typename genType> 
00099         genType modf(
00100                 genType const & x, 
00101                 genType & i);
00102 
00105         template <typename genType> 
00106         genType min(
00107                 genType const & x, 
00108                 genType const & y);
00109 
00110         template <typename genType> 
00111         genType min(
00112                 genType const & x, 
00113                 typename genType::value_type const & y);
00114 
00117         template <typename genType> 
00118         genType max(
00119                 genType const & x, 
00120                 genType const & y);
00121 
00122         template <typename genType> 
00123         genType max(
00124                 genType const & x, 
00125                 typename genType::value_type const & y);
00126 
00130         template <typename genType> 
00131         genType clamp(
00132                 genType const & x, 
00133                 genType const & minVal, 
00134                 genType const & maxVal); 
00135 
00136         template <typename genType> 
00137         genType clamp(
00138                 genType const & x, 
00139                 typename genType::value_type const & minVal, 
00140                 typename genType::value_type const & maxVal); 
00141 
00165         // \todo Test when 'a' is a boolean.
00166         template <typename genTypeT, typename genTypeU> 
00167         genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);
00168 
00171         template <typename genType> 
00172         genType step(
00173                 genType const & edge, 
00174                 genType const & x);
00175 
00176         template <typename genType> 
00177         genType step(
00178                 typename genType::value_type const & edge, 
00179                 genType const & x);
00180 
00191         template <typename genType> 
00192         genType smoothstep(
00193                 genType const & edge0, 
00194                 genType const & edge1, 
00195                 genType const & x);
00196 
00197         template <typename genType> 
00198         genType smoothstep(
00199                 typename genType::value_type const & edge0, 
00200                 typename genType::value_type const & edge1, 
00201                 genType const & x);
00202 
00209         template <typename genType> 
00210         typename genType::bool_type isnan(genType const & x);
00211 
00218         template <typename genType> 
00219         typename genType::bool_type isinf(genType const & x);
00220 
00225         template <typename genType, typename genIType>
00226         genIType floatBitsToInt(genType const & value);
00227 
00232         template <typename genType, typename genUType>
00233         genUType floatBitsToInt(genType const & value);
00234 
00241         template <typename genType, typename genIUType>
00242         genType intBitsToFloat(genIUType const & value);
00243 
00246         template <typename genType>
00247         genType fma(genType const & a, genType const & b, genType const & c);
00248 
00258         template <typename genType, typename genIType>
00259         genType frexp(genType const & x, genIType & exp);
00260 
00267         template <typename genType, typename genIType>
00268         genType ldexp(genType const & x, genIType const & exp);
00269 
00271 
00272         }//namespace common
00273         }//namespace function
00274         }//namespace core
00275 
00276         using namespace core::function::common;
00277 }//namespace glm
00278 
00279 #include "func_common.inl"
00280 
00281 #endif//glm_core_func_common