mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Fixed aligned matrices #777
This commit is contained in:
parent
d18c7f55ec
commit
d427da09df
@ -33,9 +33,7 @@ namespace detail
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m)
|
||||
{
|
||||
mat<4, 4, float, Q> Result;
|
||||
glm_mat4_transpose(
|
||||
*static_cast<glm_vec4 const (*)[4]>(&m[0].data),
|
||||
*static_cast<glm_vec4(*)[4]>(&Result[0].data));
|
||||
glm_mat4_transpose(&m[0].data, &Result[0].data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
@ -45,7 +43,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, Q> const& m)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_mat4_determinant(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data)));
|
||||
return _mm_cvtss_f32(glm_mat4_determinant(&m[0].data));
|
||||
}
|
||||
};
|
||||
|
||||
@ -55,7 +53,7 @@ namespace detail
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m)
|
||||
{
|
||||
mat<4, 4, float, Q> Result;
|
||||
glm_mat4_inverse(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data), *reinterpret_cast<__m128(*)[4]>(&Result[0].data));
|
||||
glm_mat4_inverse(&m[0].data, &Result[0].data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
@ -20,10 +20,10 @@
|
||||
# pragma message("GLM: GLM_GTC_type_aligned extension included")
|
||||
#endif
|
||||
|
||||
#include "../gtc/vec1.hpp"
|
||||
#include "../vec2.hpp"
|
||||
#include "../vec3.hpp"
|
||||
#include "../vec4.hpp"
|
||||
#include "../gtc/vec1.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
|
@ -127,7 +127,6 @@ static int test_ctor()
|
||||
return Error;
|
||||
}
|
||||
|
||||
/*
|
||||
using namespace glm;
|
||||
|
||||
typedef mat<4, 4, float, aligned> aligned_mat4;
|
||||
@ -144,7 +143,6 @@ static int test_aligned_mat4()
|
||||
|
||||
return Error;
|
||||
}
|
||||
*/
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -152,7 +150,7 @@ int main()
|
||||
|
||||
Error += test_ctor();
|
||||
Error += test_copy();
|
||||
// Error += test_aligned_mat4();
|
||||
Error += test_aligned_mat4();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user