mirror of
https://github.com/g-truc/glm.git
synced 2024-11-26 10:14:35 +00:00
Clean up
This commit is contained in:
parent
019c6ced18
commit
c06484ff12
@ -6,7 +6,7 @@ project(glm)
|
|||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
#add_definitions(-S)
|
#add_definitions(-S)
|
||||||
#add_definitions(-s)
|
#add_definitions(-s)
|
||||||
#add_definitions(-msse2)
|
add_definitions(-msse2)
|
||||||
#add_definitions(-m32)
|
#add_definitions(-m32)
|
||||||
#add_definitions(-mfpmath=387)
|
#add_definitions(-mfpmath=387)
|
||||||
#add_definitions(-ffast-math)
|
#add_definitions(-ffast-math)
|
||||||
|
@ -331,7 +331,7 @@ namespace detail
|
|||||||
# if(GLM_COMPILER >= GLM_COMPILER_GCC33)
|
# if(GLM_COMPILER >= GLM_COMPILER_GCC33)
|
||||||
# define GLM_RESTRICT __restrict__
|
# define GLM_RESTRICT __restrict__
|
||||||
# define GLM_RESTRICT_VAR __restrict__
|
# define GLM_RESTRICT_VAR __restrict__
|
||||||
# elif
|
# else
|
||||||
# define GLM_RESTRICT
|
# define GLM_RESTRICT
|
||||||
# define GLM_RESTRICT_VAR
|
# define GLM_RESTRICT_VAR
|
||||||
# endif
|
# endif
|
||||||
|
@ -137,7 +137,6 @@ namespace glm
|
|||||||
//! From GLM_GTC_matrix_transform extension.
|
//! From GLM_GTC_matrix_transform extension.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
detail::tmat4x4<T> lookAt(
|
detail::tmat4x4<T> lookAt(
|
||||||
detail::tmat4x4<T> const & m,
|
|
||||||
detail::tvec3<T> const & eye,
|
detail::tvec3<T> const & eye,
|
||||||
detail::tvec3<T> const & center,
|
detail::tvec3<T> const & center,
|
||||||
detail::tvec3<T> const & up);
|
detail::tvec3<T> const & up);
|
||||||
|
@ -326,7 +326,6 @@ namespace matrix_transform
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline detail::tmat4x4<T> lookAt(
|
inline detail::tmat4x4<T> lookAt(
|
||||||
detail::tmat4x4<T> const & m,
|
|
||||||
const detail::tvec3<T>& eye,
|
const detail::tvec3<T>& eye,
|
||||||
const detail::tvec3<T>& center,
|
const detail::tvec3<T>& center,
|
||||||
const detail::tvec3<T>& up)
|
const detail::tvec3<T>& up)
|
||||||
@ -351,7 +350,7 @@ namespace matrix_transform
|
|||||||
Result[3][1] =-dot(y, eye);
|
Result[3][1] =-dot(y, eye);
|
||||||
Result[3][2] = dot(f, eye);
|
Result[3][2] = dot(f, eye);
|
||||||
*/
|
*/
|
||||||
return m * gtc::matrix_transform::translate(Result, -eye);
|
return gtc::matrix_transform::translate(Result, -eye);
|
||||||
}
|
}
|
||||||
}//namespace matrix_transform
|
}//namespace matrix_transform
|
||||||
}//namespace gtc
|
}//namespace gtc
|
||||||
|
@ -21,7 +21,7 @@ inline T swizzle
|
|||||||
comp x
|
comp x
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
assert(int(x) < int(typename vecType<T>::_size));
|
assert(int(x) < int(vecType<T>::value_size));
|
||||||
return v[x];
|
return v[x];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,13 +17,13 @@
|
|||||||
// Dependency:
|
// Dependency:
|
||||||
#include "../glm.hpp"
|
#include "../glm.hpp"
|
||||||
|
|
||||||
#if(!(GLM_ARCH & GLM_ARCH_SSE2))
|
#if(GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
|
# include "../core/intrinsic_common.hpp"
|
||||||
|
# include "../core/intrinsic_geometric.hpp"
|
||||||
|
#else
|
||||||
# error "GLM: GLM_GTX_simd_vec4 requires compiler support of SSE2 through intrinsics"
|
# error "GLM: GLM_GTX_simd_vec4 requires compiler support of SSE2 through intrinsics"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../core/intrinsic_common.hpp"
|
|
||||||
#include "../core/intrinsic_geometric.hpp"
|
|
||||||
|
|
||||||
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
|
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
|
||||||
# pragma message("GLM: GLM_GTX_simd_vec4 extension included")
|
# pragma message("GLM: GLM_GTX_simd_vec4 extension included")
|
||||||
#endif
|
#endif
|
||||||
|
@ -109,14 +109,6 @@ namespace glm
|
|||||||
valType scale,
|
valType scale,
|
||||||
valType bias);
|
valType bias);
|
||||||
|
|
||||||
//! Build a look at view matrix.
|
|
||||||
//! From GLM_GTX_transform2 extension.
|
|
||||||
template <typename T>
|
|
||||||
detail::tmat4x4<T> lookAt(
|
|
||||||
detail::tvec3<T> const & eye,
|
|
||||||
detail::tvec3<T> const & center,
|
|
||||||
detail::tvec3<T> const & up);
|
|
||||||
|
|
||||||
}//namespace transform2
|
}//namespace transform2
|
||||||
}//namespace gtx
|
}//namespace gtx
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
@ -153,35 +153,6 @@ namespace transform2
|
|||||||
return m * scaleBias(scale, bias);
|
return m * scaleBias(scale, bias);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
inline detail::tmat4x4<T> lookAt(
|
|
||||||
const detail::tvec3<T>& eye,
|
|
||||||
const detail::tvec3<T>& center,
|
|
||||||
const detail::tvec3<T>& up)
|
|
||||||
{
|
|
||||||
detail::tvec3<T> f = normalize(center - eye);
|
|
||||||
detail::tvec3<T> u = normalize(up);
|
|
||||||
detail::tvec3<T> s = normalize(cross(f, u));
|
|
||||||
u = cross(s, f);
|
|
||||||
|
|
||||||
detail::tmat4x4<T> Result(1);
|
|
||||||
Result[0][0] = s.x;
|
|
||||||
Result[1][0] = s.y;
|
|
||||||
Result[2][0] = s.z;
|
|
||||||
Result[0][1] = u.x;
|
|
||||||
Result[1][1] = u.y;
|
|
||||||
Result[2][1] = u.z;
|
|
||||||
Result[0][2] =-f.x;
|
|
||||||
Result[1][2] =-f.y;
|
|
||||||
Result[2][2] =-f.z;
|
|
||||||
/* Test this instead of translate3D
|
|
||||||
Result[3][0] =-dot(s, eye);
|
|
||||||
Result[3][1] =-dot(y, eye);
|
|
||||||
Result[3][2] = dot(f, eye);
|
|
||||||
*/
|
|
||||||
return gtc::matrix_transform::translate(Result, -eye);
|
|
||||||
}
|
|
||||||
|
|
||||||
}//namespace transform2
|
}//namespace transform2
|
||||||
}//namespace gtx
|
}//namespace gtx
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
// File : test/gtx/simd-mat4.cpp
|
// File : test/gtx/simd-mat4.cpp
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
int test_static_assert()
|
int test_static_assert()
|
||||||
@ -130,8 +129,7 @@ int test_all()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
int main(int argc, void* argv[])
|
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -131,7 +131,7 @@ int test_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -131,7 +131,7 @@ int test_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -131,7 +131,7 @@ int test_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -131,7 +131,7 @@ int test_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -131,7 +131,7 @@ int test_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -131,7 +131,7 @@ int test_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
// File : test/gtx/simd-mat4.cpp
|
// File : test/gtx/simd-mat4.cpp
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
int test_static_assert()
|
int test_static_assert()
|
||||||
@ -131,7 +130,7 @@ int test_all()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
// File : test/gtx/simd-mat4.cpp
|
// File : test/gtx/simd-mat4.cpp
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
||||||
int test_static_assert()
|
int test_static_assert()
|
||||||
@ -130,8 +129,7 @@ int test_all()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
int main(int argc, void* argv[])
|
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_static_assert();
|
Failed += test_static_assert();
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtc/half_float.hpp>
|
#include <glm/gtc/half_float.hpp>
|
||||||
#include <xmmintrin.h>
|
|
||||||
#include <emmintrin.h>
|
|
||||||
|
|
||||||
template <int Value>
|
template <int Value>
|
||||||
struct mask
|
struct mask
|
||||||
@ -26,12 +24,12 @@ enum comp
|
|||||||
W
|
W
|
||||||
};
|
};
|
||||||
|
|
||||||
template<comp X, comp Y, comp Z, comp W>
|
//template<comp X, comp Y, comp Z, comp W>
|
||||||
__m128 swizzle(glm::vec4 const & v)
|
//__m128 swizzle(glm::vec4 const & v)
|
||||||
{
|
//{
|
||||||
__m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x);
|
// __m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x);
|
||||||
return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value);
|
// return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value);
|
||||||
}
|
//}
|
||||||
|
|
||||||
bool test_hvec4()
|
bool test_hvec4()
|
||||||
{
|
{
|
||||||
@ -57,8 +55,8 @@ int main()
|
|||||||
{
|
{
|
||||||
test_hvec4();
|
test_hvec4();
|
||||||
|
|
||||||
__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
|
//__m128 DataA = swizzle<X, Y, Z, W>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
|
||||||
__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
|
//__m128 DataB = swizzle<W, Z, Y, X>(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f));
|
||||||
|
|
||||||
bool Result = true;
|
bool Result = true;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ int test_int_matrix()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_int_matrix();
|
Failed += test_int_matrix();
|
||||||
|
@ -114,7 +114,7 @@ int test_swizzle_vec4_const_static()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
Failed += test_swizzle_vec4_ref_dynamic();
|
Failed += test_swizzle_vec4_ref_dynamic();
|
||||||
|
@ -127,7 +127,7 @@ namespace bitRevert
|
|||||||
}
|
}
|
||||||
}//bitRevert
|
}//bitRevert
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
::extractField::test();
|
::extractField::test();
|
||||||
::bitRevert::test();
|
::bitRevert::test();
|
||||||
|
@ -221,7 +221,7 @@ int test_compute_gtx()
|
|||||||
return Output.size() != 0;
|
return Output.size() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, void* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = GLM_COMPILER;
|
int Failed = GLM_COMPILER;
|
||||||
|
|
||||||
|
@ -7,12 +7,11 @@
|
|||||||
// File : test/gtx/simd-vec4.cpp
|
// File : test/gtx/simd-vec4.cpp
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtx/simd_vec4.hpp>
|
#include <glm/gtx/simd_vec4.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main()
|
||||||
{
|
{
|
||||||
glm::simd_vec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
|
glm::simd_vec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
|
||||||
glm::simd_vec4 B1(0.4f, 0.5f, 0.6f, 0.7f);
|
glm::simd_vec4 B1(0.4f, 0.5f, 0.6f, 0.7f);
|
||||||
|
Loading…
Reference in New Issue
Block a user