1 /// @ref gtx_common 2 /// @file glm/gtx/common.hpp 3 /// 4 /// @see core (dependence) 5 /// @see gtc_half_float (dependence) 6 /// 7 /// @defgroup gtx_common GLM_GTX_common 8 /// @ingroup gtx 9 /// 10 /// @brief Provide functions to increase the compatibility with Cg and HLSL languages 11 /// 12 /// <glm/gtx/common.hpp> need to be included to use these functionalities. 13 14 #pragma once 15 16 // Dependencies: 17 #include "../vec2.hpp" 18 #include "../vec3.hpp" 19 #include "../vec4.hpp" 20 #include "../gtc/vec1.hpp" 21 22 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 # pragma message("GLM: GLM_GTX_common extension included") 24 #endif 25 26 namespace glm 27 { 28 /// @addtogroup gtx_common 29 /// @{ 30 31 /// Returns true if x is a denormalized number 32 /// Numbers whose absolute value is too small to be represented in the normal format are represented in an alternate, denormalized format. 33 /// This format is less precise but can represent values closer to zero. 34 /// 35 /// @tparam genType Floating-point scalar or vector types. 36 /// 37 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a> 38 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> 39 template <typename genType> 40 GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x); 41 42 /// Similar to 'mod' but with a different rounding and integer support. 43 /// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)' 44 /// 45 /// @see <a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a> 46 /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> 47 template <typename T, precision P, template <typename, precision> class vecType> 48 GLM_FUNC_DECL vecType<T, P> fmod(vecType<T, P> const & v); 49 50 /// @} 51 }//namespace glm 52 53 #include "common.inl" 54