Quiet most GLM_FORCE_RADIANS messages

This commit is contained in:
Christophe Riccio
2014-01-11 21:12:53 +01:00
parent 3394af0cf2
commit aeba3c6fe7
94 changed files with 435 additions and 411 deletions

View File

@@ -7,9 +7,7 @@
// File : test/gtx/associated_min_max.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <emmintrin.h>
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/associated_min_max.hpp>

View File

@@ -7,11 +7,11 @@
// File : test/gtx/bit.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <emmintrin.h>
#define GLM_FORCE_RADIANS
#include <glm/gtx/bit.hpp>
#include <glm/gtc/type_precision.hpp>
#include <emmintrin.h>
#if(GLM_ARCH != GLM_ARCH_PURE)
# include <glm/detail/intrinsic_integer.hpp>
#endif

View File

@@ -7,9 +7,7 @@
// File : test/gtx/associated_min_max.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <emmintrin.h>
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/associated_min_max.hpp>

View File

@@ -7,9 +7,7 @@
// File : test/gtx/color_space.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <emmintrin.h>
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/color_space.hpp>

View File

@@ -7,9 +7,7 @@
// File : test/gtx/color_space_YCoCg.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <emmintrin.h>
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/color_space_YCoCg.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/compatibility.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/compatibility.hpp>

View File

@@ -7,9 +7,7 @@
// File : test/gtx/component_wise.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <emmintrin.h>
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/component_wise.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtc/gtc_dual_quaternion.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/gtx/dual_quaternion.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/epsilon.hpp>

View File

@@ -1,7 +1,15 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2013-10-25
// Updated : 2014-01-11
// Licence : This source is under MIT licence
// File : test/gtx/euler_angle.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Code sample from Filippo Ramaciotti
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/string_cast.hpp>
#include <glm/gtx/euler_angles.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/extend.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/extend.hpp>

View File

@@ -7,9 +7,7 @@
// File : test/gtx/associated_min_max.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <emmintrin.h>
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/associated_min_max.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/associated_min_max.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_exponential.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/fast_square_root.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_square_root.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/fast_trigonometry.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/gradient_paint.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtx/gradient_paint.hpp>
int test_radialGradient()

View File

@@ -7,7 +7,7 @@
// File : test/gtx/handed_coordinate_space.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/handed_coordinate_space.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/inertia.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/inertia.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/gtx_integer.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/epsilon.hpp>
#include <glm/gtx/integer.hpp>
#include <cstdio>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/intersect.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/intersect.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/io.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/io.hpp>
#include <iostream>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/log_base.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/log_base.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/matrix_cross_product.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/matrix_cross_product.hpp>

View File

@@ -7,15 +7,13 @@
// File : test/gtx/matrix_interpolation.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtx/matrix_interpolation.hpp>
int main()
{
int Error(0);
return Error;
}

View File

@@ -7,7 +7,7 @@
// File : test/gtx/matrix_major_storage.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/matrix_major_storage.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/matrix_operation.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/matrix_operation.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/matrix_query.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtx/matrix_query.hpp>
int test_isNull()

View File

@@ -7,7 +7,7 @@
// File : test/gtx/gtx_multiple.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtx/multiple.hpp>
int test_higher_int()

View File

@@ -7,7 +7,7 @@
// File : test/gtx/norm.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/norm.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/normal.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/normal.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/normalize_dot.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/normalize_dot.hpp>

View File

@@ -7,7 +7,7 @@
// File : test/gtx/number_precision.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/number_precision.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/optimum_pow.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/optimum_pow.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/orthonormalize.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/orthonormalize.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/perpendicular.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/perpendicular.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/polar_coordinates.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/polar_coordinates.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/projection.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/projection.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/quaternion.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtx/quaternion.hpp>
@@ -16,9 +17,9 @@ int test_quat_fastMix()
int Error = 0;
glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1));
glm::quat B = glm::angleAxis(90.0f, glm::vec3(0, 0, 1));
glm::quat B = glm::angleAxis(glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
glm::quat C = glm::fastMix(A, B, 0.5f);
glm::quat D = glm::angleAxis(45.0f, glm::vec3(0, 0, 1));
glm::quat D = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1;
Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1;
@@ -33,9 +34,9 @@ int test_quat_shortMix()
int Error(0);
glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1));
glm::quat B = glm::angleAxis(90.0f, glm::vec3(0, 0, 1));
glm::quat B = glm::angleAxis(glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
glm::quat C = glm::shortMix(A, B, 0.5f);
glm::quat D = glm::angleAxis(45.0f, glm::vec3(0, 0, 1));
glm::quat D = glm::angleAxis(glm::pi<float>() * 0.25f, glm::vec3(0, 0, 1));
Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1;
Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1;
@@ -78,7 +79,7 @@ int test_rotation()
float Angle = glm::angle(Rotation);
Error += glm::abs(Angle - 90.0f) < glm::epsilon<float>() ? 0 : 1;
Error += glm::abs(Angle - glm::pi<float>() * 0.5f) < glm::epsilon<float>() ? 0 : 1;
return Error;
}

View File

@@ -26,12 +26,13 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtx/rotate_normalized_axis.hpp>
int main()
{
int Error(0);
return Error;
}

View File

@@ -7,31 +7,23 @@
// File : test/gtx/rotate_vector.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/constants.hpp>
#include <glm/gtx/rotate_vector.hpp>
int test_rotate()
{
int Error = 0;
glm::vec2 A = glm::rotate(glm::vec2(1, 0), 90.f);
glm::vec3 B = glm::rotate(glm::vec3(1, 0, 0), 90.f, glm::vec3(0, 0, 1));
glm::vec4 C = glm::rotate(glm::vec4(1, 0, 0, 1), 90.f, glm::vec3(0, 0, 1));
glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), 90.f);
glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), 90.f);
glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), 90.f);
glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), 90.f);
glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), 90.f);
glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), 90.f);
glm::vec2 A = glm::rotate(glm::vec2(1, 0), glm::pi<float>() * 0.5f);
glm::vec3 B = glm::rotate(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
glm::vec4 C = glm::rotate(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f, glm::vec3(0, 0, 1));
glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi<float>() * 0.5f);
glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1));
return Error;
@@ -39,56 +31,54 @@ int test_rotate()
int test_rotateX()
{
int Error = 0;
glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), 90.f);
glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), 90.f);
return Error;
int Error = 0;
glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
return Error;
}
int test_rotateY()
{
int Error = 0;
glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), 90.f);
glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), 90.f);
return Error;
int Error = 0;
glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi<float>() * 0.5f);
return Error;
}
int test_rotateZ()
{
int Error = 0;
glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), 90.f);
glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), 90.f);
return Error;
int Error = 0;
glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi<float>() * 0.5f);
glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi<float>() * 0.5f);
return Error;
}
int test_orientation()
{
int Error = 0;
glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1));
return Error;
int Error = 0;
glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1));
return Error;
}
int main()
{
int Error = 0;
Error += test_rotate();
Error += test_rotateX();
Error += test_rotateY();
Error += test_rotateZ();
Error += test_orientation();
Error += test_rotate();
Error += test_rotateX();
Error += test_rotateY();
Error += test_rotateZ();
Error += test_orientation();
return Error;
}

View File

@@ -7,6 +7,7 @@
// File : test/gtx/gtx_scalar_relational.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtx/scalar_relational.hpp>
#include <cstdio>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/simd-mat4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/quaternion.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/simd-vec4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtx/simd_vec4.hpp>
#include <cstdio>
@@ -28,7 +29,7 @@ int main()
//printf("C1(%2.3f, %2.3f, %2.3f, %2.3f)\n", C1.x, C1.y, C1.z, C1.w);
//printf("D1(%2.3f, %2.3f, %2.3f, %2.3f)\n", D1.x, D1.y, D1.z, D1.w);
__m128 value;
__m128 value = _mm_set1_ps(0.0f);
__m128 data = _mm_cmpeq_ps(value, value);
__m128 add0 = _mm_add_ps(data, data);

View File

@@ -7,6 +7,7 @@
// File : test/gtx/associated_min_max.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/spline.hpp>

View File

@@ -7,6 +7,7 @@
// File : test/gtx/string_cast.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtx/string_cast.hpp>
#include <iostream>

View File

@@ -7,7 +7,8 @@
// File : test/gtx/vector_angle.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/glm.hpp>
#define GLM_FORCE_RADIANS
#include <glm/gtc/constants.hpp>
#include <glm/gtx/vector_angle.hpp>
#include <iostream>
#include <limits>
@@ -17,11 +18,11 @@ int test_angle()
int Error = 0;
float AngleA = glm::angle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1)));
Error += glm::epsilonEqual(AngleA, 45.f, 0.01f) ? 0 : 1;
Error += glm::epsilonEqual(AngleA, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
float AngleB = glm::angle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0)));
Error += glm::epsilonEqual(AngleB, 45.f, 0.01f) ? 0 : 1;
Error += glm::epsilonEqual(AngleB, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
float AngleC = glm::angle(glm::vec4(1, 0, 0, 0), glm::normalize(glm::vec4(1, 1, 0, 0)));
Error += glm::epsilonEqual(AngleC, 45.f, 0.01f) ? 0 : 1;
Error += glm::epsilonEqual(AngleC, glm::pi<float>() * 0.25f, 0.01f) ? 0 : 1;
return Error;
}
@@ -31,11 +32,11 @@ int test_orientedAngle_vec2()
int Error = 0;
float AngleA = glm::orientedAngle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1)));
Error += AngleA == 45.f ? 0 : 1;
Error += AngleA == glm::pi<float>() * 0.25f ? 0 : 1;
float AngleB = glm::orientedAngle(glm::vec2(0, 1), glm::normalize(glm::vec2(1, 1)));
Error += AngleB == -45.f ? 0 : 1;
Error += AngleB == -glm::pi<float>() * 0.25f ? 0 : 1;
float AngleC = glm::orientedAngle(glm::normalize(glm::vec2(1, 1)), glm::vec2(0, 1));
Error += AngleC == 45.f ? 0 : 1;
Error += AngleC == glm::pi<float>() * 0.25f ? 0 : 1;
return Error;
}
@@ -45,11 +46,11 @@ int test_orientedAngle_vec3()
int Error = 0;
float AngleA = glm::orientedAngle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1));
Error += AngleA == 45.f ? 0 : 1;
Error += AngleA == glm::pi<float>() * 0.25f ? 0 : 1;
float AngleB = glm::orientedAngle(glm::vec3(0, 1, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1));
Error += AngleB == -45.f ? 0 : 1;
Error += AngleB == -glm::pi<float>() * 0.25f ? 0 : 1;
float AngleC = glm::orientedAngle(glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 1, 0), glm::vec3(0, 0, 1));
Error += AngleC == 45.f ? 0 : 1;
Error += AngleC == glm::pi<float>() * 0.25f ? 0 : 1;
return Error;
}

View File

@@ -7,6 +7,7 @@
// File : test/gtx/vector_query.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_FORCE_RADIANS
#include <glm/glm.hpp>
#include <glm/gtx/vector_query.hpp>