Merge branch '0.9.1' into 0.9.2
This commit is contained in:
@@ -1206,7 +1206,7 @@ namespace glm
|
||||
{
|
||||
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'mix' only accept floating-point inputs");
|
||||
|
||||
#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
return typename genType::bool_type(_isnan(x));
|
||||
#else
|
||||
return typename genType::bool_type(std::isnan(x));
|
||||
@@ -1257,7 +1257,7 @@ namespace glm
|
||||
{
|
||||
GLM_STATIC_ASSERT(detail::type<genType>::is_float, "'isinf' only accept floating-point inputs");
|
||||
|
||||
#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
return typename genType::bool_type(_fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF);
|
||||
#else
|
||||
return typename genType::bool_type(std::isinf(x));
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace glm
|
||||
Result |= (1 << (sizeof(genIUType) * 8 - 1)) & (1 << (Offset + Bits - 1));
|
||||
|
||||
genIUType Mask = 0;
|
||||
for(std::size_t Bit = Offset; Bit < Bits; ++Bit)
|
||||
for(int Bit = Offset; Bit < Bits; ++Bit)
|
||||
Mask |= (1 << Bit);
|
||||
|
||||
return Result | ((Mask & Value) >> Offset);
|
||||
@@ -339,7 +339,7 @@ namespace glm
|
||||
return Base;
|
||||
|
||||
genIUType Mask = 0;
|
||||
for(std::size_t Bit = Offset; Bit < Offset + Bits; ++Bit)
|
||||
for(int Bit = Offset; Bit < Offset + Bits; ++Bit)
|
||||
Mask |= (1 << Bit);
|
||||
|
||||
return (Base & ~Mask) | (Insert & Mask);
|
||||
|
||||
@@ -1064,7 +1064,7 @@ inline void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m
|
||||
Result[0] = TmpA4;
|
||||
Result[1] = TmpB4;
|
||||
Result[2] = TmpC4;
|
||||
Result[2] = _mm_set_ps(1, 0, 0, 0);
|
||||
Result[3] = _mm_set_ps(1, 0, 0, 0);
|
||||
|
||||
//detail::tmat4x4<valType> Result(detail::tmat4x4<valType>::null);
|
||||
//Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2];
|
||||
|
||||
@@ -167,13 +167,13 @@
|
||||
// Report compiler detection
|
||||
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_COMPILER_DISPLAYED))
|
||||
# define GLM_MESSAGE_COMPILER_DISPLAYED
|
||||
# if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)
|
||||
# if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
# pragma message("GLM: Visual C++ compiler detected")
|
||||
# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC)
|
||||
# elif(GLM_COMPILER & GLM_COMPILER_GCC)
|
||||
# pragma message("GLM: GCC compiler detected")
|
||||
# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_BC)
|
||||
# elif(GLM_COMPILER & GLM_COMPILER_BC)
|
||||
# pragma message("GLM: Borland compiler detected but not supported")
|
||||
# elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_CODEWARRIOR)
|
||||
# elif(GLM_COMPILER & GLM_COMPILER_CODEWARRIOR)
|
||||
# pragma message("GLM: Codewarrior compiler detected but not supported")
|
||||
# else
|
||||
# pragma message("GLM: Compiler not detected")
|
||||
@@ -401,21 +401,4 @@
|
||||
# endif
|
||||
#endif//GLM_MESSAGE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Precision
|
||||
|
||||
#define GLM_PRECISION_NONE 0x00000000
|
||||
|
||||
#define GLM_PRECISION_LOWP_FLOAT 0x00000011
|
||||
#define GLM_PRECISION_MEDIUMP_FLOAT 0x00000012
|
||||
#define GLM_PRECISION_HIGHP_FLOAT 0x00000013
|
||||
|
||||
#define GLM_PRECISION_LOWP_INT 0x00001100
|
||||
#define GLM_PRECISION_MEDIUMP_INT 0x00001200
|
||||
#define GLM_PRECISION_HIGHP_INT 0x00001300
|
||||
|
||||
#define GLM_PRECISION_LOWP_UINT 0x00110000
|
||||
#define GLM_PRECISION_MEDIUMP_UINT 0x00120000
|
||||
#define GLM_PRECISION_HIGHP_UINT 0x00130000
|
||||
|
||||
#endif//glm_setup
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace type
|
||||
//////////////////////////
|
||||
// Float definition
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_FLOAT))
|
||||
typedef precision::highp_vec2 vec2;
|
||||
typedef precision::highp_vec3 vec3;
|
||||
typedef precision::highp_vec4 vec4;
|
||||
@@ -51,7 +51,7 @@ namespace type
|
||||
typedef precision::highp_mat4x2 mat4x2;
|
||||
typedef precision::highp_mat4x3 mat4x3;
|
||||
typedef precision::highp_mat4x4 mat4x4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
|
||||
typedef precision::mediump_vec2 vec2;
|
||||
typedef precision::mediump_vec3 vec3;
|
||||
typedef precision::mediump_vec4 vec4;
|
||||
@@ -64,7 +64,7 @@ namespace type
|
||||
typedef precision::mediump_mat4x2 mat4x2;
|
||||
typedef precision::mediump_mat4x3 mat4x3;
|
||||
typedef precision::mediump_mat4x4 mat4x4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::lowp_vec2 vec2;
|
||||
typedef precision::lowp_vec3 vec3;
|
||||
typedef precision::lowp_vec4 vec4;
|
||||
@@ -158,15 +158,15 @@ namespace type
|
||||
//////////////////////////
|
||||
// Signed integer definition
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_INT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_INT))
|
||||
typedef precision::highp_ivec2 ivec2;
|
||||
typedef precision::highp_ivec3 ivec3;
|
||||
typedef precision::highp_ivec4 ivec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef precision::mediump_ivec2 ivec2;
|
||||
typedef precision::mediump_ivec3 ivec3;
|
||||
typedef precision::mediump_ivec4 ivec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_INT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::lowp_ivec2 ivec2;
|
||||
typedef precision::lowp_ivec3 ivec3;
|
||||
typedef precision::lowp_ivec4 ivec4;
|
||||
@@ -190,15 +190,15 @@ namespace type
|
||||
//////////////////////////
|
||||
// Unsigned integer definition
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_UINT))
|
||||
typedef precision::highp_uvec2 uvec2;
|
||||
typedef precision::highp_uvec3 uvec3;
|
||||
typedef precision::highp_uvec4 uvec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef precision::mediump_uvec2 uvec2;
|
||||
typedef precision::mediump_uvec3 uvec3;
|
||||
typedef precision::mediump_uvec4 uvec4;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_UINT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::lowp_uvec2 uvec2;
|
||||
typedef precision::lowp_uvec3 uvec3;
|
||||
typedef precision::lowp_uvec4 uvec4;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace glm
|
||||
//! There is no guarantee on the actual precision.
|
||||
//! From GLSL 1.30.8 specification
|
||||
//! \ingroup core_precision
|
||||
typedef mediump_float_t mediump_float;
|
||||
typedef mediump_float_t mediump_float;
|
||||
//! High precision floating-point numbers.
|
||||
//! There is no guarantee on the actual precision.
|
||||
//! From GLSL 1.30.8 specification
|
||||
@@ -55,18 +55,17 @@ namespace glm
|
||||
}
|
||||
//namespace precision
|
||||
|
||||
#ifndef GLM_PRECISION
|
||||
typedef precision::mediump_float float_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)
|
||||
typedef precision::highp_float float_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)
|
||||
typedef precision::mediump_float float_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)
|
||||
typedef precision::lowp_float float_t;
|
||||
#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::mediump_float float_t;
|
||||
#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::highp_float float_t;
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::mediump_float float_t;
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::lowp_float float_t;
|
||||
#else
|
||||
# pragma message("GLM message: Precisson undefined for float numbers.");
|
||||
typedef precision::mediump_float float_t;
|
||||
#endif//GLM_PRECISION
|
||||
# error "GLM error: multiple default precision requested for floating-point types"
|
||||
#endif
|
||||
|
||||
}//namespace type
|
||||
}//namespace core
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace glm
|
||||
//! There is no guarantee on the actual precision.
|
||||
//! From GLSL 1.30.8 specification.
|
||||
//! \ingroup core_precision
|
||||
typedef detail::mediump_int_t mediump_int;
|
||||
typedef detail::mediump_int_t mediump_int;
|
||||
//! High precision signed integer.
|
||||
//! There is no guarantee on the actual precision.
|
||||
//! From GLSL 1.30.8 specification.
|
||||
@@ -75,35 +75,33 @@ namespace glm
|
||||
//! There is no guarantee on the actual precision.
|
||||
//! From GLSL 1.30.8 specification.
|
||||
//! \ingroup core_precision
|
||||
typedef detail::highp_uint_t highp_uint;
|
||||
typedef detail::highp_uint_t highp_uint;
|
||||
}
|
||||
//namespace precision
|
||||
|
||||
#ifndef GLM_PRECISION
|
||||
#if(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::mediump_int int_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT)
|
||||
typedef precision::highp_int int_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)
|
||||
#elif(defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::highp_int int_t;
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_INT) && defined(GLM_PRECISION_MEDIUMP_INT) && !defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::mediump_int int_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT)
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::lowp_int int_t;
|
||||
#else
|
||||
typedef precision::mediump_int int_t;
|
||||
# pragma message("GLM message: Precisson undefined for signed integer number.");
|
||||
#endif//GLM_PRECISION
|
||||
# error "GLM error: multiple default precision requested for signed interger types"
|
||||
#endif
|
||||
|
||||
#ifndef GLM_PRECISION
|
||||
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::mediump_uint uint_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)
|
||||
typedef precision::highp_uint uint_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)
|
||||
#elif(defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::highp_uint uint_t;
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::mediump_uint uint_t;
|
||||
#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT)
|
||||
typedef precision::lowp_uint uint_t;
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::lowp_uint uint_t;
|
||||
#else
|
||||
typedef precision::mediump_uint uint_t;
|
||||
# pragma message("GLM message: Precisson undefined for unsigned integer number.");
|
||||
#endif//GLM_PRECISION
|
||||
# error "GLM error: multiple default precision requested for unsigned interger types"
|
||||
#endif
|
||||
|
||||
//! Unsigned integer.
|
||||
//! From GLSL 1.30.8 specification section 4.1.3 Integers.
|
||||
|
||||
@@ -117,11 +117,10 @@ namespace glm
|
||||
typedef detail::tmat4x3<lowp_uint> lowp_umat4x3; //!< \brief Low-precision signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef detail::tmat4x4<lowp_uint> lowp_umat4x4; //!< \brief Low-precision signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_HIGHP_INT))
|
||||
#if(defined(GLM_PRECISION_HIGHP_INT))
|
||||
typedef highp_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
typedef highp_imat2x2 imat2x2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat2x3 imat2x3; //!< \brief Signed integer 2x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat2x4 imat2x4; //!< \brief Signed integer 2x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
@@ -131,8 +130,7 @@ namespace glm
|
||||
typedef highp_imat4x2 imat4x2; //!< \brief Signed integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat4x3 imat4x3; //!< \brief Signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#elif(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_LOWP_INT))
|
||||
#elif(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef lowp_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
@@ -145,8 +143,7 @@ namespace glm
|
||||
typedef lowp_imat4x2 imat4x2; //!< \brief Signed integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat4x3 imat4x3; //!< \brief Signed integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#else //if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT))
|
||||
#else //if(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef mediump_imat2 imat2; //!< \brief Signed integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_imat3 imat3; //!< \brief Signed integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_imat4 imat4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
@@ -161,7 +158,7 @@ namespace glm
|
||||
typedef mediump_imat4x4 imat4x4; //!< \brief Signed integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_HIGHP_UINT))
|
||||
#if(defined(GLM_PRECISION_HIGHP_UINT))
|
||||
typedef highp_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
@@ -174,8 +171,7 @@ namespace glm
|
||||
typedef highp_umat4x2 umat4x2; //!< \brief Unsigned integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat4x3 umat4x3; //!< \brief Unsigned integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef highp_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#elif(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_LOWP_UINT))
|
||||
#elif(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef lowp_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
@@ -188,8 +184,7 @@ namespace glm
|
||||
typedef lowp_umat4x2 umat4x2; //!< \brief Unsigned integer 4x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat4x3 umat4x3; //!< \brief Unsigned integer 4x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef lowp_umat4x4 umat4x4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
#else //if(defined(GLM_PRECISION) && (GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT))
|
||||
#else //if(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef mediump_umat2 umat2; //!< \brief Unsigned integer 2x2 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_umat3 umat3; //!< \brief Unsigned integer 3x3 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
typedef mediump_umat4 umat4; //!< \brief Unsigned integer 4x4 matrix. (from GLM_GTC_matrix_integer extension)
|
||||
|
||||
@@ -359,7 +359,7 @@ namespace matrix_transform
|
||||
|
||||
// Translate and scale the picked region to the entire window
|
||||
Result = translate(Result, Temp);
|
||||
return scale(Result, T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1));
|
||||
return scale(Result, detail::tvec3<T>(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -601,8 +601,8 @@ inline genType bitRevert(genType const & In)
|
||||
genType Out = 0;
|
||||
std::size_t BitSize = sizeof(genType) * 8;
|
||||
for(std::size_t i = 0; i < BitSize; ++i)
|
||||
if(In & (1 << i))
|
||||
Out |= 1 << (BitSize - 1 - i);
|
||||
if(In & (genType(1) << i))
|
||||
Out |= genType(1) << (BitSize - 1 - i);
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ template <typename genType>
|
||||
inline bool isfinite(
|
||||
genType const & x)
|
||||
{
|
||||
#ifdef GLM_COMPILER_VC
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
return _finite(x);
|
||||
#else//GLM_COMPILER_GCC
|
||||
#else//(GLM_COMPILER & GLM_COMPILER_GCC)
|
||||
return std::isfinite(x);
|
||||
#endif
|
||||
}
|
||||
@@ -58,7 +58,7 @@ template <typename genType>
|
||||
inline bool isinf(
|
||||
genType const & x)
|
||||
{
|
||||
#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
|
||||
#else
|
||||
return std::isinf(x);
|
||||
@@ -99,7 +99,7 @@ inline detail::tvec4<bool> isinf(
|
||||
template <typename genType>
|
||||
inline bool isnan(genType const & x)
|
||||
{
|
||||
#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))
|
||||
#if(GLM_COMPILER & GLM_COMPILER_VC)
|
||||
return _isnan(x);
|
||||
#else
|
||||
return std::isnan(x);
|
||||
|
||||
@@ -80,11 +80,11 @@ namespace glm
|
||||
//! From GLM_GTX_vec1 extension.
|
||||
typedef detail::tvec1<bool> bvec1;
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_FLOAT))
|
||||
typedef precision::highp_vec1 vec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
|
||||
typedef precision::mediump_vec1 vec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::lowp_vec1 vec1;
|
||||
#else
|
||||
//! 1 component vector of floating-point numbers.
|
||||
@@ -92,11 +92,11 @@ namespace glm
|
||||
typedef precision::mediump_vec1 vec1;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_INT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_INT))
|
||||
typedef precision::highp_ivec1 ivec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef precision::mediump_ivec1 ivec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_INT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef precision::lowp_ivec1 ivec1;
|
||||
#else
|
||||
//! 1 component vector of signed integer numbers.
|
||||
@@ -104,11 +104,11 @@ namespace glm
|
||||
typedef precision::mediump_ivec1 ivec1;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)
|
||||
#if(defined(GLM_PRECISION_HIGHP_UINT))
|
||||
typedef precision::highp_uvec1 uvec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef precision::mediump_uvec1 uvec1;
|
||||
#elif(defined(GLM_PRECISION) && GLM_PRECISION & GLM_PRECISION_LOWP_UINT)
|
||||
#elif(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef precision::lowp_uvec1 uvec1;
|
||||
#else
|
||||
//! 1 component vector of unsigned integer numbers.
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace vector_query
|
||||
typename genType::value_type const & epsilon
|
||||
)
|
||||
{
|
||||
return abs(length(v) - GLMvalType(1)) <= GLMvalType(2) * epsilon;
|
||||
return abs(length(v) - typename genType::value_type(1)) <= typename genType::value_type(2) * epsilon;
|
||||
}
|
||||
|
||||
template <typename genType>
|
||||
|
||||
Reference in New Issue
Block a user