This commit is contained in:
Christophe Riccio 2011-01-24 15:44:14 +00:00
parent 019c6ced18
commit c06484ff12
23 changed files with 30 additions and 77 deletions

View File

@ -6,7 +6,7 @@ project(glm)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
#add_definitions(-S)
#add_definitions(-s)
#add_definitions(-msse2)
add_definitions(-msse2)
#add_definitions(-m32)
#add_definitions(-mfpmath=387)
#add_definitions(-ffast-math)

View File

@ -331,7 +331,7 @@ namespace detail
# if(GLM_COMPILER >= GLM_COMPILER_GCC33)
# define GLM_RESTRICT __restrict__
# define GLM_RESTRICT_VAR __restrict__
# elif
# else
# define GLM_RESTRICT
# define GLM_RESTRICT_VAR
# endif

View File

@ -137,7 +137,6 @@ namespace glm
//! From GLM_GTC_matrix_transform extension.
template <typename T>
detail::tmat4x4<T> lookAt(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & eye,
detail::tvec3<T> const & center,
detail::tvec3<T> const & up);

View File

@ -326,7 +326,6 @@ namespace matrix_transform
template <typename T>
inline detail::tmat4x4<T> lookAt(
detail::tmat4x4<T> const & m,
const detail::tvec3<T>& eye,
const detail::tvec3<T>& center,
const detail::tvec3<T>& up)
@ -351,7 +350,7 @@ namespace matrix_transform
Result[3][1] =-dot(y, 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 gtc

View File

@ -21,7 +21,7 @@ inline T swizzle
comp x
)
{
assert(int(x) < int(typename vecType<T>::_size));
assert(int(x) < int(vecType<T>::value_size));
return v[x];
}

View File

@ -17,13 +17,13 @@
// Dependency:
#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"
#endif
#include "../core/intrinsic_common.hpp"
#include "../core/intrinsic_geometric.hpp"
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
# pragma message("GLM: GLM_GTX_simd_vec4 extension included")
#endif

View File

@ -109,14 +109,6 @@ namespace glm
valType scale,
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 gtx
}//namespace glm

View File

@ -153,35 +153,6 @@ namespace transform2
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 gtx
}//namespace glm

View File

@ -7,7 +7,6 @@
// File : test/gtx/simd-mat4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
#include <glm/glm.hpp>
int test_static_assert()
@ -130,8 +129,7 @@ int test_all()
return 0;
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -131,7 +131,7 @@ int test_all()
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -131,7 +131,7 @@ int test_all()
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -131,7 +131,7 @@ int test_all()
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -131,7 +131,7 @@ int test_all()
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -131,7 +131,7 @@ int test_all()
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -131,7 +131,7 @@ int test_all()
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -7,7 +7,6 @@
// File : test/gtx/simd-mat4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
#include <glm/glm.hpp>
int test_static_assert()
@ -131,7 +130,7 @@ int test_all()
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -7,7 +7,6 @@
// File : test/gtx/simd-mat4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
#include <glm/glm.hpp>
int test_static_assert()
@ -130,8 +129,7 @@ int test_all()
return 0;
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_static_assert();

View File

@ -9,8 +9,6 @@
#include <glm/glm.hpp>
#include <glm/gtc/half_float.hpp>
#include <xmmintrin.h>
#include <emmintrin.h>
template <int Value>
struct mask
@ -26,12 +24,12 @@ enum comp
W
};
template<comp X, comp Y, comp Z, comp W>
__m128 swizzle(glm::vec4 const & v)
{
__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);
}
//template<comp X, comp Y, comp Z, comp W>
//__m128 swizzle(glm::vec4 const & v)
//{
// __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);
//}
bool test_hvec4()
{
@ -57,8 +55,8 @@ int main()
{
test_hvec4();
__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 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));
bool Result = true;

View File

@ -20,7 +20,7 @@ int test_int_matrix()
return 0;
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_int_matrix();

View File

@ -114,7 +114,7 @@ int test_swizzle_vec4_const_static()
return 0;
}
int main(int argc, void* argv[])
int main()
{
int Failed = 0;
Failed += test_swizzle_vec4_ref_dynamic();

View File

@ -127,7 +127,7 @@ namespace bitRevert
}
}//bitRevert
int main(int argc, void* argv[])
int main()
{
::extractField::test();
::bitRevert::test();

View File

@ -221,7 +221,7 @@ int test_compute_gtx()
return Output.size() != 0;
}
int main(int argc, void* argv[])
int main()
{
int Failed = GLM_COMPILER;

View File

@ -7,12 +7,11 @@
// File : test/gtx/simd-vec4.cpp
///////////////////////////////////////////////////////////////////////////////////////////////////
#define GLM_INSTRUCTION_SET GLM_PLATFORM_SSE3 | GLM_PLATFORM_SSE2
#include <glm/glm.hpp>
#include <glm/gtx/simd_vec4.hpp>
#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 B1(0.4f, 0.5f, 0.6f, 0.7f);