From b92fdf5a5913e3e974ea0070009a83507f0e3669 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Dec 2016 16:00:25 +0100 Subject: [PATCH] matrix type Parameterize on dimensions #584 --- glm/detail/func_matrix.hpp | 18 +-- glm/detail/func_matrix.inl | 120 ++++++++--------- glm/detail/func_matrix_simd.inl | 34 ++--- glm/detail/glm.cpp | 108 ++++++++-------- glm/detail/precision.hpp | 5 +- glm/detail/type_mat.hpp | 155 +++++++++++----------- glm/detail/type_mat2x2.hpp | 116 ++++++++--------- glm/detail/type_mat2x2.inl | 154 +++++++++++----------- glm/detail/type_mat2x3.hpp | 102 +++++++-------- glm/detail/type_mat2x3.inl | 138 ++++++++++---------- glm/detail/type_mat2x4.hpp | 102 +++++++-------- glm/detail/type_mat2x4.inl | 130 +++++++++---------- glm/detail/type_mat3x2.hpp | 102 +++++++-------- glm/detail/type_mat3x2.inl | 130 +++++++++---------- glm/detail/type_mat3x3.hpp | 116 ++++++++--------- glm/detail/type_mat3x3.inl | 150 +++++++++++----------- glm/detail/type_mat3x4.hpp | 102 +++++++-------- glm/detail/type_mat3x4.inl | 138 ++++++++++---------- glm/detail/type_mat4x2.hpp | 102 +++++++-------- glm/detail/type_mat4x2.inl | 130 +++++++++---------- glm/detail/type_mat4x3.hpp | 102 +++++++-------- glm/detail/type_mat4x3.inl | 138 ++++++++++---------- glm/detail/type_mat4x4.hpp | 132 +++++++++---------- glm/detail/type_mat4x4.inl | 200 ++++++++++++++--------------- glm/detail/type_vec.hpp | 2 - glm/fwd.hpp | 162 +++++++++++------------ glm/gtc/matrix_integer.hpp | 144 ++++++++++----------- glm/gtc/matrix_inverse.inl | 24 ++-- glm/gtc/matrix_transform.hpp | 70 +++++----- glm/gtc/matrix_transform.inl | 106 +++++++-------- glm/gtc/quaternion.hpp | 16 +-- glm/gtc/quaternion.inl | 22 ++-- glm/gtc/type_precision.hpp | 72 +++++------ glm/gtc/type_ptr.hpp | 24 ++-- glm/gtc/type_ptr.inl | 96 +++++++------- glm/gtx/color_space.hpp | 2 +- glm/gtx/color_space.inl | 4 +- glm/gtx/compatibility.hpp | 72 +++++------ glm/gtx/dual_quaternion.hpp | 12 +- glm/gtx/dual_quaternion.inl | 16 +-- glm/gtx/euler_angles.hpp | 34 ++--- glm/gtx/euler_angles.inl | 56 ++++---- glm/gtx/hash.hpp | 36 +++--- glm/gtx/hash.inl | 18 +-- glm/gtx/io.hpp | 20 +-- glm/gtx/io.inl | 42 +++--- glm/gtx/matrix_cross_product.hpp | 4 +- glm/gtx/matrix_cross_product.inl | 8 +- glm/gtx/matrix_decompose.hpp | 2 +- glm/gtx/matrix_decompose.inl | 10 +- glm/gtx/matrix_interpolation.hpp | 14 +- glm/gtx/matrix_interpolation.inl | 24 ++-- glm/gtx/matrix_major_storage.hpp | 36 +++--- glm/gtx/matrix_major_storage.inl | 60 ++++----- glm/gtx/matrix_operation.hpp | 18 +-- glm/gtx/matrix_operation.inl | 36 +++--- glm/gtx/matrix_query.hpp | 20 +-- glm/gtx/matrix_query.inl | 28 ++-- glm/gtx/matrix_transform_2d.hpp | 20 +-- glm/gtx/matrix_transform_2d.inl | 30 ++--- glm/gtx/orthonormalize.hpp | 2 +- glm/gtx/orthonormalize.inl | 4 +- glm/gtx/quaternion.hpp | 8 +- glm/gtx/rotate_normalized_axis.hpp | 6 +- glm/gtx/rotate_normalized_axis.inl | 8 +- glm/gtx/rotate_vector.hpp | 2 +- glm/gtx/rotate_vector.inl | 6 +- glm/gtx/string_cast.inl | 36 +++--- glm/gtx/transform.hpp | 6 +- glm/gtx/transform.inl | 12 +- glm/gtx/transform2.hpp | 40 +++--- glm/gtx/transform2.inl | 46 +++---- glm/gtx/type_trait.hpp | 18 +-- glm/mat2x2.hpp | 12 +- glm/mat2x3.hpp | 6 +- glm/mat2x4.hpp | 6 +- glm/mat3x2.hpp | 6 +- glm/mat3x3.hpp | 12 +- glm/mat3x4.hpp | 6 +- glm/mat4x2.hpp | 6 +- glm/mat4x3.hpp | 6 +- glm/mat4x4.hpp | 12 +- glm/simd/matrix.h | 2 +- test/gtx/gtx_io.cpp | 54 ++++---- 84 files changed, 2198 insertions(+), 2208 deletions(-) diff --git a/glm/detail/func_matrix.hpp b/glm/detail/func_matrix.hpp index 10a339b6..e01e80e2 100644 --- a/glm/detail/func_matrix.hpp +++ b/glm/detail/func_matrix.hpp @@ -37,55 +37,55 @@ namespace detail template struct outerProduct_trait<2, 2, T, P, vec, vec> { - typedef tmat2x2 type; + typedef mat<2, 2, T, P> type; }; template struct outerProduct_trait<2, 3, T, P, vec, vec> { - typedef tmat3x2 type; + typedef mat<3, 2, T, P> type; }; template struct outerProduct_trait<2, 4, T, P, vec, vec> { - typedef tmat4x2 type; + typedef mat<4, 2, T, P> type; }; template struct outerProduct_trait<3, 2, T, P, vec, vec> { - typedef tmat2x3 type; + typedef mat<2, 3, T, P> type; }; template struct outerProduct_trait<3, 3, T, P, vec, vec> { - typedef tmat3x3 type; + typedef mat<3, 3, T, P> type; }; template struct outerProduct_trait<3, 4, T, P, vec, vec> { - typedef tmat4x3 type; + typedef mat<4, 3, T, P> type; }; template struct outerProduct_trait<4, 2, T, P, vec, vec> { - typedef tmat2x4 type; + typedef mat<2, 4, T, P> type; }; template struct outerProduct_trait<4, 3, T, P, vec, vec> { - typedef tmat3x4 type; + typedef mat<3, 4, T, P> type; }; template struct outerProduct_trait<4, 4, T, P, vec, vec> { - typedef tmat4x4 type; + typedef mat<4, 4, T, P> type; }; }//namespace detail diff --git a/glm/detail/func_matrix.inl b/glm/detail/func_matrix.inl index 11542496..4dc9a756 100644 --- a/glm/detail/func_matrix.inl +++ b/glm/detail/func_matrix.inl @@ -7,27 +7,27 @@ namespace glm{ namespace detail { - template