Ticket #137, added constexpr support
This commit is contained in:
parent
080dc2dd82
commit
fb3a41995a
@ -444,6 +444,7 @@ namespace detail
|
|||||||
# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct
|
# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct
|
||||||
# define GLM_RESTRICT __declspec(restrict)
|
# define GLM_RESTRICT __declspec(restrict)
|
||||||
# define GLM_RESTRICT_VAR __restrict
|
# define GLM_RESTRICT_VAR __restrict
|
||||||
|
# define GLM_CONSTEXPR
|
||||||
#elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31))
|
#elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31))
|
||||||
# define GLM_DEPRECATED __attribute__((__deprecated__))
|
# define GLM_DEPRECATED __attribute__((__deprecated__))
|
||||||
# define GLM_ALIGN(x) __attribute__((aligned(x)))
|
# define GLM_ALIGN(x) __attribute__((aligned(x)))
|
||||||
@ -457,12 +458,18 @@ namespace detail
|
|||||||
# endif
|
# endif
|
||||||
# define GLM_RESTRICT __restrict__
|
# define GLM_RESTRICT __restrict__
|
||||||
# define GLM_RESTRICT_VAR __restrict__
|
# define GLM_RESTRICT_VAR __restrict__
|
||||||
|
# if((GLM_COMPILER >= GLM_COMPILER_GCC47) && ((GLM_LANG & GLM_LANG_CXX0X) == GLM_LANG_CXX0X))
|
||||||
|
# define GLM_CONSTEXPR constexpr
|
||||||
|
# else
|
||||||
|
# define GLM_CONSTEXPR
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# define GLM_DEPRECATED
|
# define GLM_DEPRECATED
|
||||||
# define GLM_ALIGN
|
# define GLM_ALIGN
|
||||||
# define GLM_ALIGNED_STRUCT(x)
|
# define GLM_ALIGNED_STRUCT(x)
|
||||||
# define GLM_RESTRICT
|
# define GLM_RESTRICT
|
||||||
# define GLM_RESTRICT_VAR
|
# define GLM_RESTRICT_VAR
|
||||||
|
# define GLM_CONSTEXPR
|
||||||
#endif//GLM_COMPILER
|
#endif//GLM_COMPILER
|
||||||
|
|
||||||
#endif//glm_core_detail
|
#endif//glm_core_detail
|
||||||
|
@ -59,13 +59,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec2<T> col_type;
|
typedef tvec2<T> col_type;
|
||||||
typedef tvec2<T> row_type;
|
typedef tvec2<T> row_type;
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
|
||||||
|
|
||||||
typedef tmat2x2<T> type;
|
typedef tmat2x2<T> type;
|
||||||
typedef tmat2x2<T> transpose_type;
|
typedef tmat2x2<T> transpose_type;
|
||||||
|
|
||||||
GLM_FUNC_DECL size_type length() const;
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Implementation detail
|
// Implementation detail
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x2<T>::size_type tmat2x2<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x2<T>::size_type tmat2x2<T>::length() const
|
||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec3<T> col_type;
|
typedef tvec3<T> col_type;
|
||||||
typedef tvec2<T> row_type;
|
typedef tvec2<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat2x3<T> type;
|
||||||
|
typedef tmat3x2<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat2x3<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat3x2<T> transpose_type;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data
|
// Data
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x3<T>::size_type tmat2x3<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x3<T>::size_type tmat2x3<T>::length() const
|
||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec4<T> col_type;
|
typedef tvec4<T> col_type;
|
||||||
typedef tvec2<T> row_type;
|
typedef tvec2<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat2x4<T> type;
|
||||||
|
typedef tmat4x2<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat2x4<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat4x2<T> transpose_type;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data
|
// Data
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat2x4<T>::size_type tmat2x4<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat2x4<T>::size_type tmat2x4<T>::length() const
|
||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec2<T> col_type;
|
typedef tvec2<T> col_type;
|
||||||
typedef tvec3<T> row_type;
|
typedef tvec3<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat3x2<T> type;
|
||||||
|
typedef tmat2x3<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat3x2<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat2x3<T> transpose_type;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data
|
// Data
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x2<T>::size_type tmat3x2<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x2<T>::size_type tmat3x2<T>::length() const
|
||||||
{
|
{
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec3<T> col_type;
|
typedef tvec3<T> col_type;
|
||||||
typedef tvec3<T> row_type;
|
typedef tvec3<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat3x3<T> type;
|
||||||
|
typedef tmat3x3<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat3x3<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat3x3<T> transpose_type;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Implementation detail
|
/// Implementation detail
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x3<T>::size_type tmat3x3<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x3<T>::size_type tmat3x3<T>::length() const
|
||||||
{
|
{
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec4<T> col_type;
|
typedef tvec4<T> col_type;
|
||||||
typedef tvec3<T> row_type;
|
typedef tvec3<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat3x4<T> type;
|
||||||
|
typedef tmat4x3<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat3x4<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat4x3<T> transpose_type;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data
|
// Data
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat3x4<T>::size_type tmat3x4<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat3x4<T>::size_type tmat3x4<T>::length() const
|
||||||
{
|
{
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec2<T> col_type;
|
typedef tvec2<T> col_type;
|
||||||
typedef tvec4<T> row_type;
|
typedef tvec4<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat4x2<T> type;
|
||||||
|
typedef tmat2x4<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat4x2<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat2x4<T> transpose_type;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data
|
// Data
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x2<T>::size_type tmat4x2<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x2<T>::size_type tmat4x2<T>::length() const
|
||||||
{
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec3<T> col_type;
|
typedef tvec3<T> col_type;
|
||||||
typedef tvec4<T> row_type;
|
typedef tvec4<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat4x3<T> type;
|
||||||
|
typedef tmat3x4<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat4x3<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat3x4<T> transpose_type;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Data
|
// Data
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x3<T>::size_type tmat4x3<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x3<T>::size_type tmat4x3<T>::length() const
|
||||||
{
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -58,12 +58,13 @@ namespace detail
|
|||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
typedef tvec4<T> col_type;
|
typedef tvec4<T> col_type;
|
||||||
typedef tvec4<T> row_type;
|
typedef tvec4<T> row_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
typedef tmat4x4<T> type;
|
||||||
|
typedef tmat4x4<T> transpose_type;
|
||||||
|
|
||||||
static GLM_FUNC_DECL size_type col_size();
|
static GLM_FUNC_DECL size_type col_size();
|
||||||
static GLM_FUNC_DECL size_type row_size();
|
static GLM_FUNC_DECL size_type row_size();
|
||||||
|
|
||||||
typedef tmat4x4<T> type;
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
typedef tmat4x4<T> transpose_type;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Implementation detail
|
/// Implementation detail
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tmat4x4<T>::size_type tmat4x4<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tmat4x4<T>::size_type tmat4x4<T>::length() const
|
||||||
{
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -54,11 +54,11 @@ namespace detail
|
|||||||
|
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
|
||||||
|
|
||||||
typedef tvec1<T> type;
|
typedef tvec1<T> type;
|
||||||
typedef tvec1<bool> bool_type;
|
typedef tvec1<bool> bool_type;
|
||||||
|
|
||||||
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Data
|
// Data
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tvec1<T>::size_type tvec1<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec1<T>::size_type tvec1<T>::length() const
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -53,11 +53,11 @@ namespace detail
|
|||||||
|
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
|
||||||
|
|
||||||
typedef tvec2<T> type;
|
typedef tvec2<T> type;
|
||||||
typedef tvec2<bool> bool_type;
|
typedef tvec2<bool> bool_type;
|
||||||
|
|
||||||
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Data
|
// Data
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tvec2<T>::size_type tvec2<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec2<T>::size_type tvec2<T>::length() const
|
||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -53,11 +53,11 @@ namespace detail
|
|||||||
|
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
|
||||||
|
|
||||||
typedef tvec3<T> type;
|
typedef tvec3<T> type;
|
||||||
typedef tvec3<bool> bool_type;
|
typedef tvec3<bool> bool_type;
|
||||||
|
|
||||||
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Data
|
// Data
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tvec3<T>::size_type tvec3<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec3<T>::size_type tvec3<T>::length() const
|
||||||
{
|
{
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -53,11 +53,11 @@ namespace detail
|
|||||||
|
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
typedef std::size_t size_type;
|
typedef std::size_t size_type;
|
||||||
GLM_FUNC_DECL size_type length() const;
|
|
||||||
|
|
||||||
typedef tvec4<T> type;
|
typedef tvec4<T> type;
|
||||||
typedef tvec4<bool> bool_type;
|
typedef tvec4<bool> bool_type;
|
||||||
|
|
||||||
|
GLM_FUNC_DECL GLM_CONSTEXPR size_type length() const;
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Data
|
// Data
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace glm{
|
|||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER typename tvec4<T>::size_type tvec4<T>::length() const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T>::size_type tvec4<T>::length() const
|
||||||
{
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
///
|
///
|
||||||
/// @brief Define secant, cosecant and cotangent functions.
|
/// @brief Define secant, cosecant and cotangent functions.
|
||||||
///
|
///
|
||||||
/// <glm/gtc/reciprocal.hpp> need to be included to use these functionalities.
|
/// <glm/gtc/reciprocal.hpp> need to be included to use these features.
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef GLM_GTC_reciprocal
|
#ifndef GLM_GTC_reciprocal
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
/// @brief Allow the measurement of the accuracy of a function against a reference
|
/// @brief Allow the measurement of the accuracy of a function against a reference
|
||||||
/// implementation. This extension works on floating-point data and provide results
|
/// implementation. This extension works on floating-point data and provide results
|
||||||
/// in ULP.
|
/// in ULP.
|
||||||
/// <glm/gtc/ulp.hpp> need to be included to use these functionalities.
|
/// <glm/gtc/ulp.hpp> need to be included to use these features.
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef GLM_GTC_ulp
|
#ifndef GLM_GTC_ulp
|
||||||
|
@ -56,127 +56,127 @@ namespace glm
|
|||||||
/// @todo Implement epsilon for half-precision floating point type.
|
/// @todo Implement epsilon for half-precision floating point type.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T epsilon();
|
GLM_CONSTEXPR T epsilon();
|
||||||
|
|
||||||
/// Return 0.
|
/// Return 0.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T zero();
|
GLM_CONSTEXPR T zero();
|
||||||
|
|
||||||
/// Return 1.
|
/// Return 1.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T one();
|
GLM_CONSTEXPR T one();
|
||||||
|
|
||||||
/// Return the pi constant.
|
/// Return the pi constant.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T pi();
|
GLM_CONSTEXPR T pi();
|
||||||
|
|
||||||
/// Return square root of pi.
|
/// Return square root of pi.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T root_pi();
|
GLM_CONSTEXPR T root_pi();
|
||||||
|
|
||||||
/// Return pi / 2.
|
/// Return pi / 2.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T half_pi();
|
GLM_CONSTEXPR T half_pi();
|
||||||
|
|
||||||
/// Return pi / 4.
|
/// Return pi / 4.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T quarter_pi();
|
GLM_CONSTEXPR T quarter_pi();
|
||||||
|
|
||||||
/// Return 1 / pi.
|
/// Return 1 / pi.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T one_over_pi();
|
GLM_CONSTEXPR T one_over_pi();
|
||||||
|
|
||||||
/// Return 2 / pi.
|
/// Return 2 / pi.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T two_over_pi();
|
GLM_CONSTEXPR T two_over_pi();
|
||||||
|
|
||||||
/// Return 2 / sqrt(pi).
|
/// Return 2 / sqrt(pi).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T two_over_root_pi();
|
GLM_CONSTEXPR T two_over_root_pi();
|
||||||
|
|
||||||
/// Return 1 / sqrt(2).
|
/// Return 1 / sqrt(2).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T one_over_root_two();
|
GLM_CONSTEXPR T one_over_root_two();
|
||||||
|
|
||||||
/// Return sqrt(pi / 2).
|
/// Return sqrt(pi / 2).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T root_half_pi();
|
GLM_CONSTEXPR T root_half_pi();
|
||||||
|
|
||||||
/// Return sqrt(2 * pi).
|
/// Return sqrt(2 * pi).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T root_two_pi();
|
GLM_CONSTEXPR T root_two_pi();
|
||||||
|
|
||||||
/// Return sqrt(ln(4)).
|
/// Return sqrt(ln(4)).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T root_ln_four();
|
GLM_CONSTEXPR T root_ln_four();
|
||||||
|
|
||||||
/// Return e constant.
|
/// Return e constant.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T e();
|
GLM_CONSTEXPR T e();
|
||||||
|
|
||||||
/// Return Euler's constant.
|
/// Return Euler's constant.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T euler();
|
GLM_CONSTEXPR T euler();
|
||||||
|
|
||||||
/// Return sqrt(2).
|
/// Return sqrt(2).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T root_two();
|
GLM_CONSTEXPR T root_two();
|
||||||
|
|
||||||
/// Return sqrt(3).
|
/// Return sqrt(3).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T root_three();
|
GLM_CONSTEXPR T root_three();
|
||||||
|
|
||||||
/// Return sqrt(5).
|
/// Return sqrt(5).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T root_five();
|
GLM_CONSTEXPR T root_five();
|
||||||
|
|
||||||
/// Return ln(2).
|
/// Return ln(2).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T ln_two();
|
GLM_CONSTEXPR T ln_two();
|
||||||
|
|
||||||
/// Return ln(10).
|
/// Return ln(10).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T ln_ten();
|
GLM_CONSTEXPR T ln_ten();
|
||||||
|
|
||||||
/// Return ln(ln(2)).
|
/// Return ln(ln(2)).
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T ln_ln_two();
|
GLM_CONSTEXPR T ln_ln_two();
|
||||||
|
|
||||||
/// Return 1 / 3.
|
/// Return 1 / 3.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T third();
|
GLM_CONSTEXPR T third();
|
||||||
|
|
||||||
/// Return 2 / 3.
|
/// Return 2 / 3.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T two_thirds();
|
GLM_CONSTEXPR T two_thirds();
|
||||||
|
|
||||||
/// Return the golden ratio constant.
|
/// Return the golden ratio constant.
|
||||||
/// @see gtx_constants
|
/// @see gtx_constants
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T golden_ratio();
|
GLM_CONSTEXPR T golden_ratio();
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
} //namespace glm
|
} //namespace glm
|
||||||
|
@ -29,151 +29,151 @@
|
|||||||
namespace glm
|
namespace glm
|
||||||
{
|
{
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T epsilon()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T epsilon()
|
||||||
{
|
{
|
||||||
return std::numeric_limits<T>::epsilon();
|
return std::numeric_limits<T>::epsilon();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T zero()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T zero()
|
||||||
{
|
{
|
||||||
return T(0);
|
return T(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T one()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T one()
|
||||||
{
|
{
|
||||||
return T(1);
|
return T(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T pi()
|
||||||
{
|
{
|
||||||
return T(3.14159265358979323846264338327950288);
|
return T(3.14159265358979323846264338327950288);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T root_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_pi()
|
||||||
{
|
{
|
||||||
return T(1.772453850905516027);
|
return T(1.772453850905516027);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T half_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T half_pi()
|
||||||
{
|
{
|
||||||
return T(1.57079632679489661923132169163975144);
|
return T(1.57079632679489661923132169163975144);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T quarter_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T quarter_pi()
|
||||||
{
|
{
|
||||||
return T(0.785398163397448309615660845819875721);
|
return T(0.785398163397448309615660845819875721);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T one_over_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T one_over_pi()
|
||||||
{
|
{
|
||||||
return T(0.318309886183790671537767526745028724);
|
return T(0.318309886183790671537767526745028724);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T two_over_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T two_over_pi()
|
||||||
{
|
{
|
||||||
return T(0.636619772367581343075535053490057448);
|
return T(0.636619772367581343075535053490057448);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T two_over_root_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T two_over_root_pi()
|
||||||
{
|
{
|
||||||
return T(1.12837916709551257389615890312154517);
|
return T(1.12837916709551257389615890312154517);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T one_over_root_two()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T one_over_root_two()
|
||||||
{
|
{
|
||||||
return T(0.707106781186547524400844362104849039);
|
return T(0.707106781186547524400844362104849039);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T root_half_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_half_pi()
|
||||||
{
|
{
|
||||||
return T(1.253314137315500251);
|
return T(1.253314137315500251);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T root_two_pi()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_two_pi()
|
||||||
{
|
{
|
||||||
return T(2.506628274631000502);
|
return T(2.506628274631000502);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T root_ln_four()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_ln_four()
|
||||||
{
|
{
|
||||||
return T(1.17741002251547469);
|
return T(1.17741002251547469);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T e()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T e()
|
||||||
{
|
{
|
||||||
return T(2.71828182845904523536);
|
return T(2.71828182845904523536);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T euler()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T euler()
|
||||||
{
|
{
|
||||||
return T(0.577215664901532860606);
|
return T(0.577215664901532860606);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T root_two()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_two()
|
||||||
{
|
{
|
||||||
return T(1.41421356237309504880168872420969808);
|
return T(1.41421356237309504880168872420969808);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T root_three()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_three()
|
||||||
{
|
{
|
||||||
return T(1.73205080756887729352744634150587236);
|
return T(1.73205080756887729352744634150587236);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T root_five()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T root_five()
|
||||||
{
|
{
|
||||||
return T(2.23606797749978969640917366873127623);
|
return T(2.23606797749978969640917366873127623);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T ln_two()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T ln_two()
|
||||||
{
|
{
|
||||||
return T(0.693147180559945309417232121458176568);
|
return T(0.693147180559945309417232121458176568);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T ln_ten()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T ln_ten()
|
||||||
{
|
{
|
||||||
return T(2.30258509299404568401799145468436421);
|
return T(2.30258509299404568401799145468436421);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T ln_ln_two()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T ln_ln_two()
|
||||||
{
|
{
|
||||||
return T(-0.3665129205816643);
|
return T(-0.3665129205816643);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T third()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T third()
|
||||||
{
|
{
|
||||||
return T(0.3333333333333333333333333333333333333333);
|
return T(0.3333333333333333333333333333333333333333);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T two_thirds()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T two_thirds()
|
||||||
{
|
{
|
||||||
return T(0.666666666666666666666666666666666666667);
|
return T(0.666666666666666666666666666666666666667);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
GLM_FUNC_QUALIFIER T golden_ratio()
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T golden_ratio()
|
||||||
{
|
{
|
||||||
return T(1.61803398874989484820458683436563811);
|
return T(1.61803398874989484820458683436563811);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user