Fixed space characters and improved forward declaration, including extensions

master
Christophe Riccio ago%!(EXTRA string=13 years)
parent 733cd31b0d
commit 4b4f3fbbaa
  1. 655
      glm/fwd.hpp
  2. 80
      glm/gtc/epsilon.inl
  3. 78
      glm/gtc/half_float.inl
  4. 4
      glm/gtc/matrix_access.hpp
  5. 8
      glm/gtc/matrix_access.inl
  6. 4
      glm/gtc/matrix_inverse.inl
  7. 11
      glm/gtc/matrix_transform.inl
  8. 8
      glm/gtc/noise.hpp
  9. 10
      glm/gtc/noise.inl
  10. 35
      glm/gtc/quaternion.hpp
  11. 6
      glm/gtc/quaternion.inl
  12. 64
      glm/gtc/type_ptr.hpp
  13. 34
      glm/gtc/type_ptr.inl
  14. 40
      glm/gtc/ulp.hpp
  15. 70
      glm/gtc/ulp.inl

@ -34,4 +34,659 @@
#include "core/type_vec.hpp" #include "core/type_vec.hpp"
#include "core/type_mat.hpp" #include "core/type_mat.hpp"
//////////////////////
// GLM_GTC_quaternion
namespace glm{
namespace detail
{
template <typename T> struct tquat;
}//namespace detail
/// Quaternion of floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<float> quat;
/// Quaternion of half-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<detail::half> hquat;
/// Quaternion of single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<float> fquat;
/// Quaternion of double-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<double> dquat;
/// Quaternion of low precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<lowp_float> lowp_quat;
/// Quaternion of medium precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<mediump_float> mediump_quat;
/// Quaternion of high precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<highp_float> highp_quat;
}//namespace glm
//////////////////////
// GLM_GTC_precision
namespace glm
{
/// @addtogroup gtc_type_precision
/// @{
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 int8;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 int16;
/// 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 int32;
/// 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 int64;
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 int8_t;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 int16_t;
/// 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 int32_t;
/// 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 int64_t;
/// 8 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int8 i8;
/// 16 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int16 i16;
/// 32 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int32 i32;
/// 64 bit signed integer type.
/// @see gtc_type_precision
typedef detail::int64 i64;
/// 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i8> i8vec1;
/// 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i8> i8vec2;
/// 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i8> i8vec3;
/// 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i8> i8vec4;
/// 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i16> i16vec1;
/// 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i16> i16vec2;
/// 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i16> i16vec3;
/// 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i16> i16vec4;
/// 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i32> i32vec1;
/// 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i32> i32vec2;
/// 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i32> i32vec3;
/// 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i32> i32vec4;
/// 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i64> i64vec1;
/// 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i64> i64vec2;
/// 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i64> i64vec3;
/// 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i64> i64vec4;
/////////////////////////////
// Unsigned int vector types
/// 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 uint8;
/// 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 uint16;
/// 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 uint32;
/// 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 uint64;
/// 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 uint8_t;
/// 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 uint16_t;
/// 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 uint32_t;
/// 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 uint64_t;
/// 8 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint8 u8;
/// 16 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint16 u16;
/// 32 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint32 u32;
/// 64 bit unsigned integer type.
/// @see gtc_type_precision
typedef detail::uint64 u64;
/// 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u8> u8vec1;
/// 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u8> u8vec2;
/// 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u8> u8vec3;
/// 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u8> u8vec4;
/// 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u16> u16vec1;
/// 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u16> u16vec2;
/// 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u16> u16vec3;
/// 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u16> u16vec4;
/// 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u32> u32vec1;
/// 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u32> u32vec2;
/// 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u32> u32vec3;
/// 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u32> u32vec4;
/// 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u64> u64vec1;
/// 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u64> u64vec2;
/// 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u64> u64vec3;
/// 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u64> u64vec4;
//////////////////////
// Float vector types
/// 16 bit half-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float16 float16;
/// 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 float32;
/// 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 float64;
/// 16 bit half-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float16 float16_t;
/// 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float32 float32_t;
/// 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef detail::float64 float64_t;
/// 16 bit half-precision floating-point scalar.
/// @see gtc_type_precision
typedef float16 f16;
/// 32 bit single-precision floating-point scalar.
/// @see gtc_type_precision
typedef float32 f32;
/// 64 bit double-precision floating-point scalar.
/// @see gtc_type_precision
typedef float64 f64;
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<float> fvec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<float> fvec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<float> fvec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<float> fvec4;
/// Half-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<f16> f16vec1;
/// Half-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<f16> f16vec2;
/// Half-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<f16> f16vec3;
/// Half-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<f16> f16vec4;
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<f32> f32vec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<f32> f32vec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<f32> f32vec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<f32> f32vec4;
/// Double-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<f64> f64vec1;
/// Double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<f64> f64vec2;
/// Double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<f64> f64vec3;
/// Double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<f64> f64vec4;
//////////////////////
// Float matrix types
/// Single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f32> fmat1;
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> fmat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> fmat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> fmat4;
/// Single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f32 fmat1x1;
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> fmat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f32> fmat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f32> fmat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f32> fmat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> fmat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f32> fmat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f32> fmat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f32> fmat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> fmat4x4;
/// Half-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f16> f16mat1;
/// Half-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f16> f16mat2;
/// Half-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f16> f16mat3;
/// Half-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f16> f16mat4;
/// Half-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f16 f16mat1x1;
/// Half-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f16> f16mat2x2;
/// Half-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f16> f16mat2x3;
/// Half-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f16> f16mat2x4;
/// Half-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f16> f16mat3x2;
/// Half-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f16> f16mat3x3;
/// Half-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f16> f16mat3x4;
/// Half-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f16> f16mat4x2;
/// Half-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f16> f16mat4x3;
/// Half-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f16> f16mat4x4;
/// Single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f32> f32mat1;
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> f32mat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> f32mat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> f32mat4;
/// Single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f32 f32mat1x1;
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> f32mat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f32> f32mat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f32> f32mat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f32> f32mat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> f32mat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f32> f32mat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f32> f32mat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f32> f32mat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> f32mat4x4;
/// Double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f64> f64mat1;
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f64> f64mat2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f64> f64mat3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f64> f64mat4;
/// Double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef f64 f64mat1x1;
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f64> f64mat2x2;
/// Double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f64> f64mat2x3;
/// Double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f64> f64mat2x4;
/// Double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f64> f64mat3x2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f64> f64mat3x3;
/// Double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f64> f64mat3x4;
/// Double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f64> f64mat4x2;
/// Double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f64> f64mat4x3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f64> f64mat4x4;
//////////////////////////
// Quaternion types
/// Half-precision floating-point quaternion.
/// @see gtc_type_precision
typedef detail::tquat<f16> f16quat;
/// Single-precision floating-point quaternion.
/// @see gtc_type_precision
typedef detail::tquat<f32> f32quat;
/// Double-precision floating-point quaternion.
/// @see gtc_type_precision
typedef detail::tquat<f64> f64quat;
}//namespace glm
#endif//GLM_FWD_INCLUDED #endif//GLM_FWD_INCLUDED

@ -30,8 +30,8 @@ namespace glm
{ {
GLM_FUNC_QUALIFIER bool epsilonEqual GLM_FUNC_QUALIFIER bool epsilonEqual
( (
glm::half const & x, glm::half const & x,
glm::half const & y, glm::half const & y,
glm::half const & epsilon glm::half const & epsilon
) )
{ {
@ -40,8 +40,8 @@ namespace glm
GLM_FUNC_QUALIFIER bool epsilonEqual GLM_FUNC_QUALIFIER bool epsilonEqual
( (
float const & x, float const & x,
float const & y, float const & y,
float const & epsilon float const & epsilon
) )
{ {
@ -50,8 +50,8 @@ namespace glm
GLM_FUNC_QUALIFIER bool epsilonEqual GLM_FUNC_QUALIFIER bool epsilonEqual
( (
double const & x, double const & x,
double const & y, double const & y,
double const & epsilon double const & epsilon
) )
{ {
@ -60,8 +60,8 @@ namespace glm
GLM_FUNC_QUALIFIER bool epsilonNotEqual GLM_FUNC_QUALIFIER bool epsilonNotEqual
( (
glm::half const & x, glm::half const & x,
glm::half const & y, glm::half const & y,
glm::half const & epsilon glm::half const & epsilon
) )
{ {
@ -70,8 +70,8 @@ namespace glm
GLM_FUNC_QUALIFIER bool epsilonNotEqual GLM_FUNC_QUALIFIER bool epsilonNotEqual
( (
float const & x, float const & x,
float const & y, float const & y,
float const & epsilon float const & epsilon
) )
{ {
@ -80,8 +80,8 @@ namespace glm
GLM_FUNC_QUALIFIER bool epsilonNotEqual GLM_FUNC_QUALIFIER bool epsilonNotEqual
( (
double const & x, double const & x,
double const & y, double const & y,
double const & epsilon double const & epsilon
) )
{ {
@ -91,8 +91,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonEqual GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonEqual
( (
detail::tvec2<valType> const & x, detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y, detail::tvec2<valType> const & y,
valType const & epsilon) valType const & epsilon)
{ {
return detail::tvec2<bool>( return detail::tvec2<bool>(
@ -103,8 +103,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonEqual GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonEqual
( (
detail::tvec2<valType> const & x, detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y, detail::tvec2<valType> const & y,
detail::tvec2<valType> const & epsilon detail::tvec2<valType> const & epsilon
) )
{ {
@ -116,8 +116,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonEqual GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonEqual
( (
detail::tvec3<valType> const & x, detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y, detail::tvec3<valType> const & y,
valType const & epsilon) valType const & epsilon)
{ {
return detail::tvec3<bool>( return detail::tvec3<bool>(
@ -129,8 +129,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonEqual GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonEqual
( (
detail::tvec3<valType> const & x, detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y, detail::tvec3<valType> const & y,
detail::tvec3<valType> const & epsilon detail::tvec3<valType> const & epsilon
) )
{ {
@ -143,8 +143,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual
( (
detail::tvec4<valType> const & x, detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y, detail::tvec4<valType> const & y,
valType const & epsilon valType const & epsilon
) )
{ {
@ -158,8 +158,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual
( (
detail::tvec4<valType> const & x, detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y, detail::tvec4<valType> const & y,
detail::tvec4<valType> const & epsilon detail::tvec4<valType> const & epsilon
) )
{ {
@ -173,8 +173,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonNotEqual GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonNotEqual
( (
detail::tvec2<valType> const & x, detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y, detail::tvec2<valType> const & y,
valType const & epsilon valType const & epsilon
) )
{ {
@ -186,8 +186,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonNotEqual GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonNotEqual
( (
detail::tvec2<valType> const & x, detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y, detail::tvec2<valType> const & y,
detail::tvec2<valType> const & epsilon detail::tvec2<valType> const & epsilon
) )
{ {
@ -199,8 +199,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonNotEqual GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonNotEqual
( (
detail::tvec3<valType> const & x, detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y, detail::tvec3<valType> const & y,
valType const & epsilon valType const & epsilon
) )
{ {
@ -213,8 +213,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonNotEqual GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonNotEqual
( (
detail::tvec3<valType> const & x, detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y, detail::tvec3<valType> const & y,
detail::tvec3<valType> const & epsilon detail::tvec3<valType> const & epsilon
) )
{ {
@ -227,8 +227,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual
( (
detail::tvec4<valType> const & x, detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y, detail::tvec4<valType> const & y,
valType const & epsilon valType const & epsilon
) )
{ {
@ -242,8 +242,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual
( (
detail::tvec4<valType> const & x, detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y, detail::tvec4<valType> const & y,
detail::tvec4<valType> const & epsilon detail::tvec4<valType> const & epsilon
) )
{ {
@ -257,8 +257,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual
( (
detail::tquat<valType> const & x, detail::tquat<valType> const & x,
detail::tquat<valType> const & y, detail::tquat<valType> const & y,
valType const & epsilon valType const & epsilon
) )
{ {
@ -272,8 +272,8 @@ namespace glm
template <typename valType> template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual
( (
detail::tquat<valType> const & x, detail::tquat<valType> const & x,
detail::tquat<valType> const & y, detail::tquat<valType> const & y,
valType const & epsilon valType const & epsilon
) )
{ {

@ -88,7 +88,7 @@ namespace detail
GLM_FUNC_QUALIFIER tvec2<half>::tvec2 GLM_FUNC_QUALIFIER tvec2<half>::tvec2
( (
half const & s1, half const & s1,
half const & s2 half const & s2
) : ) :
x(s1), x(s1),
@ -372,8 +372,8 @@ namespace detail
GLM_FUNC_QUALIFIER tvec3<half>::tvec3 GLM_FUNC_QUALIFIER tvec3<half>::tvec3
( (
half const & s0, half const & s0,
half const & s1, half const & s1,
half const & s2 half const & s2
) : ) :
x(s0), x(s0),
@ -406,11 +406,11 @@ namespace detail
z(half(x)) z(half(x))
{} {}
template <typename A, typename B, typename C> template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec3<half>::tvec3 GLM_FUNC_QUALIFIER tvec3<half>::tvec3
( (
A const & x, A const & x,
B const & y, B const & y,
C const & z C const & z
) : ) :
x(half(x)), x(half(x)),
@ -466,7 +466,7 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator= GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator=
( (
tvec3<half> const & v tvec3<half> const & v
) )
@ -692,9 +692,9 @@ namespace detail
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
half const & s1, half const & s1,
half const & s2, half const & s2,
half const & s3, half const & s3,
half const & s4 half const & s4
) : ) :
x(s1), x(s1),
@ -730,12 +730,12 @@ namespace detail
w(half(x)) w(half(x))
{} {}
template <typename A, typename B, typename C, typename D> template <typename A, typename B, typename C, typename D>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
A const & x, A const & x,
B const & y, B const & y,
C const & z, C const & z,
D const & w D const & w
) : ) :
x(half(x)), x(half(x)),
@ -747,11 +747,11 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Convertion vector constructors // Convertion vector constructors
template <typename A, typename B, typename C> template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
tvec2<A> const & v, tvec2<A> const & v,
B const & s1, B const & s1,
C const & s2 C const & s2
) : ) :
x(half(v.x)), x(half(v.x)),
@ -760,11 +760,11 @@ namespace detail
w(half(s2)) w(half(s2))
{} {}
template <typename A, typename B, typename C> template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
A const & s1, A const & s1,
tvec2<B> const & v, tvec2<B> const & v,
C const & s2 C const & s2
) : ) :
x(half(s1)), x(half(s1)),
@ -773,11 +773,11 @@ namespace detail
w(half(s2)) w(half(s2))
{} {}
template <typename A, typename B, typename C> template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
A const & s1, A const & s1,
B const & s2, B const & s2,
tvec2<C> const & v tvec2<C> const & v
) : ) :
x(half(s1)), x(half(s1)),
@ -786,10 +786,10 @@ namespace detail
w(half(v.y)) w(half(v.y))
{} {}
template <typename A, typename B> template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
tvec3<A> const & v, tvec3<A> const & v,
B const & s B const & s
) : ) :
x(half(v.x)), x(half(v.x)),
@ -798,10 +798,10 @@ namespace detail
w(half(s)) w(half(s))
{} {}
template <typename A, typename B> template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
A const & s, A const & s,
tvec3<B> const & v tvec3<B> const & v
) : ) :
x(half(s)), x(half(s)),
@ -810,10 +810,10 @@ namespace detail
w(half(v.z)) w(half(v.z))
{} {}
template <typename A, typename B> template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
tvec2<A> const & v1, tvec2<A> const & v1,
tvec2<B> const & v2 tvec2<B> const & v2
) : ) :
x(half(v1.x)), x(half(v1.x)),
@ -822,7 +822,7 @@ namespace detail
w(half(v2.y)) w(half(v2.y))
{} {}
template <typename U> template <typename U>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4 GLM_FUNC_QUALIFIER tvec4<half>::tvec4
( (
tvec4<U> const & v tvec4<U> const & v
@ -836,7 +836,7 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Unary arithmetic operators // Unary arithmetic operators
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator= GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator=
( (
tvec4<half> const & v tvec4<half> const & v
) )
@ -1015,32 +1015,32 @@ namespace detail
GLM_FUNC_QUALIFIER hvec2 abs(hvec2 const & v) GLM_FUNC_QUALIFIER hvec2 abs(hvec2 const & v)
{ {
return hvec2( return hvec2(
float(v.x) >= float(0) ? v.x : -v.x, float(v.x) >= float(0) ? v.x : -v.x,
float(v.y) >= float(0) ? v.y : -v.y); float(v.y) >= float(0) ? v.y : -v.y);
} }
GLM_FUNC_QUALIFIER hvec3 abs(hvec3 const & v) GLM_FUNC_QUALIFIER hvec3 abs(hvec3 const & v)
{ {
return hvec3( return hvec3(
float(v.x) >= float(0) ? v.x : -v.x, float(v.x) >= float(0) ? v.x : -v.x,
float(v.y) >= float(0) ? v.y : -v.y, float(v.y) >= float(0) ? v.y : -v.y,
float(v.z) >= float(0) ? v.z : -v.z); float(v.z) >= float(0) ? v.z : -v.z);
} }
GLM_FUNC_QUALIFIER hvec4 abs(hvec4 const & v) GLM_FUNC_QUALIFIER hvec4 abs(hvec4 const & v)
{ {
return hvec4( return hvec4(
float(v.x) >= float(0) ? v.x : -v.x, float(v.x) >= float(0) ? v.x : -v.x,
float(v.y) >= float(0) ? v.y : -v.y, float(v.y) >= float(0) ? v.y : -v.y,
float(v.z) >= float(0) ? v.z : -v.z, float(v.z) >= float(0) ? v.z : -v.z,
float(v.w) >= float(0) ? v.w : -v.w); float(v.w) >= float(0) ? v.w : -v.w);
} }
template <> template <>
GLM_FUNC_QUALIFIER glm::half mix GLM_FUNC_QUALIFIER glm::half mix
( (
glm::half const & x, glm::half const & x,
glm::half const & y, glm::half const & y,
bool const & a bool const & a
) )
{ {

@ -71,8 +71,8 @@ namespace glm
genType const & m, genType const & m,
int index); int index);
/// Set a specific column to a matrix. /// Set a specific column to a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template <typename genType>
genType column( genType column(
genType const & m, genType const & m,

@ -45,7 +45,7 @@ namespace glm
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER typename genType::row_type row GLM_FUNC_QUALIFIER typename genType::row_type row
( (
genType const & m, genType const & m,
int index int index
) )
{ {
@ -58,8 +58,8 @@ namespace glm
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType column GLM_FUNC_QUALIFIER genType column
( (
genType const & m, genType const & m,
int index, int index,
typename genType::col_type const & x typename genType::col_type const & x
) )
{ {
@ -71,7 +71,7 @@ namespace glm
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER typename genType::col_type column GLM_FUNC_QUALIFIER typename genType::col_type column
( (
genType const & m, genType const & m,
int index int index
) )
{ {

@ -67,7 +67,7 @@ namespace glm
detail::tmat2x2<valType> Inverse( detail::tmat2x2<valType> Inverse(
+ m[1][1] / Determinant, + m[1][1] / Determinant,
- m[0][1] / Determinant, - m[0][1] / Determinant,
- m[1][0] / Determinant, - m[1][0] / Determinant,
+ m[0][0] / Determinant); + m[0][0] / Determinant);
return Inverse; return Inverse;
@ -153,7 +153,7 @@ namespace glm
+ m[0][3] * Inverse[0][3]; + m[0][3] * Inverse[0][3];
Inverse /= Determinant; Inverse /= Determinant;
return Inverse; return Inverse;
} }
}//namespace glm }//namespace glm

@ -241,7 +241,6 @@ namespace glm
#else #else
valType const rad = glm::radians(fovy); valType const rad = glm::radians(fovy);
#endif #endif
valType range = tan(rad / valType(2)) * zNear; valType range = tan(rad / valType(2)) * zNear;
valType left = -range * aspect; valType left = -range * aspect;
valType right = range * aspect; valType right = range * aspect;
@ -314,8 +313,8 @@ namespace glm
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> tweakedInfinitePerspective GLM_FUNC_QUALIFIER detail::tmat4x4<T> tweakedInfinitePerspective
( (
T fovy, T fovy,
T aspect, T aspect,
T zNear T zNear
) )
{ {
@ -384,15 +383,15 @@ namespace glm
template <typename T, typename U> template <typename T, typename U>
detail::tmat4x4<T> pickMatrix detail::tmat4x4<T> pickMatrix
( (
detail::tvec2<T> const & center, detail::tvec2<T> const & center,
detail::tvec2<T> const & delta, detail::tvec2<T> const & delta,
detail::tvec4<U> const & viewport detail::tvec4<U> const & viewport
) )
{ {
assert(delta.x > T(0) && delta.y > T(0)); assert(delta.x > T(0) && delta.y > T(0));
detail::tmat4x4<T> Result(1.0f); detail::tmat4x4<T> Result(1.0f);
if(!(delta.x > T(0) && delta.y > T(0))) if(!(delta.x > T(0) && delta.y > T(0)))
return Result; // Error return Result; // Error
detail::tvec3<T> Temp( detail::tvec3<T> Temp(

@ -54,22 +54,22 @@ namespace glm
/// @{ /// @{
/// Classic perlin noise. /// Classic perlin noise.
/// @see gtc_noise /// @see gtc_noise
template <typename T, template<typename> class vecType> template <typename T, template<typename> class vecType>
T perlin( T perlin(
vecType<T> const & p); vecType<T> const & p);
/// Periodic perlin noise. /// Periodic perlin noise.
/// @see gtc_noise /// @see gtc_noise
template <typename T, template<typename> class vecType> template <typename T, template<typename> class vecType>
T perlin( T perlin(
vecType<T> const & p, vecType<T> const & p,
vecType<T> const & rep); vecType<T> const & rep);
/// Simplex noise. /// Simplex noise.
/// @see gtc_noise /// @see gtc_noise
template <typename T, template<typename> class vecType> template <typename T, template<typename> class vecType>
T simplex( T simplex(
vecType<T> const & p); vecType<T> const & p);
/// @} /// @}

@ -50,7 +50,7 @@ namespace glm
{ {
return mod289(((x * T(34)) + T(1)) * x); return mod289(((x * T(34)) + T(1)) * x);
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
{ {
@ -426,10 +426,10 @@ namespace glm
detail::tvec2<T> g11(gx.w, gy.w); detail::tvec2<T> g11(gx.w, gy.w);
detail::tvec4<T> norm = taylorInvSqrt(detail::tvec4<T>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); detail::tvec4<T> norm = taylorInvSqrt(detail::tvec4<T>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));
g00 *= norm.x; g00 *= norm.x;
g01 *= norm.y; g01 *= norm.y;
g10 *= norm.z; g10 *= norm.z;
g11 *= norm.w; g11 *= norm.w;
T n00 = dot(g00, detail::tvec2<T>(fx.x, fy.x)); T n00 = dot(g00, detail::tvec2<T>(fx.x, fy.x));
T n10 = dot(g10, detail::tvec2<T>(fx.y, fy.y)); T n10 = dot(g10, detail::tvec2<T>(fx.y, fy.y));

@ -338,41 +338,6 @@ namespace detail
valType const & angle, valType const & angle,
detail::tvec3<valType> const & axis); detail::tvec3<valType> const & axis);
/// Quaternion of floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<float> quat;
/// Quaternion of half-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<detail::half> hquat;
/// Quaternion of single-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<float> fquat;
/// Quaternion of double-precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<double> dquat;
/// Quaternion of low precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<lowp_float> lowp_quat;
/// Quaternion of medium precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<mediump_float> mediump_quat;
/// Quaternion of high precision floating-point numbers.
///
/// @see gtc_quaternion
typedef detail::tquat<highp_float> highp_quat;
/// @} /// @}
} //namespace glm } //namespace glm

@ -712,9 +712,9 @@ namespace detail
Result.z = biggestVal; Result.z = biggestVal;
break; break;
default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity.
assert(false); assert(false);
break; break;
} }
return Result; return Result;
} }

@ -70,96 +70,96 @@
#endif #endif
namespace glm namespace glm
{ {
/// @addtogroup gtc_type_ptr /// @addtogroup gtc_type_ptr
/// @{ /// @{
/// Return the constant address to the data of the input parameter. /// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename genType> template<typename genType>
typename genType::value_type const * value_ptr(genType const & vec); typename genType::value_type const * value_ptr(genType const & vec);
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tvec2<T> make_vec2(T const * const ptr); detail::tvec2<T> make_vec2(T const * const ptr);
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tvec3<T> make_vec3(T const * const ptr); detail::tvec3<T> make_vec3(T const * const ptr);
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tvec4<T> make_vec4(T const * const ptr); detail::tvec4<T> make_vec4(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat2x2<T> make_mat2x2(T const * const ptr); detail::tmat2x2<T> make_mat2x2(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat2x3<T> make_mat2x3(T const * const ptr); detail::tmat2x3<T> make_mat2x3(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat2x4<T> make_mat2x4(T const * const ptr); detail::tmat2x4<T> make_mat2x4(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat3x2<T> make_mat3x2(T const * const ptr); detail::tmat3x2<T> make_mat3x2(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat3x3<T> make_mat3x3(T const * const ptr); detail::tmat3x3<T> make_mat3x3(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat3x4<T> make_mat3x4(T const * const ptr); detail::tmat3x4<T> make_mat3x4(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat4x2<T> make_mat4x2( detail::tmat4x2<T> make_mat4x2(
T const * const ptr); T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat4x3<T> make_mat4x3(T const * const ptr); detail::tmat4x3<T> make_mat4x3(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat4x4<T> make_mat4x4(T const * const ptr); detail::tmat4x4<T> make_mat4x4(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat2x2<T> make_mat2(T const * const ptr); detail::tmat2x2<T> make_mat2(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat3x3<T> make_mat3(T const * const ptr); detail::tmat3x3<T> make_mat3(T const * const ptr);
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tmat4x4<T> make_mat4(T const * const ptr); detail::tmat4x4<T> make_mat4(T const * const ptr);
/// Build a quaternion from a pointer. /// Build a quaternion from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
detail::tquat<T> make_quat(T const * const ptr); detail::tquat<T> make_quat(T const * const ptr);
/// @} /// @}
}//namespace glm }//namespace glm

@ -27,12 +27,12 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
namespace glm namespace glm
{ {
/// @addtogroup gtc_type_ptr /// @addtogroup gtc_type_ptr
/// @{ /// @{
/// Return the constant address to the data of the input parameter. /// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
@ -283,18 +283,18 @@ namespace glm
{ {
return &(mat[0].x); return &(mat[0].x);
} }
//! Return the constant address to the data of the input parameter. //! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr
( (
detail::tquat<T> const & q detail::tquat<T> const & q
) )
{ {
return &(q[0]); return &(q[0]);
} }
//! Get the address of the matrix content. //! Get the address of the matrix content.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -342,7 +342,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x2<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x2<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -352,7 +352,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x3<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x3<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -362,7 +362,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x4<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x4<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -372,7 +372,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x2<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x2<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -392,7 +392,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x4<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x4<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -402,7 +402,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x2<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x2<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -412,7 +412,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x3<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x3<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -422,7 +422,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x4<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x4<T>));
return Result; return Result;
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -430,7 +430,7 @@ namespace glm
{ {
return make_mat2x2(ptr); return make_mat2x2(ptr);
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -446,7 +446,7 @@ namespace glm
{ {
return make_mat4x4(ptr); return make_mat4x4(ptr);
} }
//! Build a quaternion from a pointer. //! Build a quaternion from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T> template<typename T>
@ -456,7 +456,7 @@ namespace glm
memcpy(value_ptr(Result), ptr, sizeof(detail::tquat<T>)); memcpy(value_ptr(Result), ptr, sizeof(detail::tquat<T>));
return Result; return Result;
} }
/// @} /// @}
}//namespace glm }//namespace glm

@ -53,34 +53,34 @@ namespace glm
/// Return the next ULP value(s) after the input value(s). /// Return the next ULP value(s) after the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
genType next_float(genType const & x); genType next_float(genType const & x);
/// Return the previous ULP value(s) before the input value(s). /// Return the previous ULP value(s) before the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
genType prev_float(genType const & x); genType prev_float(genType const & x);
/// Return the value(s) ULP distance after the input value(s). /// Return the value(s) ULP distance after the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
genType next_float(genType const & x, uint const & Distance); genType next_float(genType const & x, uint const & Distance);
/// Return the value(s) ULP distance before the input value(s). /// Return the value(s) ULP distance before the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template <typename genType>
genType prev_float(genType const & x, uint const & Distance); genType prev_float(genType const & x, uint const & Distance);
/// Return the distance in the number of ULP between 2 scalars. /// Return the distance in the number of ULP between 2 scalars.
/// @see gtc_ulp /// @see gtc_ulp
template <typename T> template <typename T>
uint float_distance(T const & x, T const & y); uint float_distance(T const & x, T const & y);
/// Return the distance in the number of ULP between 2 vectors. /// Return the distance in the number of ULP between 2 vectors.
/// @see gtc_ulp /// @see gtc_ulp
template<typename T, template<typename> class vecType> template<typename T, template<typename> class vecType>
vecType<uint> float_distance(vecType<T> const & x, vecType<T> const & y); vecType<uint> float_distance(vecType<T> const & x, vecType<T> const & y);
/// @} /// @}
}// namespace glm }// namespace glm

@ -58,34 +58,34 @@ typedef union
} parts; } parts;
} ieee_double_shape_type; } ieee_double_shape_type;
#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ #define GLM_EXTRACT_WORDS(ix0,ix1,d) \
do { \ do { \
ieee_double_shape_type ew_u; \ ieee_double_shape_type ew_u; \
ew_u.value = (d); \ ew_u.value = (d); \
(ix0) = ew_u.parts.msw; \ (ix0) = ew_u.parts.msw; \
(ix1) = ew_u.parts.lsw; \ (ix1) = ew_u.parts.lsw; \
} while (0) } while (0)
#define GLM_GET_FLOAT_WORD(i,d) \ #define GLM_GET_FLOAT_WORD(i,d) \
do { \ do { \
ieee_float_shape_type gf_u; \ ieee_float_shape_type gf_u; \
gf_u.value = (d); \ gf_u.value = (d); \
(i) = gf_u.word; \ (i) = gf_u.word; \
} while (0) } while (0)
#define GLM_SET_FLOAT_WORD(d,i) \ #define GLM_SET_FLOAT_WORD(d,i) \
do { \ do { \
ieee_float_shape_type sf_u; \ ieee_float_shape_type sf_u; \
sf_u.word = (i); \ sf_u.word = (i); \
(d) = sf_u.value; \ (d) = sf_u.value; \
} while (0) } while (0)
#define GLM_INSERT_WORDS(d,ix0,ix1) \ #define GLM_INSERT_WORDS(d,ix0,ix1) \
do { \ do { \
ieee_double_shape_type iw_u; \ ieee_double_shape_type iw_u; \
iw_u.parts.msw = (ix0); \ iw_u.parts.msw = (ix0); \
iw_u.parts.lsw = (ix1); \ iw_u.parts.lsw = (ix1); \
(d) = iw_u.value; \ (d) = iw_u.value; \
} while (0) } while (0)
namespace glm{ namespace glm{
@ -98,28 +98,28 @@ namespace detail
GLM_GET_FLOAT_WORD(hx, x); GLM_GET_FLOAT_WORD(hx, x);
GLM_GET_FLOAT_WORD(hy, y); GLM_GET_FLOAT_WORD(hy, y);
ix = hx&0x7fffffff; // |x| ix = hx&0x7fffffff; // |x|
iy = hy&0x7fffffff; // |y| iy = hy&0x7fffffff; // |y|
if((ix>0x7f800000) || // x is nan if((ix>0x7f800000) || // x is nan
(iy>0x7f800000)) // y is nan (iy>0x7f800000)) // y is nan
return x+y; return x+y;
if(x==y) return y; // x=y, return y if(x==y) return y; // x=y, return y
if(ix==0) { // x == 0 if(ix==0) { // x == 0
GLM_SET_FLOAT_WORD(x,(hy&0x80000000)|1);// return +-minsubnormal GLM_SET_FLOAT_WORD(x,(hy&0x80000000)|1);// return +-minsubnormal
t = x*x; t = x*x;
if(t==x) return t; else return x; // raise underflow flag if(t==x) return t; else return x; // raise underflow flag
} }
if(hx>=0) { // x > 0 if(hx>=0) { // x > 0
if(hx>hy) { // x > y, x -= ulp if(hx>hy) { // x > y, x -= ulp
hx -= 1; hx -= 1;
} else { // x < y, x += ulp } else { // x < y, x += ulp
hx += 1; hx += 1;
} }
} else { // x < 0 } else { // x < 0
if(hy>=0||hx>hy){ // x < y, x -= ulp if(hy>=0||hx>hy){ // x < y, x -= ulp
hx -= 1; hx -= 1;
} else { // x > y, x += ulp } else { // x > y, x += ulp
hx += 1; hx += 1;
} }
} }

Loading…
Cancel
Save