mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 02:04:35 +00:00
Merged master
This commit is contained in:
commit
e5d6b1c64b
@ -6,9 +6,9 @@
|
||||
#define GLM_VERSION_MAJOR 0
|
||||
#define GLM_VERSION_MINOR 9
|
||||
#define GLM_VERSION_PATCH 9
|
||||
#define GLM_VERSION_REVISION 2
|
||||
#define GLM_VERSION 992
|
||||
#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.2"
|
||||
#define GLM_VERSION_REVISION 3
|
||||
#define GLM_VERSION 993
|
||||
#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.3"
|
||||
|
||||
#define GLM_SETUP_INCLUDED GLM_VERSION
|
||||
|
||||
@ -710,21 +710,22 @@ namespace detail
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Configure the use of defaulted initialized types
|
||||
|
||||
#define GLM_CTOR_INITIALIZER_LIST (1 << 1)
|
||||
#define GLM_CTOR_INITIALISATION (1 << 2)
|
||||
#define GLM_CTOR_INIT_DISABLE 0
|
||||
#define GLM_CTOR_INITIALIZER_LIST 1
|
||||
#define GLM_CTOR_INITIALISATION 2
|
||||
|
||||
#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS
|
||||
# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST
|
||||
#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS
|
||||
# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION
|
||||
#else
|
||||
# define GLM_CONFIG_CTOR_INIT GLM_DISABLE
|
||||
# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Configure the use of defaulted function
|
||||
|
||||
#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_DISABLE
|
||||
#if GLM_HAS_DEFAULTED_FUNCTIONS && GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE
|
||||
# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE
|
||||
# define GLM_DEFAULT = default
|
||||
#else
|
||||
|
@ -89,7 +89,7 @@ namespace detail
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q>::qua()
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE
|
||||
# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE
|
||||
: x(0), y(0), z(0), w(1)
|
||||
# endif
|
||||
{}
|
||||
|
@ -9,7 +9,7 @@ namespace glm
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec()
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE
|
||||
# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE
|
||||
: x(0)
|
||||
# endif
|
||||
{}
|
||||
|
@ -9,7 +9,7 @@ namespace glm
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec()
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE
|
||||
# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE
|
||||
: x(0), y(0)
|
||||
# endif
|
||||
{}
|
||||
|
@ -9,7 +9,7 @@ namespace glm
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec()
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE
|
||||
# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE
|
||||
: x(0), y(0), z(0)
|
||||
# endif
|
||||
{}
|
||||
|
@ -132,7 +132,7 @@ namespace detail
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec()
|
||||
# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE
|
||||
# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE
|
||||
: x(0), y(0), z(0), w(0)
|
||||
# endif
|
||||
{}
|
||||
|
@ -52,12 +52,14 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
|
||||
|
||||
## Release notes
|
||||
|
||||
### [GLM 0.9.9.2](https://github.com/g-truc/glm/commits/master) - 2018-XX-XX
|
||||
### [GLM 0.9.9.3](https://github.com/g-truc/glm/commits/master) - 201X-XX-XX
|
||||
#### Features:
|
||||
- Added equal and notEqual overload with max ULPs parameters for scalar numbers #121
|
||||
|
||||
### [GLM 0.9.9.2](https://github.com/g-truc/glm/releases/tag/0.9.9.2) - 2018-09-14
|
||||
#### Fixes:
|
||||
- Fixed GLM_FORCE_CXX** section in the manual
|
||||
- Fixed default initialization with vector and quaternion types using GLM_FORCE_CTOR_INIT #812
|
||||
|
||||
### [GLM 0.9.9.1](https://github.com/g-truc/glm/releases/tag/0.9.9.1) - 2018-09-03
|
||||
#### Features:
|
||||
|
@ -3,10 +3,137 @@
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/ext.hpp>
|
||||
|
||||
int main()
|
||||
static int test_vec()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
glm::vec1 V1;
|
||||
Error += glm::all(glm::equal(V1, glm::vec1(0), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dvec1 U1;
|
||||
Error += glm::all(glm::equal(U1, glm::dvec1(0), glm::epsilon<double>())) ? 0 : 1;
|
||||
|
||||
glm::vec2 V2;
|
||||
Error += glm::all(glm::equal(V2, glm::vec2(0, 0), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dvec2 U2;
|
||||
Error += glm::all(glm::equal(U2, glm::dvec2(0, 0), glm::epsilon<double>())) ? 0 : 1;
|
||||
|
||||
glm::vec3 V3;
|
||||
Error += glm::all(glm::equal(V3, glm::vec3(0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dvec3 U3;
|
||||
Error += glm::all(glm::equal(U3, glm::dvec3(0, 0, 0), glm::epsilon<double>())) ? 0 : 1;
|
||||
|
||||
glm::vec4 V4;
|
||||
Error += glm::all(glm::equal(V4, glm::vec4(0, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dvec4 U4;
|
||||
Error += glm::all(glm::equal(U4, glm::dvec4(0, 0, 0, 0), glm::epsilon<double>())) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_mat()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
{
|
||||
glm::mat2x2 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat2x2(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat2x2 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat2x2(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat2x3 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat2x3(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat2x3 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat2x3(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat2x4 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat2x4(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat2x4 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat2x4(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat3x2 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat3x2(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat3x2 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat3x2(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat3x3 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat3x3(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat3x3 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat3x3(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat3x4 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat3x4(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat3x4 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat3x4(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat4x2 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat4x2(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat4x2 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat4x2(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat4x3 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat4x3(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat4x3 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat4x3(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
{
|
||||
glm::mat4x4 F;
|
||||
Error += glm::all(glm::equal(F, glm::mat4x4(1), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dmat4x4 D;
|
||||
Error += glm::all(glm::equal(D, glm::dmat4x4(1), glm::epsilon<double>())) ? 0 : 1;
|
||||
}
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_qua()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
glm::quat F;
|
||||
Error += glm::all(glm::equal(F, glm::quat(1, 0, 0, 0), glm::epsilon<float>())) ? 0 : 1;
|
||||
|
||||
glm::dquat D;
|
||||
Error += glm::all(glm::equal(D, glm::dquat(1, 0, 0, 0), glm::epsilon<double>())) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
Error += test_vec();
|
||||
Error += test_mat();
|
||||
Error += test_qua();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
|
@ -401,33 +401,6 @@ static int test_operator_increment()
|
||||
return Error;
|
||||
}
|
||||
|
||||
namespace heap
|
||||
{
|
||||
struct A
|
||||
{
|
||||
float f;
|
||||
};
|
||||
|
||||
struct B : public A
|
||||
{
|
||||
float g;
|
||||
glm::vec4 v;
|
||||
};
|
||||
|
||||
int test()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
A* p = new B;
|
||||
p->f = 0.f;
|
||||
delete p;
|
||||
|
||||
Error += sizeof(B) == (sizeof(glm::vec4) + sizeof(float) * 2) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
}//namespace heap
|
||||
|
||||
static int test_vec4_simd()
|
||||
{
|
||||
int Error = 0;
|
||||
@ -455,7 +428,6 @@ int main()
|
||||
Error += test_vec4_swizzle_partial();
|
||||
Error += test_vec4_simd();
|
||||
Error += test_operator_increment();
|
||||
Error += heap::test();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user