From 7c5b8a34649cb18b20e58e1f44ea2b104e3e19cc Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 29 Apr 2010 15:45:55 +0100 Subject: [PATCH] Clean master --- CMakeLists.txt | 2 +- experimental/half/half.cpp | 4 - experimental/half/half.h | 119 - experimental/half/half.inl | 0 experimental/half/half_test.cpp | 39 - experimental/half/half_test.h | 6 - experimental/sign.cpp | 5 - experimental/simd/sse.cpp | 1378 --------- experimental/simd/sse.h | 13 - experimental/simd/sse_mat4.cpp | 61 - experimental/simd/sse_mat4.h | 1280 --------- experimental/simd/sse_mat4array.cpp | 1 - experimental/simd/sse_mat4array.h | 0 experimental/simd/sse_vec4.cpp | 53 - experimental/simd/sse_vec4.h | 290 -- experimental/simd/sse_vec4array.cpp | 1 - experimental/simd/sse_vec4array.h | 0 experimental/sse/glm/core/_bvec2.h | 54 - experimental/sse/glm/core/_bvec2.inl | 159 -- experimental/sse/glm/core/_bvec3.h | 67 - experimental/sse/glm/core/_bvec3.inl | 224 -- experimental/sse/glm/core/_bvec4.h | 91 - experimental/sse/glm/core/_bvec4.inl | 335 --- experimental/sse/glm/core/_cvec2.h | 113 - experimental/sse/glm/core/_cvec2.inl | 253 -- experimental/sse/glm/core/_cvec3.h | 217 -- experimental/sse/glm/core/_cvec3.inl | 849 ------ experimental/sse/glm/core/_cvec4.h | 489 ---- experimental/sse/glm/core/_cvec4.inl | 2450 ----------------- experimental/sse/glm/core/_cvecx.h | 54 - experimental/sse/glm/core/_func.h | 359 --- experimental/sse/glm/core/_func.inl | 2247 --------------- experimental/sse/glm/core/_swizzle.h | 1742 ------------ experimental/sse/glm/core/_swizzle.inl | 20 - experimental/sse/glm/core/_xmat2.h | 173 -- experimental/sse/glm/core/_xmat2.inl | 416 --- experimental/sse/glm/core/_xmat2x3.h | 143 - experimental/sse/glm/core/_xmat2x3.inl | 379 --- experimental/sse/glm/core/_xmat2x4.h | 144 - experimental/sse/glm/core/_xmat2x4.inl | 392 --- experimental/sse/glm/core/_xmat3.h | 176 -- experimental/sse/glm/core/_xmat3.inl | 546 ---- experimental/sse/glm/core/_xmat3x2.h | 145 - experimental/sse/glm/core/_xmat3x2.inl | 451 --- experimental/sse/glm/core/_xmat3x4.h | 145 - experimental/sse/glm/core/_xmat3x4.inl | 434 --- experimental/sse/glm/core/_xmat4.h | 178 -- experimental/sse/glm/core/_xmat4.inl | 633 ----- experimental/sse/glm/core/_xmat4x2.h | 146 - experimental/sse/glm/core/_xmat4x2.inl | 440 --- experimental/sse/glm/core/_xmat4x3.h | 146 - experimental/sse/glm/core/_xmat4x3.inl | 460 ---- experimental/sse/glm/core/_xref2.h | 38 - experimental/sse/glm/core/_xref2.inl | 107 - experimental/sse/glm/core/_xref3.h | 39 - experimental/sse/glm/core/_xref3.inl | 118 - experimental/sse/glm/core/_xref4.h | 40 - experimental/sse/glm/core/_xref4.inl | 129 - experimental/sse/glm/core/_xvec2.h | 260 -- experimental/sse/glm/core/_xvec2.inl | 802 ------ experimental/sse/glm/core/_xvec3.h | 283 -- experimental/sse/glm/core/_xvec3.inl | 694 ----- experimental/sse/glm/core/_xvec4.h | 241 -- experimental/sse/glm/core/_xvec4.inl | 1242 --------- experimental/sse/glm/ext/gtx.h | 81 - .../sse/glm/ext/gtx/associated_min_max.h | 518 ---- .../sse/glm/ext/gtx/associated_min_max.inl | 911 ------ experimental/sse/glm/ext/gtx/bit.h | 76 - experimental/sse/glm/ext/gtx/bit.inl | 242 -- experimental/sse/glm/ext/gtx/closest_point.h | 54 - .../sse/glm/ext/gtx/closest_point.inl | 31 - experimental/sse/glm/ext/gtx/color_cast.h | 165 -- experimental/sse/glm/ext/gtx/color_cast.inl | 737 ----- experimental/sse/glm/ext/gtx/color_space.h | 51 - experimental/sse/glm/ext/gtx/color_space.inl | 149 - experimental/sse/glm/ext/gtx/compatibility.h | 298 -- .../sse/glm/ext/gtx/compatibility.inl | 132 - experimental/sse/glm/ext/gtx/component_wise.h | 49 - .../sse/glm/ext/gtx/component_wise.inl | 85 - experimental/sse/glm/ext/gtx/determinant.h | 45 - experimental/sse/glm/ext/gtx/determinant.inl | 47 - experimental/sse/glm/ext/gtx/double.h | 80 - experimental/sse/glm/ext/gtx/double.inl | 13 - experimental/sse/glm/ext/gtx/epsilon.h | 100 - experimental/sse/glm/ext/gtx/epsilon.inl | 131 - experimental/sse/glm/ext/gtx/euler_angles.h | 54 - experimental/sse/glm/ext/gtx/euler_angles.inl | 97 - experimental/sse/glm/ext/gtx/extend.h | 41 - experimental/sse/glm/ext/gtx/extend.inl | 38 - .../sse/glm/ext/gtx/extented_min_max.h | 105 - .../sse/glm/ext/gtx/extented_min_max.inl | 155 -- .../sse/glm/ext/gtx/fast_exponential.h | 84 - .../sse/glm/ext/gtx/fast_exponential.inl | 265 -- .../sse/glm/ext/gtx/fast_square_root.h | 72 - .../sse/glm/ext/gtx/fast_square_root.inl | 165 -- .../sse/glm/ext/gtx/fast_trigonometry.h | 80 - .../sse/glm/ext/gtx/fast_trigonometry.inl | 243 -- experimental/sse/glm/ext/gtx/flexible_mix.h | 47 - experimental/sse/glm/ext/gtx/flexible_mix.inl | 58 - experimental/sse/glm/ext/gtx/gpu_shader4.h | 169 -- experimental/sse/glm/ext/gtx/gpu_shader4.inl | 949 ------- experimental/sse/glm/ext/gtx/half.h | 405 --- experimental/sse/glm/ext/gtx/half.inl | 1248 --------- .../sse/glm/ext/gtx/handed_coordinate_space.h | 45 - .../glm/ext/gtx/handed_coordinate_space.inl | 23 - experimental/sse/glm/ext/gtx/hyperbolic.h | 75 - experimental/sse/glm/ext/gtx/hyperbolic.inl | 219 -- experimental/sse/glm/ext/gtx/inertia.h | 55 - experimental/sse/glm/ext/gtx/inertia.inl | 82 - experimental/sse/glm/ext/gtx/integer.h | 104 - experimental/sse/glm/ext/gtx/integer.inl | 284 -- experimental/sse/glm/ext/gtx/intersect.h | 107 - experimental/sse/glm/ext/gtx/intersect.inl | 148 - experimental/sse/glm/ext/gtx/inverse.h | 61 - experimental/sse/glm/ext/gtx/inverse.inl | 184 -- .../sse/glm/ext/gtx/inverse_transpose.h | 43 - .../sse/glm/ext/gtx/inverse_transpose.inl | 101 - experimental/sse/glm/ext/gtx/mat4x3.h | 134 - experimental/sse/glm/ext/gtx/mat4x3.inl | 405 --- experimental/sse/glm/ext/gtx/matrix_access.h | 43 - .../sse/glm/ext/gtx/matrix_access.inl | 83 - .../sse/glm/ext/gtx/matrix_cross_product.h | 43 - .../sse/glm/ext/gtx/matrix_cross_product.inl | 37 - .../sse/glm/ext/gtx/matrix_major_storage.h | 65 - .../sse/glm/ext/gtx/matrix_major_storage.inl | 170 -- .../sse/glm/ext/gtx/matrix_projection.h | 53 - .../sse/glm/ext/gtx/matrix_projection.inl | 135 - experimental/sse/glm/ext/gtx/matrix_query.h | 62 - experimental/sse/glm/ext/gtx/matrix_query.inl | 255 -- .../sse/glm/ext/gtx/matrix_selection.h | 51 - .../sse/glm/ext/gtx/matrix_selection.inl | 63 - experimental/sse/glm/ext/gtx/matx.h | 184 -- experimental/sse/glm/ext/gtx/matx.inl | 479 ---- experimental/sse/glm/ext/gtx/mixed_product.h | 54 - .../sse/glm/ext/gtx/mixed_product.inl | 28 - experimental/sse/glm/ext/gtx/mul.h | 48 - experimental/sse/glm/ext/gtx/mul.inl | 85 - experimental/sse/glm/ext/gtx/norm.h | 58 - experimental/sse/glm/ext/gtx/norm.inl | 47 - experimental/sse/glm/ext/gtx/normal.h | 41 - experimental/sse/glm/ext/gtx/normal.inl | 17 - experimental/sse/glm/ext/gtx/normalize_dot.h | 52 - .../sse/glm/ext/gtx/normalize_dot.inl | 54 - .../sse/glm/ext/gtx/number_precision.h | 265 -- .../sse/glm/ext/gtx/number_precision.inl | 13 - experimental/sse/glm/ext/gtx/optimum_pow.h | 55 - experimental/sse/glm/ext/gtx/optimum_pow.inl | 58 - experimental/sse/glm/ext/gtx/orthonormalize.h | 43 - .../sse/glm/ext/gtx/orthonormalize.inl | 36 - experimental/sse/glm/ext/gtx/outer_product.h | 45 - .../sse/glm/ext/gtx/outer_product.inl | 64 - experimental/sse/glm/ext/gtx/perpendicular.h | 47 - .../sse/glm/ext/gtx/perpendicular.inl | 29 - .../sse/glm/ext/gtx/polar_coordinates.h | 47 - .../sse/glm/ext/gtx/polar_coordinates.inl | 35 - experimental/sse/glm/ext/gtx/projection.h | 45 - experimental/sse/glm/ext/gtx/projection.inl | 29 - experimental/sse/glm/ext/gtx/quaternion.h | 175 -- experimental/sse/glm/ext/gtx/quaternion.inl | 847 ------ experimental/sse/glm/ext/gtx/random.h | 157 -- experimental/sse/glm/ext/gtx/random.inl | 627 ----- experimental/sse/glm/ext/gtx/rotate_vector.h | 60 - .../sse/glm/ext/gtx/rotate_vector.inl | 119 - experimental/sse/glm/ext/gtx/round.h | 51 - experimental/sse/glm/ext/gtx/round.inl | 39 - experimental/sse/glm/ext/gtx/spline.h | 46 - experimental/sse/glm/ext/gtx/spline.inl | 48 - .../sse/glm/ext/gtx/statistics_operation.h | 71 - .../sse/glm/ext/gtx/statistics_operation.inl | 81 - experimental/sse/glm/ext/gtx/transform.h | 107 - experimental/sse/glm/ext/gtx/transform.inl | 334 --- experimental/sse/glm/ext/gtx/transform2.h | 69 - experimental/sse/glm/ext/gtx/transform2.inl | 136 - experimental/sse/glm/ext/gtx/transpose.h | 45 - experimental/sse/glm/ext/gtx/transpose.inl | 66 - experimental/sse/glm/ext/gtx/unsigned_int.h | 47 - experimental/sse/glm/ext/gtx/unsigned_int.inl | 40 - experimental/sse/glm/ext/gtx/vector_access.h | 64 - .../sse/glm/ext/gtx/vector_access.inl | 82 - experimental/sse/glm/ext/gtx/vector_angle.h | 56 - experimental/sse/glm/ext/gtx/vector_angle.inl | 82 - .../sse/glm/ext/gtx/vector_comp_mult.h | 56 - .../sse/glm/ext/gtx/vector_comp_mult.inl | 38 - experimental/sse/glm/ext/gtx/vector_query.h | 69 - experimental/sse/glm/ext/gtx/vector_query.inl | 233 -- experimental/sse/glm/ext/gtx/vecx.h | 221 -- experimental/sse/glm/ext/gtx/vecx.inl | 866 ------ .../sse/glm/ext/gtx/verbose_operator.h | 45 - .../sse/glm/ext/gtx/verbose_operator.inl | 29 - experimental/sse/glm/glm.h | 180 -- experimental/sse/glm/glmext.h | 20 - experimental/sse/glm/glmsetup.h | 128 - experimental/sse/main.cpp | 137 - experimental/sse/precompiled.cpp | 1 - experimental/sse/precompiled.h | 7 - experimental/sse/rdtsc.cpp | 1 - experimental/sse/rdtsc.h | 0 experimental/sse/sse.cpp | 1378 --------- experimental/sse/sse.h | 13 - experimental/sse/sse.sln | 23 - experimental/sse/sse.vcproj | 276 -- experimental/sse/sse_mat4.cpp | 60 - experimental/sse/sse_mat4.h | 1280 --------- experimental/sse/sse_mat4array.cpp | 1 - experimental/sse/sse_mat4array.h | 0 experimental/sse/sse_vec4.cpp | 52 - experimental/sse/sse_vec4.h | 290 -- experimental/sse/sse_vec4array.cpp | 1 - experimental/sse/sse_vec4array.h | 0 sample/CMakeLists.txt | 0 test/CMakeLists.txt | 52 - test/bug.cpp | 0 test/core.cpp | 27 - test/core.hpp | 0 test/core/cast/mat.cpp | 130 - test/core/cast/mat.h | 6 - test/core/ctor/vec2.cpp | 11 - test/core/ctor/vec2.h | 6 - test/core/ctor/vec3.cpp | 12 - test/core/ctor/vec3.h | 6 - test/core/ctor/vec4.cpp | 14 - test/core/ctor/vec4.h | 6 - test/core/func_common.cpp | 882 ------ test/core/func_exponential.cpp | 351 --- test/core/func_geometric.cpp | 370 --- test/core/func_matrix.cpp | 81 - test/core/func_noise.cpp | 27 - test/core/func_trigonometric.cpp | 400 --- test/core/func_vector_relational.cpp | 383 --- test/core/type.cpp | 10 - test/core/type_float.cpp | 22 - test/core/type_half.cpp | 42 - test/core/type_int.cpp | 22 - test/core/type_mat2x2.cpp | 22 - test/core/type_mat2x3.cpp | 22 - test/core/type_mat2x4.cpp | 22 - test/core/type_mat3x2.cpp | 22 - test/core/type_mat3x3.cpp | 22 - test/core/type_mat3x4.cpp | 22 - test/core/type_mat4x2.cpp | 22 - test/core/type_mat4x3.cpp | 22 - test/core/type_mat4x4.cpp | 22 - test/core/type_vec1.cpp | 22 - test/core/type_vec2.cpp | 22 - test/core/type_vec3.cpp | 22 - test/core/type_vec4.cpp | 22 - test/gtc.cpp | 0 test/gtc.hpp | 0 test/gtc/double_float.cpp | 14 - test/gtc/half_float.cpp | 25 - test/gtc/matrix_access.cpp | 14 - test/gtc/matrix_operation.cpp | 14 - test/gtc/matrix_projection.cpp | 14 - test/gtc/matrix_transform.cpp | 14 - test/gtc/quaternion.cpp | 14 - test/gtc/type_precision.cpp | 14 - test/gtx.hpp | 0 test/gtx/associated_min_max.cpp | 222 -- test/gtx/bit.cpp | 11 - test/gtx/closest_point.cpp | 11 - test/gtx/color_cast.cpp | 11 - test/gtx/color_space.cpp | 11 - test/gtx/comparison.cpp | 11 - test/gtx/compatibility.cpp | 11 - test/gtx/component_wise.cpp | 11 - test/gtx/epsilon.cpp | 11 - test/gtx/euler_angles.cpp | 11 - test/gtx/extend.cpp | 11 - test/gtx/extented_min_max.cpp | 11 - test/gtx/fast_exponential.cpp | 11 - test/gtx/fast_square_root.cpp | 11 - test/gtx/fast_trigonometry.cpp | 11 - test/gtx/handed_coordinate_space.cpp | 11 - test/gtx/inertia.cpp | 11 - test/gtx/integer.cpp | 11 - test/gtx/intersect.cpp | 27 - test/gtx/inverse.cpp | 11 - test/gtx/inverse_transpose.cpp | 11 - test/gtx/matrix_access.cpp | 11 - test/gtx/matrix_cross_product.cpp | 11 - test/gtx/matrix_major_storage.cpp | 11 - test/gtx/matrix_projection.cpp | 11 - test/gtx/matrix_query.cpp | 11 - test/gtx/matrix_selection.cpp | 11 - test/gtx/matx.cpp | 11 - test/gtx/mixed_product.cpp | 11 - test/gtx/norm.cpp | 11 - test/gtx/normal.cpp | 11 - test/gtx/normalize_dot.cpp | 11 - test/gtx/number_precision.cpp | 11 - test/gtx/optimum_pow.cpp | 11 - test/gtx/orthonormalize.cpp | 11 - test/gtx/perpendicular.cpp | 11 - test/gtx/polar_coordinates.cpp | 11 - test/gtx/projection.cpp | 11 - test/gtx/quaternion.cpp | 11 - test/gtx/random.cpp | 11 - test/gtx/rotate_vector.cpp | 11 - test/gtx/safe_limits.cpp | 12 - test/gtx/spline.cpp | 11 - test/gtx/statistics_operation.cpp | 11 - test/gtx/std_based_type.cpp | 11 - test/gtx/string_cast.cpp | 11 - test/gtx/transform.cpp | 11 - test/gtx/transform2.cpp | 11 - test/gtx/transpose.cpp | 10 - test/gtx/unsigned_int.cpp | 11 - test/gtx/vector_access.cpp | 11 - test/gtx/vector_angle.cpp | 11 - test/gtx/vector_query.cpp | 11 - test/gtx/vecx.cpp | 11 - test/gtx/verbose_operator.cpp | 11 - test/header.cpp | 128 - test/img.cpp | 34 - test/img.hpp | 24 - test/img/multiple.cpp | 127 - test/img/wrap.cpp | 141 - test/main.cpp | 2313 ---------------- test/precompiled.cpp | 2 - test/precompiled.hpp | 18 - test/virtrev.cpp | 0 test/virtrev.hpp | 0 322 files changed, 1 insertion(+), 51614 deletions(-) delete mode 100644 experimental/half/half.cpp delete mode 100644 experimental/half/half.h delete mode 100644 experimental/half/half.inl delete mode 100644 experimental/half/half_test.cpp delete mode 100644 experimental/half/half_test.h delete mode 100644 experimental/sign.cpp delete mode 100644 experimental/simd/sse.cpp delete mode 100644 experimental/simd/sse.h delete mode 100644 experimental/simd/sse_mat4.cpp delete mode 100644 experimental/simd/sse_mat4.h delete mode 100644 experimental/simd/sse_mat4array.cpp delete mode 100644 experimental/simd/sse_mat4array.h delete mode 100644 experimental/simd/sse_vec4.cpp delete mode 100644 experimental/simd/sse_vec4.h delete mode 100644 experimental/simd/sse_vec4array.cpp delete mode 100644 experimental/simd/sse_vec4array.h delete mode 100644 experimental/sse/glm/core/_bvec2.h delete mode 100644 experimental/sse/glm/core/_bvec2.inl delete mode 100644 experimental/sse/glm/core/_bvec3.h delete mode 100644 experimental/sse/glm/core/_bvec3.inl delete mode 100644 experimental/sse/glm/core/_bvec4.h delete mode 100644 experimental/sse/glm/core/_bvec4.inl delete mode 100644 experimental/sse/glm/core/_cvec2.h delete mode 100644 experimental/sse/glm/core/_cvec2.inl delete mode 100644 experimental/sse/glm/core/_cvec3.h delete mode 100644 experimental/sse/glm/core/_cvec3.inl delete mode 100644 experimental/sse/glm/core/_cvec4.h delete mode 100644 experimental/sse/glm/core/_cvec4.inl delete mode 100644 experimental/sse/glm/core/_cvecx.h delete mode 100644 experimental/sse/glm/core/_func.h delete mode 100644 experimental/sse/glm/core/_func.inl delete mode 100644 experimental/sse/glm/core/_swizzle.h delete mode 100644 experimental/sse/glm/core/_swizzle.inl delete mode 100644 experimental/sse/glm/core/_xmat2.h delete mode 100644 experimental/sse/glm/core/_xmat2.inl delete mode 100644 experimental/sse/glm/core/_xmat2x3.h delete mode 100644 experimental/sse/glm/core/_xmat2x3.inl delete mode 100644 experimental/sse/glm/core/_xmat2x4.h delete mode 100644 experimental/sse/glm/core/_xmat2x4.inl delete mode 100644 experimental/sse/glm/core/_xmat3.h delete mode 100644 experimental/sse/glm/core/_xmat3.inl delete mode 100644 experimental/sse/glm/core/_xmat3x2.h delete mode 100644 experimental/sse/glm/core/_xmat3x2.inl delete mode 100644 experimental/sse/glm/core/_xmat3x4.h delete mode 100644 experimental/sse/glm/core/_xmat3x4.inl delete mode 100644 experimental/sse/glm/core/_xmat4.h delete mode 100644 experimental/sse/glm/core/_xmat4.inl delete mode 100644 experimental/sse/glm/core/_xmat4x2.h delete mode 100644 experimental/sse/glm/core/_xmat4x2.inl delete mode 100644 experimental/sse/glm/core/_xmat4x3.h delete mode 100644 experimental/sse/glm/core/_xmat4x3.inl delete mode 100644 experimental/sse/glm/core/_xref2.h delete mode 100644 experimental/sse/glm/core/_xref2.inl delete mode 100644 experimental/sse/glm/core/_xref3.h delete mode 100644 experimental/sse/glm/core/_xref3.inl delete mode 100644 experimental/sse/glm/core/_xref4.h delete mode 100644 experimental/sse/glm/core/_xref4.inl delete mode 100644 experimental/sse/glm/core/_xvec2.h delete mode 100644 experimental/sse/glm/core/_xvec2.inl delete mode 100644 experimental/sse/glm/core/_xvec3.h delete mode 100644 experimental/sse/glm/core/_xvec3.inl delete mode 100644 experimental/sse/glm/core/_xvec4.h delete mode 100644 experimental/sse/glm/core/_xvec4.inl delete mode 100644 experimental/sse/glm/ext/gtx.h delete mode 100644 experimental/sse/glm/ext/gtx/associated_min_max.h delete mode 100644 experimental/sse/glm/ext/gtx/associated_min_max.inl delete mode 100644 experimental/sse/glm/ext/gtx/bit.h delete mode 100644 experimental/sse/glm/ext/gtx/bit.inl delete mode 100644 experimental/sse/glm/ext/gtx/closest_point.h delete mode 100644 experimental/sse/glm/ext/gtx/closest_point.inl delete mode 100644 experimental/sse/glm/ext/gtx/color_cast.h delete mode 100644 experimental/sse/glm/ext/gtx/color_cast.inl delete mode 100644 experimental/sse/glm/ext/gtx/color_space.h delete mode 100644 experimental/sse/glm/ext/gtx/color_space.inl delete mode 100644 experimental/sse/glm/ext/gtx/compatibility.h delete mode 100644 experimental/sse/glm/ext/gtx/compatibility.inl delete mode 100644 experimental/sse/glm/ext/gtx/component_wise.h delete mode 100644 experimental/sse/glm/ext/gtx/component_wise.inl delete mode 100644 experimental/sse/glm/ext/gtx/determinant.h delete mode 100644 experimental/sse/glm/ext/gtx/determinant.inl delete mode 100644 experimental/sse/glm/ext/gtx/double.h delete mode 100644 experimental/sse/glm/ext/gtx/double.inl delete mode 100644 experimental/sse/glm/ext/gtx/epsilon.h delete mode 100644 experimental/sse/glm/ext/gtx/epsilon.inl delete mode 100644 experimental/sse/glm/ext/gtx/euler_angles.h delete mode 100644 experimental/sse/glm/ext/gtx/euler_angles.inl delete mode 100644 experimental/sse/glm/ext/gtx/extend.h delete mode 100644 experimental/sse/glm/ext/gtx/extend.inl delete mode 100644 experimental/sse/glm/ext/gtx/extented_min_max.h delete mode 100644 experimental/sse/glm/ext/gtx/extented_min_max.inl delete mode 100644 experimental/sse/glm/ext/gtx/fast_exponential.h delete mode 100644 experimental/sse/glm/ext/gtx/fast_exponential.inl delete mode 100644 experimental/sse/glm/ext/gtx/fast_square_root.h delete mode 100644 experimental/sse/glm/ext/gtx/fast_square_root.inl delete mode 100644 experimental/sse/glm/ext/gtx/fast_trigonometry.h delete mode 100644 experimental/sse/glm/ext/gtx/fast_trigonometry.inl delete mode 100644 experimental/sse/glm/ext/gtx/flexible_mix.h delete mode 100644 experimental/sse/glm/ext/gtx/flexible_mix.inl delete mode 100644 experimental/sse/glm/ext/gtx/gpu_shader4.h delete mode 100644 experimental/sse/glm/ext/gtx/gpu_shader4.inl delete mode 100644 experimental/sse/glm/ext/gtx/half.h delete mode 100644 experimental/sse/glm/ext/gtx/half.inl delete mode 100644 experimental/sse/glm/ext/gtx/handed_coordinate_space.h delete mode 100644 experimental/sse/glm/ext/gtx/handed_coordinate_space.inl delete mode 100644 experimental/sse/glm/ext/gtx/hyperbolic.h delete mode 100644 experimental/sse/glm/ext/gtx/hyperbolic.inl delete mode 100644 experimental/sse/glm/ext/gtx/inertia.h delete mode 100644 experimental/sse/glm/ext/gtx/inertia.inl delete mode 100644 experimental/sse/glm/ext/gtx/integer.h delete mode 100644 experimental/sse/glm/ext/gtx/integer.inl delete mode 100644 experimental/sse/glm/ext/gtx/intersect.h delete mode 100644 experimental/sse/glm/ext/gtx/intersect.inl delete mode 100644 experimental/sse/glm/ext/gtx/inverse.h delete mode 100644 experimental/sse/glm/ext/gtx/inverse.inl delete mode 100644 experimental/sse/glm/ext/gtx/inverse_transpose.h delete mode 100644 experimental/sse/glm/ext/gtx/inverse_transpose.inl delete mode 100644 experimental/sse/glm/ext/gtx/mat4x3.h delete mode 100644 experimental/sse/glm/ext/gtx/mat4x3.inl delete mode 100644 experimental/sse/glm/ext/gtx/matrix_access.h delete mode 100644 experimental/sse/glm/ext/gtx/matrix_access.inl delete mode 100644 experimental/sse/glm/ext/gtx/matrix_cross_product.h delete mode 100644 experimental/sse/glm/ext/gtx/matrix_cross_product.inl delete mode 100644 experimental/sse/glm/ext/gtx/matrix_major_storage.h delete mode 100644 experimental/sse/glm/ext/gtx/matrix_major_storage.inl delete mode 100644 experimental/sse/glm/ext/gtx/matrix_projection.h delete mode 100644 experimental/sse/glm/ext/gtx/matrix_projection.inl delete mode 100644 experimental/sse/glm/ext/gtx/matrix_query.h delete mode 100644 experimental/sse/glm/ext/gtx/matrix_query.inl delete mode 100644 experimental/sse/glm/ext/gtx/matrix_selection.h delete mode 100644 experimental/sse/glm/ext/gtx/matrix_selection.inl delete mode 100644 experimental/sse/glm/ext/gtx/matx.h delete mode 100644 experimental/sse/glm/ext/gtx/matx.inl delete mode 100644 experimental/sse/glm/ext/gtx/mixed_product.h delete mode 100644 experimental/sse/glm/ext/gtx/mixed_product.inl delete mode 100644 experimental/sse/glm/ext/gtx/mul.h delete mode 100644 experimental/sse/glm/ext/gtx/mul.inl delete mode 100644 experimental/sse/glm/ext/gtx/norm.h delete mode 100644 experimental/sse/glm/ext/gtx/norm.inl delete mode 100644 experimental/sse/glm/ext/gtx/normal.h delete mode 100644 experimental/sse/glm/ext/gtx/normal.inl delete mode 100644 experimental/sse/glm/ext/gtx/normalize_dot.h delete mode 100644 experimental/sse/glm/ext/gtx/normalize_dot.inl delete mode 100644 experimental/sse/glm/ext/gtx/number_precision.h delete mode 100644 experimental/sse/glm/ext/gtx/number_precision.inl delete mode 100644 experimental/sse/glm/ext/gtx/optimum_pow.h delete mode 100644 experimental/sse/glm/ext/gtx/optimum_pow.inl delete mode 100644 experimental/sse/glm/ext/gtx/orthonormalize.h delete mode 100644 experimental/sse/glm/ext/gtx/orthonormalize.inl delete mode 100644 experimental/sse/glm/ext/gtx/outer_product.h delete mode 100644 experimental/sse/glm/ext/gtx/outer_product.inl delete mode 100644 experimental/sse/glm/ext/gtx/perpendicular.h delete mode 100644 experimental/sse/glm/ext/gtx/perpendicular.inl delete mode 100644 experimental/sse/glm/ext/gtx/polar_coordinates.h delete mode 100644 experimental/sse/glm/ext/gtx/polar_coordinates.inl delete mode 100644 experimental/sse/glm/ext/gtx/projection.h delete mode 100644 experimental/sse/glm/ext/gtx/projection.inl delete mode 100644 experimental/sse/glm/ext/gtx/quaternion.h delete mode 100644 experimental/sse/glm/ext/gtx/quaternion.inl delete mode 100644 experimental/sse/glm/ext/gtx/random.h delete mode 100644 experimental/sse/glm/ext/gtx/random.inl delete mode 100644 experimental/sse/glm/ext/gtx/rotate_vector.h delete mode 100644 experimental/sse/glm/ext/gtx/rotate_vector.inl delete mode 100644 experimental/sse/glm/ext/gtx/round.h delete mode 100644 experimental/sse/glm/ext/gtx/round.inl delete mode 100644 experimental/sse/glm/ext/gtx/spline.h delete mode 100644 experimental/sse/glm/ext/gtx/spline.inl delete mode 100644 experimental/sse/glm/ext/gtx/statistics_operation.h delete mode 100644 experimental/sse/glm/ext/gtx/statistics_operation.inl delete mode 100644 experimental/sse/glm/ext/gtx/transform.h delete mode 100644 experimental/sse/glm/ext/gtx/transform.inl delete mode 100644 experimental/sse/glm/ext/gtx/transform2.h delete mode 100644 experimental/sse/glm/ext/gtx/transform2.inl delete mode 100644 experimental/sse/glm/ext/gtx/transpose.h delete mode 100644 experimental/sse/glm/ext/gtx/transpose.inl delete mode 100644 experimental/sse/glm/ext/gtx/unsigned_int.h delete mode 100644 experimental/sse/glm/ext/gtx/unsigned_int.inl delete mode 100644 experimental/sse/glm/ext/gtx/vector_access.h delete mode 100644 experimental/sse/glm/ext/gtx/vector_access.inl delete mode 100644 experimental/sse/glm/ext/gtx/vector_angle.h delete mode 100644 experimental/sse/glm/ext/gtx/vector_angle.inl delete mode 100644 experimental/sse/glm/ext/gtx/vector_comp_mult.h delete mode 100644 experimental/sse/glm/ext/gtx/vector_comp_mult.inl delete mode 100644 experimental/sse/glm/ext/gtx/vector_query.h delete mode 100644 experimental/sse/glm/ext/gtx/vector_query.inl delete mode 100644 experimental/sse/glm/ext/gtx/vecx.h delete mode 100644 experimental/sse/glm/ext/gtx/vecx.inl delete mode 100644 experimental/sse/glm/ext/gtx/verbose_operator.h delete mode 100644 experimental/sse/glm/ext/gtx/verbose_operator.inl delete mode 100644 experimental/sse/glm/glm.h delete mode 100644 experimental/sse/glm/glmext.h delete mode 100644 experimental/sse/glm/glmsetup.h delete mode 100644 experimental/sse/main.cpp delete mode 100644 experimental/sse/precompiled.cpp delete mode 100644 experimental/sse/precompiled.h delete mode 100644 experimental/sse/rdtsc.cpp delete mode 100644 experimental/sse/rdtsc.h delete mode 100644 experimental/sse/sse.cpp delete mode 100644 experimental/sse/sse.h delete mode 100644 experimental/sse/sse.sln delete mode 100644 experimental/sse/sse.vcproj delete mode 100644 experimental/sse/sse_mat4.cpp delete mode 100644 experimental/sse/sse_mat4.h delete mode 100644 experimental/sse/sse_mat4array.cpp delete mode 100644 experimental/sse/sse_mat4array.h delete mode 100644 experimental/sse/sse_vec4.cpp delete mode 100644 experimental/sse/sse_vec4.h delete mode 100644 experimental/sse/sse_vec4array.cpp delete mode 100644 experimental/sse/sse_vec4array.h delete mode 100644 sample/CMakeLists.txt delete mode 100644 test/CMakeLists.txt delete mode 100644 test/bug.cpp delete mode 100644 test/core.cpp delete mode 100644 test/core.hpp delete mode 100644 test/core/cast/mat.cpp delete mode 100644 test/core/cast/mat.h delete mode 100644 test/core/ctor/vec2.cpp delete mode 100644 test/core/ctor/vec2.h delete mode 100644 test/core/ctor/vec3.cpp delete mode 100644 test/core/ctor/vec3.h delete mode 100644 test/core/ctor/vec4.cpp delete mode 100644 test/core/ctor/vec4.h delete mode 100644 test/core/func_common.cpp delete mode 100644 test/core/func_exponential.cpp delete mode 100644 test/core/func_geometric.cpp delete mode 100644 test/core/func_matrix.cpp delete mode 100644 test/core/func_noise.cpp delete mode 100644 test/core/func_trigonometric.cpp delete mode 100644 test/core/func_vector_relational.cpp delete mode 100644 test/core/type.cpp delete mode 100644 test/core/type_float.cpp delete mode 100644 test/core/type_half.cpp delete mode 100644 test/core/type_int.cpp delete mode 100644 test/core/type_mat2x2.cpp delete mode 100644 test/core/type_mat2x3.cpp delete mode 100644 test/core/type_mat2x4.cpp delete mode 100644 test/core/type_mat3x2.cpp delete mode 100644 test/core/type_mat3x3.cpp delete mode 100644 test/core/type_mat3x4.cpp delete mode 100644 test/core/type_mat4x2.cpp delete mode 100644 test/core/type_mat4x3.cpp delete mode 100644 test/core/type_mat4x4.cpp delete mode 100644 test/core/type_vec1.cpp delete mode 100644 test/core/type_vec2.cpp delete mode 100644 test/core/type_vec3.cpp delete mode 100644 test/core/type_vec4.cpp delete mode 100644 test/gtc.cpp delete mode 100644 test/gtc.hpp delete mode 100644 test/gtc/double_float.cpp delete mode 100644 test/gtc/half_float.cpp delete mode 100644 test/gtc/matrix_access.cpp delete mode 100644 test/gtc/matrix_operation.cpp delete mode 100644 test/gtc/matrix_projection.cpp delete mode 100644 test/gtc/matrix_transform.cpp delete mode 100644 test/gtc/quaternion.cpp delete mode 100644 test/gtc/type_precision.cpp delete mode 100644 test/gtx.hpp delete mode 100644 test/gtx/associated_min_max.cpp delete mode 100644 test/gtx/bit.cpp delete mode 100644 test/gtx/closest_point.cpp delete mode 100644 test/gtx/color_cast.cpp delete mode 100644 test/gtx/color_space.cpp delete mode 100644 test/gtx/comparison.cpp delete mode 100644 test/gtx/compatibility.cpp delete mode 100644 test/gtx/component_wise.cpp delete mode 100644 test/gtx/epsilon.cpp delete mode 100644 test/gtx/euler_angles.cpp delete mode 100644 test/gtx/extend.cpp delete mode 100644 test/gtx/extented_min_max.cpp delete mode 100644 test/gtx/fast_exponential.cpp delete mode 100644 test/gtx/fast_square_root.cpp delete mode 100644 test/gtx/fast_trigonometry.cpp delete mode 100644 test/gtx/handed_coordinate_space.cpp delete mode 100644 test/gtx/inertia.cpp delete mode 100644 test/gtx/integer.cpp delete mode 100644 test/gtx/intersect.cpp delete mode 100644 test/gtx/inverse.cpp delete mode 100644 test/gtx/inverse_transpose.cpp delete mode 100644 test/gtx/matrix_access.cpp delete mode 100644 test/gtx/matrix_cross_product.cpp delete mode 100644 test/gtx/matrix_major_storage.cpp delete mode 100644 test/gtx/matrix_projection.cpp delete mode 100644 test/gtx/matrix_query.cpp delete mode 100644 test/gtx/matrix_selection.cpp delete mode 100644 test/gtx/matx.cpp delete mode 100644 test/gtx/mixed_product.cpp delete mode 100644 test/gtx/norm.cpp delete mode 100644 test/gtx/normal.cpp delete mode 100644 test/gtx/normalize_dot.cpp delete mode 100644 test/gtx/number_precision.cpp delete mode 100644 test/gtx/optimum_pow.cpp delete mode 100644 test/gtx/orthonormalize.cpp delete mode 100644 test/gtx/perpendicular.cpp delete mode 100644 test/gtx/polar_coordinates.cpp delete mode 100644 test/gtx/projection.cpp delete mode 100644 test/gtx/quaternion.cpp delete mode 100644 test/gtx/random.cpp delete mode 100644 test/gtx/rotate_vector.cpp delete mode 100644 test/gtx/safe_limits.cpp delete mode 100644 test/gtx/spline.cpp delete mode 100644 test/gtx/statistics_operation.cpp delete mode 100644 test/gtx/std_based_type.cpp delete mode 100644 test/gtx/string_cast.cpp delete mode 100644 test/gtx/transform.cpp delete mode 100644 test/gtx/transform2.cpp delete mode 100644 test/gtx/transpose.cpp delete mode 100644 test/gtx/unsigned_int.cpp delete mode 100644 test/gtx/vector_access.cpp delete mode 100644 test/gtx/vector_angle.cpp delete mode 100644 test/gtx/vector_query.cpp delete mode 100644 test/gtx/vecx.cpp delete mode 100644 test/gtx/verbose_operator.cpp delete mode 100644 test/header.cpp delete mode 100644 test/img.cpp delete mode 100644 test/img.hpp delete mode 100644 test/img/multiple.cpp delete mode 100644 test/img/wrap.cpp delete mode 100644 test/main.cpp delete mode 100644 test/precompiled.cpp delete mode 100644 test/precompiled.hpp delete mode 100644 test/virtrev.cpp delete mode 100644 test/virtrev.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fc46d193..e0007705 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,6 @@ add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_subdirectory(glm) add_subdirectory(doc) -add_subdirectory(test) + diff --git a/experimental/half/half.cpp b/experimental/half/half.cpp deleted file mode 100644 index 9c7c19b8..00000000 --- a/experimental/half/half.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "precompiled.h" -#include "half.h" - - diff --git a/experimental/half/half.h b/experimental/half/half.h deleted file mode 100644 index 52133950..00000000 --- a/experimental/half/half.h +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef __HALF_H__ -#define __HALF_H__ - -namespace dev -{ -/* namespace detail - { - class _halfGTX; - - struct hdata - { - hdata() : data(0) {} - hdata(const hdata& value); - //hdata(float value); - - hdata& operator=(_halfGTX s); - hdata& operator=(float s); - hdata& operator=(double s); - - //operator float(); - //operator const float() const; - - short data; - }; - - float _toFloat32(hdata value); - hdata _toFloat16(float value); - - union uif - { - int i; - float f; - }; - - class _halfGTX - { - public: - // Constructors - _halfGTX(); - _halfGTX(float s); - _halfGTX(double s); - _halfGTX(int s); - _halfGTX(bool s); - _halfGTX(detail::hdata value) : - data(value) - {} - - operator float() const; - operator double() const; - operator int() const; - operator detail::hdata() const; - - // Operators - _halfGTX& operator=(_halfGTX s); - _halfGTX& operator=(float s); - _halfGTX operator+ (_halfGTX s) const; - _halfGTX& operator+= (_halfGTX s); - _halfGTX operator+ (float s) const; - _halfGTX& operator+= (float s); - _halfGTX operator- (_halfGTX s) const; - _halfGTX& operator-= (_halfGTX s); - _halfGTX operator- (float s) const; - _halfGTX& operator-= (float s); - _halfGTX operator* (_halfGTX s) const; - _halfGTX& operator*= (_halfGTX s); - _halfGTX operator* (float s) const; - _halfGTX& operator*= (float s); - _halfGTX operator/ (_halfGTX s) const; - _halfGTX& operator/= (_halfGTX s); - _halfGTX operator/ (float s) const; - _halfGTX& operator/= (float s); - _halfGTX operator- () const; - _halfGTX operator++ (); - _halfGTX operator++ (int n) const; - _halfGTX operator-- (); - _halfGTX operator-- (int n) const; - - bool operator< (const _halfGTX& s) const; - bool operator> (const _halfGTX& s) const; - bool operator<=(const _halfGTX& s) const; - bool operator>=(const _halfGTX& s) const; - bool operator==(const _halfGTX& s) const; - bool operator!=(const _halfGTX& s) const; - - detail::hdata _data() const{return data;} - - private: - detail::hdata data; - }; - - class _hvec2GTX - { - public: - typedef _halfGTX value_type; - typedef int size_type; - static const size_type value_size; - - union - { - struct{detail::hdata x, y;}; - struct{detail::hdata r, g;}; - struct{detail::hdata s, t;}; - }; - - _hvec2GTX() - {} - - _hvec2GTX(const _halfGTX x, const _halfGTX y) : - x(x._data()), - y(y._data()) - {} - }; - } -*/ -} - -//#include "half.inl" - -#endif//__HALF_H__ diff --git a/experimental/half/half.inl b/experimental/half/half.inl deleted file mode 100644 index e69de29b..00000000 diff --git a/experimental/half/half_test.cpp b/experimental/half/half_test.cpp deleted file mode 100644 index 1e538674..00000000 --- a/experimental/half/half_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "precompiled.h" -#include "half_test.h" -#include "half.h" - -void test_hdata() -{ - //dev::detail::hdata HdataA(dev::detail::_toFloat16(1.0f)); - //dev::detail::hdata HdataB(dev::detail::_toFloat16(2.0f)); - //float FloatA = float(dev::detail::_toFloat32(HdataA) + dev::detail::_toFloat32(HdataB)); - //float FloatB = _toFloat32(HdataA) + _toFloat32(HdataB); - //float FloatC = _toFloat32(HdataA); - //float FloatD = _toFloat32(HdataB); - - //dev::detail::_halfGTX HalfA(HdataA); - //dev::detail::_halfGTX HalfB(HdataB); - //float FloatE = float(HalfA); - //float FloatF = float(HalfB); - //dev::detail::_halfGTX HalfC(FloatE); - //dev::detail::_halfGTX HalfD(FloatF); - //float FloatG = float(HalfC); - //float FloatH = float(HalfD); - - //dev::detail::_hvec2GTX hvec2A(HalfA, HalfB); - //dev::detail::_hvec2GTX hvec2B(HalfC, HalfD); - - //HdataA = HalfA; - //HdataB = 4.0f; - //HdataB = 4.0; - - //float FloatI = float(dev::detail::_halfGTX(HdataA)); - //float FloatJ = float(dev::detail::_halfGTX(HdataB)); - - int end = 0; -} - -void test_half_full() -{ - test_hdata(); -} diff --git a/experimental/half/half_test.h b/experimental/half/half_test.h deleted file mode 100644 index 5312d46e..00000000 --- a/experimental/half/half_test.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __HALF_TEST_H__ -#define __HALF_TEST_H__ - -void test_half_full(); - -#endif//__HALF_TEST_H__ diff --git a/experimental/sign.cpp b/experimental/sign.cpp deleted file mode 100644 index 709e7926..00000000 --- a/experimental/sign.cpp +++ /dev/null @@ -1,5 +0,0 @@ -template <> -inline bool sign(float const & f) -{ - return (*((int *)(&f)) & 0x80000000) == 0; -} diff --git a/experimental/simd/sse.cpp b/experimental/simd/sse.cpp deleted file mode 100644 index f68aaa32..00000000 --- a/experimental/simd/sse.cpp +++ /dev/null @@ -1,1378 +0,0 @@ -#include "precompiled.h" -#include "sse.h" - -//namespace sse -//{ -// // some defines first -// union ieee754_QNAN -// { -// const float f; -// struct -// { -// const unsigned int mantissa:23, exp:8, sign:1; -// }; -// -// ieee754_QNAN() : f(0.0), mantissa(0x7FFFFF), exp(0xFF), sign(0x0) {} -// }; -// -// namespace detail -// { -// union ieee754 -// { -// ieee754() : -// f(0.0f) -// {} -// -// ieee754(float f) : -// f(f) -// {} -// -// ieee754(unsigned int mantissa, unsigned int exp, unsigned int sign) : -// mantissa(mantissa), exp(exp), sign(sign) -// {} -// -// float f; -// struct -// { -// unsigned int mantissa:23, exp:8, sign:1; -// }; -// }; -// -// _MM_ALIGN16 const ieee754 qnan(0x7FFFFF, 0xFF, 0x0); -// } -// -// float load(unsigned int mantissa, unsigned int exp, unsigned int sign) -// { -// sse::detail::ieee754 value(mantissa, exp, sign); -// return value.f; -// } -// -// _MM_ALIGN16 const sse::detail::ieee754 qnan(0x7FFFFF, 0xFF, 0x0); -// -// _MM_ALIGN16 const ieee754_QNAN absMask; -// //static const __m128 abs4Mask = _mm_load1_ps( &absMask.f); -// static const __m128 abs4Mask = _mm_set_ps1(absMask.f); -// -// __m128 _mm_neg_ps(__m128 v) -// { -// return _mm_sub_ps(_mm_setzero_ps(), v); -// } -// -// __m128 fast_pow(__m128 base, __m128 exponent) -// { -// __m128 denom = _mm_mul_ps( exponent, base); -// denom = _mm_sub_ps( exponent, denom); -// denom = _mm_add_ps( base, denom); -// return _mm_mul_ps( base, _mm_rcp_ps(denom)); -// } -// -// static const __m128 zero = _mm_setzero_ps(); -// static const __m128 one = _mm_set_ps1(1.0f); -// static const __m128 two = _mm_set_ps1(2.0f); -// static const __m128 pi = _mm_set_ps1(3.1415926535897932384626433832795f); -// static const __m128 hundred_eighty = _mm_set_ps1(180.f); -// static const __m128 pi_over_hundred_eighty = _mm_set_ps1(0.017453292519943295769236907684886f); -// static const __m128 hundred_eighty_over_pi = _mm_set_ps1(57.295779513082320876798154814105f); -// -// //vec4 radians(vec4 degrees) -// //{ -// // const float pi = float(3.1415926535897932384626433832795); -// // return degrees * (pi / 180.f); -// //} -// __m128 radians(__m128 degrees) -// { -// return _mm_mul_ps(degrees, pi_over_hundred_eighty); -// } -// -// __m128 _mm_rad_ss(__m128 degrees) -// { -// return _mm_mul_ss(degrees, pi_over_hundred_eighty); -// } -// -// __m128 _mm_rad_ps(__m128 degrees) -// { -// return _mm_mul_ps(degrees, pi_over_hundred_eighty); -// } -// -// //vec4 degrees(vec4 radians) -// //{ -// // const float pi = float(3.1415926535897932384626433832795); -// // return radians * (180.f / pi); -// //} -// __m128 degrees(__m128 radians) -// { -// return _mm_mul_ps(radians, hundred_eighty_over_pi); -// } -// -// __m128 _mm_deg_ss(__m128 radians) -// { -// return _mm_mul_ss(radians, hundred_eighty_over_pi); -// } -// -// __m128 _mm_deg_ps(__m128 radians) -// { -// return _mm_mul_ps(radians, hundred_eighty_over_pi); -// } -// -// //vec4 sqrt(vec4 v) -// //{ -// // return vec4(sqrt(v.x), sqrt(v.y), sqrt(v.z), sqrt(v.w)); -// //} -// __m128 sqrt(__m128 v) -// { -// return _mm_sqrt_ps(v); -// } -// -// //vec4 inversesqrt(vec4 x) -// //{ -// // return vec4(1.0f) / sqrt(x); -// //} -// __m128 inversesqrt(__m128 v) -// { -// return _mm_rsqrt_ps(v); -// } -// -// //vec4 abs(vec4 x) -// //{ -// // return x >= T(0) ? x : -x; -// //} -// __m128 abs(__m128 x) -// { -// return _mm_and_ps(abs4Mask, x); -// } -// -// //__m128 _mm_abs_ss(__m128 x) -// //{ -// // return _mm_and_ss(abs4Mask, x); -// //} -// -// __m128 _mm_abs_ps(__m128 x) -// { -// return _mm_and_ps(abs4Mask, x); -// } -// -// //vec4 sign(vec4 x) -// //{ -// // vec4 result; -// // if(x > vec4(0)) -// // result = vec4(1); -// // else if(x < T(0)) -// // result = vec4(-1); -// // else -// // result = vec4(0); -// // return result; -// //} -// __m128 sign(__m128 x) -// { -// __m128 result; -// __m128 cmp0 = _mm_cmpeq_ps(x, zero); -// if(_mm_movemask_ps(cmp0) == 0) -// result = zero; -// else -// { -// __m128 cmp1 = _mm_cmpge_ps(x, zero); -// //__m128 cmp2 = _mm_cmple_ps(x, zero); -// if(_mm_movemask_ps(cmp1) > 0) -// result = one; -// else //if(_mm_movemask_ps(cmp2) > 0) -// result = minus_one; -// } -// return result; -// } -// -// __m128 _mm_sgn_ss(__m128 x) -// { -// __m128 result; -// __m128 cmp0 = _mm_cmpeq_ss(x, zero); -// if(_mm_movemask_ss(cmp0) == 0) -// result = zero; -// else -// { -// __m128 cmp1 = _mm_cmpge_ss(x, zero); -// //__m128 cmp2 = _mm_cmple_ss(x, zero); -// if(_mm_movemask_ss(cmp1) > 0) -// result = one; -// else //if(_mm_movemask_ss(cmp2) > 0) -// result = minus_one; -// } -// return result; -// } -// -// __m128 _mm_sgn_ps(__m128 x) -// { -// __m128 cmp0 = _mm_cmpeq_ps(x, zero); -// __m128 cmp1 = _mm_cmple_ps(x, zero); -// __m128 cmp2 = _mm_cmpge_ps(x, zero) -// -// __m128 result; -// __m128 cmp0 = _mm_cmpeq_ps(x, zero); -// if(_mm_movemask_ps(cmp0) == 0) -// result = zero; -// else -// { -// __m128 cmp1 = _mm_cmpge_ps(x, zero); -// //__m128 cmp2 = _mm_cmple_ps(x, zero); -// if(_mm_movemask_ps(cmp1) > 0) -// result = one; -// else //if(_mm_movemask_ps(cmp2) > 0) -// result = minus_one; -// } -// return result; -// } -// -// //vec4 floor(vec4 x) -// //{ -// // return ::std::floor(x); -// //} -// -// __m128 floor(__m128 v) -// { -// -// } -// -// __m128 _mm_flr_ss(__m128 v) -// { -// -// } -// -// __m128 _mm_flr_ps(__m128 v) -// { -// -// } -// -// //vec4 ceil(vec4 x) -// //{ -// // return ::std::ceil(vec4); -// //} -// -// -// -// //vec4 fract(vec4 x) -// //{ -// // return x - floor(x); -// //} -// __m128 fract(__m128 x) -// { -// __m128 flr0 = floor(x); -// __m128 sub0 = _mm_sub_ps(x, flr0); -// return sub0; -// } -// -// __m128 _mm_frc_ss(__m128 x) -// { -// __m128 flr0 = _mm_flr_ss(x); -// __m128 sub0 = _mm_sub_ss(x, flr0); -// return sub0; -// } -// -// __m128 _mm_frc_ps(__m128 x) -// { -// __m128 flr0 = _mm_flr_ps(x); -// __m128 sub0 = _mm_sub_ps(x, flr0); -// return sub0; -// } -// -// //vec4 mod(vec4 x, vec4 y) -// //{ -// // return x - y * floor(x / y); -// //} -// __m128 mod(__m128 x, __m128 y) -// { -// __m128 div0 = _mm_div_ps(x, y); -// __m128 flr0 = _mm_flr_ps(div0); -// __m128 mul0 = _mm_mul_ps(y, flr0); -// __m128 sub0 = _mm_sub_ps(x, mul0); -// return sub0; -// } -// -// __m128 _mm_mod_ss(__m128 x, __m128 y) -// { -// __m128 div0 = _mm_div_ss(x, y); -// __m128 flr0 = _mm_flr_ss(div0); -// __m128 mul0 = _mm_mul_ss(y, flr0); -// __m128 sub0 = _mm_sub_ss(x, mul0); -// return sub0; -// } -// -// __m128 _mm_mod_ps(__m128 x, __m128 y) -// { -// __m128 div0 = _mm_div_ps(x, y); -// __m128 flr0 = _mm_flr_ps(div0); -// __m128 mul0 = _mm_mul_ps(y, flr0); -// __m128 sub0 = _mm_sub_ps(x, mul0); -// return sub0; -// } -// -// //vec4 min(vec4 x, vec4 y) -// //{ -// // return x < y ? x : y; -// //} -// __m128 min(__m128 v1, __m128 v2) -// { -// return _mm_min_ps(v1, v2); -// } -// -// //vec4 max(vec4 x, vec4 y) -// //{ -// // return x > y ? x : y; -// //} -// __m128 max(__m128 v1, __m128 v2) -// { -// return _mm_max_ps(v1, v2); -// } -// -// //vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal) -// //{ -// // return max(min(v, maxVal), minVal); -// //} -// __m128 clamp(__m128 v, __m128 minVal, __m128 maxVal) -// { -// return _mm_max_ps(_mm_min_ps(v, maxVal), minVal); -// } -// -// __m128 _mm_clp_ss(__m128 v, __m128 minVal, __m128 maxVal) -// { -// __m128 min0 = _mm_min_ss(v, maxVal); -// __m128 max0 = _mm_max_ss(min0, minVal); -// return max0; -// } -// -// __m128 _mm_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) -// { -// __m128 min0 = _mm_min_ps(v, maxVal); -// __m128 max0 = _mm_max_ps(min0, minVal); -// return max0; -// } -// -// //vec4 mix(vec4 x, vec4 y, vec4 a) -// //{ -// // return x * (vec4(1) - a) + y * a; -// //} -// __m128 mix(__m128 v1, __m128 v2, __m128 a) -// { -// __m128 sub0 = _mm_sub_ps(one, a); -// __m128 mul0 = _mm_mul_ps(v1, sub0); -// __m128 mul1 = _mm_mul_ps(v2, a); -// __m128 add0 = _mm_add_ps(mul0, mul1); -// return add0; -// } -// -// __m128 _mm_lerp_ss(__m128 v1, __m128 v2, __m128 a) -// { -// __m128 sub0 = _mm_sub_ss(one, a); -// __m128 mul0 = _mm_mul_ss(v1, sub0); -// __m128 mul1 = _mm_mul_ss(v2, a); -// __m128 add0 = _mm_add_ss(mul0, mul1); -// return add0; -// } -// -// __m128 _mm_lerp_ps(__m128 v1, __m128 v2, __m128 a) -// { -// __m128 sub0 = _mm_sub_ps(one, a); -// __m128 mul0 = _mm_mul_ps(v1, sub0); -// __m128 mul1 = _mm_mul_ps(v2, a); -// __m128 add0 = _mm_add_ps(mul0, mul1); -// return add0; -// } -// -// //vec4 step(vec4 edge, vec4 x) -// //{ -// // return x <= edge ? vec4(0) : vec4(1); -// //} -// __m128 step(__m128 edge, __m128 x) -// { -// __m128 cmp = _mm_cmple_ps(x, edge); -// if(_mm_movemask_ps(cmp) == 0) -// return one; -// else -// return zero; -// } -// -// __m128 _mm_step_ss(__m128 edge, __m128 x) -// { -// __m128 cmp = _mm_cmple_ss(x, edge); -// if(_mm_movemask_ss(cmp) == 0) -// return one; -// else -// return zero; -// } -// -// __m128 _mm_step_ps(__m128 edge, __m128 x) -// { -// __m128 cmp = _mm_cmple_ps(x, edge); -// if(_mm_movemask_ps(cmp) == 0) -// return one; -// else -// return zero; -// } -// -// //vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x) -// //{ -// // vec4 tmp = clamp((x - edge0) / (edge1 - edge0), vec4(0), vec4(1)); -// // return tmp * tmp * (vec4(3) - vec4(2) * tmp); -// //} -// __m128 smoothstep(__m128 edge0, __m128 edge1, __m128 x) -// { -// __m128 sub0 = _mm_sub_ps(x, edge0); -// __m128 sub1 = _mm_sub_ps(edge1, edge0); -// __m128 div0 = _mm_sub_ps(sub0, sub1); -// __m128 clp0 = _mm_clp_ps(div0, zero, one); -// __m128 mul0 = _mm_mul_ps(two, clp0); -// __m128 sub2 = _mm_sub_ps(three, mul0); -// __m128 mul1 = _mm_mul_ps(clp0, clp0); -// __m128 mul2 = _mm_mul_ps(mul1, sub2); -// return mul2; -// } -// -// __m128 _mm_ssp_ss(__m128 edge0, __m128 edge1, __m128 x) -// { -// __m128 sub0 = _mm_sub_ss(x, edge0); -// __m128 sub1 = _mm_sub_ss(edge1, edge0); -// __m128 div0 = _mm_sub_ss(sub0, sub1); -// __m128 clp0 = _mm_clp_ss(div0, zero, one); -// __m128 mul0 = _mm_mul_ss(two, clp0); -// __m128 sub2 = _mm_sub_ss(three, mul0); -// __m128 mul1 = _mm_mul_ss(clp0, clp0); -// __m128 mul2 = _mm_mul_ss(mul1, sub2); -// return mul2; -// } -// -// __m128 _mm_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) -// { -// __m128 sub0 = _mm_sub_ps(x, edge0); -// __m128 sub1 = _mm_sub_ps(edge1, edge0); -// __m128 div0 = _mm_sub_ps(sub0, sub1); -// __m128 clp0 = _mm_clp_ps(div0, zero, one); -// __m128 mul0 = _mm_mul_ps(two, clp0); -// __m128 sub2 = _mm_sub_ps(three, mul0); -// __m128 mul1 = _mm_mul_ps(clp0, clp0); -// __m128 mul2 = _mm_mul_ps(mul1, sub2); -// return mul2; -// } -// -// //float length(vec4 x) -// //{ -// // float sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; -// // return sqrt(sqr); -// //} -// __m128 length(__m128 x) -// { -// __m128 dot0 = dot(x, x); -// __m128 sqt0 = _mm_sqrt_ps(dot0); -// return sqt0; -// } -// -// __m128 _mm_len_ss(__m128 x) -// { -// __m128 dot0 = _mm_dot_ss(x, x); -// __m128 sqt0 = _mm_sqrt_ss(dot0); -// return sqt0; -// } -// -// __m128 _mm_len_ps(__m128 x) -// { -// __m128 dot0 = _mm_dot_ps(x, x); -// __m128 sqt0 = _mm_sqrt_ps(dot0); -// return sqt0; -// } -// -// //float distance(vec4 p0, vec4 p1) -// //{ -// // return length(p1 - p0); -// //} -// __m128 distance(__m128 p0, __m128 p1) -// { -// __m128 sub0 = _mm_sub_ps(p0, p1); -// __m128 len0 = _mm_len_ps(sub0); -// return len0; -// } -// -// __m128 _mm_dst_ss(__m128 p0, __m128 p1) -// { -// __m128 sub0 = _mm_sub_ps(p0, p1); -// __m128 len0 = _mm_len_ps(sub0); -// return len0; -// } -// -// __m128 _mm_dst_ps(__m128 p0, __m128 p1) -// { -// __m128 sub0 = _mm_sub_ps(p0, p1); -// __m128 len0 = _mm_len_ps(sub0); -// return len0; -// } -// -// //vec4 dot(vec4 x, vec4 y) -// //{ -// // return vec4(x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w); -// //} -// __m128 dot(__m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v1, v2); -// __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); -// __m128 add0 = _mm_add_ps(mul0, swp0); -// __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); -// __m128 add1 = _mm_add_ps(add0, swp1); -// return add1; -// } -// -// __m128 _mm_dot_ss(__m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v1, v2); -// __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); -// __m128 add0 = _mm_add_ps(mul0, swp0); -// __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); -// __m128 add1 = _mm_add_ps(add0, swp1); -// return add1; -// } -// -// __m128 _mm_dot_ps(__m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v1, v2); -// __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); -// __m128 add0 = _mm_add_ps(mul0, swp0); -// __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); -// __m128 add1 = _mm_add_ps(add0, swp1); -// return add1; -// } -// -// //vec3 cross(vec3 x, vec3 y) -// //{ -// // return vec3( -// // x.y * y.z - y.y * x.z, -// // x.z * y.x - y.z * x.x, -// // x.x * y.y - y.x * x.y); -// //} -// __m128 cross(__m128 v1, __m128 v2) -// { -// __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 mul0 = _mm_mul_ps(swp0, swp3); -// __m128 mul1 = _mm_mul_ps(swp1, swp2); -// __m128 sub0 = _mm_sub_ps(mul0, mul1); -// return sub0; -// } -// -// __m128 _mm_xpd_ps(__m128 v1, __m128 v2) -// { -// __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 mul0 = _mm_mul_ps(swp0, swp3); -// __m128 mul1 = _mm_mul_ps(swp1, swp2); -// __m128 sub0 = _mm_sub_ps(mul0, mul1); -// return sub0; -// } -// -// //vec4 normalize(vec4 x) -// //{ -// // float sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; -// // return x * inversesqrt(sqr); -// //} -// __m128 normalize(__m128 v) -// { -// __m128 dot0 = dot(v, v); -// __m128 isr0 = _mm_rsqrt_ps(dot0); -// __m128 mul0 = _mm_mul_ps(v, isr0); -// return mul0; -// } -// -// __m128 _mm_nrm_ps(__m128 v) -// { -// __m128 dot0 = dot(v, v); -// __m128 isr0 = _mm_rsqrt_ps(dot0); -// __m128 mul0 = _mm_mul_ps(v, isr0); -// return mul0; -// } -// -// __m128 rcp(__m128 v) -// { -// return _mm_rcp_ps(v); -// } -// -// //vec4 mad(vec4 v0, vec4 v1, vec4 v2) -// //{ -// // return v0 * v1 + v2; -// //} -// __m128 mad(__m128 v0, __m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v0, v1); -// __m128 add0 = _mm_add_ps(mul0, v2); -// return add0; -// } -// -// __m128 _mm_mad_ss(__m128 v0, __m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ss(v0, v1); -// __m128 add0 = _mm_add_ss(mul0, v2); -// return add0; -// } -// -// __m128 _mm_mad_ps(__m128 v0, __m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v0, v1); -// __m128 add0 = _mm_add_ps(mul0, v2); -// return add0; -// } -// -// //vec4 reflect(vec4 I, vec4 N) -// //{ -// // return I - N * dot(N, I) * 2.0f; -// //} -// __m128 reflect(__m128 I, __m128 N) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(N, I); -// __m128 mul1 = _mm_mul_ps(mul0, two); -// __m128 sub0 = _mm_sub_ps(I, mul1); -// return sub0; -// } -// -// __m128 _mm_rfe_ps(__m128 I, __m128 N) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(N, I); -// __m128 mul1 = _mm_mul_ps(mul0, two); -// __m128 sub0 = _mm_sub_ps(I, mul1); -// return sub0; -// } -// -// //vec4 refract(vec4 I, vec4 N, T eta) -// //{ -// // float dotValue = dot(N, I); -// // float k = 1.0f - eta * eta * (1.0f - dotValue * dotValue); -// // if(k < 0.0f) -// // return vec4(0.0f); -// // return eta * I - (eta * dotValue + sqrt(k)) * N; -// //} -// __m128 refract(__m128 I, __m128 N, __m128 eta) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(eta, eta); -// __m128 mul1 = _mm_mul_ps(dot0, dot0); -// __m128 sub0 = _mm_sub_ps(one, mul0); -// __m128 sub1 = _mm_sub_ps(one, mul1); -// __m128 mul2 = _mm_mul_ps(sub0, sub1); -// -// if(_mm_movemask_ps(_mm_cmplt_ss(mul2, zero)) == 0) -// return zero; -// -// __m128 sqt0 = _mm_sqrt_ps(mul2); -// __m128 mul3 = _mm_mul_ps(eta, dot0); -// __m128 add0 = _mm_add_ps(mul3, sqt0); -// __m128 mul4 = _mm_mul_ps(add0, N); -// __m128 mul5 = _mm_mul_ps(eta, I); -// __m128 sub2 = _mm_sub_ps(mul5, mul4); -// -// return sub2; -// } -// -// __m128 _mm_rfa_ps(__m128 I, __m128 N, __m128 eta) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(eta, eta); -// __m128 mul1 = _mm_mul_ps(dot0, dot0); -// __m128 sub0 = _mm_sub_ps(one, mul0); -// __m128 sub1 = _mm_sub_ps(one, mul1); -// __m128 mul2 = _mm_mul_ps(sub0, sub1); -// -// if(_mm_movemask_ps(_mm_cmplt_ss(mul2, zero)) == 0) -// return zero; -// -// __m128 sqt0 = _mm_sqrt_ps(mul2); -// __m128 mul3 = _mm_mul_ps(eta, dot0); -// __m128 add0 = _mm_add_ps(mul3, sqt0); -// __m128 mul4 = _mm_mul_ps(add0, N); -// __m128 mul5 = _mm_mul_ps(eta, I); -// __m128 sub2 = _mm_sub_ps(mul5, mul4); -// -// return sub2; -// } -// -// -// struct vec4; -// typedef const vec4& vec4_param; -// -// template -// class comp -// { -// public: -// comp(int i) : -// index(i) -// { -// assert(i < N && i >= 0); -// } -// -// operator const int() const{return index;} -// -// private: -// int index; -// }; -// -// typedef comp<4> comp4_t; -// -// struct vec4 -// { -// vec4(); -// vec4(float s); -// vec4(float x, float y, float z, float w); -// vec4(float v[4]); -// -// explicit vec4(__m128 data); -// -// vec4& operator= (vec4_param v); -// vec4& operator+=(float s); -// vec4& operator+=(vec4_param v); -// vec4& operator-=(float s); -// vec4& operator-=(vec4_param v); -// vec4& operator*=(float s); -// vec4& operator*=(vec4_param v); -// vec4& operator/=(float s); -// vec4& operator/=(vec4_param v); -// vec4& operator++(); -// vec4& operator--(); -// -// union -// { -// __m128 data; -// struct{float x, y, z, w;}; -// float array[4]; -// }; -// }; -// -// vec4::vec4() : -// data(_mm_setzero_ps()) -// {} -// -// vec4::vec4(float s) : -// data(_mm_load_ps1(&s)) -//// data(_mm_set_ps1(s)) -// {} -// -// vec4::vec4(float v[4]) : -// data(_mm_load_ps(v)) -// {} -// -// vec4::vec4(float x, float y, float z, float w) : -//// data(_mm_setr_ps(x, y, z, w)) -// data(_mm_set_ps(w, z, y, x)) -// {} -// -// vec4::vec4(__m128 data) : -// data(data) -// {} -// -// vec4& vec4::operator= (vec4_param v) -// { -// this->data = v.data; -// return *this; -// } -// -// vec4& vec4::operator+=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_add_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator+=(vec4_param v) -// { -// this->data = _mm_add_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator-=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_sub_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator-=(vec4_param v) -// { -// this->data = _mm_sub_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator*=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_mul_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator*=(vec4_param v) -// { -// this->data = _mm_mul_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator/=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_div_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator/=(vec4_param v) -// { -// this->data = _mm_div_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator++() -// { -// static __m128 inc = _mm_set_ps1(1.0f); -// this->data = _mm_add_ps(this->data , inc); -// return *this; -// } -// -// vec4& vec4::operator--() -// { -// static __m128 inc = _mm_set_ps1(1.0f); -// this->data = _mm_sub_ps(this->data , inc); -// return *this; -// } -// -// vec4 operator+ (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_add_ps(v1.data , v2.data)); -// } -// -// vec4 operator+ (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_add_ps(v1.data , v2.data)); -// } -// -// vec4 operator+ (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_add_ps(v1.data , v2.data)); -// } -// -// vec4 operator- (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_sub_ps(v1.data , v2.data)); -// } -// -// vec4 operator- (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_sub_ps(v1.data , v2.data)); -// } -// -// vec4 operator- (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_sub_ps(v1.data , v2.data)); -// } -// -// vec4 operator* (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_mul_ps(v1.data , v2.data)); -// } -// -// vec4 operator* (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_mul_ps(v1.data , v2.data)); -// } -// -// vec4 operator* (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_mul_ps(v1.data , v2.data)); -// } -// -// vec4 operator/ (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_div_ps(v1.data , v2.data)); -// } -// -// vec4 operator/ (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_div_ps(v1.data , v2.data)); -// } -// -// vec4 operator/ (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_div_ps(v1.data , v2.data)); -// } -// -// vec4 load(const vec4& v, const comp4_t component) -// { -// switch(component) -// { -// default: -// case 3: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0))); -// case 2: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1))); -// case 1: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2))); -// case 0: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3))); -// } -// } -// -// vec4 rcp(vec4_param v) -// { -// return vec4(_mm_rcp_ps(v.data)); -// } -// -// vec4 sqrt(vec4_param v) -// { -// return vec4(_mm_sqrt_ps(v.data)); -// } -// -// vec4 inversesqrt(vec4_param v) -// { -// return vec4(_mm_rsqrt_ps(v.data)); -// } -// -// vec4 min(vec4_param v1, vec4_param v2) -// { -// return vec4(_mm_min_ps(v1.data, v2.data)); -// } -// -// vec4 max(vec4_param v1, vec4_param v2) -// { -// return vec4(_mm_max_ps(v1.data, v2.data)); -// } -// -// vec4 clamp(vec4_param v, float minVal, float maxVal) -// { -// vec4 v1(minVal); -// vec4 v2(maxVal); -// return vec4(_mm_min_ps(_mm_max_ps(v.data, v2.data), v1.data)); -// } -// -// vec4 clamp(vec4_param v, vec4_param minVal, vec4_param maxVal) -// { -// return vec4(_mm_min_ps(_mm_max_ps(v.data, maxVal.data), minVal.data)); -// } -// -// vec4 mix(vec4_param x, vec4_param y, vec4_param a) -// { -// __m128 one = _mm_set_ps1(1.0f); -// __m128 b = _mm_sub_ps(one, a.data); -// __m128 mul1 = _mm_mul_ps(x.data, b); -// __m128 mul2 = _mm_mul_ps(y.data, a.data); -// __m128 addFinal = _mm_add_ps(mul1, mul2); -// return vec4(addFinal); -// -// -//// __m128 b = _mm_sub_ps(_mm_set_ps1(1.0f), a.data); -//// return vec4(_mm_add_ps(_mm_mul_ps(x.data, b), _mm_mul_ps(y.data, a.data))); -// } -// -// float dot(vec4_param x, vec4_param y) -// { -// float result = 0.0f; -// _mm_store_ss(&result, dot(x.data, y.data)); -// return result; -// } -// -// vec4 reflect(vec4_param I, vec4_param N) -// { -// __m128 Normal = N.data; -// __m128 Inc = I.data; -// __m128 Two = _mm_set_ps1(2.0f); -// __m128 Mul = _mm_mul_ps(Normal, dot(Normal, Inc)); -// return vec4(_mm_sub_ps(Inc, _mm_mul_ps(Mul, Two))); -// } -// -// vec4 refract(vec4_param I, vec4_param N, float eta) -// { -// __m128 zero = _mm_set_ps1(0.0f); -// __m128 eta1 = _mm_set_ps1(eta); -// __m128 eta2 = _mm_mul_ps(eta1, eta1); -// __m128 one = _mm_set_ps1(1.0f); -// __m128 dotValue = dot(I.data, N.data); -// __m128 dotValue2 = _mm_mul_ps(dotValue, dotValue); -// __m128 k = _mm_sub_ps(one, _mm_mul_ps(eta2, _mm_sub_ps(one, dotValue2))); -// __m128 isnull = _mm_cmplt_ss(k, zero); -// if(_mm_movemask_ps(isnull) == 0) -// return vec4(zero); -// else -// { -// __m128 temp0 = _mm_add_ps(_mm_mul_ps(eta1, dotValue), sqrt(k)); -// __m128 temp1 = _mm_shuffle_ps(temp0, temp0, _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 temp2 = _mm_mul_ps(temp1, N.data); -// __m128 temp3 = _mm_mul_ps(eta1, I.data); -// return vec4(_mm_sub_ps(temp3, temp2)); -// } -// } -// -// -//}; -// -//namespace glm -//{ -// glm::vec4 rcp(const glm::vec4& v) -// { -// return 1.0f / v; -// } -//} -// -//namespace cpu -//{ -// void sincos(float a, float &s, float &c) -// { -// _asm -// { -// fld a -// fsincos -// mov ecx, c -// mov edx, s -// fstp dword ptr [ecx] -// fstp dword ptr [edx] -// } -// } -// -// void sincos(double a, double& s, double& c) -// { -// _asm -// { -// fld a -// fsincos -// mov ecx, c -// mov edx, s -// fstp qword ptr [ecx] -// fstp qword ptr [edx] -// } -// } -// -// float sin(float s) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s -// fsin -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// -// //float result = 0.0f; -// //_asm -// //{ -// // fld s -// // fsin -// // mov ecx, result -// // fstp dword ptr [ecx] -// //} -// //return result; -// } -// -// float abs(float s) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s -// fabs -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// -// //float result = 0.0f; -// //_asm -// //{ -// // fld s -// // fsin -// // mov ecx, result -// // fstp dword ptr [ecx] -// //} -// //return result; -// } -// -// float add(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fadd -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -// -// float sub(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fsub -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -// -// float mul(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fmul -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -// -// float div(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fdiv -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -//} -// -//void test_asm() -//{ -// float sin0 = cpu::sin(1.0f); -// float sin1 = glm::sin(1.0f); -// float add0 = cpu::add(1.0f, 2.0f); -// float sub0 = cpu::sub(1.0f, 2.0f); -// -// -// float end = 1.0f; -//} -// -//void test_clamp() -//{ -// sse::vec4 v(0.5f, 0.5f, 9.5f, 9.5f); -// sse::vec4 minVal(1.0f, 2.0f, 3.0f, 4.0f); -// sse::vec4 maxVal(5.0f, 6.0f, 7.0f, 8.0f); -// -// __m128 clamp0 = sse::clamp( -// v.data, -// minVal.data, -// maxVal.data); -// -// glm::vec4 clamp1 = glm::clamp( -// glm::vec4(0.5f, 0.5f, 9.5f, 9.5f), -// glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), -// glm::vec4(5.0f, 6.0f, 7.0f, 8.0f)); -// -// __m128 end = _mm_setzero_ps(); -//} -// -//#define DECLARE_EPI32_CONST(name) \ -// extern const _MM_ALIGN16 int _epi32_##name[4]; -//#define IMPLEMENT_EPI32_CONST(name,x) \ -// const _MM_ALIGN16 int _epi32_##name[4]={x,x,x,x}; -//#define IMPLEMENT_EPI32_CONST4(name,x,y,z,w) \ -// const _MM_ALIGN16 int _epi32_##name[4]={w,z,y,x}; -// -//#define DECLARE_PS_CONST(name) \ -// extern const _MM_ALIGN16 float _ps_##name[4]; -//#define IMPLEMENT_PS_CONST(name,x) \ -// const _MM_ALIGN16 float _ps_##name[4]={x,x,x,x}; -//#define IMPLEMENT_PS_CONST4(name,x,y,z,w) \ -// const _MM_ALIGN16 float _ps_##name[4]={w,z,y,x}; -// -////IMPLEMENT_PS_CONST(sincos_p0, 0.15707963267948963959e1f) -////IMPLEMENT_PS_CONST(sincos_p1, -0.64596409750621907082e0f) -////IMPLEMENT_PS_CONST(sincos_p2, 0.7969262624561800806e-1f) -////IMPLEMENT_PS_CONST(sincos_p3, -0.468175413106023168e-2f) -// -//IMPLEMENT_EPI32_CONST(sign_mask,0x80000000) -//IMPLEMENT_EPI32_CONST(inv_sign_mask,0x7FFFFFFF) -//IMPLEMENT_EPI32_CONST(mant_mask,0x7F800000) -//IMPLEMENT_EPI32_CONST(inv_mant_mask,0x807FFFFF) -//IMPLEMENT_EPI32_CONST(min_norm_pos,0x00800000) -//IMPLEMENT_EPI32_CONST(1,1) -//IMPLEMENT_EPI32_CONST(2,2) -//IMPLEMENT_EPI32_CONST(7,7) -//IMPLEMENT_EPI32_CONST(127,127) -//IMPLEMENT_EPI32_CONST(ninf,0xFF800000) -//IMPLEMENT_EPI32_CONST(pinf,0x7F800000) -// -//IMPLEMENT_PS_CONST(1_3,0.33333333333333333333333333333333f) -//IMPLEMENT_PS_CONST(0p5,0.5f) -//IMPLEMENT_PS_CONST(1,1.0f) -//IMPLEMENT_PS_CONST(m1,-1.0f) -//IMPLEMENT_PS_CONST(2,2.0f) -//IMPLEMENT_PS_CONST(3,3.0f) -//IMPLEMENT_PS_CONST(127,127.0f) -//IMPLEMENT_PS_CONST(255,255.0f) -//IMPLEMENT_PS_CONST(2pow23,8388608.0f) -// -//IMPLEMENT_PS_CONST4(1_0_0_0,1.0f,0.0f,0.0f,0.0f) -//IMPLEMENT_PS_CONST4(0_1_0_0,0.0f,1.0f,0.0f,0.0f) -//IMPLEMENT_PS_CONST4(0_0_1_0,0.0f,0.0f,1.0f,0.0f) -//IMPLEMENT_PS_CONST4(0_0_0_1,0.0f,0.0f,0.0f,1.0f) -// -//IMPLEMENT_PS_CONST(pi, 3.1415926535897932384626433832795f) -//IMPLEMENT_PS_CONST(pi2, 6.283185307179586476925286766560f) -//IMPLEMENT_PS_CONST(2_pi, 0.63661977236758134307553505349006f) -//IMPLEMENT_PS_CONST(pi_2, 1.5707963267948966192313216916398f) -//IMPLEMENT_PS_CONST(4_pi, 1.2732395447351626861510701069801f) -//IMPLEMENT_PS_CONST(pi_4, 0.78539816339744830961566084581988f) -// -//IMPLEMENT_PS_CONST(sincos_p0, 0.15707963267948963959e1f) -//IMPLEMENT_PS_CONST(sincos_p1, -0.64596409750621907082e0f) -//IMPLEMENT_PS_CONST(sincos_p2, 0.7969262624561800806e-1f) -//IMPLEMENT_PS_CONST(sincos_p3, -0.468175413106023168e-2f) -//IMPLEMENT_PS_CONST(tan_p0, -1.79565251976484877988e7f) -//IMPLEMENT_PS_CONST(tan_p1, 1.15351664838587416140e6f) -//IMPLEMENT_PS_CONST(tan_p2, -1.30936939181383777646e4f) -//IMPLEMENT_PS_CONST(tan_q0, -5.38695755929454629881e7f) -//IMPLEMENT_PS_CONST(tan_q1, 2.50083801823357915839e7f) -//IMPLEMENT_PS_CONST(tan_q2, -1.32089234440210967447e6f) -//IMPLEMENT_PS_CONST(tan_q3, 1.36812963470692954678e4f) -//IMPLEMENT_PS_CONST(tan_poleval,3.68935e19f) -//IMPLEMENT_PS_CONST(atan_t0, -0.91646118527267623468e-1f) -//IMPLEMENT_PS_CONST(atan_t1, -0.13956945682312098640e1f) -//IMPLEMENT_PS_CONST(atan_t2, -0.94393926122725531747e2f) -//IMPLEMENT_PS_CONST(atan_t3, 0.12888383034157279340e2f) -//IMPLEMENT_PS_CONST(atan_s0, 0.12797564625607904396e1f) -//IMPLEMENT_PS_CONST(atan_s1, 0.21972168858277355914e1f) -//IMPLEMENT_PS_CONST(atan_s2, 0.68193064729268275701e1f) -//IMPLEMENT_PS_CONST(atan_s3, 0.28205206687035841409e2f) -// -//IMPLEMENT_PS_CONST(exp_hi, 88.3762626647949f) -//IMPLEMENT_PS_CONST(exp_lo, -88.3762626647949f) -//IMPLEMENT_PS_CONST(exp_rln2, 1.4426950408889634073599f) -//IMPLEMENT_PS_CONST(exp_p0, 1.26177193074810590878e-4f) -//IMPLEMENT_PS_CONST(exp_p1, 3.02994407707441961300e-2f) -//IMPLEMENT_PS_CONST(exp_q0, 3.00198505138664455042e-6f) -//IMPLEMENT_PS_CONST(exp_q1, 2.52448340349684104192e-3f) -//IMPLEMENT_PS_CONST(exp_q2, 2.27265548208155028766e-1f) -//IMPLEMENT_PS_CONST(exp_q3, 2.00000000000000000009e0f) -//IMPLEMENT_PS_CONST(exp_c1, 6.93145751953125e-1f) -//IMPLEMENT_PS_CONST(exp_c2, 1.42860682030941723212e-6f) -//IMPLEMENT_PS_CONST(exp2_hi, 127.4999961853f) -//IMPLEMENT_PS_CONST(exp2_lo, -127.4999961853f) -//IMPLEMENT_PS_CONST(exp2_p0, 2.30933477057345225087e-2f) -//IMPLEMENT_PS_CONST(exp2_p1, 2.02020656693165307700e1f) -//IMPLEMENT_PS_CONST(exp2_p2, 1.51390680115615096133e3f) -//IMPLEMENT_PS_CONST(exp2_q0, 2.33184211722314911771e2f) -//IMPLEMENT_PS_CONST(exp2_q1, 4.36821166879210612817e3f) -//IMPLEMENT_PS_CONST(log_p0, -7.89580278884799154124e-1f) -//IMPLEMENT_PS_CONST(log_p1, 1.63866645699558079767e1f) -//IMPLEMENT_PS_CONST(log_p2, -6.41409952958715622951e1f) -//IMPLEMENT_PS_CONST(log_q0, -3.56722798256324312549e1f) -//IMPLEMENT_PS_CONST(log_q1, 3.12093766372244180303e2f) -//IMPLEMENT_PS_CONST(log_q2, -7.69691943550460008604e2f) -//IMPLEMENT_PS_CONST(log_c0, 0.693147180559945f) -//IMPLEMENT_PS_CONST(log2_c0, 1.44269504088896340735992f) -// -//#define GLM_NAKED __declspec(naked) __cdecl -// -//__m128 GLM_NAKED _mm_cos_ps(__m128 x) -//{ -// __asm -// { -// andps xmm0, _epi32_inv_sign_mask -// addps xmm0, _ps_pi_2 -// mulps xmm0, _ps_2_pi -// pxor xmm3, xmm3 -// movdqa xmm5, _epi32_1 -// movaps xmm4, _ps_1 -// cvttps2dq xmm2, xmm0 -// pand xmm5, xmm2 -// pcmpeqd xmm5, xmm3 -// cvtdq2ps xmm6, xmm2 -// pand xmm2, _epi32_2 -// pslld xmm2, 30 -// subps xmm0, xmm6 -// minps xmm0, xmm4 -// subps xmm4, xmm0 -// andps xmm0, xmm5 -// andnps xmm5, xmm4 -// orps xmm0, xmm5 -// movaps xmm1, xmm0 -// mulps xmm0, xmm0 -// orps xmm1, xmm2 -// movaps xmm7, xmm0 -// mulps xmm0, _ps_sincos_p3 -// addps xmm0, _ps_sincos_p2 -// mulps xmm0, xmm7 -// addps xmm0, _ps_sincos_p1 -// mulps xmm0, xmm7 -// addps xmm0, _ps_sincos_p0 -// mulps xmm0, xmm1 -// ret -// } -//} -// -//void test_sse() -//{ -// sse::vec4 v1(1.0f, 2.0f, 3.0f, 4.0f); -// sse::vec4 v2(5.0f, 6.0f, 7.0f, 8.0f); -// sse::vec4 v3(9.0f); -// sse::vec4 v4(0.5f, 0.5f, 0.5f, 0.5f); -// __m128 v5 = sse::mix(v1.data, v2.data, v4.data); -// __m128 dot0 = sse::dot(v1.data, v2.data); -// float dot1 = sse::dot(v1, v2); -// __m128 rcp0 = sse::rcp(v1.data); -// glm::vec4 rcp1 = rcp(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); -// -// // cross -// { -// sse::vec4 v1(4.0f, 2.0f, 2.0f, 0.0f); -// sse::vec4 v2(1.0f, 2.0f, 3.0f, 0.0f); -// __m128 crs0 = sse::cross(v1.data, v2.data); -// -// glm::vec3 v3(4.0f, 2.0f, 2.0f); -// glm::vec3 v4(1.0f, 2.0f, 3.0f); -// glm::vec3 crs1 = glm::cross(v3, v4); -// -// __m128 end = _mm_set_ps1(1.0f); -// } -// -// // ieee754 -// { -// sse::detail::ieee754 one(1.f); -// float f = sse::load(one.mantissa, one.exp, one.sign); -// -// __m128 end = _mm_set_ps1(1.0f); -// } -// -// test_clamp(); -// test_asm(); -// -// __m128 cos0 = _mm_cos_ps(_mm_set_ps1(1.0f)); -// glm::vec4 cos1 = glm::cos(glm::vec4(1.0f)); -// -// float f = glm::dot(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(5.0f, 6.0f, 7.0f, 8.0f)); -// sse::vec4 end(9.0f); -// -// //sse::vec4 vComp = sse::load(sse::vec4(1.0f, 2.0f, 3.0f, 4.0f), 1); -// //vComp += sse::vec4(1.0f); -// //--vComp; -// //sse::vec4 vMixed = sse::mix(vComp, sse::vec4(-0.5f), sse::vec4(0.5f)); -// //float sDot = sse::dot(sse::vec4(1.0f), sse::vec4(2.0f)); -// //float cDot = glm::dot(glm::vec4(1.0f), glm::vec4(2.0f)); -//} diff --git a/experimental/simd/sse.h b/experimental/simd/sse.h deleted file mode 100644 index 72ef15d3..00000000 --- a/experimental/simd/sse.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef GLM_SSE_H -#define GLM_SSE_H - -#ifdef _WIN32 -#include -#endif - -#include "../glm/glm.h" -#include "../glm/glmext.h" - -void test_sse(); - -#endif//GLM_SSE_H diff --git a/experimental/simd/sse_mat4.cpp b/experimental/simd/sse_mat4.cpp deleted file mode 100644 index 21a651b0..00000000 --- a/experimental/simd/sse_mat4.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "precompiled.h" -#include "sse_mat4.h" -/* -void test_sse_mat4() -{ - { - glm::sse::mat4 m( - glm::sse::vec4(0, 1, 2, 3), - glm::sse::vec4(4, 5, 6, 7), - glm::sse::vec4(8, 9, 10, 11), - glm::sse::vec4(12, 13, 14, 15)); - glm::sse::mat4 n = glm::sse::transpose(m); - m.transpose(); - glm::sse::mat4 m_end; - } - - { - glm::sse::mat4 m0; - glm::sse::mat4 m1(3.f); - glm::sse::mat4 m2( - glm::sse::vec4(1), - glm::sse::vec4(2), - glm::sse::vec4(3), - glm::sse::vec4(4)); - glm::sse::mat4 m3 = m1 + 1.0f; - glm::sse::mat4 m4 = 1.0f + m1; - glm::sse::mat4 m5 = m2 * m2; - - glm::sse::vec4 v0 = glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::sse::vec4 v1 = glm::sse::vec4(5.0f, 6.0f, 7.0f, 8.0f); - glm::sse::vec4 v2 = glm::sse::mat4(v0, v1, v0, v1) * glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::sse::vec4 v3 = glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f) * glm::sse::mat4(v0, v1, v0, v1); - glm::sse::vec4 v_end; - } - - { - glm::mat4 m0; - glm::mat4 m1(3.f); - glm::mat4 m2( - glm::vec4(1), - glm::vec4(2), - glm::vec4(3), - glm::vec4(4)); - glm::mat4 m3 = m1 + 1.0f; - glm::mat4 m4 = 1.0f + m1; - glm::mat4 m5 = m2 * m2; - - glm::vec4 v0 = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4 v1 = glm::vec4(5.0f, 6.0f, 7.0f, 8.0f); - glm::vec4 v2 = glm::mat4(v0, v1, v0, v1) * glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4 v3 = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f) * glm::mat4(v0, v1, v0, v1); - glm::vec4 v_end; - } - - { - int a[][4] = {{0, 0, 1, 2}, {0, 0, 1, 2}}; - } - - glm::sse::mat4 m_end; -} -*/ diff --git a/experimental/simd/sse_mat4.h b/experimental/simd/sse_mat4.h deleted file mode 100644 index 2b564c74..00000000 --- a/experimental/simd/sse_mat4.h +++ /dev/null @@ -1,1280 +0,0 @@ -#ifdef GLM_SSE_MAT4_H -#define GLM_SSE_MAT4_H - -#include -#include -#include "sse_vec4.h" - -namespace glm{ -namespace sse{ - -const __m128i maskX = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF); -const __m128i maskY = _mm_set_epi32(0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000); -const __m128i maskZ = _mm_set_epi32(0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000); -const __m128i maskW = _mm_set_epi32(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000); - -GLM_ALIGN(16) struct mat4 -{ - enum ENoInit - { - NO_INIT - }; - - union - { - __m128 data[4]; - }; - - mat4(); - mat4(ENoInit NoInit); - mat4(float s); - mat4(const vec4& x, const vec4& y, const vec4& z, const vec4& w); - - mat4& operator+=(const float s); - - mat4& operator+=(const mat4& m); - mat4& operator*=(const mat4& m); - - void mat4::transpose(); -}; - -__forceinline mat4::mat4() -{ - void* address = this; - - __asm - { - mov esi, address - xorps xmm0, xmm0 - movaps [esi+0x00], xmm0 - movaps [esi+0x10], xmm0 - movaps [esi+0x20], xmm0 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4::mat4(ENoInit NoInit) -{} - -__forceinline mat4::mat4(float s) -{ - void* address = this; - - __asm - { - mov esi, address - movss xmm0, s - shufps xmm0, xmm0, 0 - xorps xmm1, xmm1 - movaps [esi+0x00], xmm1 - movaps [esi+0x10], xmm1 - movaps [esi+0x20], xmm1 - movaps [esi+0x30], xmm1 - movss [esi+0x00], xmm0 - movss [esi+0x14], xmm0 - movss [esi+0x28], xmm0 - movss [esi+0x3C], xmm0 - } -} - -__forceinline mat4::mat4(const vec4& x, const vec4& y, const vec4& z, const vec4& w) -{ - void* address = this; - - __asm - { - mov esi, address - - mov edi, x - movaps xmm0, [edi] - movaps [esi+0x00], xmm0 - - mov edi, y - movaps xmm0, [edi] - movaps [esi+0x10], xmm0 - - mov edi, z - movaps xmm0, [edi] - movaps [esi+0x20], xmm0 - - mov edi, w - movaps xmm0, [edi] - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator+(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - addps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - addps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - addps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - addps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator+(float s, const mat4& m) -{ - return m + s; -} - -__forceinline mat4 operator-(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - subps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - subps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - subps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - subps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator-(float s, const mat4& m) -{ - __asm - { - movss xmm2, s - shufps xmm2, xmm2, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x00], xmm1 - - movaps xmm0, [esi+0x10] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x10], xmm1 - - movaps xmm0, [esi+0x20] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x20], xmm1 - - movaps xmm0, [esi+0x30] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x30], xmm1 - } -} - -__forceinline mat4 operator*(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - mulps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - mulps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - mulps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - mulps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator*(float s, const mat4& m) -{ - return m * s; -} - -__forceinline mat4 operator/(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - divps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - divps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - divps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - divps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator/(float s, const mat4& m) -{ - __asm - { - movss xmm2, s - shufps xmm2, xmm2, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x00], xmm1 - - movaps xmm0, [esi+0x10] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x10], xmm1 - - movaps xmm0, [esi+0x20] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x20], xmm1 - - movaps xmm0, [esi+0x30] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x30], xmm1 - } -} - -__forceinline vec4 operator*(const mat4& m, const vec4& v) -{ - vec4 result(vec4::NO_INIT); - - // SSE2 - __asm - { - mov esi, [m] - mov edi, [v] - movaps xmm4, [edi] - - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result, xmm0 - } - - return result; -} - -__forceinline vec4 operator*(const vec4& v, const mat4& m) -{ - vec4 result(vec4::NO_INIT); - - // SSE1 - __asm - { - mov esi, [m] - mov edi, [v] - movaps xmm4, [edi] // xmm4: v[3], v[2], v[1], v[0] - - movaps xmm0, [esi+0x00] // xmm0: m[0][3], m[0][2], m[0][1], m[0][0] - movaps xmm1, [esi+0x10] // xmm1: m[1][3], m[1][2], m[1][1], m[1][0] - movaps xmm2, [esi+0x20] // xmm2: m[2][3], m[2][2], m[2][1], m[2][0] - movaps xmm3, [esi+0x30] // xmm3: m[3][3], m[3][2], m[3][1], m[3][0] - - mulps xmm0, xmm4 // xmm0: m[0][3]*v[3], m[0][2]*v[2], m[0][1]*v[1], m[0][0]*v[0] - mulps xmm1, xmm4 // xmm1: m[1][3]*v[3], m[1][2]*v[2], m[1][1]*v[1], m[1][0]*v[0] - mulps xmm2, xmm4 // xmm2: m[2][3]*v[3], m[2][2]*v[2], m[2][1]*v[1], m[2][0]*v[0] - mulps xmm3, xmm4 // xmm2: m[3][3]*v[3], m[3][2]*v[2], m[3][1]*v[1], m[3][0]*v[0] - - movaps xmm4, xmm0 // xmm4: m[0][3]*v[3], m[0][2]*v[2], m[0][1]*v[1], m[0][0]*v[0] - movhlps xmm0, xmm1 // xmm0: m[0][3]*v[3], m[0][2]*v[2], m[1][3]*v[3], m[1][2]*v[2] - movlhps xmm1, xmm4 // xmm1: m[0][1]*v[1], m[0][0]*v[0], m[1][1]*v[1], m[1][0]*v[0] - addps xmm0, xmm1 - - movaps xmm5, xmm2 - movhlps xmm2, xmm3 - movlhps xmm3, xmm5 - addps xmm2, xmm3 - - movaps xmm1, xmm0 - shufps xmm0, xmm2, _MM_SHUFFLE(0, 2, 0, 2) //_MM_SHUFFLE(2, 0, 2, 0) - shufps xmm1, xmm2, _MM_SHUFFLE(1, 3, 1, 3) //_MM_SHUFFLE(3, 1, 3, 1) - addps xmm0, xmm1 - - movaps result, xmm0 - } - - return result; -} - -// 289000 -/* -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - next: - movaps xmm7, [edi] - - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm4 - - pshufd xmm4, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm4 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm4 - - pshufd xmm4, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm4 - - addps xmm2, xmm3 - addps xmm0, xmm1 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -// 288000 -/* -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - next: - movaps xmm7, [edi] - - movaps xmm0, [esi+0x00] - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm5 - - movaps xmm1, [esi+0x10] - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - - movaps xmm2, [esi+0x20] - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm5 - - movaps xmm3, [esi+0x30] - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ -/* -// 290000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm4 - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm4 - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 295000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm4 - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm4 - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 290000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm0, xmm4 - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm2, xmm4 - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 288000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm0, xmm4 - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm2, xmm4 - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 298000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - const int int0x10 = 0x10; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov edx, int0x10 - - // First column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, edx - add eax, edx - - // Second column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, edx - add eax, edx - - // Third column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, edx - add eax, edx - - // Forth column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - } - - return result; -} -*/ - -// 294000 -__forceinline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result(mat4::NO_INIT); - - // SSE2 - __asm - { - mov esi, m - mov edi, n - - // First column - movaps xmm4, [edi+0x00] - - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x00], xmm0 - - // Second column - movaps xmm4, [edi+0x10] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x10], xmm0 - - // Third column - movaps xmm4, [edi+0x20] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x20], xmm0 - - // Forth column - movaps xmm4, [edi+0x30] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x30], xmm0 - } - - return result; -} - -static const __m128 sign1010 = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); -static const __m128 sign0101 = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); -static const __m128i mask1010 = _mm_set_epi32(0x00000000, 0x80000000, 0x00000000, 0x80000000); -static const __m128i mask0101 = _mm_set_epi32(0x80000000, 0x00000000, 0x80000000, 0x00000000); - -__forceinline mat4 inverse(const mat4& m) -{ - mat4 result(mat4::NO_INIT); - - vec4 m0a; - vec4 m0b; - vec4 m0c; - - vec4 m1a; - vec4 m1b; - vec4 m1c; - - vec4 m2a; - vec4 m2b; - vec4 m2c; - - vec4 m3a; - vec4 m3b; - vec4 m3c; - - __asm - { - mov esi, m - - ////////////////////////////////////////////////////////////////////////////////////////////// - //R00 = +1 * m11*(m22*m33 - m32*m23) -1 * m12*(m23*m31 - m33*m21) +1 * m13*(m21*m32 - m31*m22) - //R01 = -1 * m12*(m23*m30 - m33*m20) +1 * m13*(m20*m32 - m30*m22) -1 * m10*(m22*m33 - m32*m23) - //R02 = +1 * m13*(m20*m31 - m30*m21) -1 * m10*(m21*m33 - m31*m23) +1 * m11*(m23*m30 - m33*m20) - //R03 = -1 * m10*(m21*m32 - m31*m22) +1 * m11*(m22*m30 - m32*m20) -1 * m12*(m20*m31 - m30*m21) - - movaps xmm6, [esi+20] // xmm6: m23, m22, m21, m20 - movaps xmm7, [esi+30] // xmm7: m33, m32, m31, m30 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm0: m21, m20, m23, m22 (movhlps optimization possible) - pshufd xmm1, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm1: m30, m33, m32, m31 - pshufd xmm2, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm2: m20, m23, m22, m21 - pshufd xmm3, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm3: m31, m30, m33, m32 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m21*m30, m20*m33, m23*m32, m22*m31 - mulps xmm3, xmm2 // xmm2: m20*m31, m23*m30, m22*m33, m21*m32 - subps xmm3, xmm0 // xmm2: m20*m31-m21*m30, m23*m30-m20*m33, m22*m33-m23*m32, m21*m32-m22*m31 - movaps xmm4, xmm3 // xmm4: m20*m31-m21*m30, m23*m30-m20*m33, m22*m33-m23*m32, m21*m32-m22*m31 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm0: m22, m21, m20, m23 - // Reuse xmm1: pshufd xmm1, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm1: m30, m33, m32, m31 - // Reuse xmm2: pshufd xmm2, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm2: m20, m23, m22, m21 - pshufd xmm3, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm3: m32, m31, m30, m33 - - mulps xmm1, xmm0 // xmm1: m30*m22, m33*m21, m32*m20, m31*m23 - mulps xmm2, xmm3 // xmm2: m20*m32, m23*m31, m22*m30, m21*m33 - subps xmm1, xmm2 // xmm1: m30*m22-m20*m32, m33*m21-m23*m31, m32*m20-m22*m30, m31*m23-m21*m33 - movaps xmm5, xmm2 // xmm5: m30*m22-m20*m32, m33*m21-m23*m31, m32*m20-m22*m30, m31*m23-m21*m33 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - // Reuse xmm0: pshufd xmm0, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm0: m22, m21, m20, m23 - pshufd xmm1, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm1: m31, m30, m33, m32 (movhlps optimization possible) - pshufd xmm2, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm2: m21, m20, m23, m22 (movhlps optimization possible) - // Reuse xmm3: pshufd xmm3, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm3: m32, m31, m30, m33 - - mulps xmm0, xmm1 // xmm1: m22*m31, m21*m30, m20*m33, m23*m32 - mulps xmm2, xmm3 // xmm2: m21*m32, m20*m31, m23*m30, m22*m33 - subps xmm2, xmm0 // xmm2: m23*m32-m22*m33, m20*m33-m23*m30, m21*m30-m20*m31, m22*m31-m21*m32 - movaps xmm6, xmm0 // xmm6: m23*m32-m22*m33, m20*m33-m23*m30, m21*m30-m20*m31, m22*m31-m21*m32 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - movaps xmm0, [esi+10] // m13, m12, m11, m10 - - pshufd xmm1, xmm0, _MM_SHUFFLE(2, 1, 0, 3) - xorps xmm1, mask1010 //-m12, m11,-m10, m13 - mulaps xmm4, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(1, 0, 3, 2) // (movhlps optimization possible) - xorps xmm1, mask0101 // m11,-m10, m13,-m12 - mulaps xmm5, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(0, 3, 2, 1) - xorps xmm1, mask1010 //-m10, m13,-m12, m10 - mulaps xmm6, xmm1 - - mulaps xmm6, xmm5 - mulaps xmm6, xmm4 - movaps result[0x00], xmm6 - - ////////////////////////////////////////////////////////////////////////////////////////////// - //R10 = -1 * m21*(m32*m03 – m02*m33) +1 * m22*(m33*m01 – m03*m31) –1 * m23*(m31*m02 – m01*m32) - //R11 = +1 * m22*(m33*m00 – m03*m30) –1 * m23*(m30*m02 – m00*m32) +1 * m20*(m32*m03 – m02*m33) - //R12 = -1 * m23*(m30*m01 – m00*m31) +1 * m20*(m31*m03 – m01*m33) -1 * m21*(m33*m00 – m03*m30) - //R13 = +1 * m20*(m31*m02 – m01*m32) -1 * m21*(m32*m00 – m02*m30) +1 * m22*(m30*m01 – m00*m31) - - movaps xmm6, [esi+00] // xmm6: m03, m02, m01, m00 - // Reuse xmm7 movaps xmm7, [esi+30] // xmm7: m33, m32, m31, m30 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm0: m00, m03, m02, m01 - pshufd xmm1, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm1: m31, m30, m33, m32 (movhlps optimization possible) - pshufd xmm2, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm2: m01, m00, m03, m02 (movhlps optimization possible) - pshufd xmm3, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm3: m30, m33, m32, m31 - - mulps xmm0, xmm1 // xmm0: m31*m00, m30*m03, m33*m02, m32*m01 - mulps xmm3, xmm2 // xmm3: m30*m01, m33*m00, m32*m03, m31*m02 - subps xmm3, xmm0 // xmm3: m30*m01-m31*m00, m33*m00-m30*m03, m32*m03-m33*m02, m31*m02-m32*m01 - movaps xmm4, xmm3 // xmm4: m30*m01-m31*m00, m33*m00-m30*m03, m32*m03-m33*m02, m31*m02-m32*m01 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - // Reuse xmm0 pshufd xmm0, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm0: m00, m03, m02, m01 - pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - // Reuse xmm3 pshufd xmm3, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm3: m30, m33, m32, m31 - - mulps xmm0, xmm1 // xmm0: m00*m32, m03*m31, m02*m30, m01*m33 - mulps xmm3, xmm2 // xmm3: m30*m02, m33*m01, m32*m00, m31*m03 - subps xmm0, xmm3 // xmm3: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - movaps xmm5, xmm0 // xmm4: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(3, 0, 3, 2) // xmm0: m01, m00, m03, m02 (movhlps optimization possible) - // Reuse xmm1: pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - // Reuse xmm2: pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - pshufd xmm3, xmm7, _MM_SHUFFLE(3, 0, 3, 2) // xmm3: m31, m30, m33, m32 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m01*m32, m00*m31, m03*m30, m02*m33 - mulps xmm3, xmm2 // xmm3: m02*m31, m01*m30, m00*m33, m03*m32 - subps xmm3, xmm0 // xmm3: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - movaps xmm6, xmm3 // xmm6: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - movaps xmm0, [esi+20] // m23, m22, m21, m20 - - pshufd xmm1, xmm0, _MM_SHUFFLE(2, 1, 0, 3) - xorps xmm1, mask0101 //-m22, m21,-m20, m23 - mulaps xmm4, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(1, 0, 3, 2) // (movhlps optimization possible) - xorps xmm1, mask1010 // m21,-m20, m23,-m22 - mulaps xmm5, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(0, 3, 2, 1) - xorps xmm1, mask0101 //-m20, m23,-m22, m21 - mulaps xmm6, xmm1 - - mulaps xmm6, xmm5 - mulaps xmm6, xmm4 - movaps result[0x10], xmm6 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - //R20 = +1 * m31*(m02*m13 - m12*m03) -1 * m32*(m03*m11 – m13*m01) +1 * m33*(m01*m12 - m11*m02) - //R21 = -1 * m32*(m03*m10 - m13*m00) +1 * m33*(m00*m12 – m10*m02) -1 * m30*(m02*m13 - m12*m03) - //R22 = +1 * m33*(m00*m11 - m10*m01) -1 * m30*(m01*m13 – m11*m03) +1 * m31*(m03*m10 - m13*m00) - //R23 = -1 * m30*(m01*m12 - m11*m02) +1 * m31*(m02*m10 – m12*m00) -1 * m32*(m00*m11 - m10*m01) - - //Reuse xmm6: movaps xmm6, [esi+00] // xmm6: m03, m02, m01, m00 - movaps xmm7, [esi+10] // xmm7: m13, m12, m11, m10 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm0: m11, m10, m13, m12 (movhlps optimization possible) - pshufd xmm1, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm1: m00, m03, m02, m01 - pshufd xmm2, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm2: m10, m13, m12, m11 - pshufd xmm3, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm3: m01, m00, m03, m02 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m11*m00, m10*m03, m13*m02, m12*m01 - mulps xmm3, xmm2 // xmm3: m01*m10, m00*m13, m03*m12, m02*m11 - subps xmm3, xmm0 // xmm3: m11*m00-m01*m10, m10*m03-m00*m13, m13*m02-m03*m12, m12*m01-m02*m11 - movaps xmm4, xmm3 // xmm4: m11*m00-m01*m10, m10*m03-m00*m13, m13*m02-m03*m12, m12*m01-m02*m11 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - // Reuse xmm0 pshufd xmm0, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm0: m00, m03, m02, m01 - pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - // Reuse xmm3 pshufd xmm3, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm3: m30, m33, m32, m31 - - mulps xmm0, xmm1 // xmm0: m00*m32, m03*m31, m02*m30, m01*m33 - mulps xmm3, xmm2 // xmm3: m30*m02, m33*m01, m32*m00, m31*m03 - subps xmm0, xmm3 // xmm3: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - movaps xmm5, xmm0 // xmm4: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(3, 0, 3, 2) // xmm0: m01, m00, m03, m02 (movhlps optimization possible) - // Reuse xmm1: pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - // Reuse xmm2: pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - pshufd xmm3, xmm7, _MM_SHUFFLE(3, 0, 3, 2) // xmm3: m31, m30, m33, m32 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m01*m32, m00*m31, m03*m30, m02*m33 - mulps xmm3, xmm2 // xmm3: m02*m31, m01*m30, m00*m33, m03*m32 - subps xmm3, xmm0 // xmm3: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - movaps xmm6, xmm3 // xmm6: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - movaps xmm0, [esi+20] // m23, m22, m21, m20 - - pshufd xmm1, xmm0, _MM_SHUFFLE(2, 1, 0, 3) - xorps xmm1, mask0101 //-m22, m21,-m20, m23 - mulaps xmm4, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(1, 0, 3, 2) // (movhlps optimization possible) - xorps xmm1, mask1010 // m21,-m20, m23,-m22 - mulaps xmm5, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(0, 3, 2, 1) - xorps xmm1, mask0101 //-m20, m23,-m22, m21 - mulaps xmm6, xmm1 - - mulaps xmm6, xmm5 - mulaps xmm6, xmm4 - movaps result[0x10], xmm6 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - - } - - return result; -} - -__forceinline mat4 transpose(const mat4& m) -{ - mat4 result(mat4::NO_INIT); - - __asm - { - mov esi, m - - movaps xmm4, [esi+0x00] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x10] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movaps xmm0, xmm5 - movhlps xmm1, xmm5 - - movaps xmm2, xmm4 - movhlps xmm3, xmm4 - - movaps xmm4, [esi+0x20] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x30] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movlhps xmm0, xmm5 - movlhps xmm2, xmm4 - - movhlps xmm7, xmm5 - movhlps xmm6, xmm4 - - movlhps xmm1, xmm7 - movlhps xmm3, xmm6 - - movaps result[0x00], xmm0 - movaps result[0x10], xmm1 - movaps result[0x20], xmm2 - movaps result[0x30], xmm3 - } - - return result; -} - -__forceinline void mat4::transpose() -{ - void* address = this; - - __asm - { - mov esi, address - - movaps xmm4, [esi+0x00] - movaps xmm6, [esi+0x10] - movaps xmm5, xmm4 - - unpcklps xmm5, xmm6 - movaps xmm0, xmm5 - movhlps xmm1, xmm5 - - unpckhps xmm4, xmm6 - movaps xmm2, xmm4 - movhlps xmm3, xmm4 - - movaps xmm4, [esi+0x20] - movaps xmm6, [esi+0x30] - movaps xmm5, xmm4 - - unpcklps xmm5, xmm6 - movlhps xmm0, xmm5 - movhlps xmm2, xmm5 - movlhps xmm1, xmm5 - - unpckhps xmm4, xmm6 - movlhps xmm2, xmm4 - movhlps xmm4, xmm4 - movlhps xmm3, xmm4 - - movaps [esi+0x00], xmm0 - movaps [esi+0x10], xmm1 - movaps [esi+0x20], xmm2 - movaps [esi+0x30], xmm3 - } -} - - -/* -inline mat4 transpose(const mat4& m) -{ - mat4 result; - - __asm - { - mov esi, m - - movaps xmm4, [esi+0x00] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x10] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movaps xmm0, xmm5 - movhlps xmm1, xmm5 - - movaps xmm2, xmm4 - movhlps xmm3, xmm4 - - movaps xmm4, [esi+0x20] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x30] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movlhps xmm0, xmm5 - movhlps xmm7, xmm5 - movlhps xmm1, xmm7 - - movlhps xmm2, xmm4 - movhlps xmm6, xmm4 - movlhps xmm3, xmm6 - - movaps result[0x00], xmm0 - movaps result[0x10], xmm1 - movaps result[0x20], xmm2 - movaps result[0x30], xmm3 - } - - return result; -} -*/ -}//namespace sse -}//namespace glm - -void test_sse_mat4(); - -#endif//GLM_SSE_MAT4_H diff --git a/experimental/simd/sse_mat4array.cpp b/experimental/simd/sse_mat4array.cpp deleted file mode 100644 index 5f656a45..00000000 --- a/experimental/simd/sse_mat4array.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precompiled.h" diff --git a/experimental/simd/sse_mat4array.h b/experimental/simd/sse_mat4array.h deleted file mode 100644 index e69de29b..00000000 diff --git a/experimental/simd/sse_vec4.cpp b/experimental/simd/sse_vec4.cpp deleted file mode 100644 index 71371503..00000000 --- a/experimental/simd/sse_vec4.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "precompiled.h" -#include "sse_vec4.h" -/* -void test_shufps(const glm::sse::vec4& v1, const glm::sse::vec4& v2) -{ - glm::sse::vec4 Result0; - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm0, [esi] - movaps xmm1, [edi] - shufps xmm0, xmm1, _MM_SHUFFLE(3, 2, 1, 0) - movaps Result0, xmm0 - } - - glm::sse::vec4 Result1; - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm2, [esi] - movaps xmm3, [edi] - pshufd xmm2, xmm3, _MM_SHUFFLE(3, 2, 1, 0) - movaps Result1, xmm2 - } - - glm::sse::vec4 end; -} - -void test_sse_vec4() -{ - test_shufps( - glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f), - glm::sse::vec4(5.0f, 6.0f, 7.0f, 8.0f)); - - glm::sse::vec4 v0; - glm::sse::vec4 v1(76.f); - glm::sse::vec4 v2(5.f, 1.f, 2.f, 3.f); - v2 += v1; - glm::sse::vec4 v3 = v2; - glm::sse::vec4 v4(1.0f); - float dot = glm::sse::dot(v4, v1); - ++v4; - glm::sse::vec4 v5 = -v4; - glm::sse::vec4 v6(2.f); - glm::sse::vec4 v7 = glm::sse::cross(v2, v6); - glm::vec3 v8 = glm::cross(glm::vec3(5.f, 1.f, 2.f), glm::vec3(2.f)); - //printf("vec4(%f, %f, %f, %f)\n", v4.x, v4.y, v4.z, v4.w); - glm::sse::vec4 v9 = glm::sse::normalize(glm::sse::vec4(1.0f, 1.0f, 1.0f, 0.0f)); - glm::sse::vec4 vx; -} -*/ \ No newline at end of file diff --git a/experimental/simd/sse_vec4.h b/experimental/simd/sse_vec4.h deleted file mode 100644 index 0f0c7451..00000000 --- a/experimental/simd/sse_vec4.h +++ /dev/null @@ -1,290 +0,0 @@ -#ifndef GLM_SSE_VEC4_H -#define GLM_SSE_VEC4_H - -#include -#include - -namespace glm{ -namespace sse{ - -#define GLM_SHUFFLE(fp3,fp2,fp1,fp0) (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | ((fp0))) - -const __m128 zero = _mm_setzero_ps(); -const __m128 one = _mm_set_ps1(1.0f); -const __m128 two = _mm_set_ps1(2.0f); -const __m128 three = _mm_set_ps1(3.0f); -const __m128 pouet = _mm_set_ps(2.0f, 4.0f, 6.0f, 8.0f); - -#define GLM_ALIGN(x) __declspec(align(x)) - -GLM_ALIGN(16) struct vec4 -{ - enum ENoInit - { - NO_INIT - }; - - union - { - __m128 data; - struct s{float x, y, z, w;}; - float array[4]; - }; - - vec4(); - vec4(ENoInit NoInit); - vec4(float s); - vec4(float x, float y, float z, float w); - vec4(float v[4]); - - vec4& operator+=(const float s); - - vec4& operator+=(const vec4& v); - vec4& operator*=(const vec4& v); - - vec4& operator++(); -}; - -__forceinline vec4::vec4() -{ - void* address = this; - - __asm - { - mov eax, [address] - xorps xmm0, xmm0 - movaps [eax], xmm0 - } -} - -__forceinline vec4::vec4(ENoInit NoInit) -{} - -__forceinline vec4::vec4(float s) -{ - void* address = this; - - __asm - { - mov esi, [address] - movss xmm0, s - shufps xmm0, xmm0, 0 - movaps [esi], xmm0 - } -} - -__forceinline vec4::vec4(float x, float y, float z, float w) -{ - void* address = this; - - __asm - { - mov esi, address - movss xmm0, x - movss xmm1, y - movss xmm2, z - movss xmm3, w - unpcklps xmm0, xmm1 - unpcklps xmm2, xmm3 - movlhps xmm0, xmm2 - movaps [esi], xmm0 - } -} - -__forceinline vec4::vec4(float v[4]) -{ - void* address = this; - - __asm - { - mov eax, [address] - mov ebx, [v] - movups xmm0, [ebx] - movaps [eax], xmm0 - } -} - -__forceinline vec4& vec4::operator+=(const float s) -{ - void* address = this; - - __asm - { - mov eax, [address] - movss xmm1, s - shufps xmm1, xmm1, 0 - movaps xmm0, [eax] - addps xmm0, xmm1 - movaps [eax], xmm0 - } - - return *this; -} - -__forceinline vec4& vec4::operator+=(const vec4& v) -{ - void* address = this; - - __asm - { - mov eax, [address] - mov ebx, [v] - movaps xmm0, [eax] - addps xmm0, [ebx] - movaps [eax], xmm0 - } - - return *this; -} - -__forceinline vec4& vec4::operator*=(const vec4& v) -{ - void* address = this; - - __asm - { - mov esi, address - mov edi, v - movaps xmm0, esi - mulps xmm0, edi - movaps [esi], xmm0 - } - - return *this; -} - -__forceinline vec4& vec4::operator++() -{ - void* address = this; - - __asm - { - mov eax, [address] - movaps xmm0, [eax] - addps xmm0, one - movaps [eax], xmm0 - } - - return *this; -} - -__forceinline const vec4 operator- (const vec4& v) -{ - vec4 result(vec4::NO_INIT); - - __asm - { - mov esi, v - xorps xmm0, xmm0 - subps xmm0, [esi] - movaps result, xmm0 - } - - result; -} - -__forceinline vec4 cross(const vec4& v1, const vec4& v2) -{ - vec4 result(vec4::NO_INIT); - - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm0, [esi] - movaps xmm1, [edi] - shufps xmm0, xmm0, _MM_SHUFFLE(3, 0, 2, 1) - movaps xmm2, xmm0 - shufps xmm0, xmm0, _MM_SHUFFLE(3, 1, 0, 2) - shufps xmm1, xmm1, _MM_SHUFFLE(3, 0, 2, 1) - movaps xmm3, xmm1 - shufps xmm1, xmm1, _MM_SHUFFLE(3, 1, 0, 2) - mulps xmm0, xmm3 - mulps xmm1, xmm2 - subps xmm0, xmm1 - movaps result, xmm0 - } - - return result; -} - -__forceinline float dot(const vec4& v1, const vec4& v2) -{ - float result; - - // All component processed - //__asm - //{ - // mov esi, v1 - // mov edi, v2 - // movaps xmm0, [esi] - // movaps xmm1, [edi] - // mulps xmm0, xmm1 - // movaps xmm1, xmm0 - // shufps xmm0, xmm0, _MM_SHUFFLE(2, 3, 0, 1) - // addps xmm0, xmm1 - // movaps xmm1, xmm0 - // shufps xmm0, xmm0, _MM_SHUFFLE(0, 1, 2, 3) - // addps xmm0, xmm1 - // movss result, xmm0 - //} - - // SSE - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm0, [esi] // w1, z1, y1, x1 - mulps xmm0, [edi] // w1 * w2, z1 * z2, y1 * y2, x1 * x2 - movhlps xmm1, xmm0 // XX, XX, w1 * w2, z1 * z2 - addps xmm0, xmm1 // XX, XX, y1 * y2 + w1 * w2, x1 * x2 + z1 * z2 - pshufd xmm1, xmm0, 1 // XX, XX, XX, y1 * y2 + w1 * w2 - addss xmm0, xmm1 // y1 * y2 + w1 * w2 + x1 * x2 + z1 * z2 - movss result, xmm0 - } - - // SSE 3 - - // SSE 4.1 - //__asm - //{ - // mov esi, v1 - // mov edi, v2 - // movaps xmm0, [esi] - // dpps xmm0, [edi] - // movss result, xmm0 - //} - - return result; -} - -__forceinline vec4 normalize(const vec4& v) -{ - vec4 result(vec4::NO_INIT); - - __asm - { - mov esi, v - movaps xmm2, [esi] - movaps xmm0, xmm2 - mulps xmm0, xmm0 - movaps xmm1, xmm0 - shufps xmm0, xmm0, _MM_SHUFFLE(2, 3, 0, 1) - addps xmm0, xmm1 - movaps xmm1, xmm0 - shufps xmm0, xmm0, _MM_SHUFFLE(0, 1, 2, 3) - addps xmm0, xmm1 - rsqrtps xmm0, xmm0 - mulps xmm2, xmm0 - movaps result, xmm2 - } - - return result; -} - -}//namespace sse -}//namespace glm - -void test_sse_vec4(); - -#endif//GLM_SSE_VEC4_H diff --git a/experimental/simd/sse_vec4array.cpp b/experimental/simd/sse_vec4array.cpp deleted file mode 100644 index c08ca1f1..00000000 --- a/experimental/simd/sse_vec4array.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precompiled.h" \ No newline at end of file diff --git a/experimental/simd/sse_vec4array.h b/experimental/simd/sse_vec4array.h deleted file mode 100644 index e69de29b..00000000 diff --git a/experimental/sse/glm/core/_bvec2.h b/experimental/sse/glm/core/_bvec2.h deleted file mode 100644 index 8c7e8b12..00000000 --- a/experimental/sse/glm/core/_bvec2.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_bvec2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_bvec2__ -#define __glm_core_bvec2__ - -#include "./_cvec2.inl" - -namespace glm{ -namespace detail{ - - class _bvec2 : public _cvec2 > - { - public: - // Common constructors - _bvec2(); - _bvec2(const _bvec2& v); - - // Swizzle constructors - _bvec2(const _xref2& r); - - // Bool constructors - explicit _bvec2(const bool a); - explicit _bvec2(const bool a, const bool b); - explicit _bvec2(const bool a, const _bvec2& b); - explicit _bvec2(const bool a, const _bvec3& b); - explicit _bvec2(const bool a, const _bvec4& b); - explicit _bvec2(const _bvec3& a); - explicit _bvec2(const _bvec4& a); - - // U constructors - template explicit _bvec2(const U x); - template explicit _bvec2(const U a, const U b); - template explicit _bvec2(const U a, const _xvec2& b); - template explicit _bvec2(const U a, const _xvec3& b); - template explicit _bvec2(const U a, const _xvec4& b); - template explicit _bvec2(const _xvec3& a); - template explicit _bvec2(const _xvec4& a); - - // Operators - _bvec2& operator=(const _bvec2& v); - //_bvec2 operator! () const; - }; - -} //namespace detail -} //namespace glm - -#endif//__glm_core_bvec2__ diff --git a/experimental/sse/glm/core/_bvec2.inl b/experimental/sse/glm/core/_bvec2.inl deleted file mode 100644 index f9ce3087..00000000 --- a/experimental/sse/glm/core/_bvec2.inl +++ /dev/null @@ -1,159 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : _bvec2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __bvec2_inl__ -#define __bvec2_inl__ - -#include "./_bvec2.h" -#include "./_bvec3.h" -#include "./_bvec4.h" -#include "./_xref2.h" -#include "./_xref3.h" -#include "./_xref4.h" -#include "./_swizzle.inl" - -namespace glm{ -namespace detail{ - - ////////////////////////////////////////////////////////////// - // Common constructors - - inline _bvec2::_bvec2() : - _cvec2(false, false) - {} - - inline _bvec2::_bvec2(const _bvec2& v) : - _cvec2(v.x, v.y) - {} - - ////////////////////////////////////////////////////////////// - // Swizzle constructors - inline _bvec2::_bvec2(const _xref2& r) : - _cvec2(r.x, r.y) - {} - - ////////////////////////////////////////////////////////////// - // Bool constructors - - inline _bvec2::_bvec2(const bool a) : - _cvec2(a, a) - {} - - inline _bvec2::_bvec2(const bool a, const bool b) : - _cvec2(a, b) - {} - - inline _bvec2::_bvec2(const bool a, const _bvec2& b) : - _cvec2(a, b.x) - {} - - inline _bvec2::_bvec2(const bool a, const _bvec3& b) : - _cvec2(a, b.x) - {} - - inline _bvec2::_bvec2(const bool a, const _bvec4& b) : - _cvec2(a, b.x) - {} - - inline _bvec2::_bvec2(const _bvec3& a) : - _cvec2(a.x, a.y) - {} - - inline _bvec2::_bvec2(const _bvec4& a) : - _cvec2(a.x, a.y) - {} - - ////////////////////////////////////////////////////////////// - // U constructors - - template - inline _bvec2::_bvec2(const U a) : - _cvec2(bool(a), bool(a)) - {} - - template - inline _bvec2::_bvec2(const U a, const U b) : - _cvec2(bool(a), bool(b)) - {} - - template - inline _bvec2::_bvec2(const U a, const _xvec2& b) : - _cvec2(bool(a), bool(b.x)) - {} - - template - inline _bvec2::_bvec2(const U a, const _xvec3& b) : - _cvec2(bool(a), bool(b.x)) - {} - - template - inline _bvec2::_bvec2(const U a, const _xvec4& b) : - _cvec2(bool(a), bool(b.x)) - {} - - template - inline _bvec2::_bvec2(const _xvec3& a) : - _cvec2(bool(a.x), bool(a.y)) - {} - - template - inline _bvec2::_bvec2(const _xvec4& a) : - _cvec2(bool(a.x), bool(a.y)) - {} - - ////////////////////////////////////////////////////////////// - // bvec2 operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - inline _bvec2& _bvec2::operator=(const _bvec2& x) - { - this->x = x.x; - this->y = x.y; - return *this; - } -/* - inline _bvec2 _bvec2::operator--() - { - x = !x; - y = !y; - return *this; - } - - inline _bvec2 _bvec2::operator++() - { - x = !x; - y = !y; - return *this; - } - - inline const _bvec2 _bvec2::operator--(int n) const - { - return _bvec2( - !this->x, - !this->y); - } - - inline const _bvec2 _bvec2::operator++(int n) const - { - return _bvec2( - !this->x, - !this->y); - } -*/ - //inline _bvec2 _bvec2::operator!() const - //{ - // return _bvec2( - // !this->x, - // !this->y); - //} - -} //namespace detail -} //namespace glm - -#endif //__bvec2_inl__ diff --git a/experimental/sse/glm/core/_bvec3.h b/experimental/sse/glm/core/_bvec3.h deleted file mode 100644 index 92d96609..00000000 --- a/experimental/sse/glm/core/_bvec3.h +++ /dev/null @@ -1,67 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_bvec3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_bvec3__ -#define __glm_core_bvec3__ - -#include "./_cvec3.inl" - -namespace glm{ -namespace detail{ - - class _bvec3 : public _cvec3, _xref3 > - { - public: - // Common constructors - _bvec3(); - _bvec3(const _bvec3& v); - - // Swizzle constructors - _bvec3(const _xref3& r); - - // Bool constructors - explicit _bvec3(const bool a); - explicit _bvec3(const bool a, const bool b, const bool c); - explicit _bvec3(const bool a, const bool b, const _bvec2& c); - explicit _bvec3(const bool a, const bool b, const _bvec3& c); - explicit _bvec3(const bool a, const bool b, const _bvec4& c); - explicit _bvec3(const bool a, const _bvec2& b); - explicit _bvec3(const bool a, const _bvec3& b); - explicit _bvec3(const bool a, const _bvec4& b); - explicit _bvec3(const _bvec2& a, bool b); - explicit _bvec3(const _bvec2& a, const _bvec2& b); - explicit _bvec3(const _bvec2& a, const _bvec3& b); - explicit _bvec3(const _bvec2& a, const _bvec4& b); - explicit _bvec3(const _bvec4& a); - - // U constructors - template explicit _bvec3(const U x); - template explicit _bvec3(const U a, const U b, const U c); - template explicit _bvec3(const U a, const U b, const _xvec2& c); - template explicit _bvec3(const U a, const U b, const _xvec3& c); - template explicit _bvec3(const U a, const U b, const _xvec4& c); - template explicit _bvec3(const U a, const _xvec2& b); - template explicit _bvec3(const U a, const _xvec3& b); - template explicit _bvec3(const U a, const _xvec4& b); - template explicit _bvec3(const _xvec2& a, U b); - template explicit _bvec3(const _xvec2& a, const _xvec2& b); - template explicit _bvec3(const _xvec2& a, const _xvec3& b); - template explicit _bvec3(const _xvec2& a, const _xvec4& b); - template explicit _bvec3(const _xvec3& a); - template explicit _bvec3(const _xvec4& a); - - // Operators - _bvec3& operator=(const _bvec3& x); - //_bvec3 operator! () const; - }; - -} //namespace detail -} //namespace glm - -#endif//__glm_core_bvec3__ diff --git a/experimental/sse/glm/core/_bvec3.inl b/experimental/sse/glm/core/_bvec3.inl deleted file mode 100644 index 842d2b7b..00000000 --- a/experimental/sse/glm/core/_bvec3.inl +++ /dev/null @@ -1,224 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : _bvec3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __bvec3_inl__ -#define __bvec3_inl__ - -#include "./_bvec2.h" -#include "./_bvec3.h" -#include "./_bvec4.h" -#include "./_xref2.h" -#include "./_xref3.h" -#include "./_xref4.h" -#include "./_swizzle.inl" - -namespace glm{ -namespace detail{ - - ////////////////////////////////////////////////////////////// - // Common constructors - - inline _bvec3::_bvec3() : - _cvec3(false, false, false) - {} - - inline _bvec3::_bvec3(const _bvec3& v) : - _cvec3(v.x, v.y, v.z) - {} - - ////////////////////////////////////////////////////////////// - // Swizzle constructors - inline _bvec3::_bvec3(const _xref3& r) : - _cvec3(r.x, r.y, r.z) - {} - - ////////////////////////////////////////////////////////////// - // Bool constructors - - inline _bvec3::_bvec3(const bool a) : - _cvec3(a, a, a) - {} - - inline _bvec3::_bvec3(const bool a, const bool b, const bool c) : - _cvec3(a, b, c) - {} - - inline _bvec3::_bvec3(const bool a, const bool b, const _bvec2& c) : - _cvec3(a, b, c.x) - {} - - inline _bvec3::_bvec3(const bool a, const bool b, const _bvec3& c) : - _cvec3(a, b, c.x) - {} - - inline _bvec3::_bvec3(const bool a, const bool b, const _bvec4& c) : - _cvec3(a, b, c.x) - {} - - inline _bvec3::_bvec3(const bool a, const _bvec2& b) : - _cvec3(a, b.x, b.y) - {} - - inline _bvec3::_bvec3(const bool a, const _bvec3& b) : - _cvec3(a, b.x, b.y) - {} - - inline _bvec3::_bvec3(const bool a, const _bvec4& b) : - _cvec3(a, b.x, b.y) - {} - - inline _bvec3::_bvec3(const _bvec2& a, bool b) : - _cvec3(a.x, a.y, b) - {} - - inline _bvec3::_bvec3(const _bvec2& a, const _bvec2& b) : - _cvec3(a.x, a.y, b.x) - {} - - inline _bvec3::_bvec3(const _bvec2& a, const _bvec3& b) : - _cvec3(a.x, a.y, b.x) - {} - - inline _bvec3::_bvec3(const _bvec2& a, const _bvec4& b) : - _cvec3(a.x, a.y, b.x) - {} - - inline _bvec3::_bvec3(const _bvec4& a) : - _cvec3(a.x, a.y, a.z) - {} - - ////////////////////////////////////////////////////////////// - // U constructors - - template - inline _bvec3::_bvec3(const U a) : - _cvec3(bool(a), bool(a), bool(a)) - {} - - template - inline _bvec3::_bvec3(const U a, const U b, const U c) : - _cvec3(bool(a), bool(b), bool(c)) - {} - - template - inline _bvec3::_bvec3(const U a, const U b, const _xvec2& c) : - _cvec3(bool(a), bool(b), bool(c.x)) - {} - - template - inline _bvec3::_bvec3(const U a, const U b, const _xvec3& c) : - _cvec3(bool(a), bool(b), bool(c.x)) - {} - - template - inline _bvec3::_bvec3(const U a, const U b, const _xvec4& c) : - _cvec3(bool(a), bool(b), bool(c.x)) - {} - - template - inline _bvec3::_bvec3(const U a, const _xvec2& b) : - _cvec3(bool(a), bool(b.x), bool(b.y)) - {} - - template - inline _bvec3::_bvec3(const U a, const _xvec3& b) : - _cvec3(bool(a), bool(b.x), bool(b.y)) - {} - - template - inline _bvec3::_bvec3(const U a, const _xvec4& b) : - _cvec3(bool(a), bool(b.x), bool(b.y)) - {} - - template - inline _bvec3::_bvec3(const _xvec2& a, U b) : - _cvec3(bool(a.x), bool(a.y), bool(b)) - {} - - template - inline _bvec3::_bvec3(const _xvec2& a, const _xvec2& b) : - _cvec3(bool(a.x), bool(a.y), bool(b.x)) - {} - - template - inline _bvec3::_bvec3(const _xvec2& a, const _xvec3& b) : - _cvec3(bool(a.x), bool(a.y), bool(b.x)) - {} - - template - inline _bvec3::_bvec3(const _xvec2& a, const _xvec4& b) : - _cvec3(bool(a.x), bool(a.y), bool(b.x)) - {} - - template - inline _bvec3::_bvec3(const _xvec3& a) : - _cvec3(bool(a.x), bool(a.y), bool(a.z)) - {} - - template - inline _bvec3::_bvec3(const _xvec4& a) : - _cvec3(bool(a.x), bool(a.y), bool(a.z)) - {} - - ////////////////////////////////////////////////////////////// - // bvec3 operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - inline _bvec3& _bvec3::operator=(const _bvec3& x) - { - this->x = x.x; - this->y = x.y; - this->z = x.z; - return *this; - } -/* - inline _bvec3 _bvec3::operator--() - { - this->x = !x; - this->y = !y; - this->z = !z; - return *this; - } - - inline _bvec3 _bvec3::operator++() - { - this->x = !x; - this->y = !y; - this->z = !z; - return *this; - } - - inline const _bvec3 _bvec3::operator--(int n) const - { - return _bvec3( - !this->x, - !this->y, - !this->z); - } - - inline const _bvec3 _bvec3::operator++(int n) const - { - return _bvec3( - !this->x, - !this->y, - !this->z); - } -*/ - //inline _bvec3 _bvec3::operator!() const - //{ - // return _bvec3( - // !this->x, - // !this->y, - // !this->z); - //} - -} //namespace detail -} //namespace glm - -#endif//__bvec3_inl__ diff --git a/experimental/sse/glm/core/_bvec4.h b/experimental/sse/glm/core/_bvec4.h deleted file mode 100644 index 62796934..00000000 --- a/experimental/sse/glm/core/_bvec4.h +++ /dev/null @@ -1,91 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_bvec4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_bvec4__ -#define __glm_core_bvec4__ - -#include "./_cvec4.inl" - -namespace glm{ -namespace detail{ - - class _bvec4 : public _cvec4, _xref3, _xref4 > - { - public: - // Common constructors - _bvec4(); - _bvec4(const _bvec4& v); - - // Swizzle constructors - _bvec4(const _xref4& r); - - // Bool constructors - explicit _bvec4(const bool x); - explicit _bvec4(const bool a, const bool b, const bool c, const bool d); - explicit _bvec4(const bool a, const bool b, const bool c, const _bvec2& d); - explicit _bvec4(const bool a, const bool b, const bool c, const _bvec3& d); - explicit _bvec4(const bool a, const bool b, const bool c, const _bvec4& d); - explicit _bvec4(const bool a, const bool b, const _bvec2& c); - explicit _bvec4(const bool a, const bool b, const _bvec3& c); - explicit _bvec4(const bool a, const bool b, const _bvec4& c); - explicit _bvec4(const bool a, const _bvec2& b, const bool c); - explicit _bvec4(const bool a, const _bvec2& b, const _bvec2& c); - explicit _bvec4(const bool a, const _bvec2& b, const _bvec3& c); - explicit _bvec4(const bool a, const _bvec2& b, const _bvec4& c); - explicit _bvec4(const bool a, const _bvec3& b); - explicit _bvec4(const bool a, const _bvec4& b); - explicit _bvec4(const _bvec2& a, const bool b, const bool c); - explicit _bvec4(const _bvec2& a, const bool b, const _bvec2& c); - explicit _bvec4(const _bvec2& a, const bool b, const _bvec3& c); - explicit _bvec4(const _bvec2& a, const bool b, const _bvec4& c); - explicit _bvec4(const _bvec2& a, const _bvec2& b); - explicit _bvec4(const _bvec2& a, const _bvec3& b); - explicit _bvec4(const _bvec2& a, const _bvec4& b); - explicit _bvec4(const _bvec3& a, const bool b); - explicit _bvec4(const _bvec3& a, const _bvec2& b); - explicit _bvec4(const _bvec3& a, const _bvec3& b); - explicit _bvec4(const _bvec3& a, const _bvec4& b); - - // U constructors - template explicit _bvec4(const U x); - template explicit _bvec4(const U a, const U b, const U c, const U d); - template explicit _bvec4(const U a, const U b, const U c, const _xvec2& d); - template explicit _bvec4(const U a, const U b, const U c, const _xvec3& d); - template explicit _bvec4(const U a, const U b, const U c, const _xvec4& d); - template explicit _bvec4(const U a, const U b, const _xvec2& c); - template explicit _bvec4(const U a, const U b, const _xvec3& c); - template explicit _bvec4(const U a, const U b, const _xvec4& c); - template explicit _bvec4(const U a, const _xvec2& b, const U c); - template explicit _bvec4(const U a, const _xvec2& b, const _xvec2& c); - template explicit _bvec4(const U a, const _xvec2& b, const _xvec3& c); - template explicit _bvec4(const U a, const _xvec2& b, const _xvec4& c); - template explicit _bvec4(const U a, const _xvec3& b); - template explicit _bvec4(const U a, const _xvec4& b); - template explicit _bvec4(const _xvec2& a, const U b, const U c); - template explicit _bvec4(const _xvec2& a, const U b, const _xvec2& c); - template explicit _bvec4(const _xvec2& a, const U b, const _xvec3& c); - template explicit _bvec4(const _xvec2& a, const U b, const _xvec4& c); - template explicit _bvec4(const _xvec2& a, const _xvec2& b); - template explicit _bvec4(const _xvec2& a, const _xvec3& b); - template explicit _bvec4(const _xvec2& a, const _xvec4& b); - template explicit _bvec4(const _xvec3& a, const U b); - template explicit _bvec4(const _xvec3& a, const _xvec2& b); - template explicit _bvec4(const _xvec3& a, const _xvec3& b); - template explicit _bvec4(const _xvec3& a, const _xvec4& b); - template explicit _bvec4(const _xvec4& a); - - // Operators - _bvec4& operator=(const _bvec4& x); - //_bvec4 operator!() const ; - }; - -} //namespace detail -} //namespace glm - -#endif//__glm_core_bvec4__ diff --git a/experimental/sse/glm/core/_bvec4.inl b/experimental/sse/glm/core/_bvec4.inl deleted file mode 100644 index 6fb72743..00000000 --- a/experimental/sse/glm/core/_bvec4.inl +++ /dev/null @@ -1,335 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : _bvec4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __bvec4_inl__ -#define __bvec4_inl__ - -#include "./_bvec2.h" -#include "./_bvec3.h" -#include "./_bvec4.h" -#include "./_xref2.h" -#include "./_xref3.h" -#include "./_xref4.h" -#include "./_swizzle.inl" - -namespace glm{ -namespace detail{ - - ////////////////////////////////////////////////////////////// - // bvec4 constructors - - inline _bvec4::_bvec4() : - _cvec4(false, false, false, false) - {} - - inline _bvec4::_bvec4(const _bvec4& v) : - _cvec4(v.x, v.y, v.z, v.w) - {} - - ////////////////////////////////////////////////////////////// - // Swizzle constructors - inline _bvec4::_bvec4(const _xref4& r) : - _cvec4(r.x, r.y, r.z, r.w) - {} - - // Bool constructors - inline _bvec4::_bvec4(const bool a) : - _cvec4(a, a, a, a) - {} - - inline _bvec4::_bvec4(const bool a, const bool b, const bool c, const bool d) : - _cvec4(a, b, c, d) - {} - - inline _bvec4::_bvec4(const bool a, const bool b, const bool c, const _bvec2& d) : - _cvec4(a, b, c, d.x) - {} - - inline _bvec4::_bvec4(const bool a, const bool b, const bool c, const _bvec3& d) : - _cvec4(a, b, c, d.x) - {} - - inline _bvec4::_bvec4(const bool a, const bool b, const bool c, const _bvec4& d) : - _cvec4(a, b, c, d.x) - {} - - inline _bvec4::_bvec4(const bool a, const bool b, const _bvec2& c) : - _cvec4(a, b, c.x, c.y) - {} - - inline _bvec4::_bvec4(const bool a, const bool b, const _bvec3& c) : - _cvec4(a, b, c.x, c.y) - {} - - inline _bvec4::_bvec4(const bool a, const bool b, const _bvec4& c) : - _cvec4(a, b, c.x, c.y) - {} - - inline _bvec4::_bvec4(const bool a, const _bvec2& b, const bool c) : - _cvec4(a, b.x, b.y, c) - {} - - inline _bvec4::_bvec4(const bool a, const _bvec2& b, const _bvec2& c) : - _cvec4(a, b.x, b.y, c.x) - {} - - inline _bvec4::_bvec4(const bool a, const _bvec2& b, const _bvec3& c) : - _cvec4(a, b.x, b.y, c.x) - {} - - inline _bvec4::_bvec4(const bool a, const _bvec2& b, const _bvec4& c) : - _cvec4(a, b.x, b.y, c.x) - {} - - inline _bvec4::_bvec4(const bool a, const _bvec3& b) : - _cvec4(a, b.x, b.y, b.z) - {} - - inline _bvec4::_bvec4(const bool a, const _bvec4& b) : - _cvec4(a, b.x, b.y, b.z) - {} - - inline _bvec4::_bvec4(const _bvec2& a, const bool b, const bool c) : - _cvec4(a.x, a.y, b, c) - {} - - inline _bvec4::_bvec4(const _bvec2& a, const bool b, const _bvec2& c) : - _cvec4(a.x, a.y, b, c.x) - {} - - inline _bvec4::_bvec4(const _bvec2& a, const bool b, const _bvec3& c) : - _cvec4(a.x, a.y, b, c.x) - {} - - inline _bvec4::_bvec4(const _bvec2& a, const bool b, const _bvec4& c) : - _cvec4(a.x, a.y, b, c.x) - {} - - inline _bvec4::_bvec4(const _bvec2& a, const _bvec2& b) : - _cvec4(a.x, a.y, b.x, b.y) - {} - - inline _bvec4::_bvec4(const _bvec2& a, const _bvec3& b) : - _cvec4(a.x, a.y, b.x, b.y) - {} - - inline _bvec4::_bvec4(const _bvec2& a, const _bvec4& b) : - _cvec4(a.x, a.y, b.x, b.y) - {} - - inline _bvec4::_bvec4(const _bvec3& a, const bool b) : - _cvec4(a.x, a.y, a.z, b) - {} - - inline _bvec4::_bvec4(const _bvec3& a, const _bvec2& b) : - _cvec4(a.x, a.y, a.z, b.x) - {} - - inline _bvec4::_bvec4(const _bvec3& a, const _bvec3& b) : - _cvec4(a.x, a.y, a.z, b.x) - {} - - inline _bvec4::_bvec4(const _bvec3& a, const _bvec4& b) : - _cvec4(a.x, a.y, a.z, b.x) - {} - - ////////////////////////////////////////////////////////////// - // U constructors - template - inline _bvec4::_bvec4(const U a) : - _cvec4(bool(a), bool(a), bool(a), bool(a)) - {} - - template - inline _bvec4::_bvec4(const U a, const U b, const U c, const U d) : - _cvec4(bool(a), bool(b), bool(c), bool(d)) - {} - - template - inline _bvec4::_bvec4(const U a, const U b, const U c, const _xvec2& d) : - _cvec4(bool(a), bool(b), bool(c), bool(d.x)) - {} - - template - inline _bvec4::_bvec4(const U a, const U b, const U c, const _xvec3& d) : - _cvec4(bool(a), bool(b), bool(c), bool(d.x)) - {} - - template - inline _bvec4::_bvec4(const U a, const U b, const U c, const _xvec4& d) : - _cvec4(bool(a), bool(b), bool(c), bool(d.x)) - {} - - template - inline _bvec4::_bvec4(const U a, const U b, const _xvec2& c) : - _cvec4(bool(a), bool(b), bool(c.x), bool(c.y)) - {} - - template - inline _bvec4::_bvec4(const U a, const U b, const _xvec3& c) : - _cvec4(bool(a), bool(b), bool(c.x), bool(c.y)) - {} - - template - inline _bvec4::_bvec4(const U a, const U b, const _xvec4& c) : - _cvec4(bool(a), bool(b), bool(c.x), bool(c.y)) - {} - - template - inline _bvec4::_bvec4(const U a, const _xvec2& b, const U c) : - _cvec4(bool(a), bool(b.x), bool(b.y), bool(c)) - {} - - template - inline _bvec4::_bvec4(const U a, const _xvec2& b, const _xvec2& c) : - _cvec4(bool(a), bool(b.x), bool(b.y), bool(c.x)) - {} - - template - inline _bvec4::_bvec4(const U a, const _xvec2& b, const _xvec3& c) : - _cvec4(bool(a), bool(b.x), bool(b.y), bool(c.x)) - {} - - template - inline _bvec4::_bvec4(const U a, const _xvec2& b, const _xvec4& c) : - _cvec4(bool(a), bool(b.x), bool(b.y), bool(c.x)) - {} - - template - inline _bvec4::_bvec4(const U a, const _xvec3& b) : - _cvec4(bool(a), bool(b.x), bool(b.y), bool(b.z)) - {} - - template - inline _bvec4::_bvec4(const U a, const _xvec4& b) : - _cvec4(bool(a), bool(b.x), bool(b.y), bool(b.z)) - {} - - template - inline _bvec4::_bvec4(const _xvec2& a, const U b, const U c) : - _cvec4(bool(a.x), bool(a.y), bool(b), bool(c)) - {} - - template - inline _bvec4::_bvec4(const _xvec2& a, const U b, const _xvec2& c) : - _cvec4(bool(a.x), bool(a.y), bool(b), bool(c.x)) - {} - - template - inline _bvec4::_bvec4(const _xvec2& a, const U b, const _xvec3& c) : - _cvec4(bool(a.x), bool(a.y), bool(b), bool(c.x)) - {} - - template - inline _bvec4::_bvec4(const _xvec2& a, const U b, const _xvec4& c) : - _cvec4(bool(a.x), bool(a.y), bool(b), bool(c.x)) - {} - - template - inline _bvec4::_bvec4(const _xvec2& a, const _xvec2& b) : - _cvec4(bool(a.x), bool(a.y), bool(b.x), bool(b.y)) - {} - - template - inline _bvec4::_bvec4(const _xvec2& a, const _xvec3& b) : - _cvec4(bool(a.x), bool(a.y), bool(b.x), bool(b.y)) - {} - - template - inline _bvec4::_bvec4(const _xvec2& a, const _xvec4& b) : - _cvec4(bool(a.x), bool(a.y), bool(b.x), bool(b.y)) - {} - - template - inline _bvec4::_bvec4(const _xvec3& a, const U b) : - _cvec4(bool(a.x), bool(a.y), bool(a.z), bool(b)) - {} - - template - inline _bvec4::_bvec4(const _xvec3& a, const _xvec2& b) : - _cvec4(bool(a.x), bool(a.y), bool(a.z), bool(b.x)) - {} - - template - inline _bvec4::_bvec4(const _xvec3& a, const _xvec3& b) : - _cvec4(bool(a.x), bool(a.y), bool(a.z), bool(b.x)) - {} - - template - inline _bvec4::_bvec4(const _xvec3& a, const _xvec4& b) : - _cvec4(bool(a.x), bool(a.y), bool(a.z), bool(b.x)) - {} - - template - inline _bvec4::_bvec4(const _xvec4& a) : - _cvec4(bool(a.x), bool(a.y), bool(a.z), bool(a.w)) - {} - - ////////////////////////////////////////////////////////////// - // bvec4 operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - inline _bvec4& _bvec4::operator=(const _bvec4& v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - this->w = v.w; - return *this; - } -/* - inline _bvec4 _bvec4::operator--() - { - this->x = !x; - this->y = !y; - this->z = !z; - this->w = !w; - return *this; - } - - inline _bvec4 _bvec4::operator++() - { - this->x = !x; - this->y = !y; - this->z = !z; - this->w = !w; - return *this; - } - - inline const _bvec4 _bvec4::operator--(int n) const - { - return _bvec4( - !this->x, - !this->y, - !this->z, - !this->w); - } - - inline const _bvec4 _bvec4::operator++(int n) const - { - return _bvec4( - !this->x, - !this->y, - !this->z, - !this->w); - } -*/ - //inline _bvec4 _bvec4::operator!() const - //{ - // return _bvec4( - // !this->x, - // !this->y, - // !this->z, - // !this->w); - //} - -} //namespace detail -} //namespace glm - -#endif//__bvec4_inl__ diff --git a/experimental/sse/glm/core/_cvec2.h b/experimental/sse/glm/core/_cvec2.h deleted file mode 100644 index aeb75204..00000000 --- a/experimental/sse/glm/core/_cvec2.h +++ /dev/null @@ -1,113 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-12 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_cvec2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_cvec2__ -#define __glm_core_cvec2__ - -#include "_cvecx.h" - -namespace glm{ -namespace detail{ - - template - class _cvec2 - { - public: - typedef T value_type; - typedef int size_type; - static const size_type value_size; - - // Data - /* ISO C++ version unavailable with VC7.1 ... - union{T x, r, s;}; - union{T y, g, t;}; - */ - // Solution away from ISO C++ but available with VC7.1 and GCC without -pedantic -/* - union - { - struct{T x, y;}; - struct{T r, g;}; - struct{T s, t;}; - }; -*/ -#ifndef GLM_SINGLE_COMP_NAME -#ifdef GLM_COMPILER_GCC - union {T x, r, s;}; - union {T y, g, t;}; -#endif//GLM_COMPILER_GCC - -#ifdef GLM_COMPILER_VC - union - { - struct{T x, y;}; - struct{T r, g;}; - struct{T s, t;}; - }; -#endif//GLM_COMPILER_VC - -#else - T x, y; -#endif//GLM_SINGLE_COMP_NAME - - // Conclassor - _cvec2(){} - _cvec2(const T x, const T y); - - // Accesses - T& operator[](size_type i); - const T operator[](size_type i) const; - operator T*(); - operator const T*() const; - -#if defined(GLM_SWIZZLE) - // Left hand side 2 components common swizzle operators - REF2 _xy(); - REF2 _yx(); - - // Right hand side 2 components common swizzle operators - const VEC2 _xx() const; - const VEC2 _yx() const; - VEC2 _xy() const; - const VEC2 _yy() const; - - // Right hand side 3 components common swizzle operators - const VEC3 _xxx() const; - const VEC3 _yxx() const; - const VEC3 _xyx() const; - const VEC3 _yyx() const; - const VEC3 _xxy() const; - const VEC3 _yxy() const; - const VEC3 _xyy() const; - const VEC3 _yyy() const; - - // Right hand side 4 components common swizzle operators - const VEC4 _xxxx() const; - const VEC4 _yxxx() const; - const VEC4 _xyxx() const; - const VEC4 _yyxx() const; - const VEC4 _xxyx() const; - const VEC4 _yxyx() const; - const VEC4 _xyyx() const; - const VEC4 _yyyx() const; - const VEC4 _xxxy() const; - const VEC4 _yxxy() const; - const VEC4 _xyxy() const; - const VEC4 _yyxy() const; - const VEC4 _xxyy() const; - const VEC4 _yxyy() const; - const VEC4 _xyyy() const; - const VEC4 _yyyy() const; -#endif// defined(GLM_SWIZZLE) - }; - -} //namespace detail -} //namespace glm - -#endif //__glm_core_cvec2__ diff --git a/experimental/sse/glm/core/_cvec2.inl b/experimental/sse/glm/core/_cvec2.inl deleted file mode 100644 index 3c74ae1d..00000000 --- a/experimental/sse/glm/core/_cvec2.inl +++ /dev/null @@ -1,253 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-15 -// Updated : 2007-01-15 -// Licence : This source is under GNU LGPL licence -// File : _cvec2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __cvec2_inl__ -#define __cvec2_inl__ - -#include "_cvec2.h" - -namespace glm{ -namespace detail{ - - template - const int _cvec2::value_size = 2; - - ////////////////////////////////////////////////////////////// - // _cvec2 constructor - - template - inline _cvec2::_cvec2(const T x, const T y) : - x(x), y(y) - {} - - ////////////////////////////////////////////////////////////// - // vec2 and ivec2 accesses - - template - inline T& _cvec2::operator [] (int i) - { - return (&x)[i]; - } - - template - inline const T _cvec2::operator [] (int i) const - { - return (&x)[i]; - } - - template - inline _cvec2::operator T* () - { - return &x; - } - - template - inline _cvec2::operator const T* () const - { - return &x; - } - -#if defined(GLM_SWIZZLE) - ////////////////////////////////////////////////////////////// - // Left hand side 2 components common swizzle operator - - template - inline REF2 _cvec2::_xy() - { - return REF2(this->x, this->y); - } - - template - inline REF2 _cvec2::_yx() - { - return REF2(this->y, this->x); - } - - ////////////////////////////////////////////////////////////// - // Right hand side 2 components common swizzle operators - - template - inline const VEC2 _cvec2::_xx() const - { - return VEC2(this->x, this->x); - } - - template - inline const VEC2 _cvec2::_yx() const - { - return VEC2(this->y, this->x); - } - - template - inline VEC2 _cvec2::_xy() const - { - return VEC2(this->x, this->y); - } - - template - inline const VEC2 _cvec2::_yy() const - { - return VEC2(this->y, this->y); - } - - ////////////////////////////////////////////////////////////// - // Right hand side 3 components common swizzle operators - - template - inline const VEC3 _cvec2::_xxx() const - { - return VEC3(this->x, this->x, this->x); - } - - template - inline const VEC3 _cvec2::_yxx() const - { - return VEC3(this->y, this->x, this->x); - } - - template - inline const VEC3 _cvec2::_xyx() const - { - return VEC3(this->x, this->y, this->x); - } - - template - inline const VEC3 _cvec2::_yyx() const - { - return VEC3(this->y, this->y, this->x); - } - - template - inline const VEC3 _cvec2::_xxy() const - { - return VEC3(this->x, this->x, this->y); - } - - template - inline const VEC3 _cvec2::_yxy() const - { - return VEC3(this->y, this->x, this->y); - } - - template - inline const VEC3 _cvec2::_xyy() const - { - return VEC3(this->x, this->y, this->y); - } - - template - inline const VEC3 _cvec2::_yyy() const - { - return VEC3(this->y, this->y, this->y); - } - - ////////////////////////////////////////////////////////////// - // Right hand side 4 components common swizzle operators - - template - inline const VEC4 _cvec2::_xxxx() const - { - return VEC4(this->x, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec2::_yxxx() const - { - return VEC4(this->y, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec2::_xyxx() const - { - return VEC4(this->x, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec2::_yyxx() const - { - return VEC4(this->y, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec2::_xxyx() const - { - return VEC4(this->x, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec2::_yxyx() const - { - return VEC4(this->y, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec2::_xyyx() const - { - return VEC4(this->x, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec2::_yyyx() const - { - return VEC4(this->y, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec2::_xxxy() const - { - return VEC4(this->x, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec2::_yxxy() const - { - return VEC4(this->y, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec2::_xyxy() const - { - return VEC4(this->x, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec2::_yyxy() const - { - return VEC4(this->y, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec2::_xxyy() const - { - return VEC4(this->x, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec2::_yxyy() const - { - return VEC4(this->y, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec2::_xyyy() const - { - return VEC4(this->x, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec2::_yyyy() const - { - return VEC4(this->y, this->y, this->y, this->y); - } -#endif //defined(GLM_SWIZZLE) - -} //namespace detail -} //namespace glm - -#endif //__cvec2_inl__ diff --git a/experimental/sse/glm/core/_cvec3.h b/experimental/sse/glm/core/_cvec3.h deleted file mode 100644 index d810401b..00000000 --- a/experimental/sse/glm/core/_cvec3.h +++ /dev/null @@ -1,217 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-15 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_cvec3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_cvec3__ -#define __glm_core_cvec3__ - -#include "_cvecx.h" - -namespace glm{ -namespace detail{ - - template - class _cvec3 - { - public: - typedef T value_type; - typedef int size_type; - static const size_type value_size; - - // Data - /* ISO C++ version unavailable with VC7.1 ... - union{T x, r, s;}; - union{T y, g, t;}; - union{T z, b, p;}; - */ - // Solution away from ISO C++ but available with VC7.1 and GCC without -pedantic -/* - union - { - struct{T x, y, z;}; - struct{T r, g, b;}; - struct{T s, t, p;}; - }; -*/ - -#ifndef GLM_SINGLE_COMP_NAME -#ifdef GLM_COMPILER_GCC - union{T x, r, s;}; - union{T y, g, t;}; - union{T z, b, p;}; -#endif//GLM_COMPILER_GCC - -#ifdef GLM_COMPILER_VC - union - { - struct{T x, y, z;}; - struct{T r, g, b;}; - struct{T s, t, p;}; - }; -#endif//GLM_COMPILER_VC - -#else - T x, y, z; -#endif//GLM_SINGLE_COMP_NAME - - // Constructor - _cvec3(){} - _cvec3(const T x, const T y, const T z); - - // Accesses - T& operator [] (size_type i); - const T operator [] (size_type i) const; - operator T* (); - operator const T* () const; - -#if defined(GLM_SWIZZLE) - // Left hand side 2 components common swizzle operators - REF2 _yx(); - REF2 _zx(); - REF2 _xy(); - REF2 _zy(); - REF2 _xz(); - REF2 _yz(); - - // Right hand side 2 components common swizzle operators - const VEC2 _xx() const; - const VEC2 _yx() const; - const VEC2 _zx() const; - const VEC2 _xy() const; - const VEC2 _yy() const; - const VEC2 _zy() const; - const VEC2 _xz() const; - const VEC2 _yz() const; - const VEC2 _zz() const; - - // Left hand side 3 components common swizzle operators - REF3 _zyx(); - REF3 _yzx(); - REF3 _zxy(); - REF3 _xzy(); - REF3 _yxz(); - REF3 _xyz(); - - // Right hand side 3 components common swizzle operators - const VEC3 _xxx() const; - const VEC3 _yxx() const; - const VEC3 _zxx() const; - const VEC3 _xyx() const; - const VEC3 _yyx() const; - const VEC3 _zyx() const; - const VEC3 _xzx() const; - const VEC3 _yzx() const; - const VEC3 _zzx() const; - const VEC3 _xxy() const; - const VEC3 _yxy() const; - const VEC3 _zxy() const; - const VEC3 _xyy() const; - const VEC3 _yyy() const; - const VEC3 _zyy() const; - const VEC3 _xzy() const; - const VEC3 _yzy() const; - const VEC3 _zzy() const; - const VEC3 _xxz() const; - const VEC3 _yxz() const; - const VEC3 _zxz() const; - const VEC3 _xyz() const; - const VEC3 _yyz() const; - const VEC3 _zyz() const; - const VEC3 _xzz() const; - const VEC3 _yzz() const; - const VEC3 _zzz() const; - - // 4 components common swizzle operators - const VEC4 _xxxx() const; - const VEC4 _yxxx() const; - const VEC4 _zxxx() const; - const VEC4 _xyxx() const; - const VEC4 _yyxx() const; - const VEC4 _zyxx() const; - const VEC4 _xzxx() const; - const VEC4 _yzxx() const; - const VEC4 _zzxx() const; - const VEC4 _xxyx() const; - const VEC4 _yxyx() const; - const VEC4 _zxyx() const; - const VEC4 _xyyx() const; - const VEC4 _yyyx() const; - const VEC4 _zyyx() const; - const VEC4 _xzyx() const; - const VEC4 _yzyx() const; - const VEC4 _zzyx() const; - const VEC4 _xxzx() const; - const VEC4 _yxzx() const; - const VEC4 _zxzx() const; - const VEC4 _xyzx() const; - const VEC4 _yyzx() const; - const VEC4 _zyzx() const; - const VEC4 _xzzx() const; - const VEC4 _yzzx() const; - const VEC4 _zzzx() const; - const VEC4 _xxxy() const; - const VEC4 _yxxy() const; - const VEC4 _zxxy() const; - const VEC4 _xyxy() const; - const VEC4 _yyxy() const; - const VEC4 _zyxy() const; - const VEC4 _xzxy() const; - const VEC4 _yzxy() const; - const VEC4 _zzxy() const; - const VEC4 _xxyy() const; - const VEC4 _yxyy() const; - const VEC4 _zxyy() const; - const VEC4 _xyyy() const; - const VEC4 _yyyy() const; - const VEC4 _zyyy() const; - const VEC4 _xzyy() const; - const VEC4 _yzyy() const; - const VEC4 _zzyy() const; - const VEC4 _xxzy() const; - const VEC4 _yxzy() const; - const VEC4 _zxzy() const; - const VEC4 _xyzy() const; - const VEC4 _yyzy() const; - const VEC4 _zyzy() const; - const VEC4 _xzzy() const; - const VEC4 _yzzy() const; - const VEC4 _zzzy() const; - const VEC4 _xxxz() const; - const VEC4 _yxxz() const; - const VEC4 _zxxz() const; - const VEC4 _xyxz() const; - const VEC4 _yyxz() const; - const VEC4 _zyxz() const; - const VEC4 _xzxz() const; - const VEC4 _yzxz() const; - const VEC4 _zzxz() const; - const VEC4 _xxyz() const; - const VEC4 _yxyz() const; - const VEC4 _zxyz() const; - const VEC4 _xyyz() const; - const VEC4 _yyyz() const; - const VEC4 _zyyz() const; - const VEC4 _xzyz() const; - const VEC4 _yzyz() const; - const VEC4 _zzyz() const; - const VEC4 _xxzz() const; - const VEC4 _yxzz() const; - const VEC4 _zxzz() const; - const VEC4 _xyzz() const; - const VEC4 _yyzz() const; - const VEC4 _zyzz() const; - const VEC4 _xzzz() const; - const VEC4 _yzzz() const; - const VEC4 _zzzz() const; -#endif// defined(GLM_SWIZZLE) - }; - -} //namespace detail -} //namespace glm - -#endif//__cvec3_h__ diff --git a/experimental/sse/glm/core/_cvec3.inl b/experimental/sse/glm/core/_cvec3.inl deleted file mode 100644 index c6847f0b..00000000 --- a/experimental/sse/glm/core/_cvec3.inl +++ /dev/null @@ -1,849 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-15 -// Updated : 2007-01-15 -// Licence : This source is under GNU LGPL licence -// File : _cvec3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __cvec3_inl__ -#define __cvec3_inl__ - -#include "_cvec3.h" - -namespace glm{ -namespace detail{ - - template - const int _cvec3::value_size = 3; - - ////////////////////////////////////////////////////////////// - // _cvec3 constructor - - template - inline _cvec3::_cvec3(const T x, const T y, const T z) : - x(x), y(y), z(z) - {} - - ////////////////////////////////////////////////////////////// - // vec3 and ivec3 accesses - - template - inline T& _cvec3::operator [] (int i) - { - return (&x)[i]; - } - - template - inline const T _cvec3::operator [] (int i) const - { - return (&x)[i]; - } - - template - inline _cvec3::operator T* () - { - return &x; - } - - template - inline _cvec3::operator const T* () const - { - return &x; - } - -#if defined(GLM_SWIZZLE) - ////////////////////////////////////////////////////////////// - // Left hand side 2 components common swizzle operators - - template - inline REF2 _cvec3::_yx() - { - return REF2(this->y, this->x); - } - - template - inline REF2 _cvec3::_zx() - { - return REF2(this->z, this->x); - } - - template - inline REF2 _cvec3::_xy() - { - return REF2(this->x, this->y); - } - - template - inline REF2 _cvec3::_zy() - { - return REF2(this->x, this->y); - } - - template - inline REF2 _cvec3::_xz() - { - return REF2(this->x, this->z); - } - - template - inline REF2 _cvec3::_yz() - { - return REF2(this->y, this->z); - } - - ////////////////////////////////////////////////////////////// - // Right hand side 2 components swizzles operators - - template - inline const VEC2 _cvec3::_xx() const - { - return VEC2(this->x, this->x); - } - - template - inline const VEC2 _cvec3::_yx() const - { - return VEC2(this->y, this->x); - } - - template - inline const VEC2 _cvec3::_zx() const - { - return VEC2(this->z, this->x); - } - - template - inline const VEC2 _cvec3::_xy() const - { - return VEC2(this->x, this->y); - } - - template - inline const VEC2 _cvec3::_yy() const - { - return VEC2(this->y, this->y); - } - - template - inline const VEC2 _cvec3::_zy() const - { - return VEC2(this->z, this->y); - } - - template - inline const VEC2 _cvec3::_xz() const - { - return VEC2(this->x, this->z); - } - - template - inline const VEC2 _cvec3::_yz() const - { - return VEC2(this->y, this->z); - } - - template - inline const VEC2 _cvec3::_zz() const - { - return VEC2(this->z, this->z); - } - - ////////////////////////////////////////////////////////////// - // Left hand side 3 components common swizzle operator - - template - inline REF3 _cvec3::_zyx() - { - return REF3(this->z, this->y, this->x); - } - - template - inline REF3 _cvec3::_yzx() - { - return REF3(this->y, this->z, this->x); - } - - template - inline REF3 _cvec3::_zxy() - { - return REF3(this->z, this->x, this->y); - } - - template - inline REF3 _cvec3::_xzy() - { - return REF3(this->x, this->z, this->y); - } - - template - inline REF3 _cvec3::_yxz() - { - return REF3(this->y, this->x, this->z); - } - - template - inline REF3 _cvec3::_xyz() - { - return REF3(this->x, this->y, this->z); - } - - ////////////////////////////////////////////////////////////// - // Right hand side 3 components common swizzle operators - - template - inline const VEC3 _cvec3::_xxx() const - { - return _cvec3(this->x, this->x, this->x); - } - - template - inline const VEC3 _cvec3::_yxx() const - { - return _cvec3(this->y, this->x, this->x); - } - - template - inline const VEC3 _cvec3::_zxx() const - { - return _cvec3(this->z, this->x, this->x); - } - - template - inline const VEC3 _cvec3::_xyx() const - { - return _cvec3(this->x, this->y, this->x); - } - - template - inline const VEC3 _cvec3::_yyx() const - { - return _cvec3(this->y, this->y, this->x); - } - - template - inline const VEC3 _cvec3::_zyx() const - { - return _cvec3(this->z, this->y, this->x); - } - - template - inline const VEC3 _cvec3::_xzx() const - { - return _cvec3(this->x, this->z, this->x); - } - - template - inline const VEC3 _cvec3::_yzx() const - { - return _cvec3(this->y, this->z, this->x); - } - - template - inline const VEC3 _cvec3::_zzx() const - { - return _cvec3(this->z, this->z, this->x); - } - - template - inline const VEC3 _cvec3::_xxy() const - { - return _cvec3(this->x, this->x, this->y); - } - - template - inline const VEC3 _cvec3::_yxy() const - { - return _cvec3(this->y, this->x, this->y); - } - - template - inline const VEC3 _cvec3::_zxy() const - { - return _cvec3(this->z, this->x, this->y); - } - - template - inline const VEC3 _cvec3::_xyy() const - { - return _cvec3(this->x, this->y, this->y); - } - - template - inline const VEC3 _cvec3::_yyy() const - { - return _cvec3(this->y, this->y, this->y); - } - - template - inline const VEC3 _cvec3::_zyy() const - { - return _cvec3(this->z, this->y, this->y); - } - - template - inline const VEC3 _cvec3::_xzy() const - { - return _cvec3(this->x, this->z, this->y); - } - - template - inline const VEC3 _cvec3::_yzy() const - { - return _cvec3(this->y, this->z, this->y); - } - - template - inline const VEC3 _cvec3::_zzy() const - { - return _cvec3(this->z, this->z, this->y); - } - - template - inline const VEC3 _cvec3::_xxz() const - { - return _cvec3(this->x, this->x, this->z); - } - - template - inline const VEC3 _cvec3::_yxz() const - { - return _cvec3(this->y, this->x, this->z); - } - - template - inline const VEC3 _cvec3::_zxz() const - { - return _cvec3(this->z, this->x, this->z); - } - - template - inline const VEC3 _cvec3::_xyz() const - { - return _cvec3(this->x, this->y, this->z); - } - - template - inline const VEC3 _cvec3::_yyz() const - { - return _cvec3(this->y, this->y, this->z); - } - - template - inline const VEC3 _cvec3::_zyz() const - { - return _cvec3(this->z, this->y, this->z); - } - - template - inline const VEC3 _cvec3::_xzz() const - { - return _cvec3(this->x, this->z, this->z); - } - - template - inline const VEC3 _cvec3::_yzz() const - { - return _cvec3(this->y, this->z, this->z); - } - - template - inline const VEC3 _cvec3::_zzz() const - { - return _cvec3(this->z, this->z, this->z); - } - - // Right hand side4 components swizzles operators - template - inline const VEC4 _cvec3::_xxxx() const - { - return VEC4(this->x, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_yxxx() const - { - return VEC4(this->y, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_zxxx() const - { - return VEC4(this->z, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_xyxx() const - { - return VEC4(this->x, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_yyxx() const - { - return VEC4(this->y, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_zyxx() const - { - return VEC4(this->z, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_xzxx() const - { - return VEC4(this->x, this->z, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_yzxx() const - { - return VEC4(this->y, this->z, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_zzxx() const - { - return VEC4(this->z, this->z, this->x, this->x); - } - - template - inline const VEC4 _cvec3::_xxyx() const - { - return VEC4(this->x, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_yxyx() const - { - return VEC4(this->y, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_zxyx() const - { - return VEC4(this->z, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_xyyx() const - { - return VEC4(this->x, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_yyyx() const - { - return VEC4(this->y, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_zyyx() const - { - return VEC4(this->z, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_xzyx() const - { - return VEC4(this->x, this->z, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_yzyx() const - { - return VEC4(this->y, this->z, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_zzyx() const - { - return VEC4(this->z, this->z, this->y, this->x); - } - - template - inline const VEC4 _cvec3::_xxzx() const - { - return VEC4(this->x, this->x, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_yxzx() const - { - return VEC4(this->y, this->x, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_zxzx() const - { - return VEC4(this->z, this->x, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_xyzx() const - { - return VEC4(this->x, this->y, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_yyzx() const - { - return VEC4(this->y, this->y, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_zyzx() const - { - return VEC4(this->z, this->y, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_xzzx() const - { - return VEC4(this->x, this->z, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_yzzx() const - { - return VEC4(this->y, this->z, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_zzzx() const - { - return VEC4(this->z, this->z, this->z, this->x); - } - - template - inline const VEC4 _cvec3::_xxxy() const - { - return VEC4(this->x, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_yxxy() const - { - return VEC4(this->y, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_zxxy() const - { - return VEC4(this->z, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_xyxy() const - { - return VEC4(this->x, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_yyxy() const - { - return VEC4(this->y, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_zyxy() const - { - return VEC4(this->z, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_xzxy() const - { - return VEC4(this->x, this->z, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_yzxy() const - { - return VEC4(this->y, this->z, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_zzxy() const - { - return VEC4(this->z, this->z, this->x, this->y); - } - - template - inline const VEC4 _cvec3::_xxyy() const - { - return VEC4(this->x, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_yxyy() const - { - return VEC4(this->y, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_zxyy() const - { - return VEC4(this->z, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_xyyy() const - { - return VEC4(this->x, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_yyyy() const - { - return VEC4(this->y, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_zyyy() const - { - return VEC4(this->z, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_xzyy() const - { - return VEC4(this->x, this->z, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_yzyy() const - { - return VEC4(this->y, this->z, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_zzyy() const - { - return VEC4(this->z, this->z, this->y, this->y); - } - - template - inline const VEC4 _cvec3::_xxzy() const - { - return VEC4(this->x, this->x, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_yxzy() const - { - return VEC4(this->y, this->x, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_zxzy() const - { - return VEC4(this->z, this->x, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_xyzy() const - { - return VEC4(this->x, this->y, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_yyzy() const - { - return VEC4(this->y, this->y, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_zyzy() const - { - return VEC4(this->z, this->y, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_xzzy() const - { - return VEC4(this->x, this->z, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_yzzy() const - { - return VEC4(this->y, this->z, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_zzzy() const - { - return VEC4(this->z, this->z, this->z, this->y); - } - - template - inline const VEC4 _cvec3::_xxxz() const - { - return VEC4(this->x, this->x, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_yxxz() const - { - return VEC4(this->y, this->x, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_zxxz() const - { - return VEC4(this->z, this->x, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_xyxz() const - { - return VEC4(this->x, this->y, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_yyxz() const - { - return VEC4(this->y, this->y, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_zyxz() const - { - return VEC4(this->z, this->y, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_xzxz() const - { - return VEC4(this->x, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_yzxz() const - { - return VEC4(this->y, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_zzxz() const - { - return VEC4(this->z, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec3::_xxyz() const - { - return VEC4(this->x, this->x, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_yxyz() const - { - return VEC4(this->y, this->x, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_zxyz() const - { - return VEC4(this->z, this->x, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_xyyz() const - { - return VEC4(this->x, this->y, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_yyyz() const - { - return VEC4(this->y, this->y, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_zyyz() const - { - return VEC4(this->z, this->y, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_xzyz() const - { - return VEC4(this->x, this->z, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_yzyz() const - { - return VEC4(this->y, this->z, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_zzyz() const - { - return VEC4(this->z, this->z, this->y, this->z); - } - - template - inline const VEC4 _cvec3::_xxzz() const - { - return VEC4(this->x, this->x, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_yxzz() const - { - return VEC4(this->y, this->x, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_zxzz() const - { - return VEC4(this->z, this->x, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_xyzz() const - { - return VEC4(this->x, this->y, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_yyzz() const - { - return VEC4(this->y, this->y, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_zyzz() const - { - return VEC4(this->z, this->y, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_xzzz() const - { - return VEC4(this->x, this->z, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_yzzz() const - { - return VEC4(this->y, this->z, this->z, this->z); - } - - template - inline const VEC4 _cvec3::_zzzz() const - { - return VEC4(this->z, this->z, this->z, this->z); - } -#endif //defined(GLM_SWIZZLE) - -} //namespace detail -} //namespace glm - -#endif//__cvec3_inl__ - diff --git a/experimental/sse/glm/core/_cvec4.h b/experimental/sse/glm/core/_cvec4.h deleted file mode 100644 index 09a75ef3..00000000 --- a/experimental/sse/glm/core/_cvec4.h +++ /dev/null @@ -1,489 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-15 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : _cvec4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __cvec4_h__ -#define __cvec4_h__ - -#include "_cvecx.h" - -namespace glm{ -namespace detail{ - - template - class _cvec4 - { - public: - typedef T value_type; - typedef int size_type; - static const size_type value_size; - - // Data - /* ISO C++ version unavailable with VC7.1 ... - union{T x, r, s;}; - union{T y, g, t;}; - union{T z, b, p;}; - union{T w, a, q;}; - */ -/* - // Solution away from ISO C++ but available with VC7.1 and GCC without -pedantic - union - { - struct{T x, y, z, w;}; - struct{T r, g, b, a;}; - struct{T s, t, p, q;}; - //__m128 data; - }; -*/ - -#ifndef GLM_SINGLE_COMP_NAME -#ifdef GLM_COMPILER_GCC - union{T x, r, s;}; - union{T y, g, t;}; - union{T z, b, p;}; - union{T w, a, q;}; -#endif//GLM_COMPILER_GCC - -#ifdef GLM_COMPILER_VC - union - { - struct{T x, y, z, w;}; - struct{T r, g, b, a;}; - struct{T s, t, p, q;}; - }; -#endif//GLM_COMPILER_VC - -#else - T x, y, z, w; -#endif//GLM_SINGLE_COMP_NAME - - // Constructor - _cvec4(){} - _cvec4(const T x, const T y, const T z, const T w); - - // Accesses - T& operator[](size_type i); - const T operator[](size_type i) const; - operator T*(); - operator const T*() const; - -#if defined(GLM_SWIZZLE) - // Left hand side 2 components common swizzle operators - REF2 _yx(); - REF2 _zx(); - REF2 _wx(); - REF2 _xy(); - REF2 _zy(); - REF2 _wy(); - REF2 _xz(); - REF2 _yz(); - REF2 _wz(); - REF2 _xw(); - REF2 _yw(); - REF2 _zw(); - - // Right hand side 2 components common swizzle operators - const VEC2 _xx() const; - const VEC2 _yx() const; - const VEC2 _zx() const; - const VEC2 _wx() const; - const VEC2 _xy() const; - const VEC2 _yy() const; - const VEC2 _zy() const; - const VEC2 _wy() const; - const VEC2 _xz() const; - const VEC2 _yz() const; - const VEC2 _zz() const; - const VEC2 _wz() const; - const VEC2 _xw() const; - const VEC2 _yw() const; - const VEC2 _zw() const; - const VEC2 _ww() const; - - // Left hand side 3 components common swizzle operators - REF3 _zyx(); - REF3 _wyx(); - REF3 _yzx(); - REF3 _wzx(); - REF3 _ywx(); - REF3 _zwx(); - REF3 _zxy(); - REF3 _wxy(); - REF3 _xzy(); - REF3 _wzy(); - REF3 _xwy(); - REF3 _zwy(); - REF3 _yxz(); - REF3 _wxz(); - REF3 _xyz(); - REF3 _wyz(); - REF3 _xwz(); - REF3 _ywz(); - REF3 _yxw(); - REF3 _zxw(); - REF3 _xyw(); - REF3 _zyw(); - REF3 _xzw(); - REF3 _yzw(); - - // Right hand side 3 components common swizzle operators - const VEC3 _xxx() const; - const VEC3 _yxx() const; - const VEC3 _zxx() const; - const VEC3 _wxx() const; - const VEC3 _xyx() const; - const VEC3 _yyx() const; - const VEC3 _zyx() const; - const VEC3 _wyx() const; - const VEC3 _xzx() const; - const VEC3 _yzx() const; - const VEC3 _zzx() const; - const VEC3 _wzx() const; - const VEC3 _xwx() const; - const VEC3 _ywx() const; - const VEC3 _zwx() const; - const VEC3 _wwx() const; - const VEC3 _xxy() const; - const VEC3 _yxy() const; - const VEC3 _zxy() const; - const VEC3 _wxy() const; - const VEC3 _xyy() const; - const VEC3 _yyy() const; - const VEC3 _zyy() const; - const VEC3 _wyy() const; - const VEC3 _xzy() const; - const VEC3 _yzy() const; - const VEC3 _zzy() const; - const VEC3 _wzy() const; - const VEC3 _xwy() const; - const VEC3 _ywy() const; - const VEC3 _zwy() const; - const VEC3 _wwy() const; - const VEC3 _xxz() const; - const VEC3 _yxz() const; - const VEC3 _zxz() const; - const VEC3 _wxz() const; - const VEC3 _xyz() const; - const VEC3 _yyz() const; - const VEC3 _zyz() const; - const VEC3 _wyz() const; - const VEC3 _xzz() const; - const VEC3 _yzz() const; - const VEC3 _zzz() const; - const VEC3 _wzz() const; - const VEC3 _xwz() const; - const VEC3 _ywz() const; - const VEC3 _zwz() const; - const VEC3 _wwz() const; - const VEC3 _xxw() const; - const VEC3 _yxw() const; - const VEC3 _zxw() const; - const VEC3 _wxw() const; - const VEC3 _xyw() const; - const VEC3 _yyw() const; - const VEC3 _zyw() const; - const VEC3 _wyw() const; - const VEC3 _xzw() const; - const VEC3 _yzw() const; - const VEC3 _zzw() const; - const VEC3 _wzw() const; - const VEC3 _xww() const; - const VEC3 _yww() const; - const VEC3 _zww() const; - const VEC3 _www() const; - - // Left hand side 4 components common swizzle operators - REF4 _wzyx(); - REF4 _zwyx(); - REF4 _wyzx(); - REF4 _ywzx(); - REF4 _zywx(); - REF4 _yzwx(); - REF4 _wzxy(); - REF4 _zwxy(); - REF4 _wxzy(); - REF4 _xwzy(); - REF4 _zxwy(); - REF4 _xzwy(); - REF4 _wyxz(); - REF4 _ywxz(); - REF4 _wxyz(); - REF4 _xwyz(); - REF4 _yxwz(); - REF4 _xywz(); - REF4 _zyxw(); - REF4 _yzxw(); - REF4 _zxyw(); - REF4 _xzyw(); - REF4 _yxzw(); - REF4 _xyzw(); - - // Right hand side 4 components common swizzle operators - const VEC4 _xxxx() const; - const VEC4 _yxxx() const; - const VEC4 _zxxx() const; - const VEC4 _wxxx() const; - const VEC4 _xyxx() const; - const VEC4 _yyxx() const; - const VEC4 _zyxx() const; - const VEC4 _wyxx() const; - const VEC4 _xzxx() const; - const VEC4 _yzxx() const; - const VEC4 _zzxx() const; - const VEC4 _wzxx() const; - const VEC4 _xwxx() const; - const VEC4 _ywxx() const; - const VEC4 _zwxx() const; - const VEC4 _wwxx() const; - const VEC4 _xxyx() const; - const VEC4 _yxyx() const; - const VEC4 _zxyx() const; - const VEC4 _wxyx() const; - const VEC4 _xyyx() const; - const VEC4 _yyyx() const; - const VEC4 _zyyx() const; - const VEC4 _wyyx() const; - const VEC4 _xzyx() const; - const VEC4 _yzyx() const; - const VEC4 _zzyx() const; - const VEC4 _wzyx() const; - const VEC4 _xwyx() const; - const VEC4 _ywyx() const; - const VEC4 _zwyx() const; - const VEC4 _wwyx() const; - const VEC4 _xxzx() const; - const VEC4 _yxzx() const; - const VEC4 _zxzx() const; - const VEC4 _wxzx() const; - const VEC4 _xyzx() const; - const VEC4 _yyzx() const; - const VEC4 _zyzx() const; - const VEC4 _wyzx() const; - const VEC4 _xzzx() const; - const VEC4 _yzzx() const; - const VEC4 _zzzx() const; - const VEC4 _wzzx() const; - const VEC4 _xwzx() const; - const VEC4 _ywzx() const; - const VEC4 _zwzx() const; - const VEC4 _wwzx() const; - const VEC4 _xxwx() const; - const VEC4 _yxwx() const; - const VEC4 _zxwx() const; - const VEC4 _wxwx() const; - const VEC4 _xywx() const; - const VEC4 _yywx() const; - const VEC4 _zywx() const; - const VEC4 _wywx() const; - const VEC4 _xzwx() const; - const VEC4 _yzwx() const; - const VEC4 _zzwx() const; - const VEC4 _wzwx() const; - const VEC4 _xwwx() const; - const VEC4 _ywwx() const; - const VEC4 _zwwx() const; - const VEC4 _wwwx() const; - const VEC4 _xxxy() const; - const VEC4 _yxxy() const; - const VEC4 _zxxy() const; - const VEC4 _wxxy() const; - const VEC4 _xyxy() const; - const VEC4 _yyxy() const; - const VEC4 _zyxy() const; - const VEC4 _wyxy() const; - const VEC4 _xzxy() const; - const VEC4 _yzxy() const; - const VEC4 _zzxy() const; - const VEC4 _wzxy() const; - const VEC4 _xwxy() const; - const VEC4 _ywxy() const; - const VEC4 _zwxy() const; - const VEC4 _wwxy() const; - const VEC4 _xxyy() const; - const VEC4 _yxyy() const; - const VEC4 _zxyy() const; - const VEC4 _wxyy() const; - const VEC4 _xyyy() const; - const VEC4 _yyyy() const; - const VEC4 _zyyy() const; - const VEC4 _wyyy() const; - const VEC4 _xzyy() const; - const VEC4 _yzyy() const; - const VEC4 _zzyy() const; - const VEC4 _wzyy() const; - const VEC4 _xwyy() const; - const VEC4 _ywyy() const; - const VEC4 _zwyy() const; - const VEC4 _wwyy() const; - const VEC4 _xxzy() const; - const VEC4 _yxzy() const; - const VEC4 _zxzy() const; - const VEC4 _wxzy() const; - const VEC4 _xyzy() const; - const VEC4 _yyzy() const; - const VEC4 _zyzy() const; - const VEC4 _wyzy() const; - const VEC4 _xzzy() const; - const VEC4 _yzzy() const; - const VEC4 _zzzy() const; - const VEC4 _wzzy() const; - const VEC4 _xwzy() const; - const VEC4 _ywzy() const; - const VEC4 _zwzy() const; - const VEC4 _wwzy() const; - const VEC4 _xxwy() const; - const VEC4 _yxwy() const; - const VEC4 _zxwy() const; - const VEC4 _wxwy() const; - const VEC4 _xywy() const; - const VEC4 _yywy() const; - const VEC4 _zywy() const; - const VEC4 _wywy() const; - const VEC4 _xzwy() const; - const VEC4 _yzwy() const; - const VEC4 _zzwy() const; - const VEC4 _wzwy() const; - const VEC4 _xwwy() const; - const VEC4 _ywwy() const; - const VEC4 _zwwy() const; - const VEC4 _wwwy() const; - const VEC4 _xxxz() const; - const VEC4 _yxxz() const; - const VEC4 _zxxz() const; - const VEC4 _wxxz() const; - const VEC4 _xyxz() const; - const VEC4 _yyxz() const; - const VEC4 _zyxz() const; - const VEC4 _wyxz() const; - const VEC4 _xzxz() const; - const VEC4 _yzxz() const; - const VEC4 _zzxz() const; - const VEC4 _wzxz() const; - const VEC4 _xwxz() const; - const VEC4 _ywxz() const; - const VEC4 _zwxz() const; - const VEC4 _wwxz() const; - const VEC4 _xxyz() const; - const VEC4 _yxyz() const; - const VEC4 _zxyz() const; - const VEC4 _wxyz() const; - const VEC4 _xyyz() const; - const VEC4 _yyyz() const; - const VEC4 _zyyz() const; - const VEC4 _wyyz() const; - const VEC4 _xzyz() const; - const VEC4 _yzyz() const; - const VEC4 _zzyz() const; - const VEC4 _wzyz() const; - const VEC4 _xwyz() const; - const VEC4 _ywyz() const; - const VEC4 _zwyz() const; - const VEC4 _wwyz() const; - const VEC4 _xxzz() const; - const VEC4 _yxzz() const; - const VEC4 _zxzz() const; - const VEC4 _wxzz() const; - const VEC4 _xyzz() const; - const VEC4 _yyzz() const; - const VEC4 _zyzz() const; - const VEC4 _wyzz() const; - const VEC4 _xzzz() const; - const VEC4 _yzzz() const; - const VEC4 _zzzz() const; - const VEC4 _wzzz() const; - const VEC4 _xwzz() const; - const VEC4 _ywzz() const; - const VEC4 _zwzz() const; - const VEC4 _wwzz() const; - const VEC4 _xxwz() const; - const VEC4 _yxwz() const; - const VEC4 _zxwz() const; - const VEC4 _wxwz() const; - const VEC4 _xywz() const; - const VEC4 _yywz() const; - const VEC4 _zywz() const; - const VEC4 _wywz() const; - const VEC4 _xzwz() const; - const VEC4 _yzwz() const; - const VEC4 _zzwz() const; - const VEC4 _wzwz() const; - const VEC4 _xwwz() const; - const VEC4 _ywwz() const; - const VEC4 _zwwz() const; - const VEC4 _wwwz() const; - const VEC4 _xxxw() const; - const VEC4 _yxxw() const; - const VEC4 _zxxw() const; - const VEC4 _wxxw() const; - const VEC4 _xyxw() const; - const VEC4 _yyxw() const; - const VEC4 _zyxw() const; - const VEC4 _wyxw() const; - const VEC4 _xzxw() const; - const VEC4 _yzxw() const; - const VEC4 _zzxw() const; - const VEC4 _wzxw() const; - const VEC4 _xwxw() const; - const VEC4 _ywxw() const; - const VEC4 _zwxw() const; - const VEC4 _wwxw() const; - const VEC4 _xxyw() const; - const VEC4 _yxyw() const; - const VEC4 _zxyw() const; - const VEC4 _wxyw() const; - const VEC4 _xyyw() const; - const VEC4 _yyyw() const; - const VEC4 _zyyw() const; - const VEC4 _wyyw() const; - const VEC4 _xzyw() const; - const VEC4 _yzyw() const; - const VEC4 _zzyw() const; - const VEC4 _wzyw() const; - const VEC4 _xwyw() const; - const VEC4 _ywyw() const; - const VEC4 _zwyw() const; - const VEC4 _wwyw() const; - const VEC4 _xxzw() const; - const VEC4 _yxzw() const; - const VEC4 _zxzw() const; - const VEC4 _wxzw() const; - const VEC4 _xyzw() const; - const VEC4 _yyzw() const; - const VEC4 _zyzw() const; - const VEC4 _wyzw() const; - const VEC4 _xzzw() const; - const VEC4 _yzzw() const; - const VEC4 _zzzw() const; - const VEC4 _wzzw() const; - const VEC4 _xwzw() const; - const VEC4 _ywzw() const; - const VEC4 _zwzw() const; - const VEC4 _wwzw() const; - const VEC4 _xxww() const; - const VEC4 _yxww() const; - const VEC4 _zxww() const; - const VEC4 _wxww() const; - const VEC4 _xyww() const; - const VEC4 _yyww() const; - const VEC4 _zyww() const; - const VEC4 _wyww() const; - const VEC4 _xzww() const; - const VEC4 _yzww() const; - const VEC4 _zzww() const; - const VEC4 _wzww() const; - const VEC4 _xwww() const; - const VEC4 _ywww() const; - const VEC4 _zwww() const; - const VEC4 _wwww() const; -#endif// defined(GLM_SWIZZLE) - }; - -} //namespace detail -} //namespace glm - -#endif//__cvec4_h__ diff --git a/experimental/sse/glm/core/_cvec4.inl b/experimental/sse/glm/core/_cvec4.inl deleted file mode 100644 index f19c64cf..00000000 --- a/experimental/sse/glm/core/_cvec4.inl +++ /dev/null @@ -1,2450 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-15 -// Updated : 2007-01-15 -// Licence : This source is under GNU LGPL licence -// File : _cvec4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __cvec4_inl__ -#define __cvec4_inl__ - -#include "_cvec4.h" - -namespace glm{ -namespace detail{ - - template - const int _cvec4::value_size = 4; - - ////////////////////////////////////////////////////////////// - // _cvec4 constructor - - template - inline _cvec4::_cvec4(const T x, const T y, const T z, const T w) : - x(x), y(y), z(z), w(w) - {} - - ////////////////////////////////////////////////////////////// - // vec4 and ivec4 accesses - - template - inline T& _cvec4::operator[](int i) - { - return (&x)[i]; - } - - template - inline const T _cvec4::operator[](int i) const - { - return (&x)[i]; - } - - template - inline _cvec4::operator T*() - { - return &x; - } - - template - inline _cvec4::operator const T*() const - { - return &x; - } - -#if defined(GLM_SWIZZLE) - ////////////////////////////////////////////////////////////// - // Left hand side 2 components common swizzle operators - - template - inline REF2 _cvec4::_yx() - { - return REF2(this->y, this->x); - } - - template - inline REF2 _cvec4::_zx() - { - return REF2(this->z, this->x); - } - - template - inline REF2 _cvec4::_wx() - { - return REF2(this->w, this->x); - } - - template - inline REF2 _cvec4::_xy() - { - return REF2(this->x, this->y); - } - - template - inline REF2 _cvec4::_zy() - { - return REF2(this->z, this->y); - } - - template - inline REF2 _cvec4::_wy() - { - return REF2(this->w, this->y); - } - - template - inline REF2 _cvec4::_xz() - { - return REF2(this->x, this->z); - } - - template - inline REF2 _cvec4::_yz() - { - return REF2(this->y, this->z); - } - - template - inline REF2 _cvec4::_wz() - { - return REF2(this->w, this->z); - } - - template - inline REF2 _cvec4::_xw() - { - return REF2(this->x, this->w); - } - - template - inline REF2 _cvec4::_yw() - { - return REF2(this->y, this->w); - } - - template - inline REF2 _cvec4::_zw() - { - return REF2(this->z, this->w); - } - - // Right hand side 2 components swizzles operators - - template - inline const VEC2 _cvec4::_xx() const - { - return VEC2(this->x, this->x); - } - - template - inline const VEC2 _cvec4::_yx() const - { - return VEC2(this->y, this->x); - } - - template - inline const VEC2 _cvec4::_zx() const - { - return VEC2(this->z, this->x); - } - - template - inline const VEC2 _cvec4::_wx() const - { - return VEC2(this->w, this->x); - } - - template - inline const VEC2 _cvec4::_xy() const - { - return VEC2(this->x, this->y); - } - - template - inline const VEC2 _cvec4::_yy() const - { - return VEC2(this->y, this->y); - } - - template - inline const VEC2 _cvec4::_zy() const - { - return VEC2(this->z, this->y); - } - - template - inline const VEC2 _cvec4::_wy() const - { - return VEC2(this->w, this->y); - } - - template - inline const VEC2 _cvec4::_xz() const - { - return VEC2(this->x, this->z); - } - - template - inline const VEC2 _cvec4::_yz() const - { - return VEC2(this->y, this->z); - } - - template - inline const VEC2 _cvec4::_zz() const - { - return VEC2(this->z, this->z); - } - - template - inline const VEC2 _cvec4::_wz() const - { - return VEC2(this->w, this->z); - } - - template - inline const VEC2 _cvec4::_xw() const - { - return VEC2(this->x, this->w); - } - - template - inline const VEC2 _cvec4::_yw() const - { - return VEC2(this->y, this->w); - } - - template - inline const VEC2 _cvec4::_zw() const - { - return VEC2(this->z, this->w); - } - - template - inline const VEC2 _cvec4::_ww() const - { - return VEC2(this->w, this->w); - } - - ////////////////////////////////////////////////////////////// - // Left hand side 3 components swizzles operators - - template - inline REF3 _cvec4::_zyx() - { - return REF3(this->z, this->y, this->x); - } - - template - inline REF3 _cvec4::_wyx() - { - return REF3(this->w, this->y, this->x); - } - - template - inline REF3 _cvec4::_yzx() - { - return REF3(this->y, this->z, this->x); - } - - template - inline REF3 _cvec4::_wzx() - { - return REF3(this->w, this->z, this->x); - } - - template - inline REF3 _cvec4::_ywx() - { - return REF3(this->y, this->w, this->x); - } - - template - inline REF3 _cvec4::_zwx() - { - return REF3(this->z, this->w, this->x); - } - - template - inline REF3 _cvec4::_zxy() - { - return REF3(this->z, this->x, this->y); - } - - template - inline REF3 _cvec4::_wxy() - { - return REF3(this->w, this->x, this->y); - } - - template - inline REF3 _cvec4::_xzy() - { - return REF3(this->x, this->z, this->y); - } - - template - inline REF3 _cvec4::_wzy() - { - return REF3(this->w, this->z, this->y); - } - - template - inline REF3 _cvec4::_xwy() - { - return REF3(this->x, this->w, this->y); - } - - template - inline REF3 _cvec4::_zwy() - { - return REF3(this->z, this->w, this->y); - } - - template - inline REF3 _cvec4::_yxz() - { - return REF3(this->y, this->x, this->z); - } - - template - inline REF3 _cvec4::_wxz() - { - return REF3(this->w, this->x, this->z); - } - - template - inline REF3 _cvec4::_xyz() - { - return REF3(this->x, this->y, this->z); - } - - template - inline REF3 _cvec4::_wyz() - { - return REF3(this->w, this->y, this->z); - } - - template - inline REF3 _cvec4::_xwz() - { - return REF3(this->x, this->w, this->z); - } - - template - inline REF3 _cvec4::_ywz() - { - return REF3(this->y, this->w, this->z); - } - - template - inline REF3 _cvec4::_yxw() - { - return REF3(this->y, this->x, this->w); - } - - template - inline REF3 _cvec4::_zxw() - { - return REF3(this->z, this->x, this->w); - } - - template - inline REF3 _cvec4::_xyw() - { - return REF3(this->x, this->y, this->w); - } - - template - inline REF3 _cvec4::_zyw() - { - return REF3(this->z, this->y, this->w); - } - - template - inline REF3 _cvec4::_xzw() - { - return REF3(this->x, this->z, this->w); - } - - template - inline REF3 _cvec4::_yzw() - { - return REF3(this->y, this->z, this->w); - } - - ////////////////////////////////////////////////////////////// - // Right hand side 3 components swizzles operators - - template - inline const VEC3 _cvec4::_xxx() const - { - return VEC3(this->x, this->x, this->x); - } - - template - inline const VEC3 _cvec4::_yxx() const - { - return VEC3(this->y, this->x, this->x); - } - - template - inline const VEC3 _cvec4::_zxx() const - { - return VEC3(this->z, this->x, this->x); - } - - template - inline const VEC3 _cvec4::_wxx() const - { - return VEC3(this->w, this->x, this->x); - } - - template - inline const VEC3 _cvec4::_xyx() const - { - return VEC3(this->x, this->y, this->x); - } - - template - inline const VEC3 _cvec4::_yyx() const - { - return VEC3(this->y, this->y, this->x); - } - - template - inline const VEC3 _cvec4::_zyx() const - { - return VEC3(this->z, this->y, this->x); - } - - template - inline const VEC3 _cvec4::_wyx() const - { - return VEC3(this->w, this->y, this->x); - } - - template - inline const VEC3 _cvec4::_xzx() const - { - return VEC3(this->x, this->z, this->x); - } - - template - inline const VEC3 _cvec4::_yzx() const - { - return VEC3(this->y, this->z, this->x); - } - - template - inline const VEC3 _cvec4::_zzx() const - { - return VEC3(this->z, this->z, this->x); - } - - template - inline const VEC3 _cvec4::_wzx() const - { - return VEC3(this->w, this->z, this->x); - } - - template - inline const VEC3 _cvec4::_xwx() const - { - return VEC3(this->x, this->w, this->x); - } - - template - inline const VEC3 _cvec4::_ywx() const - { - return VEC3(this->y, this->w, this->x); - } - - template - inline const VEC3 _cvec4::_zwx() const - { - return VEC3(this->z, this->w, this->x); - } - - template - inline const VEC3 _cvec4::_wwx() const - { - return VEC3(this->w, this->w, this->x); - } - - template - inline const VEC3 _cvec4::_xxy() const - { - return VEC3(this->x, this->x, this->y); - } - - template - inline const VEC3 _cvec4::_yxy() const - { - return VEC3(this->y, this->x, this->y); - } - - template - inline const VEC3 _cvec4::_zxy() const - { - return VEC3(this->z, this->x, this->y); - } - - template - inline const VEC3 _cvec4::_wxy() const - { - return VEC3(this->w, this->x, this->y); - } - - template - inline const VEC3 _cvec4::_xyy() const - { - return VEC3(this->x, this->y, this->y); - } - - template - inline const VEC3 _cvec4::_yyy() const - { - return VEC3(this->y, this->y, this->y); - } - - template - inline const VEC3 _cvec4::_zyy() const - { - return VEC3(this->z, this->y, this->y); - } - - template - inline const VEC3 _cvec4::_wyy() const - { - return VEC3(this->w, this->y, this->y); - } - - template - inline const VEC3 _cvec4::_xzy() const - { - return VEC3(this->x, this->z, this->y); - } - - template - inline const VEC3 _cvec4::_yzy() const - { - return VEC3(this->y, this->z, this->y); - } - - template - inline const VEC3 _cvec4::_zzy() const - { - return VEC3(this->z, this->z, this->y); - } - - template - inline const VEC3 _cvec4::_wzy() const - { - return VEC3(this->w, this->z, this->y); - } - - template - inline const VEC3 _cvec4::_xwy() const - { - return VEC3(this->x, this->w, this->y); - } - - template - inline const VEC3 _cvec4::_ywy() const - { - return VEC3(this->y, this->w, this->y); - } - - template - inline const VEC3 _cvec4::_zwy() const - { - return VEC3(this->z, this->w, this->y); - } - - template - inline const VEC3 _cvec4::_wwy() const - { - return VEC3(this->w, this->w, this->y); - } - - template - inline const VEC3 _cvec4::_xxz() const - { - return VEC3(this->x, this->x, this->z); - } - - template - inline const VEC3 _cvec4::_yxz() const - { - return VEC3(this->y, this->x, this->z); - } - - template - inline const VEC3 _cvec4::_zxz() const - { - return VEC3(this->z, this->x, this->z); - } - - template - inline const VEC3 _cvec4::_wxz() const - { - return VEC3(this->w, this->x, this->z); - } - - template - inline const VEC3 _cvec4::_xyz() const - { - return VEC3(this->x, this->y, this->z); - } - - template - inline const VEC3 _cvec4::_yyz() const - { - return VEC3(this->y, this->y, this->z); - } - - template - inline const VEC3 _cvec4::_zyz() const - { - return VEC3(this->z, this->y, this->z); - } - - template - inline const VEC3 _cvec4::_wyz() const - { - return VEC3(this->w, this->y, this->z); - } - - template - inline const VEC3 _cvec4::_xzz() const - { - return VEC3(this->x, this->z, this->z); - } - - template - inline const VEC3 _cvec4::_yzz() const - { - return VEC3(this->y, this->z, this->z); - } - - template - inline const VEC3 _cvec4::_zzz() const - { - return VEC3(this->z, this->z, this->z); - } - - template - inline const VEC3 _cvec4::_wzz() const - { - return VEC3(this->w, this->z, this->z); - } - - template - inline const VEC3 _cvec4::_xwz() const - { - return VEC3(this->x, this->w, this->z); - } - - template - inline const VEC3 _cvec4::_ywz() const - { - return VEC3(this->y, this->w, this->z); - } - - template - inline const VEC3 _cvec4::_zwz() const - { - return VEC3(this->z, this->w, this->z); - } - - template - inline const VEC3 _cvec4::_wwz() const - { - return VEC3(this->w, this->w, this->z); - } - - template - inline const VEC3 _cvec4::_xxw() const - { - return VEC3(this->x, this->x, this->w); - } - - template - inline const VEC3 _cvec4::_yxw() const - { - return VEC3(this->y, this->x, this->w); - } - - template - inline const VEC3 _cvec4::_zxw() const - { - return VEC3(this->z, this->x, this->w); - } - - template - inline const VEC3 _cvec4::_wxw() const - { - return VEC3(this->w, this->x, this->w); - } - - template - inline const VEC3 _cvec4::_xyw() const - { - return VEC3(this->x, this->y, this->w); - } - - template - inline const VEC3 _cvec4::_yyw() const - { - return VEC3(this->y, this->y, this->w); - } - - template - inline const VEC3 _cvec4::_zyw() const - { - return VEC3(this->z, this->y, this->w); - } - - template - inline const VEC3 _cvec4::_wyw() const - { - return VEC3(this->w, this->y, this->w); - } - - template - inline const VEC3 _cvec4::_xzw() const - { - return VEC3(this->x, this->z, this->w); - } - - template - inline const VEC3 _cvec4::_yzw() const - { - return VEC3(this->y, this->z, this->w); - } - - template - inline const VEC3 _cvec4::_zzw() const - { - return VEC3(this->z, this->z, this->w); - } - - template - inline const VEC3 _cvec4::_wzw() const - { - return VEC3(this->w, this->z, this->w); - } - - template - inline const VEC3 _cvec4::_xww() const - { - return VEC3(this->x, this->w, this->w); - } - - template - inline const VEC3 _cvec4::_yww() const - { - return VEC3(this->y, this->w, this->w); - } - - template - inline const VEC3 _cvec4::_zww() const - { - return VEC3(this->z, this->w, this->w); - } - - template - inline const VEC3 _cvec4::_www() const - { - return VEC3(this->w, this->w, this->w); - } - - // Left hand side 4 components swizzles operators - template - inline REF4 _cvec4::_wzyx() - { - return REF4(this->w, this->z, this->y, this->x); - } - - template - inline REF4 _cvec4::_zwyx() - { - return REF4(this->z, this->w, this->y, this->x); - } - - template - inline REF4 _cvec4::_wyzx() - { - return REF4(this->w, this->y, this->z, this->x); - } - - template - inline REF4 _cvec4::_ywzx() - { - return REF4(this->y, this->w, this->z, this->x); - } - - template - inline REF4 _cvec4::_zywx() - { - return REF4(this->z, this->y, this->w, this->x); - } - - template - inline REF4 _cvec4::_yzwx() - { - return REF4(this->y, this->z, this->w, this->x); - } - - template - inline REF4 _cvec4::_wzxy() - { - return REF4(this->w, this->z, this->x, this->y); - } - - template - inline REF4 _cvec4::_zwxy() - { - return REF4(this->z, this->w, this->x, this->y); - } - - template - inline REF4 _cvec4::_wxzy() - { - return REF4(this->w, this->x, this->z, this->y); - } - - template - inline REF4 _cvec4::_xwzy() - { - return REF4(this->x, this->w, this->z, this->y); - } - - template - inline REF4 _cvec4::_zxwy() - { - return REF4(this->z, this->x, this->w, this->y); - } - - template - inline REF4 _cvec4::_xzwy() - { - return REF4(this->x, this->z, this->w, this->y); - } - - template - inline REF4 _cvec4::_wyxz() - { - return REF4(this->w, this->y, this->x, this->z); - } - - template - inline REF4 _cvec4::_ywxz() - { - return REF4(this->y, this->w, this->x, this->z); - } - - template - inline REF4 _cvec4::_wxyz() - { - return REF4(this->w, this->x, this->y, this->z); - } - - template - inline REF4 _cvec4::_xwyz() - { - return REF4(this->x, this->w, this->y, this->z); - } - - template - inline REF4 _cvec4::_yxwz() - { - return REF4(this->y, this->x, this->w, this->z); - } - - template - inline REF4 _cvec4::_xywz() - { - return REF4(this->x, this->y, this->w, this->z); - } - - template - inline REF4 _cvec4::_zyxw() - { - return REF4(this->z, this->y, this->x, this->w); - } - - template - inline REF4 _cvec4::_yzxw() - { - return REF4(this->y, this->z, this->x, this->w); - } - - template - inline REF4 _cvec4::_zxyw() - { - return REF4(this->z, this->x, this->y, this->w); - } - - template - inline REF4 _cvec4::_xzyw() - { - return REF4(this->x, this->z, this->y, this->w); - } - - template - inline REF4 _cvec4::_yxzw() - { - return REF4(this->y, this->x, this->z, this->w); - } - - template - inline REF4 _cvec4::_xyzw() - { - return REF4(this->x, this->y, this->z, this->w); - } - - // Right hand side 4 components swizzles operators - template - inline const VEC4 _cvec4::_xxxx() const - { - return _cvec4(this->x, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_yxxx() const - { - return _cvec4(this->y, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_zxxx() const - { - return _cvec4(this->z, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_wxxx() const - { - return _cvec4(this->w, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_xyxx() const - { - return _cvec4(this->x, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_yyxx() const - { - return _cvec4(this->y, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_zyxx() const - { - return _cvec4(this->z, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_wyxx() const - { - return _cvec4(this->w, this->y, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_xzxx() const - { - return _cvec4(this->x, this->z, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_yzxx() const - { - return _cvec4(this->y, this->z, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_zzxx() const - { - return _cvec4(this->z, this->z, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_wzxx() const - { - return _cvec4(this->w, this->z, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_xwxx() const - { - return _cvec4(this->x, this->w, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_ywxx() const - { - return _cvec4(this->y, this->w, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_zwxx() const - { - return _cvec4(this->z, this->w, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_wwxx() const - { - return _cvec4(this->w, this->w, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_xxyx() const - { - return _cvec4(this->x, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_yxyx() const - { - return _cvec4(this->y, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_zxyx() const - { - return _cvec4(this->z, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_wxyx() const - { - return _cvec4(this->w, this->x, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_xyyx() const - { - return _cvec4(this->x, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_yyyx() const - { - return _cvec4(this->y, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_zyyx() const - { - return _cvec4(this->z, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_wyyx() const - { - return _cvec4(this->w, this->y, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_xzyx() const - { - return _cvec4(this->x, this->z, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_yzyx() const - { - return _cvec4(this->y, this->z, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_zzyx() const - { - return _cvec4(this->z, this->z, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_wzyx() const - { - return _cvec4(this->w, this->z, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_xwyx() const - { - return _cvec4(this->x, this->w, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_ywyx() const - { - return _cvec4(this->y, this->w, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_zwyx() const - { - return _cvec4(this->z, this->w, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_wwyx() const - { - return _cvec4(this->w, this->w, this->y, this->x); - } - - template - inline const VEC4 _cvec4::_xxzx() const - { - return _cvec4(this->x, this->x, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_yxzx() const - { - return _cvec4(this->y, this->x, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_zxzx() const - { - return _cvec4(this->z, this->x, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_wxzx() const - { - return _cvec4(this->w, this->x, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_xyzx() const - { - return _cvec4(this->x, this->y, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_yyzx() const - { - return _cvec4(this->y, this->y, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_zyzx() const - { - return _cvec4(this->z, this->y, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_wyzx() const - { - return _cvec4(this->w, this->y, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_xzzx() const - { - return _cvec4(this->x, this->z, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_yzzx() const - { - return _cvec4(this->y, this->z, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_zzzx() const - { - return _cvec4(this->z, this->z, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_wzzx() const - { - return _cvec4(this->w, this->z, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_xwzx() const - { - return _cvec4(this->x, this->w, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_ywzx() const - { - return _cvec4(this->y, this->w, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_zwzx() const - { - return _cvec4(this->z, this->w, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_wwzx() const - { - return _cvec4(this->w, this->w, this->z, this->x); - } - - template - inline const VEC4 _cvec4::_xxwx() const - { - return _cvec4(this->x, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_yxwx() const - { - return _cvec4(this->y, this->x, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_zxwx() const - { - return _cvec4(this->z, this->x, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_wxwx() const - { - return _cvec4(this->w, this->x, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_xywx() const - { - return _cvec4(this->x, this->y, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_yywx() const - { - return _cvec4(this->y, this->y, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_zywx() const - { - return _cvec4(this->z, this->y, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_wywx() const - { - return _cvec4(this->w, this->y, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_xzwx() const - { - return _cvec4(this->x, this->z, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_yzwx() const - { - return _cvec4(this->y, this->z, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_zzwx() const - { - return _cvec4(this->z, this->z, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_wzwx() const - { - return _cvec4(this->w, this->z, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_xwwx() const - { - return _cvec4(this->x, this->w, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_ywwx() const - { - return _cvec4(this->y, this->w, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_zwwx() const - { - return _cvec4(this->z, this->w, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_wwwx() const - { - return _cvec4(this->w, this->w, this->w, this->x); - } - - template - inline const VEC4 _cvec4::_xxxy() const - { - return _cvec4(this->x, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_yxxy() const - { - return _cvec4(this->y, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_zxxy() const - { - return _cvec4(this->z, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_wxxy() const - { - return _cvec4(this->w, this->x, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_xyxy() const - { - return _cvec4(this->x, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_yyxy() const - { - return _cvec4(this->y, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_zyxy() const - { - return _cvec4(this->z, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_wyxy() const - { - return _cvec4(this->w, this->y, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_xzxy() const - { - return _cvec4(this->x, this->z, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_yzxy() const - { - return _cvec4(this->y, this->z, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_zzxy() const - { - return _cvec4(this->z, this->z, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_wzxy() const - { - return _cvec4(this->w, this->z, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_xwxy() const - { - return _cvec4(this->x, this->w, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_ywxy() const - { - return _cvec4(this->y, this->w, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_zwxy() const - { - return _cvec4(this->z, this->w, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_wwxy() const - { - return _cvec4(this->w, this->w, this->x, this->y); - } - - template - inline const VEC4 _cvec4::_xxyy() const - { - return _cvec4(this->x, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_yxyy() const - { - return _cvec4(this->y, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_zxyy() const - { - return _cvec4(this->z, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_wxyy() const - { - return _cvec4(this->w, this->x, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_xyyy() const - { - return _cvec4(this->x, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_yyyy() const - { - return _cvec4(this->y, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_zyyy() const - { - return _cvec4(this->z, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_wyyy() const - { - return _cvec4(this->w, this->y, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_xzyy() const - { - return _cvec4(this->x, this->z, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_yzyy() const - { - return _cvec4(this->y, this->z, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_zzyy() const - { - return _cvec4(this->z, this->z, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_wzyy() const - { - return _cvec4(this->w, this->z, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_xwyy() const - { - return _cvec4(this->x, this->w, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_ywyy() const - { - return _cvec4(this->y, this->w, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_zwyy() const - { - return _cvec4(this->z, this->w, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_wwyy() const - { - return _cvec4(this->w, this->w, this->y, this->y); - } - - template - inline const VEC4 _cvec4::_xxzy() const - { - return _cvec4(this->x, this->x, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_yxzy() const - { - return _cvec4(this->y, this->x, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_zxzy() const - { - return _cvec4(this->z, this->x, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_wxzy() const - { - return _cvec4(this->w, this->x, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_xyzy() const - { - return _cvec4(this->x, this->y, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_yyzy() const - { - return _cvec4(this->y, this->y, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_zyzy() const - { - return _cvec4(this->z, this->y, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_wyzy() const - { - return _cvec4(this->w, this->y, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_xzzy() const - { - return _cvec4(this->x, this->z, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_yzzy() const - { - return _cvec4(this->y, this->z, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_zzzy() const - { - return _cvec4(this->z, this->z, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_wzzy() const - { - return _cvec4(this->w, this->z, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_xwzy() const - { - return _cvec4(this->x, this->w, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_ywzy() const - { - return _cvec4(this->y, this->w, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_zwzy() const - { - return _cvec4(this->z, this->w, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_wwzy() const - { - return _cvec4(this->w, this->w, this->z, this->y); - } - - template - inline const VEC4 _cvec4::_xxwy() const - { - return _cvec4(this->x, this->x, this->x, this->x); - } - - template - inline const VEC4 _cvec4::_yxwy() const - { - return _cvec4(this->y, this->x, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_zxwy() const - { - return _cvec4(this->z, this->x, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_wxwy() const - { - return _cvec4(this->w, this->x, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_xywy() const - { - return _cvec4(this->x, this->y, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_yywy() const - { - return _cvec4(this->y, this->y, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_zywy() const - { - return _cvec4(this->z, this->y, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_wywy() const - { - return _cvec4(this->w, this->y, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_xzwy() const - { - return _cvec4(this->x, this->z, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_yzwy() const - { - return _cvec4(this->y, this->z, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_zzwy() const - { - return _cvec4(this->z, this->z, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_wzwy() const - { - return _cvec4(this->w, this->z, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_xwwy() const - { - return _cvec4(this->x, this->w, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_ywwy() const - { - return _cvec4(this->y, this->w, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_zwwy() const - { - return _cvec4(this->z, this->w, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_wwwy() const - { - return _cvec4(this->w, this->w, this->w, this->y); - } - - template - inline const VEC4 _cvec4::_xxxz() const - { - return _cvec4(this->x, this->x, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_yxxz() const - { - return _cvec4(this->y, this->x, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_zxxz() const - { - return _cvec4(this->z, this->x, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_wxxz() const - { - return _cvec4(this->w, this->x, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_xyxz() const - { - return _cvec4(this->x, this->y, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_yyxz() const - { - return _cvec4(this->y, this->y, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_zyxz() const - { - return _cvec4(this->z, this->y, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_wyxz() const - { - return _cvec4(this->w, this->y, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_xzxz() const - { - return _cvec4(this->x, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_yzxz() const - { - return _cvec4(this->y, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_zzxz() const - { - return _cvec4(this->z, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_wzxz() const - { - return _cvec4(this->w, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_xwxz() const - { - return _cvec4(this->x, this->w, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_ywxz() const - { - return _cvec4(this->y, this->w, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_zwxz() const - { - return _cvec4(this->z, this->w, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_wwxz() const - { - return _cvec4(this->w, this->w, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_xxyz() const - { - return _cvec4(this->x, this->x, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_yxyz() const - { - return _cvec4(this->y, this->x, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_zxyz() const - { - return _cvec4(this->z, this->x, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_wxyz() const - { - return _cvec4(this->w, this->x, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_xyyz() const - { - return _cvec4(this->x, this->y, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_yyyz() const - { - return _cvec4(this->y, this->y, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_zyyz() const - { - return _cvec4(this->z, this->y, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_wyyz() const - { - return _cvec4(this->w, this->y, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_xzyz() const - { - return _cvec4(this->x, this->z, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_yzyz() const - { - return _cvec4(this->y, this->z, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_zzyz() const - { - return _cvec4(this->z, this->z, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_wzyz() const - { - return _cvec4(this->w, this->z, this->x, this->z); - } - - template - inline const VEC4 _cvec4::_xwyz() const - { - return _cvec4(this->x, this->w, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_ywyz() const - { - return _cvec4(this->y, this->w, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_zwyz() const - { - return _cvec4(this->z, this->w, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_wwyz() const - { - return _cvec4(this->w, this->w, this->y, this->z); - } - - template - inline const VEC4 _cvec4::_xxzz() const - { - return _cvec4(this->x, this->x, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_yxzz() const - { - return _cvec4(this->y, this->x, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_zxzz() const - { - return _cvec4(this->z, this->x, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_wxzz() const - { - return _cvec4(this->w, this->x, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_xyzz() const - { - return _cvec4(this->x, this->y, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_yyzz() const - { - return _cvec4(this->y, this->y, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_zyzz() const - { - return _cvec4(this->z, this->y, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_wyzz() const - { - return _cvec4(this->w, this->y, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_xzzz() const - { - return _cvec4(this->x, this->z, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_yzzz() const - { - return _cvec4(this->y, this->z, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_zzzz() const - { - return _cvec4(this->z, this->z, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_wzzz() const - { - return _cvec4(this->w, this->z, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_xwzz() const - { - return _cvec4(this->x, this->w, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_ywzz() const - { - return _cvec4(this->y, this->w, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_zwzz() const - { - return _cvec4(this->z, this->w, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_wwzz() const - { - return _cvec4(this->w, this->w, this->z, this->z); - } - - template - inline const VEC4 _cvec4::_xxwz() const - { - return _cvec4(this->x, this->x, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_yxwz() const - { - return _cvec4(this->y, this->x, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_zxwz() const - { - return _cvec4(this->z, this->x, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_wxwz() const - { - return _cvec4(this->w, this->x, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_xywz() const - { - return _cvec4(this->x, this->y, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_yywz() const - { - return _cvec4(this->y, this->y, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_zywz() const - { - return _cvec4(this->z, this->y, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_wywz() const - { - return _cvec4(this->w, this->y, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_xzwz() const - { - return _cvec4(this->x, this->z, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_yzwz() const - { - return _cvec4(this->y, this->z, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_zzwz() const - { - return _cvec4(this->z, this->z, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_wzwz() const - { - return _cvec4(this->w, this->z, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_xwwz() const - { - return _cvec4(this->x, this->w, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_ywwz() const - { - return _cvec4(this->y, this->w, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_zwwz() const - { - return _cvec4(this->z, this->w, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_wwwz() const - { - return _cvec4(this->w, this->w, this->w, this->z); - } - - template - inline const VEC4 _cvec4::_xxxw() const - { - return _cvec4(this->x, this->x, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_yxxw() const - { - return _cvec4(this->y, this->x, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_zxxw() const - { - return _cvec4(this->z, this->x, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_wxxw() const - { - return _cvec4(this->w, this->x, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_xyxw() const - { - return _cvec4(this->x, this->y, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_yyxw() const - { - return _cvec4(this->y, this->y, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_zyxw() const - { - return _cvec4(this->z, this->y, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_wyxw() const - { - return _cvec4(this->w, this->y, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_xzxw() const - { - return _cvec4(this->x, this->z, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_yzxw() const - { - return _cvec4(this->y, this->z, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_zzxw() const - { - return _cvec4(this->z, this->z, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_wzxw() const - { - return _cvec4(this->w, this->z, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_xwxw() const - { - return _cvec4(this->x, this->w, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_ywxw() const - { - return _cvec4(this->y, this->w, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_zwxw() const - { - return _cvec4(this->z, this->w, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_wwxw() const - { - return _cvec4(this->w, this->w, this->x, this->w); - } - - template - inline const VEC4 _cvec4::_xxyw() const - { - return _cvec4(this->x, this->x, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_yxyw() const - { - return _cvec4(this->y, this->x, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_zxyw() const - { - return _cvec4(this->z, this->x, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_wxyw() const - { - return _cvec4(this->w, this->x, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_xyyw() const - { - return _cvec4(this->x, this->y, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_yyyw() const - { - return _cvec4(this->y, this->y, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_zyyw() const - { - return _cvec4(this->z, this->y, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_wyyw() const - { - return _cvec4(this->w, this->y, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_xzyw() const - { - return _cvec4(this->x, this->z, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_yzyw() const - { - return _cvec4(this->y, this->z, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_zzyw() const - { - return _cvec4(this->z, this->z, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_wzyw() const - { - return _cvec4(this->w, this->z, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_xwyw() const - { - return _cvec4(this->x, this->w, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_ywyw() const - { - return _cvec4(this->y, this->w, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_zwyw() const - { - return _cvec4(this->z, this->w, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_wwyw() const - { - return _cvec4(this->w, this->w, this->y, this->w); - } - - template - inline const VEC4 _cvec4::_xxzw() const - { - return _cvec4(this->x, this->x, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_yxzw() const - { - return _cvec4(this->y, this->x, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_zxzw() const - { - return _cvec4(this->z, this->x, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_wxzw() const - { - return _cvec4(this->w, this->x, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_xyzw() const - { - return _cvec4(this->x, this->y, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_yyzw() const - { - return _cvec4(this->y, this->y, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_zyzw() const - { - return _cvec4(this->z, this->y, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_wyzw() const - { - return _cvec4(this->w, this->y, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_xzzw() const - { - return _cvec4(this->x, this->z, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_yzzw() const - { - return _cvec4(this->y, this->z, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_zzzw() const - { - return _cvec4(this->z, this->z, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_wzzw() const - { - return _cvec4(this->w, this->z, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_xwzw() const - { - return _cvec4(this->x, this->w, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_ywzw() const - { - return _cvec4(this->y, this->w, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_zwzw() const - { - return _cvec4(this->z, this->w, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_wwzw() const - { - return _cvec4(this->w, this->w, this->z, this->w); - } - - template - inline const VEC4 _cvec4::_xxww() const - { - return _cvec4(this->x, this->x, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_yxww() const - { - return _cvec4(this->y, this->x, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_zxww() const - { - return _cvec4(this->z, this->x, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_wxww() const - { - return _cvec4(this->w, this->x, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_xyww() const - { - return _cvec4(this->x, this->y, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_yyww() const - { - return _cvec4(this->y, this->y, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_zyww() const - { - return _cvec4(this->z, this->y, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_wyww() const - { - return _cvec4(this->w, this->y, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_xzww() const - { - return _cvec4(this->x, this->z, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_yzww() const - { - return _cvec4(this->y, this->z, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_zzww() const - { - return _cvec4(this->z, this->z, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_wzww() const - { - return _cvec4(this->w, this->z, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_xwww() const - { - return _cvec4(this->x, this->w, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_ywww() const - { - return _cvec4(this->y, this->w, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_zwww() const - { - return _cvec4(this->z, this->w, this->w, this->w); - } - - template - inline const VEC4 _cvec4::_wwww() const - { - return _cvec4(this->w, this->w, this->w, this->w); - } -#endif //defined(GLM_SWIZZLE) - -} //namespace detail -} //namespace glm - -#endif//__cvec4_inl__ diff --git a/experimental/sse/glm/core/_cvecx.h b/experimental/sse/glm/core/_cvecx.h deleted file mode 100644 index 41c74b83..00000000 --- a/experimental/sse/glm/core/_cvecx.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2007 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-15 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_cvecx.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_cvecx_h__ -#define __glm_core_cvecx_h__ - -#define CVEC2_TYPE T, VEC2, VEC3, VEC4, REF2 -#define CVEC3_TYPE T, VEC2, VEC3, VEC4, REF2, REF3 -#define CVEC4_TYPE T, VEC2, VEC3, VEC4, REF2, REF3, REF4 - -#define CVEC2_LIST typename T, typename VEC2, typename VEC3, typename VEC4, typename REF2 -#define CVEC3_LIST typename T, typename VEC2, typename VEC3, typename VEC4, typename REF2, typename REF3 -#define CVEC4_LIST typename T, typename VEC2, typename VEC3, typename VEC4, typename REF2, typename REF3, typename REF4 - -#define XVEC2_INST T, _xvec2, _xvec3, _xvec4, _xref2 -#define XVEC3_INST T, _xvec2, _xvec3, _xvec4, _xref2, _xref3 -#define XVEC4_INST T, _xvec2, _xvec3, _xvec4, _xref2, _xref3, _xref4 - -#define BVEC2_INST bool, _bvec2, _bvec3, _bvec4, _xref2 -#define BVEC3_INST bool, _bvec2, _bvec3, _bvec4, _xref2, _xref3 -#define BVEC4_INST bool, _bvec2, _bvec3, _bvec4, _xref2, _xref3, _xref4 - -#define HVEC2_INST hdata, _hvec2GTX, _hvec3GTX, _hvec4GTX, _xref2 -#define HVEC3_INST hdata, _hvec2GTX, _hvec3GTX, _hvec4GTX, _xref2, _xref3 -#define HVEC4_INST hdata, _hvec2GTX, _hvec3GTX, _hvec4GTX, _xref2, _xref3, _xref4 - -#define _xvec2_base(T) _cvec2, _xvec3, _xvec4, _xref2 > -#define _xvec3_base(T) _cvec3, _xvec3, _xvec4, _xref2, _xref3 > -#define _xvec4_base(T) _cvec4, _xvec3, _xvec4, _xref2, _xref3, _xref4 > - -namespace glm{ -namespace detail{ - - template class _xref2; //!< \dontinclude - template class _xref3; //!< \dontinclude - template class _xref4; //!< \dontinclude - - template class _xvec2; //!< \dontinclude - template class _xvec3; //!< \dontinclude - template class _xvec4; //!< \dontinclude - - class _bvec2; //!< \dontinclude - class _bvec3; //!< \dontinclude - class _bvec4; //!< \dontinclude -} //namespace detail -} //namespace glm - -#endif//__glm_core_cvecx_h__ diff --git a/experimental/sse/glm/core/_func.h b/experimental/sse/glm/core/_func.h deleted file mode 100644 index 070b189d..00000000 --- a/experimental/sse/glm/core/_func.h +++ /dev/null @@ -1,359 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-12 -// Updated : 2007-01-05 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_func.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_func__ -#define __glm_func__ - -#include "./_xvec2.h" -#include "./_xvec3.h" -#include "./_xvec4.h" -#include "./_bvec2.h" -#include "./_bvec3.h" -#include "./_bvec4.h" -#include "./_xmat2.h" -#include "./_xmat3.h" -#include "./_xmat4.h" -#include "./_xmat2x3.h" -#include "./_xmat3x2.h" -#include "./_xmat2x4.h" -#include "./_xmat4x2.h" -#include "./_xmat3x4.h" -#include "./_xmat4x3.h" -/* -#ifdef WIN32 -#pragma warning (disable : 4244) -#endif //WIN32 -*/ -namespace glm -{ - //////////////////////////////////////////////////////////////////////// - // Trigonometric Functions - - template T radians(T degrees); //!< \brief Converts degrees to radians and returns the result. (From GLSL 1.10.59 specification) - template detail::_xvec2 radians(const detail::_xvec2& degrees); //!< \brief Converts degrees to radians and returns the result. (From GLSL 1.10.59 specification) - template detail::_xvec3 radians(const detail::_xvec3& degrees); //!< \brief Converts degrees to radians and returns the result. (From GLSL 1.10.59 specification) - template detail::_xvec4 radians(const detail::_xvec4& degrees); //!< \brief Converts degrees to radians and returns the result. (From GLSL 1.10.59 specification) - - template T degrees(T radians); //!< \brief Converts radians to degrees and returns the result. (From GLSL 1.10.59 specification) - template detail::_xvec2 degrees(const detail::_xvec2& radians); //!< \brief Converts radians to degrees and returns the result. (From GLSL 1.10.59 specification) - template detail::_xvec3 degrees(const detail::_xvec3& radians); //!< \brief Converts radians to degrees and returns the result. (From GLSL 1.10.59 specification) - template detail::_xvec4 degrees(const detail::_xvec4& radians); //!< \brief Converts radians to degrees and returns the result. (From GLSL 1.10.59 specification) - - template T sin(T angle); //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - template detail::_xvec2 sin(const detail::_xvec2& angle); //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - template detail::_xvec3 sin(const detail::_xvec3& angle); //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - template detail::_xvec4 sin(const detail::_xvec4& angle); //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - - template T cos(T angle); //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - template detail::_xvec2 cos(const detail::_xvec2& angle); //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - template detail::_xvec3 cos(const detail::_xvec3& angle); //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - template detail::_xvec4 cos(const detail::_xvec4& angle); //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLSL 1.10.59 specification) - - template T tan(T angle); //!< \brief The standard trigonometric tangent function. (From GLSL 1.10.59 specification) - template detail::_xvec2 tan(const detail::_xvec2& angle); //!< \brief The standard trigonometric tangent function. (From GLSL 1.10.59 specification) - template detail::_xvec3 tan(const detail::_xvec3& angle); //!< \brief The standard trigonometric tangent function. (From GLSL 1.10.59 specification) - template detail::_xvec4 tan(const detail::_xvec4& angle); //!< \brief The standard trigonometric tangent function. (From GLSL 1.10.59 specification) - - template T asin(T x); //!< \brief Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - template detail::_xvec2 asin(const detail::_xvec2& x); //!< \brief Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - template detail::_xvec3 asin(const detail::_xvec3& x); //!< \brief Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - template detail::_xvec4 asin(const detail::_xvec4& x); //!< \brief Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - - template T acos(T x); //!< \brief Arc cosine. Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - template detail::_xvec2 acos(const detail::_xvec2& x); //!< \brief Arc cosine. Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - template detail::_xvec3 acos(const detail::_xvec3& x); //!< \brief Arc cosine. Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - template detail::_xvec4 acos(const detail::_xvec4& x); //!< \brief Arc cosine. Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLSL 1.10.59 specification) - - template T atan(T y, T x); //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLSL 1.10.59 specification) - template detail::_xvec2 atan(const detail::_xvec2& y, const detail::_xvec2& x); //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLSL 1.10.59 specification) - template detail::_xvec3 atan(const detail::_xvec3& y, const detail::_xvec3& x); //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLSL 1.10.59 specification) - template detail::_xvec4 atan(const detail::_xvec4& y, const detail::_xvec4& x); //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLSL 1.10.59 specification) - - template T atan(T y_over_x); //!< \brief Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLSL 1.10.59 specification) - template detail::_xvec2 atan(const detail::_xvec2& y_over_x); //!< \brief Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLSL 1.10.59 specification) - template detail::_xvec3 atan(const detail::_xvec3& y_over_x); //!< \brief Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLSL 1.10.59 specification) - template detail::_xvec4 atan(const detail::_xvec4& y_over_x); //!< \brief Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLSL 1.10.59 specification) - - //////////////////////////////////////////////////////////////////////// - // Exponential Functions - - template T pow(T x, T y); //!< \brief Returns x raised to the y power. (From GLSL 1.10.59 specification) - template detail::_xvec2 pow(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns x raised to the y power. (From GLSL 1.10.59 specification) - template detail::_xvec3 pow(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns x raised to the y power. (From GLSL 1.10.59 specification) - template detail::_xvec4 pow(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns x raised to the y power. (From GLSL 1.10.59 specification) - - template T exp(T x); //!< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLSL 1.10.59 specification) - template detail::_xvec2 exp(const detail::_xvec2& x); //!< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLSL 1.10.59 specification) - template detail::_xvec3 exp(const detail::_xvec3& x); //!< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLSL 1.10.59 specification) - template detail::_xvec4 exp(const detail::_xvec4& x); //!< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLSL 1.10.59 specification) - - template T log(T x); //!< \brief Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y. Results are undefined if x <= 0. (From GLSL 1.10.59 specification) - template detail::_xvec2 log(const detail::_xvec2& x); //!< \brief Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y. Results are undefined if x <= 0. (From GLSL 1.10.59 specification) - template detail::_xvec3 log(const detail::_xvec3& x); //!< \brief Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y. Results are undefined if x <= 0. (From GLSL 1.10.59 specification) - template detail::_xvec4 log(const detail::_xvec4& x); //!< \brief Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y. Results are undefined if x <= 0. (From GLSL 1.10.59 specification) - - template T exp2(T x); //!< \brief Returns 2 raised to the x power. (From GLSL 1.10.59 specification) - template detail::_xvec2 exp2(const detail::_xvec2& x); //!< \brief Returns 2 raised to the x power. (From GLSL 1.10.59 specification) - template detail::_xvec3 exp2(const detail::_xvec3& x); //!< \brief Returns 2 raised to the x power. (From GLSL 1.10.59 specification) - template detail::_xvec4 exp2(const detail::_xvec4& x); //!< \brief Returns 2 raised to the x power. (From GLSL 1.10.59 specification) - - template T log2(T x); //!< \brief Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. (From GLSL 1.10.59 specification) - template detail::_xvec2 log2(const detail::_xvec2& x); //!< \brief Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. (From GLSL 1.10.59 specification) - template detail::_xvec3 log2(const detail::_xvec3& x); //!< \brief Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. (From GLSL 1.10.59 specification) - template detail::_xvec4 log2(const detail::_xvec4& x); //!< \brief Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. (From GLSL 1.10.59 specification) - - template T sqrt(T x); //!< \brief Returns the positive square root of x. (From GLSL 1.10.59 specification) - template detail::_xvec2 sqrt(const detail::_xvec2& x); //!< \brief Returns the positive square root of x. (From GLSL 1.10.59 specification) - template detail::_xvec3 sqrt(const detail::_xvec3& x); //!< \brief Returns the positive square root of x. (From GLSL 1.10.59 specification) - template detail::_xvec4 sqrt(const detail::_xvec4& x); //!< \brief Returns the positive square root of x. (From GLSL 1.10.59 specification) - - template T inversesqrt(T x); //!< \brief Returns the reciprocal of the positive square root of x. (From GLSL 1.10.59 specification) - template detail::_xvec2 inversesqrt(const detail::_xvec2& x); //!< \brief Returns the reciprocal of the positive square root of x. (From GLSL 1.10.59 specification) - template detail::_xvec3 inversesqrt(const detail::_xvec3& x); //!< \brief Returns the reciprocal of the positive square root of x. (From GLSL 1.10.59 specification) - template detail::_xvec4 inversesqrt(const detail::_xvec4& x); //!< \brief Returns the reciprocal of the positive square root of x. (From GLSL 1.10.59 specification) - - //////////////////////////////////////////////////////////////////////// - // Common Functions - - template T abs(T x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLSL 1.10.59 specification) - template detail::_xvec2 abs(const detail::_xvec2& x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLSL 1.10.59 specification) - template detail::_xvec3 abs(const detail::_xvec3& x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLSL 1.10.59 specification) - template detail::_xvec4 abs(const detail::_xvec4& x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLSL 1.10.59 specification) - - template T sign(T x); //!< \brief Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. (From GLSL 1.10.59 specification) - template detail::_xvec2 sign(const detail::_xvec2& x); //!< \brief Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. (From GLSL 1.10.59 specification) - template detail::_xvec3 sign(const detail::_xvec3& x); //!< \brief Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. (From GLSL 1.10.59 specification) - template detail::_xvec4 sign(const detail::_xvec4& x); //!< \brief Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. (From GLSL 1.10.59 specification) - - template T floor(T x); //!< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLSL 1.10.59 specification) - template detail::_xvec2 floor(const detail::_xvec2& x); //!< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLSL 1.10.59 specification) - template detail::_xvec3 floor(const detail::_xvec3& x); //!< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLSL 1.10.59 specification) - template detail::_xvec4 floor(const detail::_xvec4& x); //!< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLSL 1.10.59 specification) - - template T ceil(T x); //!< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLSL 1.10.59 specification) - template detail::_xvec2 ceil(const detail::_xvec2& x); //!< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLSL 1.10.59 specification) - template detail::_xvec3 ceil(const detail::_xvec3& x); //!< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLSL 1.10.59 specification) - template detail::_xvec4 ceil(const detail::_xvec4& x); //!< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLSL 1.10.59 specification) - - template T fract(T x); //!< \brief Return x - floor(x). (From GLSL 1.10.59 specification) - template detail::_xvec2 fract(const detail::_xvec2& x); //!< \brief Return x - floor(x). (From GLSL 1.10.59 specification) - template detail::_xvec3 fract(const detail::_xvec3& x); //!< \brief Return x - floor(x). (From GLSL 1.10.59 specification) - template detail::_xvec4 fract(const detail::_xvec4& x); //!< \brief Return x - floor(x). (From GLSL 1.10.59 specification) - - template T mod(T x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLSL 1.10.59 specification) - template detail::_xvec2 mod(const detail::_xvec2& x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLSL 1.10.59 specification) - template detail::_xvec3 mod(const detail::_xvec3& x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLSL 1.10.59 specification) - template detail::_xvec4 mod(const detail::_xvec4& x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLSL 1.10.59 specification) - template detail::_xvec2 mod(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the corresponding component of y. (From GLSL 1.10.59 specification) - template detail::_xvec3 mod(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the corresponding component of y. (From GLSL 1.10.59 specification) - template detail::_xvec4 mod(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the corresponding component of y. (From GLSL 1.10.59 specification) - - template T min(T x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec2 min(const detail::_xvec2& x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec3 min(const detail::_xvec3& x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec4 min(const detail::_xvec4& x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec2 min(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns minimum of each component of x compared with the floating-point value y. (From GLSL 1.10.59 specification) - template detail::_xvec3 min(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns minimum of each component of x compared with the floating-point value y. (From GLSL 1.10.59 specification) - template detail::_xvec4 min(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns minimum of each component of x compared with the floating-point value y. (From GLSL 1.10.59 specification) - - template T max(T x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec2 max(const detail::_xvec2& x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec3 max(const detail::_xvec3& x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec4 max(const detail::_xvec4& x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLSL 1.10.59 specification) - template detail::_xvec2 max(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns maximum of each component of x compared with the floating-point value y. (From GLSL 1.10.59 specification) - template detail::_xvec3 max(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns maximum of each component of x compared with the floating-point value y. (From GLSL 1.10.59 specification) - template detail::_xvec4 max(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns maximum of each component of x compared with the floating-point value y. (From GLSL 1.10.59 specification) - - template T clamp(T x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLSL 1.10.59 specification) - template detail::_xvec2 clamp(const detail::_xvec2& x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLSL 1.10.59 specification) - template detail::_xvec3 clamp(const detail::_xvec3& x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLSL 1.10.59 specification) - template detail::_xvec4 clamp(const detail::_xvec4& x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLSL 1.10.59 specification) - template detail::_xvec2 clamp(const detail::_xvec2& x, const detail::_xvec2& minVal, const detail::_xvec2& maxVal); //!< \brief Returns the component-wise result of min(max(x, minVal), maxVal). (From GLSL 1.10.59 specification) - template detail::_xvec3 clamp(const detail::_xvec3& x, const detail::_xvec3& minVal, const detail::_xvec3& maxVal); //!< \brief Returns the component-wise result of min(max(x, minVal), maxVal). (From GLSL 1.10.59 specification) - template detail::_xvec4 clamp(const detail::_xvec4& x, const detail::_xvec4& minVal, const detail::_xvec4& maxVal); //!< \brief Returns the component-wise result of min(max(x, minVal), maxVal). (From GLSL 1.10.59 specification) - - template T mix(const T& x, const T& y, const U& a); // Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) -/* - template T mix(T x, T y, T a); //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) - template _xvec2 mix(const _xvec2& x, const _xvec2& y, T a); //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) - template _xvec3 mix(const _xvec3& x, const _xvec3& y, T a); //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) - template _xvec4 mix(const _xvec4& x, const _xvec4& y, T a); //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) - template _xvec2 mix(const _xvec2& x, const _xvec2& y, const _xvec2& a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) - template _xvec3 mix(const _xvec3& x, const _xvec3& y, const _xvec3& a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) - template _xvec4 mix(const _xvec4& x, const _xvec4& y, const _xvec4& a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLSL 1.10.59 specification) -*/ - template T step(T edge, T x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLSL 1.10.59 specification) - template detail::_xvec2 step(T edge, const detail::_xvec2& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLSL 1.10.59 specification) - template detail::_xvec3 step(T edge, const detail::_xvec3& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLSL 1.10.59 specification) - template detail::_xvec4 step(T edge, const detail::_xvec4& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLSL 1.10.59 specification) - template detail::_xvec2 step(const detail::_xvec2& edge, const detail::_xvec2& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLSL 1.10.59 specification) - template detail::_xvec3 step(const detail::_xvec3& edge, const detail::_xvec3& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLSL 1.10.59 specification) - template detail::_xvec4 step(const detail::_xvec4& edge, const detail::_xvec4& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLSL 1.10.59 specification) - - template T smoothstep(T edge0, T edge1, T x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLSL 1.10.59 specification) - template detail::_xvec2 smoothstep(T edge0, T edge1, const detail::_xvec2& x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLSL 1.10.59 specification) - template detail::_xvec3 smoothstep(T edge0, T edge1, const detail::_xvec3& x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLSL 1.10.59 specification) - template detail::_xvec4 smoothstep(T edge0, T edge1, const detail::_xvec4& x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLSL 1.10.59 specification) - template detail::_xvec2 smoothstep(const detail::_xvec2& edge0, const detail::_xvec2& edge1, const detail::_xvec2& x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLSL 1.10.59 specification) - template detail::_xvec3 smoothstep(const detail::_xvec3& edge0, const detail::_xvec3& edge1, const detail::_xvec3& x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLSL 1.10.59 specification) - template detail::_xvec4 smoothstep(const detail::_xvec4& edge0, const detail::_xvec4& edge1, const detail::_xvec4& x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLSL 1.10.59 specification) - - //////////////////////////////////////////////////////////////////////// - // Geometric Functions - - template T length(T x); //!< \brief Returns the length of x, i.e., sqrt(x * x). (From GLSL 1.10.59 specification) - template T length(const detail::_xvec2& x); //!< \brief Returns the length of x, i.e., sqrt(x[0] * x[0] + x[1] * x[1]). (From GLSL 1.10.59 specification) - template T length(const detail::_xvec3& x); //!< \brief Returns the length of x, i.e., sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]). (From GLSL 1.10.59 specification) - template T length(const detail::_xvec4& x); //!< \brief Returns the length of x, i.e., sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2] + x[3] * x[3]). (From GLSL 1.10.59 specification) - - template T distance(const T p0, const T p1); //!< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLSL 1.10.59 specification) - template T distance(const detail::_xvec2& p0, const detail::_xvec2& p1); //!< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLSL 1.10.59 specification) - template T distance(const detail::_xvec3& p0, const detail::_xvec3& p1); //!< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLSL 1.10.59 specification) - template T distance(const detail::_xvec4& p0, const detail::_xvec4& p1); //!< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLSL 1.10.59 specification) - //template valType distance(const genType& p0, const genType& p1); //!< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLSL 1.10.59 specification) - - template T dot(T v1, T v2); //!< \brief Returns the dot product of x and y, i.e., result = x * y. (From GLSL 1.10.59 specification) - template T dot(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1]. (From GLSL 1.10.59 specification) - template T dot(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1] + x[2] * y[2]. (From GLSL 1.10.59 specification) - template T dot(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1] + x[2] * y[2] + x[3] * y[3]. (From GLSL 1.10.59 specification) - - template detail::_xvec3 cross(const detail::_xvec3& x, const detail::_xvec3& y); //!< brief Returns the cross product of x and y. (From GLSL 1.10.59 specification) - - template T normalize(T x); //!< \brief Returns a vector in the same direction as x but with length of 1. (From GLSL 1.10.59 specification) - template detail::_xvec2 normalize(const detail::_xvec2& x); //!< \brief Returns a vector in the same direction as x but with length of 1. (From GLSL 1.10.59 specification) - template detail::_xvec3 normalize(const detail::_xvec3& x); //!< \brief Returns a vector in the same direction as x but with length of 1. (From GLSL 1.10.59 specification) - template detail::_xvec4 normalize(const detail::_xvec4& x); //!< \brief Returns a vector in the same direction as x but with length of 1. (From GLSL 1.10.59 specification) - - //template genType faceforward(const genType& N, const genType& I, const genType& Nref); //!< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLSL 1.10.59 specification) - template T faceforward(T N, T I, T Nref); //!< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLSL 1.10.59 specification) - template detail::_xvec2 faceforward(const detail::_xvec2& N, const detail::_xvec2& I, const detail::_xvec2& Nref); //!< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLSL 1.10.59 specification) - template detail::_xvec3 faceforward(const detail::_xvec3& N, const detail::_xvec3& I, const detail::_xvec3& Nref); //!< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLSL 1.10.59 specification) - template detail::_xvec4 faceforward(const detail::_xvec4& N, const detail::_xvec4& I, const detail::_xvec4& Nref); //!< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLSL 1.10.59 specification) - - //template genType reflect(const genType& I, const genType& N); //!< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLSL 1.10.59 specification) - template T reflect(T I, T N); //!< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLSL 1.10.59 specification) - template detail::_xvec2 reflect(const detail::_xvec2& I, const detail::_xvec2& N); //!< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLSL 1.10.59 specification) - template detail::_xvec3 reflect(const detail::_xvec3& I, const detail::_xvec3& N); //!< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLSL 1.10.59 specification) - template detail::_xvec4 reflect(const detail::_xvec4& I, const detail::_xvec4& N); //!< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLSL 1.10.59 specification) - - template T refract(T I, T N, T eta); //!< \brief For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. (From GLSL 1.10.59 specification) - template detail::_xvec2 refract(const detail::_xvec2& I, const detail::_xvec2& N, T eta); //!< \brief For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. (From GLSL 1.10.59 specification) - template detail::_xvec3 refract(const detail::_xvec3& I, const detail::_xvec3& N, T eta); //!< \brief For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. (From GLSL 1.10.59 specification) - template detail::_xvec4 refract(const detail::_xvec4& I, const detail::_xvec4& N, T eta); //!< \brief For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. (From GLSL 1.10.59 specification) - - //////////////////////////////////////////////////////////////////////// - // Matrix Functions - - template detail::_xmat2 matrixCompMult(const detail::_xmat2& x, const detail::_xmat2& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.10.59 specification) - template detail::_xmat3 matrixCompMult(const detail::_xmat3& x, const detail::_xmat3& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.10.59 specification) - template detail::_xmat4 matrixCompMult(const detail::_xmat4& x, const detail::_xmat4& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.10.59 specification) - template detail::_xmat2x3 matrixCompMult(const detail::_xmat2x3& x, const detail::_xmat2x3& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.20.6 specification) - template detail::_xmat3x2 matrixCompMult(const detail::_xmat3x2& x, const detail::_xmat3x2& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.20.6 specification) - template detail::_xmat2x4 matrixCompMult(const detail::_xmat2x4& x, const detail::_xmat2x4& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.20.6 specification) - template detail::_xmat4x2 matrixCompMult(const detail::_xmat4x2& x, const detail::_xmat4x2& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.20.6 specification) - template detail::_xmat3x4 matrixCompMult(const detail::_xmat3x4& x, const detail::_xmat3x4& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.20.6 specification) - template detail::_xmat4x3 matrixCompMult(const detail::_xmat4x3& x, const detail::_xmat4x3& y); //!< \brief Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (From GLSL 1.20.6 specification) - - template detail::_xmat2 outerProduct(const detail::_xvec2& c, const detail::_xvec2& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat3 outerProduct(const detail::_xvec3& c, const detail::_xvec3& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat4 outerProduct(const detail::_xvec4& c, const detail::_xvec4& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat2x3 outerProduct(const detail::_xvec3& c, const detail::_xvec2& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat3x2 outerProduct(const detail::_xvec2& c, const detail::_xvec3& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat2x4 outerProduct(const detail::_xvec2& c, const detail::_xvec4& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat4x2 outerProduct(const detail::_xvec4& c, const detail::_xvec2& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat3x4 outerProduct(const detail::_xvec4& c, const detail::_xvec3& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - template detail::_xmat4x3 outerProduct(const detail::_xvec3& c, const detail::_xvec4& r); //!< \brief Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (From GLSL 1.20.6 specification) - - template detail::_xmat2 transpose(const detail::_xmat2& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat3 transpose(const detail::_xmat3& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat4 transpose(const detail::_xmat4& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat2x3 transpose(const detail::_xmat3x2& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat3x2 transpose(const detail::_xmat2x3& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat2x4 transpose(const detail::_xmat4x2& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat4x2 transpose(const detail::_xmat2x4& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat3x4 transpose(const detail::_xmat4x3& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - template detail::_xmat4x3 transpose(const detail::_xmat3x4& x); //!< Returns the transposed matrix of x (From GLSL 1.20.6 specification) - - //////////////////////////////////////////////////////////////////////// - // Vector Relational Functions - - template detail::_bvec2 lessThan(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns the component-wise compare of x < y. (From GLSL 1.10.59 specification) - template detail::_bvec3 lessThan(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the component-wise compare of x < y. (From GLSL 1.10.59 specification) - template detail::_bvec4 lessThan(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns the component-wise compare of x < y. (From GLSL 1.10.59 specification) - - template detail::_bvec2 lessThanEqual(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns the component-wise compare of x <= y. (From GLSL 1.10.59 specification) - template detail::_bvec3 lessThanEqual(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the component-wise compare of x <= y. (From GLSL 1.10.59 specification) - template detail::_bvec4 lessThanEqual(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns the component-wise compare of x <= y. (From GLSL 1.10.59 specification) - - template detail::_bvec2 greaterThan(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns the component-wise compare of x > y. (From GLSL 1.10.59 specification) - template detail::_bvec3 greaterThan(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the component-wise compare of x > y. (From GLSL 1.10.59 specification) - template detail::_bvec4 greaterThan(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns the component-wise compare of x > y. (From GLSL 1.10.59 specification) - - template detail::_bvec2 greaterThanEqual(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns the component-wise compare of x >= y. (From GLSL 1.10.59 specification) - template detail::_bvec3 greaterThanEqual(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the component-wise compare of x >= y. (From GLSL 1.10.59 specification) - template detail::_bvec4 greaterThanEqual(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns the component-wise compare of x >= y. (From GLSL 1.10.59 specification) - - detail::_bvec2 equal(const detail::_bvec2& x, const detail::_bvec2& y); //!< \brief Returns the component-wise compare of x == y. (From GLSL 1.10.59 specification) - detail::_bvec3 equal(const detail::_bvec3& x, const detail::_bvec3& y); //!< \brief Returns the component-wise compare of x == y. (From GLSL 1.10.59 specification) - detail::_bvec4 equal(const detail::_bvec4& x, const detail::_bvec4& y); //!< \brief Returns the component-wise compare of x == y. (From GLSL 1.10.59 specification) - template detail::_bvec2 equal(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns the component-wise compare of x == y. (From GLSL 1.10.59 specification) - template detail::_bvec3 equal(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the component-wise compare of x == y. (From GLSL 1.10.59 specification) - template detail::_bvec4 equal(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns the component-wise compare of x == y. (From GLSL 1.10.59 specification) - - detail::_bvec2 notEqual(const detail::_bvec2& x, const detail::_bvec2& y); //!< \brief Returns the component-wise compare of x != y. (From GLSL 1.10.59 specification) - detail::_bvec3 notEqual(const detail::_bvec3& x, const detail::_bvec3& y); //!< \brief Returns the component-wise compare of x != y. (From GLSL 1.10.59 specification) - detail::_bvec4 notEqual(const detail::_bvec4& x, const detail::_bvec4& y); //!< \brief Returns the component-wise compare of x != y. (From GLSL 1.10.59 specification) - template detail::_bvec2 notEqual(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns the component-wise compare of x != y. (From GLSL 1.10.59 specification) - template detail::_bvec3 notEqual(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the component-wise compare of x != y. (From GLSL 1.10.59 specification) - template detail::_bvec4 notEqual(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns the component-wise compare of x != y. (From GLSL 1.10.59 specification) - - bool any(const detail::_bvec2& x); //!< \brief Returns true if any component of x is true. (From GLSL 1.10.59 specification) - bool any(const detail::_bvec3& x); //!< \brief Returns true if any component of x is true. (From GLSL 1.10.59 specification) - bool any(const detail::_bvec4& x); //!< \brief Returns true if any component of x is true. (From GLSL 1.10.59 specification) - - bool all(const detail::_bvec2& x); //!< \brief Returns true if all component of x is true. (From GLSL 1.10.59 specification) - bool all(const detail::_bvec3& x); //!< \brief Returns true if all component of x is true. (From GLSL 1.10.59 specification) - bool all(const detail::_bvec4& x); //!< \brief Returns true if all component of x is true. (From GLSL 1.10.59 specification) - -#if (defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC) // VC compiler doesn't support the C++ key word 'not' - bool not(bool x); //!< \brief Returns the component-wise logical complement of x. (From GLSL 1.10.59 specification) - detail::_bvec2 not(const detail::_bvec2& v); //!< \brief Returns the component-wise logical complement of x. (From GLSL 1.10.59 specification) - detail::_bvec3 not(const detail::_bvec3& v); //!< \brief Returns the component-wise logical complement of x. (From GLSL 1.10.59 specification) - detail::_bvec4 not(const detail::_bvec4& v); //!< \brief Returns the component-wise logical complement of x. (From GLSL 1.10.59 specification) -#elif (defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC) // GCC - detail::_bvec2 operator not(const detail::_bvec2& v); //!< \brief Returns the component-wise logical complement of x. (From GLSL 1.10.59 specification) - detail::_bvec3 operator not(const detail::_bvec3& v); //!< \brief Returns the component-wise logical complement of x. (From GLSL 1.10.59 specification) - detail::_bvec4 operator not(const detail::_bvec4& v); //!< \brief Returns the component-wise logical complement of x. (From GLSL 1.10.59 specification) -#endif - - //////////////////////////////////////////////////////////////////////// - // Noise Functions - - template T noise1(T x); //!< \brief Returns a 1D noise value based on the input value x. (From GLSL 1.10.59 specification) - template T noise1(const detail::_xvec2& x); //!< \brief Returns a 1D noise value based on the input value x. (From GLSL 1.10.59 specification) - template T noise1(const detail::_xvec3& x); //!< \brief Returns a 1D noise value based on the input value x. (From GLSL 1.10.59 specification) - template T noise1(const detail::_xvec4& x); //!< \brief Returns a 1D noise value based on the input value x. (From GLSL 1.10.59 specification) - - template detail::_xvec2 noise2(T x); //!< \brief Returns a 2D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec2 noise2(const detail::_xvec2& x); //!< \brief Returns a 2D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec2 noise2(const detail::_xvec3& x); //!< \brief Returns a 2D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec2 noise2(const detail::_xvec4& x); //!< \brief Returns a 2D noise value based on the input value x. (From GLSL 1.10.59 specification) - - template detail::_xvec3 noise3(T x); //!< \brief Returns a 3D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec3 noise3(const detail::_xvec2& x); //!< \brief Returns a 3D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec3 noise3(const detail::_xvec3& x); //!< \brief Returns a 3D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec3 noise3(const detail::_xvec4& x); //!< \brief Returns a 3D noise value based on the input value x. (From GLSL 1.10.59 specification) - - template detail::_xvec4 noise4(T x); //!< \brief Returns a 4D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec4 noise4(const detail::_xvec2& x); //!< \brief Returns a 4D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec4 noise4(const detail::_xvec3& x); //!< \brief Returns a 4D noise value based on the input value x. (From GLSL 1.10.59 specification) - template detail::_xvec4 noise4(const detail::_xvec4& x); //!< \brief Returns a 4D noise value based on the input value x. (From GLSL 1.10.59 specification) -} //namespace glm - -#endif //__glm_func__ diff --git a/experimental/sse/glm/core/_func.inl b/experimental/sse/glm/core/_func.inl deleted file mode 100644 index fcbfecf9..00000000 --- a/experimental/sse/glm/core/_func.inl +++ /dev/null @@ -1,2247 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-12 -// Updated : 2007-03-19 -// Licence : This source is under GNU LGPL licence -// File : _func.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __func_inl__ -#define __func_inl__ - -#include -#include -#include "./_func.h" - -namespace glm -{ - //////////////////////////////////////////////////////////////////////// - // Trigonometric Functions - - // radians - template - inline T radians(T degrees) - { - const T pi = T(3.1415926535897932384626433832795); - return degrees * (pi / T(180)); - } - - template - inline detail::_xvec2 radians(const detail::_xvec2& degrees) - { - return detail::_xvec2( - radians(degrees.x), - radians(degrees.y)); - } - - template - inline detail::_xvec3 radians(const detail::_xvec3& degrees) - { - return detail::_xvec3( - radians(degrees.x), - radians(degrees.y), - radians(degrees.z)); - } - - template - inline detail::_xvec4 radians(const detail::_xvec4& degrees) - { - return detail::_xvec4( - radians(degrees.x), - radians(degrees.y), - radians(degrees.z), - radians(degrees.w)); - } - - // degrees - template - inline T degrees(T radians) - { - const T pi = T(3.1415926535897932384626433832795); - return radians * (T(180) / pi); - } - - template - inline detail::_xvec2 degrees(const detail::_xvec2& radians) - { - return detail::_xvec2( - degrees(radians.x), - degrees(radians.y)); - } - - template - inline detail::_xvec3 degrees(const detail::_xvec3& radians) - { - return detail::_xvec3( - degrees(radians.x), - degrees(radians.y), - degrees(radians.z)); - } - - template - inline detail::_xvec4 degrees(const detail::_xvec4& radians) - { - return detail::_xvec4( - degrees(radians.x), - degrees(radians.y), - degrees(radians.z), - degrees(radians.w)); - } - - // sin - template - inline T sin(T angle) - { - return ::std::sin(angle); - } - - template - inline detail::_xvec2 sin(const detail::_xvec2& angle) - { - return detail::_xvec2( - sin(angle.x), - sin(angle.y)); - } - - template - inline detail::_xvec3 sin(const detail::_xvec3& angle) - { - return detail::_xvec3( - sin(angle.x), - sin(angle.y), - sin(angle.z)); - } - - template - inline detail::_xvec4 sin(const detail::_xvec4& angle) - { - return detail::_xvec4( - sin(angle.x), - sin(angle.y), - sin(angle.z), - sin(angle.w)); - } - - // cos - template - inline T cos(T angle) - { - return ::std::cos(angle); - } - - template - inline detail::_xvec2 cos(const detail::_xvec2& angle) - { - return detail::_xvec2( - cos(angle.x), - cos(angle.y)); - } - - template - inline detail::_xvec3 cos(const detail::_xvec3& angle) - { - return detail::_xvec3( - cos(angle.x), - cos(angle.y), - cos(angle.z)); - } - - template - inline detail::_xvec4 cos(const detail::_xvec4& angle) - { - return detail::_xvec4( - cos(angle.x), - cos(angle.y), - cos(angle.z), - cos(angle.w)); - } - - // tan - template - inline T tan(T angle) - { - return ::std::tan(angle); - } - - template - inline detail::_xvec2 tan(const detail::_xvec2& angle) - { - return detail::_xvec2( - tan(angle.x), - tan(angle.y)); - } - - template - inline detail::_xvec3 tan(const detail::_xvec3& angle) - { - return detail::_xvec3( - tan(angle.x), - tan(angle.y), - tan(angle.z)); - } - - template - inline detail::_xvec4 tan(const detail::_xvec4& angle) - { - return detail::_xvec4( - tan(angle.x), - tan(angle.y), - tan(angle.z), - tan(angle.w)); - } - - // asin - template - inline T asin(T x) - { - return ::std::asin(x); - } - - template - inline detail::_xvec2 asin(const detail::_xvec2& x) - { - return detail::_xvec2( - asin(x.x), - asin(x.y)); - } - - template - inline detail::_xvec3 asin(const detail::_xvec3& x) - { - return detail::_xvec3( - asin(x.x), - asin(x.y), - asin(x.z)); - } - - template - inline detail::_xvec4 asin(const detail::_xvec4& x) - { - return detail::_xvec4( - asin(x.x), - asin(x.y), - asin(x.z), - asin(x.w)); - } - - // acos - template - inline T acos(T x) - { - return ::std::acos(x); - } - - template - inline detail::_xvec2 acos(const detail::_xvec2& x) - { - return detail::_xvec2( - acos(x.x), - acos(x.y)); - } - - template - inline detail::_xvec3 acos(const detail::_xvec3& x) - { - return detail::_xvec3( - acos(x.x), - acos(x.y), - acos(x.z)); - } - - template - inline detail::_xvec4 acos(const detail::_xvec4& x) - { - return detail::_xvec4( - acos(x.x), - acos(x.y), - acos(x.z), - acos(x.w)); - } - - // atan - template - inline T atan(T y, T x) - { - return ::std::atan2(y, x); - } - - template - inline detail::_xvec2 atan(const detail::_xvec2& y, const detail::_xvec2& x) - { - return detail::_xvec2( - atan(y.x, x.x), - atan(y.y, x.y)); - } - - template - inline detail::_xvec3 atan(const detail::_xvec3& y, const detail::_xvec3& x) - { - return detail::_xvec3( - atan(y.x, x.x), - atan(y.y, x.y), - atan(y.z, x.z)); - } - - template - inline detail::_xvec4 atan(const detail::_xvec4& y, const detail::_xvec4& x) - { - return detail::_xvec4( - atan(y.x, x.x), - atan(y.y, x.y), - atan(y.z, x.z), - atan(y.w, x.w)); - } - - template - inline T atan(T x) - { - return ::std::atan(x); - } - - template - inline detail::_xvec2 atan(const detail::_xvec2& x) - { - return detail::_xvec2( - atan(x.x), - atan(x.y)); - } - - template - inline detail::_xvec3 atan(const detail::_xvec3& x) - { - return detail::_xvec3( - atan(x.x), - atan(x.y), - atan(x.z)); - } - - template - inline detail::_xvec4 atan(const detail::_xvec4& x) - { - return detail::_xvec4( - atan(x.x), - atan(x.y), - atan(x.z), - atan(x.w)); - } - - //////////////////////////////////////////////////////////////////////// - // Exponential Functions - - // pow - template - inline T pow(T x, T y) - { - return ::std::pow(x, y); - } - - template - inline detail::_xvec2 pow(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - pow(x.x, y.x), - pow(x.y, y.y)); - } - - template - inline detail::_xvec3 pow(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - pow(x.x, y.x), - pow(x.y, y.y), - pow(x.z, y.z)); - } - - template - inline detail::_xvec4 pow(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - pow(x.x, y.x), - pow(x.y, y.y), - pow(x.z, y.z), - pow(x.w, y.w)); - } - - // exp - template - inline T exp(T x) - { - return ::std::exp(x); - } - - template - inline detail::_xvec2 exp(const detail::_xvec2& x) - { - return detail::_xvec2( - exp(x.x), - exp(x.y)); - } - - template - inline detail::_xvec3 exp(const detail::_xvec3& x) - { - return detail::_xvec3( - exp(x.x), - exp(x.y), - exp(x.z)); - } - - template - inline detail::_xvec4 exp(const detail::_xvec4& x) - { - return detail::_xvec4( - exp(x.x), - exp(x.y), - exp(x.z), - exp(x.w)); - } - - // log - template - inline T log(T x) - { - return ::std::log(x); - } - - template - inline detail::_xvec2 log(const detail::_xvec2& x) - { - return detail::_xvec2( - log(x.x), - log(x.y)); - } - - template - inline detail::_xvec3 log(const detail::_xvec3& x) - { - return detail::_xvec3( - log(x.x), - log(x.y), - log(x.z)); - } - - template - inline detail::_xvec4 log(const detail::_xvec4& x) - { - return detail::_xvec4( - log(x.x), - log(x.y), - log(x.z), - log(x.w)); - } - - //exp2, ln2 = 0.69314718055994530941723212145818f - template - inline T exp2(T x) - { - return ::std::exp(T(0.69314718055994530941723212145818) * x); - } - - template - inline detail::_xvec2 exp2(const detail::_xvec2& x) - { - return detail::_xvec2( - exp2(x.x), - exp2(x.y)); - } - - template - inline detail::_xvec3 exp2(const detail::_xvec3& x) - { - return detail::_xvec3( - exp2(x.x), - exp2(x.y), - exp2(x.z)); - } - - template - inline detail::_xvec4 exp2(const detail::_xvec4& x) - { - return detail::_xvec4( - exp2(x.x), - exp2(x.y), - exp2(x.z), - exp2(x.w)); - } - - // log2, ln2 = 0.69314718055994530941723212145818f - template - inline T log2(T x) - { - return ::std::log(x) / T(0.69314718055994530941723212145818); - } - - template - inline detail::_xvec2 log2(const detail::_xvec2& x) - { - return detail::_xvec2( - log2(x.x), - log2(x.y)); - } - - template - inline detail::_xvec3 log2(const detail::_xvec3& x) - { - return detail::_xvec3( - log2(x.x), - log2(x.y), - log2(x.z)); - } - - template - inline detail::_xvec4 log2(const detail::_xvec4& x) - { - return detail::_xvec4( - log2(x.x), - log2(x.y), - log2(x.z), - log2(x.w)); - } - - // sqrt - template - inline T sqrt(T x) - { - return T(::std::sqrt(double(x))); - } - - template - inline detail::_xvec2 sqrt(const detail::_xvec2& x) - { - return detail::_xvec2( - sqrt(x.x), - sqrt(x.y)); - } - - template - inline detail::_xvec3 sqrt(const detail::_xvec3& x) - { - return detail::_xvec3( - sqrt(x.x), - sqrt(x.y), - sqrt(x.z)); - } - - template - inline detail::_xvec4 sqrt(const detail::_xvec4& x) - { - return detail::_xvec4( - sqrt(x.x), - sqrt(x.y), - sqrt(x.z), - sqrt(x.w)); - } - - template - inline T inversesqrt(T x) - { - return 1.0f / ::std::sqrt(x); - } - - template - inline detail::_xvec2 inversesqrt(const detail::_xvec2& x) - { - return detail::_xvec2( - inversesqrt(x.x), - inversesqrt(x.y)); - } - - template - inline detail::_xvec3 inversesqrt(const detail::_xvec3& x) - { - return detail::_xvec3( - inversesqrt(x.x), - inversesqrt(x.y), - inversesqrt(x.z)); - } - - template - inline detail::_xvec4 inversesqrt(const detail::_xvec4& x) - { - return detail::_xvec4( - inversesqrt(x.x), - inversesqrt(x.y), - inversesqrt(x.z), - inversesqrt(x.w)); - } - - //////////////////////////////////////////////////////////////////////// - // Common Functions - - // abs - template - inline T abs(T x) - { - return x >= T(0) ? x : -x; - } - - template - inline detail::_xvec2 abs(const detail::_xvec2& x) - { - return detail::_xvec2( - abs(x.x), - abs(x.y)); - } - - template - inline detail::_xvec3 abs(const detail::_xvec3& x) - { - return detail::_xvec3( - abs(x.x), - abs(x.y), - abs(x.z)); - } - - template - inline detail::_xvec4 abs(const detail::_xvec4& x) - { - return detail::_xvec4( - abs(x.x), - abs(x.y), - abs(x.z), - abs(x.w)); - } - - // sign -/* - Try something like based on x >> 31 to get the sign bit -*/ - template - inline T sign(T x) - { - T result; - if(x > T(0)) - result = T(1); - else if(x < T(0)) - result = T(-1); - else - result = T(0); - return result; - } - - template - inline detail::_xvec2 sign(const detail::_xvec2& x) - { - return detail::_xvec2( - sign(x.x), - sign(x.y)); - } - - template - inline detail::_xvec3 sign(const detail::_xvec3& x) - { - return detail::_xvec3( - sign(x.x), - sign(x.y), - sign(x.z)); - } - - template - inline detail::_xvec4 sign(const detail::_xvec4& x) - { - return detail::_xvec4( - sign(x.x), - sign(x.y), - sign(x.z), - sign(x.w)); - } - - // floor - template - inline T floor(T x) - { - return ::std::floor(x); - } - - template - inline detail::_xvec2 floor(const detail::_xvec2& x) - { - return detail::_xvec2( - floor(x.x), - floor(x.y)); - } - - template - inline detail::_xvec3 floor(const detail::_xvec3& x) - { - return detail::_xvec3( - floor(x.x), - floor(x.y), - floor(x.z)); - } - - template - inline detail::_xvec4 floor(const detail::_xvec4& x) - { - return detail::_xvec4( - floor(x.x), - floor(x.y), - floor(x.z), - floor(x.w)); - } - - // ceil - template - inline T ceil(T x) - { - return ::std::ceil(x); - } - - template - inline detail::_xvec2 ceil(const detail::_xvec2& x) - { - return detail::_xvec2( - ceil(x.x), - ceil(x.y)); - } - - template - inline detail::_xvec3 ceil(const detail::_xvec3& x) - { - return detail::_xvec3( - ceil(x.x), - ceil(x.y), - ceil(x.z)); - } - - template - inline detail::_xvec4 ceil(const detail::_xvec4& x) - { - return detail::_xvec4( - ceil(x.x), - ceil(x.y), - ceil(x.z), - ceil(x.w)); - } - - // fract - template - inline T fract(T x) - { - return x - ::std::floor(x); - } - - template - inline detail::_xvec2 fract(const detail::_xvec2& x) - { - return detail::_xvec2( - fract(x.x), - fract(x.y)); - } - - template - inline detail::_xvec3 fract(const detail::_xvec3& x) - { - return detail::_xvec3( - fract(x.x), - fract(x.y), - fract(x.z)); - } - - template - inline detail::_xvec4 fract(const detail::_xvec4& x) - { - return detail::_xvec4( - fract(x.x), - fract(x.y), - fract(x.z), - fract(x.w)); - } - - // mod - template - inline T mod(T x, T y) - { - return x - y * floor(x / y); - } - - template - inline detail::_xvec2 mod(const detail::_xvec2& x, T y) - { - return detail::_xvec2( - mod(x.x, y), - mod(x.y, y)); - } - - template - inline detail::_xvec3 mod(const detail::_xvec3& x, T y) - { - return detail::_xvec3( - mod(x.x, y), - mod(x.y, y), - mod(x.z, y)); - } - - template - inline detail::_xvec4 mod(const detail::_xvec4& x, T y) - { - return detail::_xvec4( - mod(x.x, y), - mod(x.y, y), - mod(x.z, y), - mod(x.w, y)); - } - - template - inline detail::_xvec2 mod(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - mod(x.x, y.x), - mod(x.y, y.y)); - } - - template - inline detail::_xvec3 mod(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - mod(x.x, y.x), - mod(x.y, y.y), - mod(x.z, y.z)); - } - - template - inline detail::_xvec4 mod(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - mod(x.x, y.x), - mod(x.y, y.y), - mod(x.z, y.z), - mod(x.w, y.w)); - } - - // min - template - inline T min(T x, T y) - { - return x < y ? x : y; - } - - template - inline detail::_xvec2 min(const detail::_xvec2& x, T y) - { - return detail::_xvec2( - min(x.x, y), - min(x.y, y)); - } - - template - inline detail::_xvec3 min(const detail::_xvec3& x, T y) - { - return detail::_xvec3( - min(x.x, y), - min(x.y, y), - min(x.z, y)); - } - - template - inline detail::_xvec4 min(const detail::_xvec4& x, T y) - { - return detail::_xvec4( - min(x.x, y), - min(x.y, y), - min(x.z, y), - min(x.w, y)); - } - - template - inline detail::_xvec2 min(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - min(x.x, y.x), - min(x.y, y.y)); - } - - template - inline detail::_xvec3 min(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - min(x.x, y.x), - min(x.y, y.y), - min(x.z, y.z)); - } - - template - inline detail::_xvec4 min(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - min(x.x, y.x), - min(x.y, y.y), - min(x.z, y.z), - min(x.w, y.w)); - } - - // max - template - inline T max(T x, T y) - { - return x > y ? x : y; - } - - template - inline detail::_xvec2 max(const detail::_xvec2& x, T y) - { - return detail::_xvec2( - max(x.x, y), - max(x.y, y)); - } - - template - inline detail::_xvec3 max(const detail::_xvec3& x, T y) - { - return detail::_xvec3( - max(x.x, y), - max(x.y, y), - max(x.z, y)); - } - - template - inline detail::_xvec4 max(const detail::_xvec4& x, T y) - { - return detail::_xvec4( - max(x.x, y), - max(x.y, y), - max(x.z, y), - max(x.w, y)); - } - - template - inline detail::_xvec2 max(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - max(x.x, y.x), - max(x.y, y.y)); - } - - template - inline detail::_xvec3 max(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - max(x.x, y.x), - max(x.y, y.y), - max(x.z, y.z)); - } - - template - inline detail::_xvec4 max(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - max(x.x, y.x), - max(x.y, y.y), - max(x.z, y.z), - max(x.w, y.w)); - } - - // clamp - template - inline T clamp(T x, T minVal, T maxVal) - { - if(x >= maxVal) return maxVal; - if(x <= minVal) return minVal; - return x; - } - - template - inline detail::_xvec2 clamp(const detail::_xvec2& x, T minVal, T maxVal) - { - return detail::_xvec2( - clamp(x.x, minVal, maxVal), - clamp(x.y, minVal, maxVal)); - } - - template - inline detail::_xvec3 clamp(const detail::_xvec3& x, T minVal, T maxVal) - { - return detail::_xvec3( - clamp(x.x, minVal, maxVal), - clamp(x.y, minVal, maxVal), - clamp(x.z, minVal, maxVal)); - } - - template - inline detail::_xvec4 clamp(const detail::_xvec4& x, T minVal, T maxVal) - { - return detail::_xvec4( - clamp(x.x, minVal, maxVal), - clamp(x.y, minVal, maxVal), - clamp(x.z, minVal, maxVal), - clamp(x.w, minVal, maxVal)); - } - - template - inline detail::_xvec2 clamp(const detail::_xvec2& x, const detail::_xvec2& minVal, const detail::_xvec2& maxVal) - { - return detail::_xvec2( - clamp(x.x, minVal.x, maxVal.x), - clamp(x.y, minVal.y, maxVal.y)); - } - - template - inline detail::_xvec3 clamp(const detail::_xvec3& x, const detail::_xvec3& minVal, const detail::_xvec3& maxVal) - { - return detail::_xvec3( - clamp(x.x, minVal.x, maxVal.x), - clamp(x.y, minVal.y, maxVal.y), - clamp(x.z, minVal.z, maxVal.z)); - } - - template - inline detail::_xvec4 clamp(const detail::_xvec4& x, const detail::_xvec4& minVal, const detail::_xvec4& maxVal) - { - return detail::_xvec4( - clamp(x.x, minVal.x, maxVal.x), - clamp(x.y, minVal.y, maxVal.y), - clamp(x.z, minVal.z, maxVal.z), - clamp(x.w, minVal.w, maxVal.w)); - } - - // mix - template - inline T mix(const T& x, const T& y, const U& a) - { - return x * (T(1) - a) + y * a; - } -/* - // mix - template - inline T mix(T x, T y, T a) - { - return x * (T(1) - a) + y * a; - } - - template - inline detail::_xvec2 mix(const detail::_xvec2& x, const detail::_xvec2& y, T a) - { - return x * (T(1) - a) + y * a; - } - - template - inline detail::_xvec3 mix(const detail::_xvec3& x, const detail::_xvec3& y, T a) - { - return x * (T(1) - a) + y * a; - } - - template - inline detail::_xvec4 mix(const detail::_xvec4& x, const detail::_xvec4& y, T a) - { - return x * (T(1) - a) + y * a; - } - - template - inline detail::_xvec2 mix(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& a) - { - return x * (T(1) - a) + y * a; - } - - template - inline detail::_xvec3 mix(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& a) - { - return x * (T(1) - a) + y * a; - } - - template - inline detail::_xvec4 mix(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& a) - { - return x * (T(1) - a) + y * a; - } -*/ - - // step - template - inline T step(T edge, T x) - { - return x <= edge ? T(0) : T(1); - } - - template - inline detail::_xvec2 step(T edge, const detail::_xvec2& x) - { - return detail::_xvec2( - x.x <= edge ? T(0) : T(1), - x.y <= edge ? T(0) : T(1)); - } - - template - inline detail::_xvec3 step(T edge, const detail::_xvec3& x) - { - return detail::_xvec3( - x.x <= edge ? T(0) : T(1), - x.y <= edge ? T(0) : T(1), - x.z <= edge ? T(0) : T(1)); - } - - template - inline detail::_xvec4 step(T edge, const detail::_xvec4& x) - { - return detail::_xvec4( - x.x <= edge ? T(0) : T(1), - x.y <= edge ? T(0) : T(1), - x.z <= edge ? T(0) : T(1), - x.w <= edge ? T(0) : T(1)); - } - - template - inline detail::_xvec2 step(const detail::_xvec2& edge, const detail::_xvec2& x) - { - return detail::_xvec2( - x.x <= edge.x ? T(0) : T(1), - x.y <= edge.y ? T(0) : T(1)); - } - - template - inline detail::_xvec3 step(const detail::_xvec3& edge, const detail::_xvec3& x) - { - return detail::_xvec3( - x.x <= edge.x ? T(0) : T(1), - x.y <= edge.y ? T(0) : T(1), - x.z <= edge.z ? T(0) : T(1)); - } - - template - inline detail::_xvec4 step(const detail::_xvec4& edge, const detail::_xvec4& x) - { - return detail::_xvec4( - x.x <= edge.x ? T(0) : T(1), - x.y <= edge.y ? T(0) : T(1), - x.z <= edge.z ? T(0) : T(1), - x.w <= edge.w ? T(0) : T(1)); - } - - // smoothstep - template - inline T smoothstep(T edge0, T edge1, T x) - { - T tmp = clamp((x - edge0) / (edge1 - edge0), T(0), T(1)); - return tmp * tmp * (T(3) - T(2) * tmp); - } - - template - inline detail::_xvec2 smoothstep(T edge0, T edge1, const detail::_xvec2& x) - { - return detail::_xvec2( - smoothstep(edge0, edge1, x.x), - smoothstep(edge0, edge1, x.y)); - } - - template - inline detail::_xvec3 smoothstep(T edge0, T edge1, const detail::_xvec3& x) - { - return detail::_xvec3( - smoothstep(edge0, edge1, x.x), - smoothstep(edge0, edge1, x.y), - smoothstep(edge0, edge1, x.z)); - } - - template - inline detail::_xvec4 smoothstep(T edge0, T edge1, const detail::_xvec4& x) - { - return detail::_xvec4( - smoothstep(edge0, edge1, x.x), - smoothstep(edge0, edge1, x.y), - smoothstep(edge0, edge1, x.z), - smoothstep(edge0, edge1, x.w)); - } - - template - inline detail::_xvec2 smoothstep(const detail::_xvec2& edge0, const detail::_xvec2& edge1, const detail::_xvec2& x) - { - return detail::_xvec2( - smoothstep(edge0.x, edge1.x, x.x), - smoothstep(edge0.y, edge1.y, x.y)); - } - - template - inline detail::_xvec3 smoothstep(const detail::_xvec3& edge0, const detail::_xvec3& edge1, const detail::_xvec3& x) - { - return detail::_xvec3( - smoothstep(edge0.x, edge1.x, x.x), - smoothstep(edge0.y, edge1.y, x.y), - smoothstep(edge0.z, edge1.z, x.z)); - } - - template - inline detail::_xvec4 smoothstep(const detail::_xvec4& edge0, const detail::_xvec4& edge1, const detail::_xvec4& x) - { - return detail::_xvec4( - smoothstep(edge0.x, edge1.x, x.x), - smoothstep(edge0.y, edge1.y, x.y), - smoothstep(edge0.z, edge1.z, x.z), - smoothstep(edge0.w, edge1.w, x.w)); - } - - //////////////////////////////////////////////////////////////////////// - // Geometric Functions - - // length - template - inline T length(T x) - { - return abs(x); - } - - template - inline T length(const detail::_xvec2& x) - { - T sqr = x.x * x.x + x.y * x.y; - return sqrt(sqr); - } - - template - inline T length(const detail::_xvec3& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z; - return sqrt(sqr); - } - - template - inline T length(const detail::_xvec4& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; - return sqrt(sqr); - } - - // distance - template - inline T distance(const T p0, const T p1) - { - return length(p1 - p0); - } - - template - inline T distance(const detail::_xvec2& p0, const detail::_xvec2& p1) - { - return length(p1 - p0); - } - - template - inline T distance(const detail::_xvec3& p0, const detail::_xvec3& p1) - { - return length(p1 - p0); - } - - template - inline T distance(const detail::_xvec4& p0, const detail::_xvec4& p1) - { - return length(p1 - p0); - } -/* - template - inline valType distance(const genType& p0, const genType& p1) - { - return length(p1 - p0); - } -*/ - // dot - template - inline T dot(T x, T y) - { - return x * y; - } - - template - inline T dot(const detail::_xvec2& x, const detail::_xvec2& y) - { - return x.x * y.x + x.y * y.y; - } - - template - inline T dot(const detail::_xvec3& x, const detail::_xvec3& y) - { - return x.x * y.x + x.y * y.y + x.z * y.z; - } -/* // SSE3 - inline float dot(const _xvec4& x, const _xvec4& y) - { - float Result; - __asm - { - mov esi, x - mov edi, y - movaps xmm0, [esi] - mulps xmm0, [edi] - haddps( _xmm0, _xmm0 ) - haddps( _xmm0, _xmm0 ) - movss Result, xmm0 - } - return Result; - } -*/ - template - inline T dot(const detail::_xvec4& x, const detail::_xvec4& y) - { - return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; - } - - // cross - template - inline detail::_xvec3 cross(const detail::_xvec3 & x, const detail::_xvec3 & y) - { - return detail::_xvec3( - x.y * y.z - y.y * x.z, - x.z * y.x - y.z * x.x, - x.x * y.y - y.x * x.y); - } - - // normalize - template - inline T normalize(T x) - { - return x < T(0) ? T(-1) : T(1); - } - - // According to issue 10, if length(x) == 0 then result is undefine and generate an error - template - inline detail::_xvec2 normalize(const detail::_xvec2& x) - { - T sqr = x.x * x.x + x.y * x.y; - return x * inversesqrt(sqr); - } - - template - inline detail::_xvec3 normalize(const detail::_xvec3& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z; - return x * inversesqrt(sqr); - } - - template - inline detail::_xvec4 normalize(const detail::_xvec4& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; - return x * inversesqrt(sqr); - } -/* - // faceforward - template - inline genType faceforward(const genType& N, const genType& I, const genType& Nref) - { - return dot(Nref, I) < T(0) ? N : -N; - } -*/ - // faceforward - template - inline T faceforward(T N, T I, T Nref) - { - return dot(Nref, I) < T(0) ? N : -N; - } - - template - inline detail::_xvec2 faceforward(const detail::_xvec2& N, const detail::_xvec2& I, const detail::_xvec2& Nref) - { - return dot(Nref, I) < T(0) ? N : -N; - } - - template - inline detail::_xvec3 faceforward(const detail::_xvec3& N, const detail::_xvec3& I, const detail::_xvec3& Nref) - { - return dot(Nref, I) < T(0) ? N : -N; - } - - template - inline detail::_xvec4 faceforward(const detail::_xvec4& N, const detail::_xvec4& I, const detail::_xvec4& Nref) - { - return dot(Nref, I) < T(0) ? N : -N; - } -/* - // reflect - template - genType reflect(const genType& I, const genType& N) - { - return I - N * dot(N, I) * T(2); - } -*/ - // reflect - template - inline T reflect(T I, T N) - { - return I - N * dot(N, I) * T(2); - } - - template - inline detail::_xvec2 reflect(const detail::_xvec2& I, const detail::_xvec2& N) - { - return I - N * dot(N, I) * T(2); - } - - template - inline detail::_xvec3 reflect(const detail::_xvec3& I, const detail::_xvec3& N) - { - return I - N * dot(N, I) * T(2); - } - - template - inline detail::_xvec4 reflect(const detail::_xvec4& I, const detail::_xvec4& N) - { - return I - N * dot(N, I) * T(2); - } - - // refract - template - inline T refract(T I, T N, T eta) - { - T dot = dot(N, I); - T k = T(1) - eta * eta * (T(1) - dot * dot); - if(k < T(0)) - return T(0); - else - return eta * I - (eta * dot + sqrt(k)) * N; - } - - template - inline detail::_xvec2 refract(const detail::_xvec2& I, const detail::_xvec2& N, T eta) - { - T dotValue = dot(N, I); - T k = T(1) - eta * eta * (T(1) - dotValue * dotValue); - if(k < T(0)) - return detail::_xvec2(T(0)); - else - return eta * I - (eta * dotValue + sqrt(k)) * N; - } - - template - inline detail::_xvec3 refract(const detail::_xvec3& I, const detail::_xvec3& N, T eta) - { - T dotValue = dot(N, I); - T k = T(1) - eta * eta * (T(1) - dotValue * dotValue); - if(k < T(0)) - return detail::_xvec3(T(0)); - else - return eta * I - (eta * dotValue + sqrt(k)) * N; - } - - template - inline detail::_xvec4 refract(const detail::_xvec4& I, const detail::_xvec4& N, T eta) - { - T dotValue = dot(N, I); - T k = T(1) - eta * eta * (T(1) - dotValue * dotValue); - if(k < T(0)) - return detail::_xvec4(T(0)); - else - return eta * I - (eta * dotValue + sqrt(k)) * N; - } - - //////////////////////////////////////////////////////////////////////// - // Matrix Functions - - // matrixCompMult - template - inline detail::_xmat2 matrixCompMult(const detail::_xmat2& x, const detail::_xmat2& y) - { - detail::_xmat2 result; - for(int j = 0; j < 2; ++j) - for(int i = 0; i < 2; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat3 matrixCompMult(const detail::_xmat3& x, const detail::_xmat3& y) - { - detail::_xmat3 result; - for(int j = 0; j < 3; ++j) - for(int i = 0; i < 3; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat4 matrixCompMult(const detail::_xmat4& x, const detail::_xmat4& y) - { - detail::_xmat4 result; - for(int j = 0; j < 4; ++j) - for(int i = 0; i < 4; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat2x3 matrixCompMult(const detail::_xmat2x3& x, const detail::_xmat2x3& y) - { - detail::_xmat2x3 result; - for(int j = 0; j < 2; ++j) - for(int i = 0; i < 3; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat3x2 matrixCompMult(const detail::_xmat3x2& x, const detail::_xmat3x2& y) - { - detail::_xmat3x2 result; - for(int j = 0; j < 3; ++j) - for(int i = 0; i < 2; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat2x4 matrixCompMult(const detail::_xmat2x4& x, const detail::_xmat2x4& y) - { - detail::_xmat2x4 result; - for(int j = 0; j < 2; ++j) - for(int i = 0; i < 4; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat4x2 matrixCompMult(const detail::_xmat4x2& x, const detail::_xmat4x2& y) - { - detail::_xmat4x2 result; - for(int j = 0; j < 4; ++j) - for(int i = 0; i < 2; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat3x4 matrixCompMult(const detail::_xmat3x4& x, const detail::_xmat3x4& y) - { - detail::_xmat3x4 result; - for(int j = 0; j < 3; ++j) - for(int i = 0; i < 4; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmat4x3 matrixCompMult(const detail::_xmat4x3& x, const detail::_xmat4x3& y) - { - detail::_xmat4x3 result; - for(int j = 0; j < 4; ++j) - for(int i = 0; i < 3; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - // outerProduct - template - inline detail::_xmat2 outerProduct(const detail::_xvec2& c, const detail::_xvec2& r) - { - detail::_xmat2 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - return m; - } - - template - inline detail::_xmat3 outerProduct(const detail::_xvec3& c, const detail::_xvec3& r) - { - detail::_xmat3 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[0][2] = c.z * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[1][2] = c.z * r.y; - m[2][0] = c.x * r.z; - m[2][1] = c.y * r.z; - m[2][2] = c.z * r.z; - return m; - } - - template - inline detail::_xmat4 outerProduct(const detail::_xvec4& c, const detail::_xvec4& r) - { - detail::_xmat4 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[0][2] = c.z * r.x; - m[0][3] = c.w * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[1][2] = c.z * r.y; - m[1][3] = c.w * r.y; - m[2][0] = c.x * r.z; - m[2][1] = c.y * r.z; - m[2][2] = c.z * r.z; - m[2][3] = c.w * r.z; - m[3][0] = c.x * r.w; - m[3][1] = c.y * r.w; - m[3][2] = c.z * r.w; - m[3][3] = c.w * r.w; - return m; - } - - template - inline detail::_xmat2x3 outerProduct(const detail::_xvec3& c, const detail::_xvec2& r) - { - detail::_xmat2x3 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[0][2] = c.z * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[1][2] = c.z * r.y; - return m; - } - - template - inline detail::_xmat3x2 outerProduct(const detail::_xvec2& c, const detail::_xvec3& r) - { - detail::_xmat3x2 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[2][0] = c.x * r.z; - m[2][1] = c.y * r.z; - return m; - } - - template - inline detail::_xmat2x4 outerProduct(const detail::_xvec2& c, const detail::_xvec4& r) - { - detail::_xmat2x4 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[0][2] = c.z * r.x; - m[0][3] = c.w * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[1][2] = c.z * r.y; - m[1][3] = c.w * r.y; - return m; - } - - template - inline detail::_xmat4x2 outerProduct(const detail::_xvec4& c, const detail::_xvec2& r) - { - detail::_xmat4x2 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[2][0] = c.x * r.z; - m[2][1] = c.y * r.z; - m[3][0] = c.x * r.w; - m[3][1] = c.y * r.w; - return m; - } - - template - inline detail::_xmat3x4 outerProduct(const detail::_xvec4& c, const detail::_xvec3& r) - { - detail::_xmat3x4 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[0][2] = c.z * r.x; - m[0][3] = c.w * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[1][2] = c.z * r.y; - m[1][3] = c.w * r.y; - m[2][0] = c.x * r.z; - m[2][1] = c.y * r.z; - m[2][2] = c.z * r.z; - m[2][3] = c.w * r.z; - return m; - } - - template - inline detail::_xmat4x3 outerProduct(const detail::_xvec3& c, const detail::_xvec4& r) - { - detail::_xmat4x3 m; - m[0][0] = c.x * r.x; - m[0][1] = c.y * r.x; - m[0][2] = c.z * r.x; - m[1][0] = c.x * r.y; - m[1][1] = c.y * r.y; - m[1][2] = c.z * r.y; - m[2][0] = c.x * r.z; - m[2][1] = c.y * r.z; - m[2][2] = c.z * r.z; - m[3][0] = c.x * r.w; - m[3][1] = c.y * r.w; - m[3][2] = c.z * r.w; - return m; - } - - template - inline detail::_xmat2 transpose(const detail::_xmat2& m) - { - detail::_xmat2 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - return result; - } - - template - inline detail::_xmat3 transpose(const detail::_xmat3 & m) - { - detail::_xmat3 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - return result; - } - - template - inline detail::_xmat4 transpose(const detail::_xmat4 & m) - { - detail::_xmat4 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[0][3] = m[3][0]; - - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[1][3] = m[3][1]; - - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - result[2][3] = m[3][2]; - - result[3][0] = m[0][3]; - result[3][1] = m[1][3]; - result[3][2] = m[2][3]; - result[3][3] = m[3][3]; - return result; - } - - template - inline detail::_xmat2x3 transpose(const detail::_xmat3x2& m) - { - detail::_xmat2x3 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - return result; - } - - template - inline detail::_xmat3x2 transpose(const detail::_xmat2x3& m) - { - detail::_xmat3x2 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - return result; - } - - template - inline detail::_xmat2x4 transpose(const detail::_xmat4x2& m) - { - detail::_xmat2x4 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[0][3] = m[3][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[1][3] = m[3][1]; - return result; - } - - template - inline detail::_xmat4x2 transpose(const detail::_xmat2x4& m) - { - detail::_xmat4x2 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[3][0] = m[0][3]; - result[3][1] = m[1][3]; - return result; - } - - template - inline detail::_xmat3x4 transpose(const detail::_xmat4x3& m) - { - detail::_xmat3x4 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[0][3] = m[3][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[1][3] = m[3][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - result[2][3] = m[3][2]; - return result; - } - - template - inline detail::_xmat4x3 transpose(const detail::_xmat3x4& m) - { - detail::_xmat4x3 result; - result[0][0] = m[0][0]; - result[0][1] = m[1][0]; - result[0][2] = m[2][0]; - result[1][0] = m[0][1]; - result[1][1] = m[1][1]; - result[1][2] = m[2][1]; - result[2][0] = m[0][2]; - result[2][1] = m[1][2]; - result[2][2] = m[2][2]; - result[3][0] = m[0][3]; - result[3][1] = m[1][3]; - result[3][2] = m[2][3]; - result[4][0] = m[0][4]; - result[4][1] = m[1][4]; - result[4][2] = m[2][4]; - return result; - } - - //////////////////////////////////////////////////////////////////////// - // Vector Relational Functions - - // lessThan - template - inline detail::_bvec2 lessThan(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_bvec2(x.x < y.x, x.y < y.y); - } - - template - inline detail::_bvec3 lessThan(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_bvec3(x.x < y.x, x.y < y.y, x.z < y.z); - } - - template - inline detail::_bvec4 lessThan(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_bvec4(x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w); - } - - // lessThanEqual - template - inline detail::_bvec2 lessThanEqual(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_bvec2(x.x <= y.x, x.y <= y.y); - } - - template - inline detail::_bvec3 lessThanEqual(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_bvec3(x.x <= y.x, x.y <= y.y, x.z <= y.z); - } - - template - inline detail::_bvec4 lessThanEqual(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_bvec4(x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w); - } - - // greaterThan - template - inline detail::_bvec2 greaterThan(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_bvec2(x.x > y.x, x.y > y.y); - } - - template - inline detail::_bvec3 greaterThan(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_bvec3(x.x > y.x, x.y > y.y, x.z > y.z); - } - - template - inline detail::_bvec4 greaterThan(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_bvec4(x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w); - } - - // greaterThanEqual - template - inline detail::_bvec2 greaterThanEqual(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_bvec2(x.x >= y.x, x.y >= y.y); - } - - template - inline detail::_bvec3 greaterThanEqual(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_bvec3(x.x >= y.x, x.y >= y.y, x.z >= y.z); - } - - template - inline detail::_bvec4 greaterThanEqual(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_bvec4(x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w); - } - - // equal - inline detail::_bvec2 equal(const detail::_bvec2& x, const detail::_bvec2& y) - { - return detail::_bvec2(x.x == y.x, x.y == y.y); - } - - inline detail::_bvec3 equal(const detail::_bvec3& x, const detail::_bvec3& y) - { - return detail::_bvec3(x.x == y.x, x.y == y.y, x.z == y.z); - } - - inline detail::_bvec4 equal(const detail::_bvec4& x, const detail::_bvec4& y) - { - return detail::_bvec4(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w); - } - - template - inline detail::_bvec2 equal(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_bvec2(x.x == y.x, x.y == y.y); - } - - template - inline detail::_bvec3 equal(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_bvec3(x.x == y.x, x.y == y.y, x.z == y.z); - } - - template - inline detail::_bvec4 equal(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_bvec4(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w); - } - - // notEqual - inline detail::_bvec2 notEqual(const detail::_bvec2& x, const detail::_bvec2& y) - { - return detail::_bvec2(x.x != y.x, x.y != y.y); - } - - inline detail::_bvec3 notEqual(const detail::_bvec3 & x, const detail::_bvec3& y) - { - return detail::_bvec3(x.x != y.x, x.y != y.y, x.z != y.z); - } - - inline detail::_bvec4 notEqual(const detail::_bvec4 & x, const detail::_bvec4& y) - { - return detail::_bvec4(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w); - } - - template - inline detail::_bvec2 notEqual(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_bvec2(x.x != y.x, x.y != y.y); - } - - template - inline detail::_bvec3 notEqual(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_bvec3(x.x != y.x, x.y != y.y, x.z != y.z); - } - - template - inline detail::_bvec4 notEqual(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_bvec4(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w); - } - - // any - inline bool any(const detail::_bvec2& x) - { - return x.x || x.y; - } - - inline bool any(const detail::_bvec3& x) - { - return x.x || x.y || x.z; - } - - inline bool any(const detail::_bvec4& x) - { - return x.x || x.y || x.z || x.w; - } - - // all - inline bool all(const detail::_bvec2& x) - { - return x.x && x.y; - } - - inline bool all(const detail::_bvec3& x) - { - return x.x && x.y && x.z; - } - - inline bool all(const detail::_bvec4& x) - { - return x.x && x.y && x.z && x.w; - } - -#ifdef GLM_COMPILER_VC - inline bool not(bool x) - { - return !x; - } - - inline detail::_bvec2 not(const detail::_bvec2& v) - { - return detail::_bvec2(!v.x, !v.y); - } - - inline detail::_bvec3 not(const detail::_bvec3& v) - { - return detail::_bvec3(!v.x, !v.y, !v.z); - } - - inline detail::_bvec4 not(const detail::_bvec4& v) - { - return detail::_bvec4(!v.x, !v.y, !v.z, !v.w); - } - -#elif GLM_COMPILER_GCC - inline detail::_bvec2 operator not(const detail::_bvec2& v) - { - return detail::_bvec2(!v.x, !v.y); - } - - inline detail::_bvec3 operator not(const detail::_bvec3& v) - { - return detail::_bvec3(!v.x, !v.y, !v.z); - } - - inline detail::_bvec4 operator not(const detail::_bvec4& v) - { - return detail::_bvec4(!v.x, !v.y, !v.z, !v.w); - } -#endif - - //////////////////////////////////////////////////////////////////////// - // Noise Functions - - // noise1 - template - inline T noise1(T x) - { - int iNbr = int(x + T(3) / T(2)) * 1103515245 + 12345; - return T(int(iNbr / T(65536)) % 32768) / T(32767); - } - - template - inline T noise1(const detail::_xvec2& x) - { - T fNbr(0); - for(int i = 0; i < 2; ++i) - fNbr += x[i]; - int iNbr = int(fNbr + T(3) / T(2)) * 1103515245 + 12345; - return T(int(iNbr / T(65536)) % 32768) / T(32767); - } - - template - inline T noise1(const detail::_xvec3& x) - { - T fNbr(0); - for(int i = 0; i < 3; ++i) - fNbr += x[i]; - int iNbr = int(fNbr + T(3) / T(2)) * 1103515245 + 12345; - return T(int(iNbr / T(65536)) % 32768) / T(32767); - } - - template - inline T noise1(const detail::_xvec4& x) - { - T fNbr(0); - for(int i = 0; i < 4; i++) - fNbr += x[i]; - int iNbr = int(fNbr + T(3) / T(2)) * 1103515245 + 12345; - return T(int(iNbr / T(65536)) % 32768) / T(32767); - } - - // noise2 - template - inline detail::_xvec2 noise2(T x) - { - T f1 = x * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - return detail::_xvec2( - noise1(f1), - noise1(f2)); - } - - template - inline detail::_xvec2 noise2(const detail::_xvec2& x) - { - T f0(0); - for(int i = 0; i < 2; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - return detail::_xvec2( - noise1(f1), - noise1(f2)); - } - - template - inline detail::_xvec2 noise2(const detail::_xvec3& x) - { - T f0(0); - for(int i = 0; i < 3; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - return detail::_xvec2( - noise1(f1), - noise1(f2)); - } - - template - inline detail::_xvec2 noise2(const detail::_xvec4& x) - { - T f0(0); - for(int i = 0; i < 4; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - return detail::_xvec2( - noise1(f1), - noise1(f2)); - } - - // noise3 - template - inline detail::_xvec3 noise3(T x) - { - T f1 = x * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - return detail::_xvec3( - noise1(f1), - noise1(f2), - noise1(f3)); - } - - template - inline detail::_xvec3 noise3(const detail::_xvec2& x) - { - T f0(0); - for(int i = 0; i < 2; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - return detail::_xvec3( - noise1(f1), - noise1(f2), - noise1(f3)); - } - - template - inline detail::_xvec3 noise3(const detail::_xvec3& x) - { - T f0(0); - for(int i = 0; i < 3; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - return detail::_xvec3( - noise1(f1), - noise1(f2), - noise1(f3)); - } - - template - inline detail::_xvec3 noise3(const detail::_xvec4& x) - { - T f0(0); - for(int i = 0; i < 4; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - return detail::_xvec3( - noise1(f1), - noise1(f2), - noise1(f3)); - } - - // noise4 - template - inline detail::_xvec4 noise4(T x) - { - T f1 = x * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - T f4 = f3 * T(1103515245) + T(12345); - return detail::_xvec4( - noise1(f1), - noise1(f2), - noise1(f3), - noise1(f4)); - } - - template - inline detail::_xvec4 noise4(const detail::_xvec2& x) - { - T f0(0); - for(int i = 0; i < 2; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - T f4 = f3 * T(1103515245) + T(12345); - return detail::_xvec4( - noise1(f1), - noise1(f2), - noise1(f3), - noise1(f4)); - } - - template - inline detail::_xvec4 noise4(const detail::_xvec3& x) - { - T f0(0); - for(int i = 0; i < 3; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - T f4 = f3 * T(1103515245) + T(12345); - return detail::_xvec4( - noise1(f1), - noise1(f2), - noise1(f3), - noise1(f4)); - } - - template - inline detail::_xvec4 noise4(const detail::_xvec4& x) - { - T f0(0); - for(int i = 0; i < 4; ++i) - f0 += x[i]; - T f1 = f0 * T(1103515245) + T(12345); - T f2 = f1 * T(1103515245) + T(12345); - T f3 = f2 * T(1103515245) + T(12345); - T f4 = f3 * T(1103515245) + T(12345); - return detail::_xvec4( - noise1(f1), - noise1(f2), - noise1(f3), - noise1(f4)); - } -} //namespace glm - -#endif //__func_inl__ diff --git a/experimental/sse/glm/core/_swizzle.h b/experimental/sse/glm/core/_swizzle.h deleted file mode 100644 index 8f7e6cfc..00000000 --- a/experimental/sse/glm/core/_swizzle.h +++ /dev/null @@ -1,1742 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-20 -// Updated : 2006-12-03 -// Licence : This source is under GNU LGPL licence -// File : _swizzle.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __swizzle_h__ -#define __swizzle_h__ - -namespace glm -{ - -} - -#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) - -// 2 components common swizzle operators -#define xx _xx() -#define yx _yx() -#define zx _zx() -#define wx _wx() -#define xy _xy() -#define yy _yy() -#define zy _zy() -#define wy _wy() -#define xz _xz() -#define yz _yz() -#define zz _zz() -#define wz _wz() -#define xw _xw() -#define yw _yw() -#define zw _zw() -#define ww _ww() - -// 3 components common swizzle operators -#define xxx _xxx() -#define yxx _yxx() -#define zxx _zxx() -#define wxx _wxx() -#define xyx _xyx() -#define yyx _yyx() -#define zyx _zyx() -#define wyx _wyx() -#define xzx _xzx() -#define yzx _yzx() -#define zzx _zzx() -#define wzx _wzx() -#define xwx _xwx() -#define ywx _ywx() -#define zwx _zwx() -#define wwx _wwx() -#define xxy _xxy() -#define yxy _yxy() -#define zxy _zxy() -#define wxy _wxy() -#define xyy _xyy() -#define yyy _yyy() -#define zyy _zyy() -#define wyy _wyy() -#define xzy _xzy() -#define yzy _yzy() -#define zzy _zzy() -#define wzy _wzy() -#define xwy _xwy() -#define ywy _ywy() -#define zwy _zwy() -#define wwy _wwy() -#define xxz _xxz() -#define yxz _yxz() -#define zxz _zxz() -#define wxz _wxz() -#define xyz _xyz() -#define yyz _yyz() -#define zyz _zyz() -#define wyz _wyz() -#define xzz _xzz() -#define yzz _yzz() -#define zzz _zzz() -#define wzz _wzz() -#define xwz _xwz() -#define ywz _ywz() -#define zwz _zwz() -#define wwz _wwz() -#define xxw _xxw() -#define yxw _yxw() -#define zxw _zxw() -#define wxw _wxw() -#define xyw _xyw() -#define yyw _yyw() -#define zyw _zyw() -#define wyw _wyw() -#define xzw _xzw() -#define yzw _yzw() -#define zzw _zzw() -#define wzw _wzw() -#define xww _xww() -#define yww _yww() -#define zww _zww() -#define www _www() - -// 4 components common swizzle operators -#define xxxx _xxxx() -#define yxxx _yxxx() -#define zxxx _zxxx() -#define wxxx _wxxx() -#define xyxx _xyxx() -#define yyxx _yyxx() -#define zyxx _zyxx() -#define wyxx _wyxx() -#define xzxx _xzxx() -#define yzxx _yzxx() -#define zzxx _zzxx() -#define wzxx _wzxx() -#define xwxx _xwxx() -#define ywxx _ywxx() -#define zwxx _zwxx() -#define wwxx _wwxx() -#define xxyx _xxyx() -#define yxyx _yxyx() -#define zxyx _zxyx() -#define wxyx _wxyx() -#define xyyx _xyyx() -#define yyyx _yyyx() -#define zyyx _zyyx() -#define wyyx _wyyx() -#define xzyx _xzyx() -#define yzyx _yzyx() -#define zzyx _zzyx() -#define wzyx _wzyx() -#define xwyx _xwyx() -#define ywyx _ywyx() -#define zwyx _zwyx() -#define wwyx _wwyx() -#define xxzx _xxzx() -#define yxzx _yxzx() -#define zxzx _zxzx() -#define wxzx _wxzx() -#define xyzx _xyzx() -#define yyzx _yyzx() -#define zyzx _zyzx() -#define wyzx _wyzx() -#define xzzx _xzzx() -#define yzzx _yzzx() -#define zzzx _zzzx() -#define wzzx _wzzx() -#define xwzx _xwzx() -#define ywzx _ywzx() -#define zwzx _zwzx() -#define wwzx _wwzx() -#define xxwx _xxwx() -#define yxwx _yxwx() -#define zxwx _zxwx() -#define wxwx _wxwx() -#define xywx _xywx() -#define yywx _yywx() -#define zywx _zywx() -#define wywx _wywx() -#define xzwx _xzwx() -#define yzwx _yzwx() -#define zzwx _zzwx() -#define wzwx _wzwx() -#define xwwx _xwwx() -#define ywwx _ywwx() -#define zwwx _zwwx() -#define wwwx _wwwx() -#define xxxy _xxxy() -#define yxxy _yxxy() -#define zxxy _zxxy() -#define wxxy _wxxy() -#define xyxy _xyxy() -#define yyxy _yyxy() -#define zyxy _zyxy() -#define wyxy _wyxy() -#define xzxy _xzxy() -#define yzxy _yzxy() -#define zzxy _zzxy() -#define wzxy _wzxy() -#define xwxy _xwxy() -#define ywxy _ywxy() -#define zwxy _zwxy() -#define wwxy _wwxy() -#define xxyy _xxyy() -#define yxyy _yxyy() -#define zxyy _zxyy() -#define wxyy _wxyy() -#define xyyy _xyyy() -#define yyyy _yyyy() -#define zyyy _zyyy() -#define wyyy _wyyy() -#define xzyy _xzyy() -#define yzyy _yzyy() -#define zzyy _zzyy() -#define wzyy _wzyy() -#define xwyy _xwyy() -#define ywyy _ywyy() -#define zwyy _zwyy() -#define wwyy _wwyy() -#define xxzy _xxzy() -#define yxzy _yxzy() -#define zxzy _zxzy() -#define wxzy _wxzy() -#define xyzy _xyzy() -#define yyzy _yyzy() -#define zyzy _zyzy() -#define wyzy _wyzy() -#define xzzy _xzzy() -#define yzzy _yzzy() -#define zzzy _zzzy() -#define wzzy _wzzy() -#define xwzy _xwzy() -#define ywzy _ywzy() -#define zwzy _zwzy() -#define wwzy _wwzy() -#define xxwy _xxwy() -#define yxwy _yxwy() -#define zxwy _zxwy() -#define wxwy _wxwy() -#define xywy _xywy() -#define yywy _yywy() -#define zywy _zywy() -#define wywy _wywy() -#define xzwy _xzwy() -#define yzwy _yzwy() -#define zzwy _zzwy() -#define wzwy _wzwy() -#define xwwy _xwwy() -#define ywwy _ywwy() -#define zwwy _zwwy() -#define wwwy _wwwy() -#define xxxz _xxxz() -#define yxxz _yxxz() -#define zxxz _zxxz() -#define wxxz _wxxz() -#define xyxz _xyxz() -#define yyxz _yyxz() -#define zyxz _zyxz() -#define wyxz _wyxz() -#define xzxz _xzxz() -#define yzxz _yzxz() -#define zzxz _zzxz() -#define wzxz _wzxz() -#define xwxz _xwxz() -#define ywxz _ywxz() -#define zwxz _zwxz() -#define wwxz _wwxz() -#define xxyz _xxyz() -#define yxyz _yxyz() -#define zxyz _zxyz() -#define wxyz _wxyz() -#define xyyz _xyyz() -#define yyyz _yyyz() -#define zyyz _zyyz() -#define wyyz _wyyz() -#define xzyz _xzyz() -#define yzyz _yzyz() -#define zzyz _zzyz() -#define wzyz _wzyz() -#define xwyz _xwyz() -#define ywyz _ywyz() -#define zwyz _zwyz() -#define wwyz _wwyz() -#define xxzz _xxzz() -#define yxzz _yxzz() -#define zxzz _zxzz() -#define wxzz _wxzz() -#define xyzz _xyzz() -#define yyzz _yyzz() -#define zyzz _zyzz() -#define wyzz _wyzz() -#define xzzz _xzzz() -#define yzzz _yzzz() -#define zzzz _zzzz() -#define wzzz _wzzz() -#define xwzz _xwzz() -#define ywzz _ywzz() -#define zwzz _zwzz() -#define wwzz _wwzz() -#define xxwz _xxwz() -#define yxwz _yxwz() -#define zxwz _zxwz() -#define wxwz _wxwz() -#define xywz _xywz() -#define yywz _yywz() -#define zywz _zywz() -#define wywz _wywz() -#define xzwz _xzwz() -#define yzwz _yzwz() -#define zzwz _zzwz() -#define wzwz _wzwz() -#define xwwz _xwwz() -#define ywwz _ywwz() -#define zwwz _zwwz() -#define wwwz _wwwz() -#define xxxw _xxxw() -#define yxxw _yxxw() -#define zxxw _zxxw() -#define wxxw _wxxw() -#define xyxw _xyxw() -#define yyxw _yyxw() -#define zyxw _zyxw() -#define wyxw _wyxw() -#define xzxw _xzxw() -#define yzxw _yzxw() -#define zzxw _zzxw() -#define wzxw _wzxw() -#define xwxw _xwxw() -#define ywxw _ywxw() -#define zwxw _zwxw() -#define wwxw _wwxw() -#define xxyw _xxyw() -#define yxyw _yxyw() -#define zxyw _zxyw() -#define wxyw _wxyw() -#define xyyw _xyyw() -#define yyyw _yyyw() -#define zyyw _zyyw() -#define wyyw _wyyw() -#define xzyw _xzyw() -#define yzyw _yzyw() -#define zzyw _zzyw() -#define wzyw _wzyw() -#define xwyw _xwyw() -#define ywyw _ywyw() -#define zwyw _zwyw() -#define wwyw _wwyw() -#define xxzw _xxzw() -#define yxzw _yxzw() -#define zxzw _zxzw() -#define wxzw _wxzw() -#define xyzw _xyzw() -#define yyzw _yyzw() -#define zyzw _zyzw() -#define wyzw _wyzw() -#define xzzw _xzzw() -#define yzzw _yzzw() -#define zzzw _zzzw() -#define wzzw _wzzw() -#define xwzw _xwzw() -#define ywzw _ywzw() -#define zwzw _zwzw() -#define wwzw _wwzw() -#define xxww _xxww() -#define yxww _yxww() -#define zxww _zxww() -#define wxww _wxww() -#define xyww _xyww() -#define yyww _yyww() -#define zyww _zyww() -#define wyww _wyww() -#define xzww _xzww() -#define yzww _yzww() -#define zzww _zzww() -#define wzww _wzww() -#define xwww _xwww() -#define ywww _ywww() -#define zwww _zwww() -#define wwww _wwww() - -#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW) - -#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA) - -// 2 components color swizzle operators -#define rr _xx() -#define gr _yx() -#define br _zx() -#define ar _wx() -#define rg _xy() -#define gg _yy() -#define bg _zy() -#define ag _wy() -#define rb _xz() -#define gb _yz() -#define bb _zz() -#define ab _wz() -#define ra _xw() -#define ga _yw() -#define ba _zw() -#define aa _ww() - -// 3 components color swizzle operators -#define rrr _xxx() -#define grr _yxx() -#define brr _zxx() -#define arr _wxx() -#define rgr _xyx() -#define ggr _yyx() -#define bgr _zyx() -#define agr _wyx() -#define rbr _xzx() -#define gbr _yzx() -#define bbr _zzx() -#define abr _wzx() -#define rar _xwx() -#define gar _ywx() -#define bar _zwx() -#define aar _wwx() -#define rrg _xxy() -#define grg _yxy() -#define brg _zxy() -#define arg _wxy() -#define rgg _xyy() -#define ggg _yyy() -#define bgg _zyy() -#define agg _wyy() -#define rbg _xzy() -#define gbg _yzy() -#define bbg _zzy() -#define abg _wzy() -#define rag _xwy() -#define gag _ywy() -#define bag _zwy() -#define aag _wwy() -#define rrb _xxz() -#define grb _yxz() -#define brb _zxz() -#define arb _wxz() -#define rgb _xyz() -#define ggb _yyz() -#define bgb _zyz() -#define agb _wyz() -#define rbb _xzz() -#define gbb _yzz() -#define bbb _zzz() -#define abb _wzz() -#define rab _xwz() -#define gab _ywz() -#define bab _zwz() -#define aab _wwz() -#define rra _xxw() -#define gra _yxw() -#define bra _zxw() -#define ara _wxw() -#define rga _xyw() -#define gga _yyw() -#define bga _zyw() -#define aga _wyw() -#define rba _xzw() -#define gba _yzw() -#define bba _zzw() -#define aba _wzw() -#define raa _xww() -#define gaa _yww() -#define baa _zww() -#define aaa _www() - -// 4 components color swizzle operators -#define rrrr _xxxx() -#define grrr _yxxx() -#define brrr _zxxx() -#define arrr _wxxx() -#define rgrr _xyxx() -#define ggrr _yyxx() -#define bgrr _zyxx() -#define agrr _wyxx() -#define rbrr _xzxx() -#define gbrr _yzxx() -#define bbrr _zzxx() -#define abrr _wzxx() -#define rarr _xwxx() -#define garr _ywxx() -#define barr _zwxx() -#define aarr _wwxx() -#define rrgr _xxyx() -#define grgr _yxyx() -#define brgr _zxyx() -#define argr _wxyx() -#define rggr _xyyx() -#define gggr _yyyx() -#define bggr _zyyx() -#define aggr _wyyx() -#define rbgr _xzyx() -#define gbgr _yzyx() -#define bbgr _zzyx() -#define abgr _wzyx() -#define ragr _xwyx() -#define gagr _ywyx() -#define bagr _zwyx() -#define aagr _wwyx() -#define rrbr _xxzx() -#define grbr _yxzx() -#define brbr _zxzx() -#define arbr _wxzx() -#define rgbr _xyzx() -#define ggbr _yyzx() -#define bgbr _zyzx() -#define agbr _wyzx() -#define rbbr _xzzx() -#define gbbr _yzzx() -#define bbbr _zzzx() -#define abbr _wzzx() -#define rabr _xwzx() -#define gabr _ywzx() -#define babr _zwzx() -#define aabr _wwzx() -#define rrar _xxwx() -#define grar _yxwx() -#define brar _zxwx() -#define arar _wxwx() -#define rgar _xywx() -#define ggar _yywx() -#define bgar _zywx() -#define agar _wywx() -#define rbar _xzwx() -#define gbar _yzwx() -#define bbar _zzwx() -#define abar _wzwx() -#define raar _xwwx() -#define gaar _ywwx() -#define baar _zwwx() -#define aaar _wwwx() -#define rrrg _xxxy() -#define grrg _yxxy() -#define brrg _zxxy() -#define arrg _wxxy() -#define rgrg _xyxy() -#define ggrg _yyxy() -#define bgrg _zyxy() -#define agrg _wyxy() -#define rbrg _xzxy() -#define gbrg _yzxy() -#define bbrg _zzxy() -#define abrg _wzxy() -#define rarg _xwxy() -#define garg _ywxy() -#define barg _zwxy() -#define aarg _wwxy() -#define rrgg _xxyy() -#define grgg _yxyy() -#define brgg _zxyy() -#define argg _wxyy() -#define rggg _xyyy() -#define gggg _yyyy() -#define bggg _zyyy() -#define aggg _wyyy() -#define rbgg _xzyy() -#define gbgg _yzyy() -#define bbgg _zzyy() -#define abgg _wzyy() -#define ragg _xwyy() -#define gagg _ywyy() -#define bagg _zwyy() -#define aagg _wwyy() -#define rrbg _xxzy() -#define grbg _yxzy() -#define brbg _zxzy() -#define arbg _wxzy() -#define rgbg _xyzy() -#define ggbg _yyzy() -#define bgbg _zyzy() -#define agbg _wyzy() -#define rbbg _xzzy() -#define gbbg _yzzy() -#define bbbg _zzzy() -#define abbg _wzzy() -#define rabg _xwzy() -#define gabg _ywzy() -#define babg _zwzy() -#define aabg _wwzy() -#define rrag _xxwy() -#define grag _yxwy() -#define brag _zxwy() -#define arag _wxwy() -#define rgag _xywy() -#define ggag _yywy() -#define bgag _zywy() -#define agag _wywy() -#define rbag _xzwy() -#define gbag _yzwy() -#define bbag _zzwy() -#define abag _wzwy() -#define raag _xwwy() -#define gaag _ywwy() -#define baag _zwwy() -#define aaag _wwwy() -#define rrrb _xxxz() -#define grrb _yxxz() -#define brrb _zxxz() -#define arrb _wxxz() -#define rgrb _xyxz() -#define ggrb _yyxz() -#define bgrb _zyxz() -#define agrb _wyxz() -#define rbrb _xzxz() -#define gbrb _yzxz() -#define bbrb _zzxz() -#define abrb _wzxz() -#define rarb _xwxz() -#define garb _ywxz() -#define barb _zwxz() -#define aarb _wwxz() -#define rrgb _xxyz() -#define grgb _yxyz() -#define brgb _zxyz() -#define argb _wxyz() -#define rggb _xyyz() -#define gggb _yyyz() -#define bggb _zyyz() -#define aggb _wyyz() -#define rbgb _xzyz() -#define gbgb _yzyz() -#define bbgb _zzyz() -#define abgb _wzyz() -#define ragb _xwyz() -#define gagb _ywyz() -#define bagb _zwyz() -#define aagb _wwyz() -#define rrbb _xxzz() -#define grbb _yxzz() -#define brbb _zxzz() -#define arbb _wxzz() -#define rgbb _xyzz() -#define ggbb _yyzz() -#define bgbb _zyzz() -#define agbb _wyzz() -#define rbbb _xzzz() -#define gbbb _yzzz() -#define bbbb _zzzz() -#define abbb _wzzz() -#define rabb _xwzz() -#define gabb _ywzz() -#define babb _zwzz() -#define aabb _wwzz() -#define rrab _xxwz() -#define grab _yxwz() -#define brab _zxwz() -#define arab _wxwz() -#define rgab _xywz() -#define ggab _yywz() -#define bgab _zywz() -#define agab _wywz() -#define rbab _xzwz() -#define gbab _yzwz() -#define bbab _zzwz() -#define abab _wzwz() -#define raab _xwwz() -#define gaab _ywwz() -#define baab _zwwz() -#define aaab _wwwz() -#define rrra _xxxw() -#define grra _yxxw() -#define brra _zxxw() -#define arra _wxxw() -#define rgra _xyxw() -#define ggra _yyxw() -#define bgra _zyxw() -#define agra _wyxw() -#define rbra _xzxw() -#define gbra _yzxw() -#define bbra _zzxw() -#define abra _wzxw() -#define rara _xwxw() -#define gara _ywxw() -#define bara _zwxw() -#define aara _wwxw() -#define rrga _xxyw() -#define grga _yxyw() -#define brga _zxyw() -#define arga _wxyw() -#define rgga _xyyw() -#define ggga _yyyw() -#define bgga _zyyw() -#define agga _wyyw() -#define rbga _xzyw() -#define gbga _yzyw() -#define bbga _zzyw() -#define abga _wzyw() -#define raga _xwyw() -#define gaga _ywyw() -#define baga _zwyw() -#define aaga _wwyw() -#define rrba _xxzw() -#define grba _yxzw() -#define brba _zxzw() -#define arba _wxzw() -#define rgba _xyzw() -#define ggba _yyzw() -#define bgba _zyzw() -#define agba _wyzw() -#define rbba _xzzw() -#define gbba _yzzw() -#define bbba _zzzw() -#define abba _wzzw() -#define raba _xwzw() -#define gaba _ywzw() -#define baba _zwzw() -#define aaba _wwzw() -#define rraa _xxww() -#define graa _yxww() -#define braa _zxww() -#define araa _wxww() -#define rgaa _xyww() -#define ggaa _yyww() -#define bgaa _zyww() -#define agaa _wyww() -#define rbaa _xzww() -#define gbaa _yzww() -#define bbaa _zzww() -#define abaa _wzww() -#define raaa _xwww() -#define gaaa _ywww() -#define baaa _zwww() -#define aaaa _wwww() - -#endif//defined(GLM_SWIZZLE) && defined(GLM_SWIZZLE_RGBA) - -#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STQP) - -// 2 components texcoord swizzle operators -#define ss _xx() -#define ts _yx() -#define ps _zx() -#define qs _wx() -#define st _xy() -#define tt _yy() -#define pt _zy() -#define qt _qy() -#define sp _xz() -#define tp _yz() -#define pp _zz() -#define qp _qz() -#define sq _xq() -#define tq _yq() -#define pq _zq() -#define qq _qq() - -// 3 components tescoord swizzle operators -#define sss _xxx() -#define tss _yxx() -#define pss _zxx() -#define qss _qxx() -#define sts _xyx() -#define tts _yyx() -#define pts _zyx() -#define qts _qyx() -#define sps _xzx() -#define tps _yzx() -#define pps _zzx() -#define qps _qzx() -#define sqs _xqx() -#define tqs _yqx() -#define pqs _zqx() -#define qqs _qqx() -#define sst _xxy() -#define tst _yxy() -#define pst _zxy() -#define qst _qxy() -#define stt _xyy() -#define ttt _yyy() -#define ptt _zyy() -#define qtt _qyy() -#define spt _xzy() -#define tpt _yzy() -#define ppt _zzy() -#define qpt _qzy() -#define sqt _xqy() -#define tqt _yqy() -#define pqt _zqy() -#define qqt _qqy() -#define ssp _xxz() -#define tsp _yxz() -#define psp _zxz() -#define qsp _qxz() -#define stp _xyz() -#define ttp _yyz() -#define ptp _zyz() -#define qtp _qyz() -#define spp _xzz() -#define tpp _yzz() -#define ppp _zzz() -#define qpp _qzz() -#define sqp _xqz() -#define tqp _yqz() -#define pqp _zqz() -#define qqp _qqz() -#define ssq _xxq() -#define tsq _yxq() -#define psq _zxq() -#define qsq _qxq() -#define stq _xyq() -#define ttq _yyq() -#define ptq _zyq() -#define qtq _qyq() -#define spq _xzq() -#define tpq _yzq() -#define ppq _zzq() -#define qpq _qzq() -#define sqq _xqq() -#define tqq _yqq() -#define pqq _zqq() -#define qqq _qqq() - -// 4 components tescoord swizzle operators -#define ssss _xxxx() -#define tsss _yxxx() -#define psss _zxxx() -#define qsss _qxxx() -#define stss _xyxx() -#define ttss _yyxx() -#define ptss _zyxx() -#define qtss _qyxx() -#define spss _xzxx() -#define tpss _yzxx() -#define ppss _zzxx() -#define qpss _qzxx() -#define sqss _xqxx() -#define tqss _yqxx() -#define pqss _zqxx() -#define qqss _qqxx() -#define ssts _xxyx() -#define tsts _yxyx() -#define psts _zxyx() -#define qsts _qxyx() -#define stts _xyyx() -#define ttts _yyyx() -#define ptts _zyyx() -#define qtts _qyyx() -#define spts _xzyx() -#define tpts _yzyx() -#define ppts _zzyx() -#define qpts _qzyx() -#define sqts _xqyx() -#define tqts _yqyx() -#define pqts _zqyx() -#define qqts _qqyx() -#define ssps _xxzx() -#define tsps _yxzx() -#define psps _zxzx() -#define qsps _qxzx() -#define stps _xyzx() -#define ttps _yyzx() -#define ptps _zyzx() -#define qtps _qyzx() -#define spps _xzzx() -#define tpps _yzzx() -#define ppps _zzzx() -#define qpps _qzzx() -#define sqps _xqzx() -#define tqps _yqzx() -#define pqps _zqzx() -#define qqps _qqzx() -#define ssqs _xxqx() -#define tsqs _yxqx() -#define psqs _zxqx() -#define qsqs _qxqx() -#define stqs _xyqx() -#define ttqs _yyqx() -#define ptqs _zyqx() -#define qtqs _qyqx() -#define spqs _xzqx() -#define tpqs _yzqx() -#define ppqs _zzqx() -#define qpqs _qzqx() -#define sqqs _xqqx() -#define tqqs _yqqx() -#define pqqs _zqqx() -#define qqqs _qqqx() -#define ssst _xxxy() -#define tsst _yxxy() -#define psst _zxxy() -#define qsst _qxxy() -#define stst _xyxy() -#define ttst _yyxy() -#define ptst _zyxy() -#define qtst _qyxy() -#define spst _xzxy() -#define tpst _yzxy() -#define ppst _zzxy() -#define qpst _qzxy() -#define sqst _xqxy() -#define tqst _yqxy() -#define pqst _zqxy() -#define qqst _qqxy() -#define sstt _xxyy() -#define tstt _yxyy() -#define pstt _zxyy() -#define qstt _qxyy() -#define sttt _xyyy() -#define tttt _yyyy() -#define pttt _zyyy() -#define qttt _qyyy() -#define sptt _xzyy() -#define tptt _yzyy() -#define pptt _zzyy() -#define qptt _qzyy() -#define sqtt _xqyy() -#define tqtt _yqyy() -#define pqtt _zqyy() -#define qqtt _qqyy() -#define sspt _xxzy() -#define tspt _yxzy() -#define pspt _zxzy() -#define qspt _qxzy() -#define stpt _xyzy() -#define ttpt _yyzy() -#define ptpt _zyzy() -#define qtpt _qyzy() -#define sppt _xzzy() -#define tppt _yzzy() -#define pppt _zzzy() -#define qppt _qzzy() -#define sqpt _xqzy() -#define tqpt _yqzy() -#define pqpt _zqzy() -#define qqpt _qqzy() -#define ssqt _xxqy() -#define tsqt _yxqy() -#define psqt _zxqy() -#define qsqt _qxqy() -#define stqt _xyqy() -#define ttqt _yyqy() -#define ptqt _zyqy() -#define qtqt _qyqy() -#define spqt _xzqy() -#define tpqt _yzqy() -#define ppqt _zzqy() -#define qpqt _qzqy() -#define sqqt _xqqy() -#define tqqt _yqqy() -#define pqqt _zqqy() -#define qqqt _qqqy() -#define sssp _xxxz() -#define tssp _yxxz() -#define pssp _zxxz() -#define qssp _qxxz() -#define stsp _xyxz() -#define ttsp _yyxz() -#define ptsp _zyxz() -#define qtsp _qyxz() -#define spsp _xzxz() -#define tpsp _yzxz() -#define ppsp _zzxz() -#define qpsp _qzxz() -#define sqsp _xqxz() -#define tqsp _yqxz() -#define pqsp _zqxz() -#define qqsp _qqxz() -#define sstp _xxyz() -#define tstp _yxyz() -#define pstp _zxyz() -#define qstp _qxyz() -#define sttp _xyyz() -#define tttp _yyyz() -#define pttp _zyyz() -#define qttp _qyyz() -#define sptp _xzyz() -#define tptp _yzyz() -#define pptp _zzyz() -#define qptp _qzyz() -#define sqtp _xqyz() -#define tqtp _yqyz() -#define pqtp _zqyz() -#define qqtp _qqyz() -#define sspp _xxzz() -#define tspp _yxzz() -#define pspp _zxzz() -#define qspp _qxzz() -#define stpp _xyzz() -#define ttpp _yyzz() -#define ptpp _zyzz() -#define qtpp _qyzz() -#define sppp _xzzz() -#define tppp _yzzz() -#define pppp _zzzz() -#define qppp _qzzz() -#define sqpp _xqzz() -#define tqpp _yqzz() -#define pqpp _zqzz() -#define qqpp _qqzz() -#define ssqp _xxqz() -#define tsqp _yxqz() -#define psqp _zxqz() -#define qsqp _qxqz() -#define stqp _xyqz() -#define ttqp _yyqz() -#define ptqp _zyqz() -#define qtqp _qyqz() -#define spqp _xzqz() -#define tpqp _yzqz() -#define ppqp _zzqz() -#define qpqp _qzqz() -#define sqqp _xqqz() -#define tqqp _yqqz() -#define pqqp _zqqz() -#define qqqp _qqqz() -#define sssq _xxxq() -#define tssq _yxxq() -#define pssq _zxxq() -#define qssq _qxxq() -#define stsq _xyxq() -#define ttsq _yyxq() -#define ptsq _zyxq() -#define qtsq _qyxq() -#define spsq _xzxq() -#define tpsq _yzxq() -#define ppsq _zzxq() -#define qpsq _qzxq() -#define sqsq _xqxq() -#define tqsq _yqxq() -#define pqsq _zqxq() -#define qqsq _qqxq() -#define sstq _xxyq() -#define tstq _yxyq() -#define pstq _zxyq() -#define qstq _qxyq() -#define sttq _xyyq() -#define tttq _yyyq() -#define pttq _zyyq() -#define qttq _qyyq() -#define sptq _xzyq() -#define tptq _yzyq() -#define pptq _zzyq() -#define qptq _qzyq() -#define sqtq _xqyq() -#define tqtq _yqyq() -#define pqtq _zqyq() -#define qqtq _qqyq() -#define sspq _xxzq() -#define tspq _yxzq() -#define pspq _zxzq() -#define qspq _qxzq() -#define stpq _xyzq() -#define ttpq _yyzq() -#define ptpq _zyzq() -#define qtpq _qyzq() -#define sppq _xzzq() -#define tppq _yzzq() -#define pppq _zzzq() -#define qppq _qzzq() -#define sqpq _xqzq() -#define tqpq _yqzq() -#define pqpq _zqzq() -#define qqpq _qqzq() -#define ssqq _xxqq() -#define tsqq _yxqq() -#define psqq _zxqq() -#define qsqq _qxqq() -#define stqq _xyqq() -#define ttqq _yyqq() -#define ptqq _zyqq() -#define qtqq _qyqq() -#define spqq _xzqq() -#define tpqq _yzqq() -#define ppqq _zzqq() -#define qpqq _qzqq() -#define sqqq _xqqq() -#define tqqq _yqqq() -#define pqqq _zqqq() -#define qqqq _qqqq() - -#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STQP) - -/* -// 2 components color swizzle operators -#define rr _rr() -#define gr _gr() -#define br _br() -#define ar _ar() -#define rg _rg() -#define gg _gg() -#define bg _bg() -#define ag _ag() -#define rb _rb() -#define gb _gb() -#define bb _bb() -#define ab _ab() -#define ra _ra() -#define ga _ga() -#define ba _ba() -#define aa _aa() - -// 3 components color swizzle operators -#define rrr _rrr() -#define grr _grr() -#define brr _brr() -#define arr _arr() -#define rgr _rgr() -#define ggr _ggr() -#define bgr _bgr() -#define agr _agr() -#define rbr _rbr() -#define gbr _gbr() -#define bbr _bbr() -#define abr _abr() -#define rar _rar() -#define gar _gar() -#define bar _bar() -#define aar _aar() -#define rrg _rrg() -#define grg _grg() -#define brg _brg() -#define arg _arg() -#define rgg _rgg() -#define ggg _ggg() -#define bgg _bgg() -#define agg _agg() -#define rbg _rbg() -#define gbg _gbg() -#define bbg _bbg() -#define abg _abg() -#define rag _rag() -#define gag _gag() -#define bag _bag() -#define aag _aag() -#define rrb _rrb() -#define grb _grb() -#define brb _brb() -#define arb _arb() -#define rgb _rgb() -#define ggb _ggb() -#define bgb _bgb() -#define agb _agb() -#define rbb _rbb() -#define gbb _gbb() -#define bbb _bbb() -#define abb _abb() -#define rab _rab() -#define gab _gab() -#define bab _bab() -#define aab _aab() -#define rra _rra() -#define gra _gra() -#define bra _bra() -#define ara _ara() -#define rga _rga() -#define gga _gga() -#define bga _bga() -#define aga _aga() -#define rba _rba() -#define gba _gba() -#define bba _bba() -#define aba _aba() -#define raa _raa() -#define gaa _gaa() -#define baa _baa() -#define aaa _aaa() - -// 4 components color swizzle operators -#define rrrr _rrrr() -#define grrr _grrr() -#define brrr _brrr() -#define arrr _arrr() -#define rgrr _rgrr() -#define ggrr _ggrr() -#define bgrr _bgrr() -#define agrr _agrr() -#define rbrr _rbrr() -#define gbrr _gbrr() -#define bbrr _bbrr() -#define abrr _abrr() -#define rarr _rarr() -#define garr _garr() -#define barr _barr() -#define aarr _aarr() -#define rrgr _rrgr() -#define grgr _grgr() -#define brgr _brgr() -#define argr _argr() -#define rggr _rggr() -#define gggr _gggr() -#define bggr _bggr() -#define aggr _aggr() -#define rbgr _rbgr() -#define gbgr _gbgr() -#define bbgr _bbgr() -#define abgr _abgr() -#define ragr _ragr() -#define gagr _gagr() -#define bagr _bagr() -#define aagr _aagr() -#define rrbr _rrbr() -#define grbr _grbr() -#define brbr _brbr() -#define arbr _arbr() -#define rgbr _rgbr() -#define ggbr _ggbr() -#define bgbr _bgbr() -#define agbr _agbr() -#define rbbr _rbbr() -#define gbbr _gbbr() -#define bbbr _bbbr() -#define abbr _abbr() -#define rabr _rabr() -#define gabr _gabr() -#define babr _babr() -#define aabr _aabr() -#define rrar _rrar() -#define grar _grar() -#define brar _brar() -#define arar _arar() -#define rgar _rgar() -#define ggar _ggar() -#define bgar _bgar() -#define agar _agar() -#define rbar _rbar() -#define gbar _gbar() -#define bbar _bbar() -#define abar _abar() -#define raar _raar() -#define gaar _gaar() -#define baar _baar() -#define aaar _aaar() -#define rrrg _rrrg() -#define grrg _grrg() -#define brrg _brrg() -#define arrg _arrg() -#define rgrg _rgrg() -#define ggrg _ggrg() -#define bgrg _bgrg() -#define agrg _agrg() -#define rbrg _rbrg() -#define gbrg _gbrg() -#define bbrg _bbrg() -#define abrg _abrg() -#define rarg _rarg() -#define garg _garg() -#define barg _barg() -#define aarg _aarg() -#define rrgg _rrgg() -#define grgg _grgg() -#define brgg _brgg() -#define argg _argg() -#define rggg _rggg() -#define gggg _gggg() -#define bggg _bggg() -#define aggg _aggg() -#define rbgg _rbgg() -#define gbgg _gbgg() -#define bbgg _bbgg() -#define abgg _abgg() -#define ragg _ragg() -#define gagg _gagg() -#define bagg _bagg() -#define aagg _aagg() -#define rrbg _rrbg() -#define grbg _grbg() -#define brbg _brbg() -#define arbg _arbg() -#define rgbg _rgbg() -#define ggbg _ggbg() -#define bgbg _bgbg() -#define agbg _agbg() -#define rbbg _rbbg() -#define gbbg _gbbg() -#define bbbg _bbbg() -#define abbg _abbg() -#define rabg _rabg() -#define gabg _gabg() -#define babg _babg() -#define aabg _aabg() -#define rrag _rrag() -#define grag _grag() -#define brag _brag() -#define arag _arag() -#define rgag _rgag() -#define ggag _ggag() -#define bgag _bgag() -#define agag _agag() -#define rbag _rbag() -#define gbag _gbag() -#define bbag _bbag() -#define abag _abag() -#define raag _raag() -#define gaag _gaag() -#define baag _baag() -#define aaag _aaag() -#define rrrb _rrrb() -#define grrb _grrb() -#define brrb _brrb() -#define arrb _arrb() -#define rgrb _rgrb() -#define ggrb _ggrb() -#define bgrb _bgrb() -#define agrb _agrb() -#define rbrb _rbrb() -#define gbrb _gbrb() -#define bbrb _bbrb() -#define abrb _abrb() -#define rarb _rarb() -#define garb _garb() -#define barb _barb() -#define aarb _aarb() -#define rrgb _rrgb() -#define grgb _grgb() -#define brgb _brgb() -#define argb _argb() -#define rggb _rggb() -#define gggb _gggb() -#define bggb _bggb() -#define aggb _aggb() -#define rbgb _rbgb() -#define gbgb _gbgb() -#define bbgb _bbgb() -#define abgb _abgb() -#define ragb _ragb() -#define gagb _gagb() -#define bagb _bagb() -#define aagb _aagb() -#define rrbb _rrbb() -#define grbb _grbb() -#define brbb _brbb() -#define arbb _arbb() -#define rgbb _rgbb() -#define ggbb _ggbb() -#define bgbb _bgbb() -#define agbb _agbb() -#define rbbb _rbbb() -#define gbbb _gbbb() -#define bbbb _bbbb() -#define abbb _abbb() -#define rabb _rabb() -#define gabb _gabb() -#define babb _babb() -#define aabb _aabb() -#define rrab _rrab() -#define grab _grab() -#define brab _brab() -#define arab _arab() -#define rgab _rgab() -#define ggab _ggab() -#define bgab _bgab() -#define agab _agab() -#define rbab _rbab() -#define gbab _gbab() -#define bbab _bbab() -#define abab _abab() -#define raab _raab() -#define gaab _gaab() -#define baab _baab() -#define aaab _aaab() -#define rrra _rrra() -#define grra _grra() -#define brra _brra() -#define arra _arra() -#define rgra _rgra() -#define ggra _ggra() -#define bgra _bgra() -#define agra _agra() -#define rbra _rbra() -#define gbra _gbra() -#define bbra _bbra() -#define abra _abra() -#define rara _rara() -#define gara _gara() -#define bara _bara() -#define aara _aara() -#define rrga _rrga() -#define grga _grga() -#define brga _brga() -#define arga _arga() -#define rgga _rgga() -#define ggga _ggga() -#define bgga _bgga() -#define agga _agga() -#define rbga _rbga() -#define gbga _gbga() -#define bbga _bbga() -#define abga _abga() -#define raga _raga() -#define gaga _gaga() -#define baga _baga() -#define aaga _aaga() -#define rrba _rrba() -#define grba _grba() -#define brba _brba() -#define arba _arba() -#define rgba _rgba() -#define ggba _ggba() -#define bgba _bgba() -#define agba _agba() -#define rbba _rbba() -#define gbba _gbba() -#define bbba _bbba() -#define abba _abba() -#define raba _raba() -#define gaba _gaba() -#define baba _baba() -#define aaba _aaba() -#define rraa _rraa() -#define graa _graa() -#define braa _braa() -#define araa _araa() -#define rgaa _rgaa() -#define ggaa _ggaa() -#define bgaa _bgaa() -#define agaa _agaa() -#define rbaa _rbaa() -#define gbaa _gbaa() -#define bbaa _bbaa() -#define abaa _abaa() -#define raaa _raaa() -#define gaaa _gaaa() -#define baaa _baaa() -#define aaaa _aaaa() - -// 2 components texcoord swizzle operators -#define ss _ss() -#define ts _ts() -#define ps _ps() -#define qs _qs() -#define st _st() -#define tt _tt() -#define pt _pt() -#define qt _qt() -#define sp _sp() -#define tp _tp() -#define pp _pp() -#define qp _qp() -#define sq _sq() -#define tq _tq() -#define pq _pq() -#define qq _qq() - -// 3 components tescoord swizzle operators -#define sss _sss() -#define tss _tss() -#define pss _pss() -#define qss _qss() -#define sts _sts() -#define tts _tts() -#define pts _pts() -#define qts _qts() -#define sps _sps() -#define tps _tps() -#define pps _pps() -#define qps _qps() -#define sqs _sqs() -#define tqs _tqs() -#define pqs _pqs() -#define qqs _qqs() -#define sst _sst() -#define tst _tst() -#define pst _pst() -#define qst _qst() -#define stt _stt() -#define ttt _ttt() -#define ptt _ptt() -#define qtt _qtt() -#define spt _spt() -#define tpt _tpt() -#define ppt _ppt() -#define qpt _qpt() -#define sqt _sqt() -#define tqt _tqt() -#define pqt _pqt() -#define qqt _qqt() -#define ssp _ssp() -#define tsp _tsp() -#define psp _psp() -#define qsp _qsp() -#define stp _stp() -#define ttp _ttp() -#define ptp _ptp() -#define qtp _qtp() -#define spp _spp() -#define tpp _tpp() -#define ppp _ppp() -#define qpp _qpp() -#define sqp _sqp() -#define tqp _tqp() -#define pqp _pqp() -#define qqp _qqp() -#define ssq _ssq() -#define tsq _tsq() -#define psq _psq() -#define qsq _qsq() -#define stq _stq() -#define ttq _ttq() -#define ptq _ptq() -#define qtq _qtq() -#define spq _spq() -#define tpq _tpq() -#define ppq _ppq() -#define qpq _qpq() -#define sqq _sqq() -#define tqq _tqq() -#define pqq _pqq() -#define qqq _qqq() - -// 4 components tescoord swizzle operators -#define ssss _ssss() -#define tsss _tsss() -#define psss _psss() -#define qsss _qsss() -#define stss _stss() -#define ttss _ttss() -#define ptss _ptss() -#define qtss _qtss() -#define spss _spss() -#define tpss _tpss() -#define ppss _ppss() -#define qpss _qpss() -#define sqss _sqss() -#define tqss _tqss() -#define pqss _pqss() -#define qqss _qqss() -#define ssts _ssts() -#define tsts _tsts() -#define psts _psts() -#define qsts _qsts() -#define stts _stts() -#define ttts _ttts() -#define ptts _ptts() -#define qtts _qtts() -#define spts _spts() -#define tpts _tpts() -#define ppts _ppts() -#define qpts _qpts() -#define sqts _sqts() -#define tqts _tqts() -#define pqts _pqts() -#define qqts _qqts() -#define ssps _ssps() -#define tsps _tsps() -#define psps _psps() -#define qsps _qsps() -#define stps _stps() -#define ttps _ttps() -#define ptps _ptps() -#define qtps _qtps() -#define spps _spps() -#define tpps _tpps() -#define ppps _ppps() -#define qpps _qpps() -#define sqps _sqps() -#define tqps _tqps() -#define pqps _pqps() -#define qqps _qqps() -#define ssqs _ssqs() -#define tsqs _tsqs() -#define psqs _psqs() -#define qsqs _qsqs() -#define stqs _stqs() -#define ttqs _ttqs() -#define ptqs _ptqs() -#define qtqs _qtqs() -#define spqs _spqs() -#define tpqs _tpqs() -#define ppqs _ppqs() -#define qpqs _qpqs() -#define sqqs _sqqs() -#define tqqs _tqqs() -#define pqqs _pqqs() -#define qqqs _qqqs() -#define ssst _ssst() -#define tsst _tsst() -#define psst _psst() -#define qsst _qsst() -#define stst _stst() -#define ttst _ttst() -#define ptst _ptst() -#define qtst _qtst() -#define spst _spst() -#define tpst _tpst() -#define ppst _ppst() -#define qpst _qpst() -#define sqst _sqst() -#define tqst _tqst() -#define pqst _pqst() -#define qqst _qqst() -#define sstt _sstt() -#define tstt _tstt() -#define pstt _pstt() -#define qstt _qstt() -#define sttt _sttt() -#define tttt _tttt() -#define pttt _pttt() -#define qttt _qttt() -#define sptt _sptt() -#define tptt _tptt() -#define pptt _pptt() -#define qptt _qptt() -#define sqtt _sqtt() -#define tqtt _tqtt() -#define pqtt _pqtt() -#define qqtt _qqtt() -#define sspt _sspt() -#define tspt _tspt() -#define pspt _pspt() -#define qspt _qspt() -#define stpt _stpt() -#define ttpt _ttpt() -#define ptpt _ptpt() -#define qtpt _qtpt() -#define sppt _sppt() -#define tppt _tppt() -#define pppt _pppt() -#define qppt _qppt() -#define sqpt _sqpt() -#define tqpt _tqpt() -#define pqpt _pqpt() -#define qqpt _qqpt() -#define ssqt _ssqt() -#define tsqt _tsqt() -#define psqt _psqt() -#define qsqt _qsqt() -#define stqt _stqt() -#define ttqt _ttqt() -#define ptqt _ptqt() -#define qtqt _qtqt() -#define spqt _spqt() -#define tpqt _tpqt() -#define ppqt _ppqt() -#define qpqt _qpqt() -#define sqqt _sqqt() -#define tqqt _tqqt() -#define pqqt _pqqt() -#define qqqt _qqqt() -#define sssp _sssp() -#define tssp _tssp() -#define pssp _pssp() -#define qssp _qssp() -#define stsp _stsp() -#define ttsp _ttsp() -#define ptsp _ptsp() -#define qtsp _qtsp() -#define spsp _spsp() -#define tpsp _tpsp() -#define ppsp _ppsp() -#define qpsp _qpsp() -#define sqsp _sqsp() -#define tqsp _tqsp() -#define pqsp _pqsp() -#define qqsp _qqsp() -#define sstp _sstp() -#define tstp _tstp() -#define pstp _pstp() -#define qstp _qstp() -#define sttp _sttp() -#define tttp _tttp() -#define pttp _pttp() -#define qttp _qttp() -#define sptp _sptp() -#define tptp _tptp() -#define pptp _pptp() -#define qptp _qptp() -#define sqtp _sqtp() -#define tqtp _tqtp() -#define pqtp _pqtp() -#define qqtp _qqtp() -#define sspp _sspp() -#define tspp _tspp() -#define pspp _pspp() -#define qspp _qspp() -#define stpp _stpp() -#define ttpp _ttpp() -#define ptpp _ptpp() -#define qtpp _qtpp() -#define sppp _sppp() -#define tppp _tppp() -#define pppp _pppp() -#define qppp _qppp() -#define sqpp _sqpp() -#define tqpp _tqpp() -#define pqpp _pqpp() -#define qqpp _qqpp() -#define ssqp _ssqp() -#define tsqp _tsqp() -#define psqp _psqp() -#define qsqp _qsqp() -#define stqp _stqp() -#define ttqp _ttqp() -#define ptqp _ptqp() -#define qtqp _qtqp() -#define spqp _spqp() -#define tpqp _tpqp() -#define ppqp _ppqp() -#define qpqp _qpqp() -#define sqqp _sqqp() -#define tqqp _tqqp() -#define pqqp _pqqp() -#define qqqp _qqqp() -#define sssq _sssq() -#define tssq _tssq() -#define pssq _pssq() -#define qssq _qssq() -#define stsq _stsq() -#define ttsq _ttsq() -#define ptsq _ptsq() -#define qtsq _qtsq() -#define spsq _spsq() -#define tpsq _tpsq() -#define ppsq _ppsq() -#define qpsq _qpsq() -#define sqsq _sqsq() -#define tqsq _tqsq() -#define pqsq _pqsq() -#define qqsq _qqsq() -#define sstq _sstq() -#define tstq _tstq() -#define pstq _pstq() -#define qstq _qstq() -#define sttq _sttq() -#define tttq _tttq() -#define pttq _pttq() -#define qttq _qttq() -#define sptq _sptq() -#define tptq _tptq() -#define pptq _pptq() -#define qptq _qptq() -#define sqtq _sqtq() -#define tqtq _tqtq() -#define pqtq _pqtq() -#define qqtq _qqtq() -#define sspq _sspq() -#define tspq _tspq() -#define pspq _pspq() -#define qspq _qspq() -#define stpq _stpq() -#define ttpq _ttpq() -#define ptpq _ptpq() -#define qtpq _qtpq() -#define sppq _sppq() -#define tppq _tppq() -#define pppq _pppq() -#define qppq _qppq() -#define sqpq _sqpq() -#define tqpq _tqpq() -#define pqpq _pqpq() -#define qqpq _qqpq() -#define ssqq _ssqq() -#define tsqq _tsqq() -#define psqq _psqq() -#define qsqq _qsqq() -#define stqq _stqq() -#define ttqq _ttqq() -#define ptqq _ptqq() -#define qtqq _qtqq() -#define spqq _spqq() -#define tpqq _tpqq() -#define ppqq _ppqq() -#define qpqq _qpqq() -#define sqqq _sqqq() -#define tqqq _tqqq() -#define pqqq _pqqq() -#define qqqq _qqqq() -*/ - -#endif//__swizzle_h__ diff --git a/experimental/sse/glm/core/_swizzle.inl b/experimental/sse/glm/core/_swizzle.inl deleted file mode 100644 index adbe5440..00000000 --- a/experimental/sse/glm/core/_swizzle.inl +++ /dev/null @@ -1,20 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2006-04-27 -// Licence : This source is under GNU LGPL licence -// File : _swizzle.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __swizzle_inl__ -#define __swizzle_inl__ - -#include "./_swizzle.h" - -namespace glm -{ - -} - -#endif//__swizzle_inl__ diff --git a/experimental/sse/glm/core/_xmat2.h b/experimental/sse/glm/core/_xmat2.h deleted file mode 100644 index b6f5580a..00000000 --- a/experimental/sse/glm/core/_xmat2.h +++ /dev/null @@ -1,173 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-27 -// Updated : 2007-03-01 -// Licence : This source is under GNU LGPL licence -// File : _xmat2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat2x2_h__ -#define __mat2x2_h__ - -namespace glm{ -namespace detail{ - - template class _xvec2; - template class _xmat3; - template class _xmat4; - template class _xmat2x4; - template class _xmat2x3; - template class _xmat3x2; - template class _xmat3x4; - template class _xmat4x2; - template class _xmat4x3; - - //!< \brief Template for 2 * 2 matrix of floating-point numbers. - template - class _xmat2 - { - private: - // Data - _xvec2 value[2]; - - public: - _xmat2 _inverse() const; - - public: - typedef T value_type; - typedef _xvec2 col_type; - typedef _xvec2 row_type; - typedef int size_type; - static const size_type value_size; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat2(); - _xmat2(const _xmat2& m); - - explicit _xmat2(const T x); - explicit _xmat2(const T x1, const T y1, - const T x2, const T y2); - explicit _xmat2(const _xvec2 & v1, - const _xvec2 & v2); - - // Conversions - template - explicit _xmat2(const _xmat2& m); - - explicit _xmat2(const _xmat3& x); - explicit _xmat2(const _xmat4& x); - explicit _xmat2(const _xmat2x3& x); - explicit _xmat2(const _xmat3x2& x); - explicit _xmat2(const _xmat2x4& x); - explicit _xmat2(const _xmat4x2& x); - explicit _xmat2(const _xmat3x4& x); - explicit _xmat2(const _xmat4x3& x); - - //explicit _xmat2(const T* a); - // GL_GTX_euler_angles - //explicit _xmat2(const _xvec2 & angles); - - // Accesses - _xvec2& operator[](int i) {return value[i];} - const _xvec2 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat2& operator=(const _xmat2& m); - _xmat2& operator+=(const T s); - _xmat2& operator+=(const _xmat2& m); - _xmat2& operator-=(const T s); - _xmat2& operator-=(const _xmat2& m); - _xmat2& operator*=(const T s); - _xmat2& operator*= (const _xmat2& m); - _xmat2& operator/= (const T s); - _xmat2& operator/= (const _xmat2& m); - _xmat2& operator++ (); - _xmat2& operator-- (); - - const _xmat2 operator- () const; - const _xmat2 operator++ (int n) const; - const _xmat2 operator-- (int n) const; - }; - - // Binary operators - template - inline _xmat2 operator+ (const _xmat2& m, const T s); - - template - inline _xmat2 operator+ (const T s, const _xmat2& m); - - template - inline _xvec2 operator+ (const _xmat2& m, const _xvec2& v); - - template - inline _xvec2 operator+ (const _xvec2& v, const _xmat2& m); - - template - inline _xmat2 operator+ (const _xmat2& m1, const _xmat2& m2); - - template - inline _xmat2 operator- (const _xmat2& m, const T s); - - template - inline _xmat2 operator- (const T s, const _xmat2& m); - - template - inline _xvec2 operator- (const _xmat2& m, const _xvec2& v); - - template - inline _xvec2 operator- (const _xvec2& v, const _xmat2& m); - - template - inline _xmat2 operator- (const _xmat2& m1, const _xmat2& m2); - - template - inline _xmat2 operator* (const _xmat2& m, const T s); - - template - inline _xmat2 operator* (const T s, const _xmat2& m); - - template - inline _xvec2 operator* (const _xmat2& m, const _xvec2& v); - - template - inline _xvec2 operator* (const _xvec2& v, const _xmat2& m); - - template - inline _xmat2 operator* (const _xmat2& m1, const _xmat2& m2); - - template - inline _xmat2 operator/ (const _xmat2& m, const T s); - - template - inline _xmat2 operator/ (const T s, const _xmat2& m); - - template - inline _xvec2 operator/ (const _xmat2& m, const _xvec2& v); - - template - inline _xvec2 operator/ (const _xvec2& v, const _xmat2& m); - - template - inline _xmat2 operator/ (const _xmat2& m1, const _xmat2& m2); - - // Unary constant operators - template - inline const _xmat2 operator- (const _xmat2& m); - - template - inline const _xmat2 operator-- (const _xmat2& m, int); - - template - inline const _xmat2 operator++ (const _xmat2& m, int); - -} //namespace detail -} //namespace glm - -#endif //__mat2x2_h__ diff --git a/experimental/sse/glm/core/_xmat2.inl b/experimental/sse/glm/core/_xmat2.inl deleted file mode 100644 index aa3a3483..00000000 --- a/experimental/sse/glm/core/_xmat2.inl +++ /dev/null @@ -1,416 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-16 -// Updated : 2007-03-01 -// Licence : This source is under GNU LGPL licence -// File : _xmat2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xmat2x2_inl__ -#define __xmat2x2_inl__ - -#include "./_xmat2.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat2::size_type _xmat2::value_size = 2; - template const typename _xmat2::size_type _xmat2::col_size = 2; - template const typename _xmat2::size_type _xmat2::row_size = 2; - - ////////////////////////////////////////////////////////////// - // mat2 constructors - - template - inline _xmat2::_xmat2() - { - this->value[0] = _xvec2(1, 0); - this->value[1] = _xvec2(0, 1); - } - - template - inline _xmat2::_xmat2(const _xmat2 & m) - { - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; - } - - template - inline _xmat2::_xmat2(const T f) - { - this->value[0] = _xvec2(f, 0); - this->value[1] = _xvec2(0, f); - } - - template - inline _xmat2::_xmat2(const T x0, const T y0, const T x1, const T y1) - { - this->value[0] = _xvec2(x0, y0); - this->value[1] = _xvec2(x1, y1); - } - - template - inline _xmat2::_xmat2(const _xvec2& v0, const _xvec2& v1) - { - this->value[0] = v0; - this->value[1] = v1; - } - - ////////////////////////////////////////////////////////////// - // mat2 conversions - - template - template - inline _xmat2::_xmat2(const _xmat2& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - } - - template - inline _xmat2::_xmat2(const _xmat3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - } - - template - inline _xmat2::_xmat2(const _xmat4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - } - - template - inline _xmat2::_xmat2(const _xmat2x3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - } - - template - inline _xmat2::_xmat2(const _xmat3x2& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - template - inline _xmat2::_xmat2(const _xmat2x4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - } - - template - inline _xmat2::_xmat2(const _xmat4x2& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - template - inline _xmat2::_xmat2(const _xmat3x4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - } - - template - inline _xmat2::_xmat2(const _xmat4x3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - } - -/* - template - inline _xmat2::_xmat2(const T* a) - { - this->value[0] = _xvec2(a[0], a[1]); - this->value[1] = _xvec2(a[2], a[3]); - } -*/ - - template - inline _xmat2 _xmat2::_inverse() const - { - T Determinant = value[0][0] * value[1][1] - value[1][0] * value[0][1]; - - _xmat2 Inverse( - + value[1][1] / Determinant, - - value[1][0] / Determinant, - - value[0][1] / Determinant, - + value[0][0] / Determinant); - return Inverse; - } - - ////////////////////////////////////////////////////////////// - // mat3 operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - template - inline _xmat2& _xmat2::operator=(const _xmat2& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template - inline _xmat2& _xmat2::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template - inline _xmat2& _xmat2::operator+= (const _xmat2& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - inline _xmat2& _xmat2::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template - inline _xmat2& _xmat2::operator-= (const _xmat2& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - inline _xmat2& _xmat2::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template - inline _xmat2& _xmat2::operator*= (const _xmat2& m) - { - return (*this = *this * m); - } - - template - inline _xmat2& _xmat2::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - template - inline _xmat2& _xmat2::operator/= (const _xmat2& m) - { - return (*this = *this / m); - } - - template - inline _xmat2& _xmat2::operator++ () - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - inline _xmat2& _xmat2::operator-- () - { - --this->value[0]; - --this->value[1]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat2 operator+ (const _xmat2& m, const T s) - { - return _xmat2( - m[0] + s, - m[1] + s); - } - - template - inline _xmat2 operator+ (const T s, const _xmat2& m) - { - return _xmat2( - m[0] + s, - m[1] + s); - } - - template - inline _xvec2 operator+ (const _xmat2& m, const _xvec2& v) - { - - } - - template - inline _xvec2 operator+ (const _xvec2& v, const _xmat2& m) - { - - } - - template - inline _xmat2 operator+ (const _xmat2& m1, const _xmat2& m2) - { - return _xmat2( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - inline _xmat2 operator- (const _xmat2& m, const T s) - { - return _xmat2( - m[0] - s, - m[1] - s); - } - - template - inline _xmat2 operator- (const T s, const _xmat2& m) - { - return _xmat2( - s - m[0], - s - m[1]); - } - - template - inline _xmat2 operator- (const _xmat2& m, const _xvec2& v) - { - - } - - template - inline _xmat2 operator- (const _xvec2& v, const _xmat2& m) - { - - } - - template - inline _xmat2 operator- (const _xmat2& m1, const _xmat2& m2) - { - return _xmat2( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - inline _xmat2 operator* (const _xmat2& m, const T s) - { - return _xmat2( - m[0] * s, - m[1] * s); - } - - template - inline _xmat2 operator* (const T s, const _xmat2& m) - { - return _xmat2( - m[0] * s, - m[1] * s); - } - - template - inline _xvec2 operator* (const _xmat2& m, const _xvec2& v) - { - return _xvec2( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y); - } - - template - inline _xvec2 operator* (const _xvec2& v, const _xmat2& m) - { - return _xvec2( - m[0][0] * v.x + m[0][1] * v.y, - m[1][0] * v.x + m[1][1] * v.y); - } - - template - inline _xmat2 operator* (const _xmat2& m1, const _xmat2& m2) - { - return _xmat2( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1]); - } - - template - inline _xmat2 operator/ (const _xmat2& m, const T s) - { - return _xmat2( - m[0] / s, - m[1] / s); - } - - template - inline _xmat2 operator/ (const T s, const _xmat2& m) - { - return _xmat2( - s / m[0], - s / m[1]); - } - - template - inline _xvec2 operator/ (const _xmat2& m, const _xvec2& v) - { - return m._inverse() * v; - } - - template - inline _xvec2 operator/ (const _xvec2& v, const _xmat2& m) - { - return v * m._inverse(); - } - - template - inline _xmat2 operator/ (const _xmat2& m1, const _xmat2& m2) - { - return m1 * m2._inverse(); - } - - // Unary constant operators - template - inline const _xmat2 operator- (const _xmat2& m) - { - return _xmat2( - -m.value[0], - -m.value[1]); - } - - template - inline const _xmat2 operator-- (const _xmat2& m, int) - { - return _xmat2( - m.value[0] - T(1), - m.value[1] - T(1)); - } - - template - inline const _xmat2 operator++ (const _xmat2& m, int) - { - return _xmat2( - m.value[0] + T(1), - m.value[1] + T(1)); - } - -} //namespace detail -} //namespace glm - -#endif //__xmat2x2_inl__ diff --git a/experimental/sse/glm/core/_xmat2x3.h b/experimental/sse/glm/core/_xmat2x3.h deleted file mode 100644 index 1d69f790..00000000 --- a/experimental/sse/glm/core/_xmat2x3.h +++ /dev/null @@ -1,143 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-10-01 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat2x3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat2x3_h__ -#define __mat2x3_h__ - -namespace glm{ -namespace detail{ - - template class _xvec2; - template class _xvec3; - template class _xvec4; - template class _xmat2; - template class _xmat3; - template class _xmat4; - template class _xmat2x4; - template class _xmat3x2; - template class _xmat3x4; - template class _xmat4x2; - template class _xmat4x3; - - //!< \brief Template for 2 * 3 matrix of floating-point numbers. - template - class _xmat2x3 - { - private: - // Data - _xvec3 value[2]; - - public: - typedef T value_type; - typedef _xvec3 col_type; - typedef _xvec2 row_type; - typedef int size_type; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat2x3(); - explicit _xmat2x3(const T x); - explicit _xmat2x3( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1); - explicit _xmat2x3( - const _xvec3& v0, - const _xvec3& v1); - - // Conversion - template - explicit _xmat2x3(const _xmat2x3& m); - - explicit _xmat2x3(const _xmat2& x); - explicit _xmat2x3(const _xmat3& x); - explicit _xmat2x3(const _xmat4& x); - explicit _xmat2x3(const _xmat2x4& x); - explicit _xmat2x3(const _xmat3x2& x); - explicit _xmat2x3(const _xmat3x4& x); - explicit _xmat2x3(const _xmat4x2& x); - explicit _xmat2x3(const _xmat4x3& x); - - // Accesses - _xvec3& operator[](int i) {return value[i];} - const _xvec3 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat2x3& operator= (const _xmat2x3& m); - _xmat2x3& operator+= (const T s); - _xmat2x3& operator+= (const _xmat2x3& m); - _xmat2x3& operator-= (const T s); - _xmat2x3& operator-= (const _xmat2x3& m); - _xmat2x3& operator*= (const T s); - _xmat2x3& operator*= (const _xmat3x2& m); - _xmat2x3& operator/= (const T s); -/* ToDo - _xmat2x3& operator/= (const _xmat3x2& m); -*/ - _xmat2x3& operator++ (); - _xmat2x3& operator-- (); - - // Unary constant operators - const _xmat2x3 operator- () const; - const _xmat2x3 operator++ (int n) const; - const _xmat2x3 operator-- (int n) const; - }; - - // Binary operators - template - _xmat2x3 operator+ (const _xmat2x3& m, const T s); - - template - _xmat2x3 operator+ (const _xmat2x3& m1, const _xmat2x3& m2); - - template - _xmat2x3 operator- (const _xmat2x3& m, const T s); - - template - _xmat2x3 operator- (const _xmat2x3& m1, const _xmat2x3& m2); - - template - _xmat2x3 operator* (const _xmat2x3& m, const T s); - - template - _xmat2x3 operator* (const T s, const _xmat2x3& m); - - template - _xvec3 operator* (const _xmat2x3& m, const _xvec2& v); - - template - _xvec3 operator* (const _xvec3& v, const _xmat2x3& m); - - template - _xmat3 operator* (const _xmat2x3& m1, const _xmat3x2& m2); - - template - _xmat3x2 operator/ (const _xmat2x3& m, const T s); - - template - _xmat3x2 operator/ (const T s, const _xmat2x3& m); -/* ToDo - template - _xvec3 operator/ (const _xmat2x3& m, const _xvec2& v); - - template - _xvec2 operator/ (const _xvec3& v, const _xmat2x3& m); - - template - _xmat3 operator/ (const _xmat3x2& m1, const _xmat2x3& m2); -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat2x3_h__ diff --git a/experimental/sse/glm/core/_xmat2x3.inl b/experimental/sse/glm/core/_xmat2x3.inl deleted file mode 100644 index 3e208a07..00000000 --- a/experimental/sse/glm/core/_xmat2x3.inl +++ /dev/null @@ -1,379 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-05 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat2x3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat2x3_inl__ -#define __mat2x3_inl__ - -#include "./_xmat2x3.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat2x3::size_type _xmat2x3::col_size = 2; - template const typename _xmat2x3::size_type _xmat2x3::row_size = 3; - - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat2x3::_xmat2x3() - { - this->value[0] = _xvec3(T(1), T(0), T(0)); - this->value[1] = _xvec3(T(0), T(1), T(0)); - } - - template - inline _xmat2x3::_xmat2x3(const T f) - { - this->value[0] = _xvec3(f, T(0), T(0)); - this->value[1] = _xvec3(T(0), f, T(0)); - } - - template - inline _xmat2x3::_xmat2x3 - ( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1 - ) - { - this->value[0] = _xvec3(x0, y0, z0); - this->value[1] = _xvec3(x1, y1, z1); - } - - template - inline _xmat2x3::_xmat2x3 - ( - const _xvec3 & v0, - const _xvec3 & v1 - ) - { - this->value[0] = v0; - this->value[1] = v1; - } - - // Conversion - template - template - inline _xmat2x3::_xmat2x3(const _xmat2x3& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat3& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat2x4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat3x2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat3x4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat4x2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - } - - template - inline _xmat2x3::_xmat2x3(const _xmat4x3& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat2x3& _xmat2x3::operator= (const _xmat2x3& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template - inline _xmat2x3& _xmat2x3::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template - inline _xmat2x3& _xmat2x3::operator+= (const _xmat2x3& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - inline _xmat2x3& _xmat2x3::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template - inline _xmat2x3& _xmat2x3::operator-= (const _xmat2x3& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - inline _xmat2x3& _xmat2x3::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template - inline _xmat2x3& _xmat2x3::operator*= (const _xmat3x2& m) - { - return (*this = _xmat2x3(*this * m)); - } - - template - inline _xmat2x3 & _xmat2x3::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } -/* ToDo - template - inline _xmat2x3& _xmat2x3::operator/= (const _xmat3x2& m) - { - return (*this = _xmat2x3(*this / m)); - } -*/ - template - inline _xmat2x3& _xmat2x3::operator++ () - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - inline _xmat2x3& _xmat2x3::operator-- () - { - --this->value[0]; - --this->value[1]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat2x3 _xmat2x3::operator- () const - { - return _xmat2x3( - -this->value[0], - -this->value[1]); - } - - template - inline const _xmat2x3 _xmat2x3::operator-- (int n) const - { - _xmat2x3 m = *this; - --m.value[0]; - --m.value[1]; - return m; - } - - template - inline const _xmat2x3 _xmat2x3::operator++ (int n) const - { - _xmat2x3 m = *this; - ++m.value[0]; - ++m.value[1]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat2x3 operator+ (const _xmat2x3& m, const T s) - { - return _xmat2x3( - m[0] + s, - m[1] + s); - } - - template - inline _xmat2x3 operator+ (const _xmat2x3& m1, const _xmat2x3& m2) - { - return _xmat2x3( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - inline _xmat2x3 operator- (const _xmat2x3& m, const T s) - { - return _xmat2x3( - m[0] - s, - m[1] - s); - } - - template - inline _xmat2x3 operator- (const _xmat2x3& m1, const _xmat2x3& m2) - { - return _xmat2x3( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - inline _xmat2x3 operator* (const _xmat2x3& m, const T s) - { - return _xmat2x3( - m[0] * s, - m[1] * s); - } - - template - inline _xmat2x3 operator* (const T s, const _xmat2x3 & m) - { - return _xmat2x3( - m[0] * s, - m[1] * s); - } - - template - inline _xvec3 operator* (const _xmat2x3& m, const _xvec2& v) - { - return _xvec3( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y, - m[0][2] * v.x + m[1][2] * v.y, - m[0][3] * v.x + m[1][3] * v.y); - } - - template - inline _xvec2 operator* (const _xvec3& v, const _xmat2x3& m) - { - return _xvec2( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); - } - - template - inline _xmat3 operator* (const _xmat2x3& m1, const _xmat3x2& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - - _xmat3 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - return Result; - } - - template - inline _xmat2x3 operator/ (const _xmat2x3& m, const T s) - { - return _xmat2x3( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s); - } - - template - inline _xmat2x3 operator/ (const T s, const _xmat2x3& m) - { - return _xmat2x3( - s / m.value[0], - s / m.value[1], - s / m.value[2]); - } -/* ToDo - template - inline _xvec3 operator/ (const _xmat2x3& m, const _xvec2& v) - { - - } - - template - inline _xvec2 operator/ (const _xvec3& v, const _xmat3x2& m) - { - - } - - template - inline _xmat3 operator/ (const _xmat2x3& m1, const _xmat3x2& m2) - { - - } -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat2x3_inl__ diff --git a/experimental/sse/glm/core/_xmat2x4.h b/experimental/sse/glm/core/_xmat2x4.h deleted file mode 100644 index 1a15ef2b..00000000 --- a/experimental/sse/glm/core/_xmat2x4.h +++ /dev/null @@ -1,144 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-05 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat2x4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat2x4_h__ -#define __mat2x4_h__ - -namespace glm{ -namespace detail{ - - template class _xvec2; - template class _xvec3; - template class _xvec4; - template class _xmat2; - template class _xmat3; - template class _xmat4; - template class _xmat2x3; - template class _xmat3x2; - template class _xmat3x4; - template class _xmat4x2; - template class _xmat4x3; - - //!< \brief Template for 2 * 4 matrix of floating-point numbers. - template - class _xmat2x4 - { - private: - // Data - _xvec4 value[2]; - - public: - typedef T value_type; - typedef _xvec2 col_type; - typedef _xvec4 row_type; - typedef int size_type; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat2x4(); - explicit _xmat2x4(const T x); - explicit _xmat2x4( - const T x0, const T y0, const T z0, const T w0, - const T x1, const T y1, const T z1, const T w1); - explicit _xmat2x4( - const _xvec4& v0, - const _xvec4& v1); - - // Conversion - template - explicit _xmat2x4(const _xmat2x4& m); - - explicit _xmat2x4(const _xmat2& x); - explicit _xmat2x4(const _xmat3& x); - explicit _xmat2x4(const _xmat4& x); - explicit _xmat2x4(const _xmat2x3& x); - //explicit _xmat2x4(const _xmat2x4& x); - explicit _xmat2x4(const _xmat3x2& x); - explicit _xmat2x4(const _xmat3x4& x); - explicit _xmat2x4(const _xmat4x2& x); - explicit _xmat2x4(const _xmat4x3& x); - - // Accesses - _xvec4& operator[](int i) {return value[i];} - const _xvec4 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat2x4& operator= (const _xmat2x4& m); - _xmat2x4& operator+= (const T s); - _xmat2x4& operator+= (const _xmat2x4& m); - _xmat2x4& operator-= (const T s); - _xmat2x4& operator-= (const _xmat2x4& m); - _xmat2x4& operator*= (const T s); - _xmat2x4& operator*= (const _xmat4x2& m); - _xmat2x4& operator/= (const T s); -/* ToDo - _xmat2x4& operator/= (const _xmat4x2& m); -*/ - _xmat2x4& operator++ (); - _xmat2x4& operator-- (); - - // Unary constant operators - const _xmat2x4 operator- () const; - const _xmat2x4 operator++ (int n) const; - const _xmat2x4 operator-- (int n) const; - }; - - // Binary operators - template - _xmat2x4 operator+ (const _xmat2x4& m, const T s); - - template - _xmat2x4 operator+ (const _xmat2x4& m1, const _xmat2x4& m2); - - template - _xmat2x4 operator- (const _xmat2x4& m, const T s); - - template - _xmat2x4 operator- (const _xmat2x4& m1, const _xmat2x4& m2); - - template - _xmat2x4 operator* (const _xmat2x4& m, const T s); - - template - _xmat2x4 operator* (const T s, const _xmat2x4& m); - - template - _xvec4 operator* (const _xmat2x4& m, const _xvec2& v); - - template - _xvec3 operator* (const _xvec4& v, const _xmat2x4& m); - - template - _xmat4 operator* (const _xmat2x4& m1, const _xmat4x2& m2); - - template - _xmat4x2 operator/ (const _xmat2x4& m, const T s); - - template - _xmat4x2 operator/ (const T s, const _xmat2x4& m); -/* ToDo - template - _xvec4 operator/ (const _xmat2x4& m, const _xvec2& v); - - template - _xvec2 operator/ (const _xvec4& v, const _xmat2x4& m); - - template - _xmat4 operator/ (const _xmat4x2& m1, const _xmat2x4& m2); -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat2x4_h__ diff --git a/experimental/sse/glm/core/_xmat2x4.inl b/experimental/sse/glm/core/_xmat2x4.inl deleted file mode 100644 index 1a7490a5..00000000 --- a/experimental/sse/glm/core/_xmat2x4.inl +++ /dev/null @@ -1,392 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-05 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat2x4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat2x4_inl__ -#define __mat2x4_inl__ - -#include "./_xmat2x4.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat2x4::size_type _xmat2x4::col_size = 2; - template const typename _xmat2x4::size_type _xmat2x4::row_size = 4; - - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat2x4::_xmat2x4() - { - this->value[0] = _xvec4(1, 0, 0, 0); - this->value[1] = _xvec4(0, 1, 0, 0); - } - - template - inline _xmat2x4::_xmat2x4(const T f) - { - this->value[0] = _xvec4(f, 0, 0, 0); - this->value[1] = _xvec4(0, f, 0, 0); - } - - template - inline _xmat2x4::_xmat2x4 - ( - const T x0, const T y0, const T z0, const T w0, - const T x1, const T y1, const T z1, const T w1 - ) - { - this->value[0] = _xvec4(x0, y0, z0, w0); - this->value[1] = _xvec4(x1, y1, z1, w1); - } - - template - inline _xmat2x4::_xmat2x4 - ( - const _xvec4 & v0, - const _xvec4 & v1 - ) - { - this->value[0] = v0; - this->value[1] = v1; - } - - // Conversion - template - template - inline _xmat2x4::_xmat2x4(const _xmat2x4& m) - { - this->value[0] = _xvec4(m[0]); - this->value[1] = _xvec4(m[1]); - } - - template - inline _xmat2x4::_xmat2x4(const _xmat2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - } - - template - inline _xmat2x4::_xmat2x4(const _xmat3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - } - - template - inline _xmat2x4::_xmat2x4(const _xmat4& m) - { - this->value[0] = _xvec4(m[0]); - this->value[1] = _xvec4(m[1]); - } - - template - inline _xmat2x4::_xmat2x4(const _xmat2x3& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - } - - template - inline _xmat2x4::_xmat2x4(const _xmat3x2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - } - - template - inline _xmat2x4::_xmat2x4(const _xmat3x4& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - } - - template - inline _xmat2x4::_xmat2x4(const _xmat4x2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(T(0))); - this->value[1] = _xvec4(m[1], _xvec2(T(0))); - } - - template - inline _xmat2x4::_xmat2x4(const _xmat4x3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat2x4& _xmat2x4::operator= (const _xmat2x4& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template - inline _xmat2x4& _xmat2x4::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template - inline _xmat2x4& _xmat2x4::operator+= (const _xmat2x4& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - inline _xmat2x4& _xmat2x4::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template - inline _xmat2x4& _xmat2x4::operator-= (const _xmat2x4& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - inline _xmat2x4& _xmat2x4::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template - inline _xmat2x4& _xmat2x4::operator*= (const _xmat4x2& m) - { - return (*this = _xmat2x4(*this * m)); - } - - template - inline _xmat2x4 & _xmat2x4::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } -/* ToDo - template - inline _xmat2x4& _xmat2x4::operator/= (const _xmat4x2& m) - { - return (*this = _xmat2x4(*this / m)); - } -*/ - template - inline _xmat2x4& _xmat2x4::operator++ () - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - inline _xmat2x4& _xmat2x4::operator-- () - { - --this->value[0]; - --this->value[1]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat2x4 _xmat2x4::operator- () const - { - return _xmat2x4( - -this->value[0], - -this->value[1]); - } - - template - inline const _xmat2x4 _xmat2x4::operator-- (int n) const - { - _xmat2x4 m = *this; - --m.value[0]; - --m.value[1]; - return m; - } - - template - inline const _xmat2x4 _xmat2x4::operator++ (int n) const - { - _xmat2x4 m = *this; - ++m.value[0]; - ++m.value[1]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat2x4 operator+ (const _xmat2x4& m, const T s) - { - return _xmat2x4( - m[0] + s, - m[1] + s); - } - - template - inline _xmat2x4 operator+ (const _xmat2x4& m1, const _xmat2x4& m2) - { - return _xmat2x4( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - inline _xmat2x4 operator- (const _xmat2x4& m, const T s) - { - return _xmat2x4( - m[0] - s, - m[1] - s); - } - - template - inline _xmat2x4 operator- (const _xmat2x4& m1, const _xmat2x4& m2) - { - return _xmat2x4( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - inline _xmat2x4 operator* (const _xmat2x4& m, const T s) - { - return _xmat2x4( - m[0] * s, - m[1] * s); - } - - template - inline _xmat2x4 operator* (const T s, const _xmat2x4 & m) - { - return _xmat2x4( - m[0] * s, - m[1] * s); - } - - template - inline _xvec4 operator* (const _xmat2x4& m, const _xvec2& v) - { - return _xvec4( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y, - m[0][2] * v.x + m[1][2] * v.y, - m[0][3] * v.x + m[1][3] * v.y); - } - - template - inline _xvec2 operator* (const _xvec4& v, const _xmat2x4& m) - { - return _xvec2( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); - } - - template - inline _xmat4 operator* (const _xmat2x4& m1, const _xmat4x2& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA03 = m1[0][3]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA13 = m1[1][3]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - - _xmat4 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31; - return Result; - } - - template - inline _xmat2x4 operator/ (const _xmat2x4& m, const T s) - { - return _xmat2x4( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s, - m.value[3] / s); - } - - template - inline _xmat2x4 operator/ (const T s, const _xmat2x4& m) - { - return _xmat2x4( - s / m.value[0], - s / m.value[1], - s / m.value[2], - s / m.value[3]); - } -/* ToDo - template - inline _xvec4 operator/ (const _xmat2x4& m, const _xvec2& v) - { - - } - - template - inline _xvec2 operator/ (const _xvec4& v, const _xmat4x2& m) - { - - } - - template - inline _xmat4 operator/ (const _xmat2x4& m1, const _xmat4x2& m2) - { - - } -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat2x4_inl__ diff --git a/experimental/sse/glm/core/_xmat3.h b/experimental/sse/glm/core/_xmat3.h deleted file mode 100644 index 63f84dce..00000000 --- a/experimental/sse/glm/core/_xmat3.h +++ /dev/null @@ -1,176 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-27 -// Updated : 2007-03-01 -// Licence : This source is under GNU LGPL licence -// File : _xmat3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xmat3_h__ -#define __xmat3_h__ - -namespace glm{ -namespace detail{ - - template class _xvec2; - template class _xvec3; - template class _xquat; - - template class _xmat2; - template class _xmat4; - template class _xmat2x4; - template class _xmat2x3; - template class _xmat3x2; - template class _xmat3x4; - template class _xmat4x2; - template class _xmat4x3; - - //!< \brief Template for 3 * 3 matrix of floating-point numbers. - template - class _xmat3 - { - private: - // Data - _xvec3 value[3]; - - public: - _xmat3 _inverse() const; - - public: - typedef T value_type; - typedef _xvec3 col_type; - typedef _xvec3 row_type; - typedef int size_type; - static const size_type value_size; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat3(); - explicit _xmat3(const T x); - explicit _xmat3(const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1, - const T x2, const T y2, const T z2); - explicit _xmat3(const _xvec3 & v0, - const _xvec3 & v1, - const _xvec3 & v2); - - // Conversions - template - explicit _xmat3(const _xmat3& m); - - explicit _xmat3(const _xmat2& x); - explicit _xmat3(const _xmat4& x); - explicit _xmat3(const _xmat2x3& x); - explicit _xmat3(const _xmat3x2& x); - explicit _xmat3(const _xmat2x4& x); - explicit _xmat3(const _xmat4x2& x); - explicit _xmat3(const _xmat3x4& x); - explicit _xmat3(const _xmat4x3& x); - - //explicit _xmat3(const T* a); - // GL_GTX_euler_angles - //explicit _xmat3(const _xvec2 & angles); - //explicit _xmat3(const _xvec3 & angles); - - // Conversions - //explicit _xmat3(const glm::_xquat & q); - - // Accesses - _xvec3& operator[](int i) {return value[i];} - const _xvec3 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat3& operator=(const _xmat3& m); - _xmat3& operator+= (const T s); - _xmat3& operator+= (const _xmat3& m); - _xmat3& operator-= (const T s); - _xmat3& operator-= (const _xmat3& m); - _xmat3& operator*= (const T s); - _xmat3& operator*= (const _xmat3& m); - _xmat3& operator/= (const T s); - _xmat3& operator/= (const _xmat3& m); - _xmat3& operator++ (); - _xmat3& operator-- (); - }; - - // Binary operators - template - inline _xmat3 operator+ (const _xmat3& m, const T s); - - template - inline _xmat3 operator+ (const T s, const _xmat3& m); - - template - inline _xvec3 operator+ (const _xmat3& m, const _xvec3& v); - - template - inline _xvec3 operator+ (const _xvec3& v, const _xmat3& m); - - template - inline _xmat3 operator+ (const _xmat3& m1, const _xmat3& m2); - - template - inline _xmat3 operator- (const _xmat3& m, const T s); - - template - inline _xmat3 operator- (const T s, const _xmat3& m); - - template - inline _xvec3 operator- (const _xmat3& m, const _xvec3& v); - - template - inline _xvec3 operator- (const _xvec3& v, const _xmat3& m); - - template - inline _xmat3 operator- (const _xmat3& m1, const _xmat3& m2); - - template - inline _xmat3 operator* (const _xmat3& m, const T s); - - template - inline _xmat3 operator* (const T s, const _xmat3& m); - - template - inline _xvec3 operator* (const _xmat3& m, const _xvec3& v); - - template - inline _xvec3 operator* (const _xvec3& v, const _xmat3& m); - - template - inline _xmat3 operator* (const _xmat3& m1, const _xmat3& m2); - - template - inline _xmat3 operator/ (const _xmat3& m, const T s); - - template - inline _xmat3 operator/ (const T s, const _xmat3& m); - - template - inline _xvec3 operator/ (const _xmat3& m, const _xvec3& v); - - template - inline _xvec3 operator/ (const _xvec3& v, const _xmat3& m); - - template - inline _xmat3 operator/ (const _xmat3& m1, const _xmat3& m2); - - // Unary constant operators - template - inline const _xmat3 operator- (const _xmat3& m); - - template - inline const _xmat3 operator-- (const _xmat3& m, int); - - template - inline const _xmat3 operator++ (const _xmat3& m, int); - -} //namespace detail -} //namespace glm - -#endif //__xmat3_h__ diff --git a/experimental/sse/glm/core/_xmat3.inl b/experimental/sse/glm/core/_xmat3.inl deleted file mode 100644 index ff7e99b0..00000000 --- a/experimental/sse/glm/core/_xmat3.inl +++ /dev/null @@ -1,546 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-27 -// Updated : 2007-03-01 -// Licence : This source is under GNU LGPL licence -// File : _xmat3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xmat3_inl__ -#define __xmat3_inl__ - -#include "./_xmat3.h" -#include "./_func.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat3::size_type _xmat3::value_size = 3; - template const typename _xmat3::size_type _xmat3::col_size = 3; - template const typename _xmat3::size_type _xmat3::row_size = 3; - - ////////////////////////////////////////////////////////////// - // mat3 constructors - - template - inline _xmat3::_xmat3() - { - this->value[0] = _xvec3(1, 0, 0); - this->value[1] = _xvec3(0, 1, 0); - this->value[2] = _xvec3(0, 0, 1); - } - - template - inline _xmat3::_xmat3(const T f) - { - this->value[0] = _xvec3(f, 0, 0); - this->value[1] = _xvec3(0, f, 0); - this->value[2] = _xvec3(0, 0, f); - } - - template - inline _xmat3::_xmat3 - ( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1, - const T x2, const T y2, const T z2 - ) - { - this->value[0] = _xvec3(x0, y0, z0); - this->value[1] = _xvec3(x1, y1, z1); - this->value[2] = _xvec3(x2, y2, z2); - } - - template - inline _xmat3::_xmat3 - ( - const _xvec3& v0, - const _xvec3& v1, - const _xvec3& v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } - - ////////////////////////////////////////////////////////////// - // mat3 conversions - - template - template - inline _xmat3::_xmat3(const _xmat3& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(m[2]); - } - - template - inline _xmat3::_xmat3(const _xmat2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - this->value[2] = _xvec3(_xvec2(0), T(1)); - } - - template - inline _xmat3::_xmat3(const _xmat4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(m[2]); - } - - template - inline _xmat3::_xmat3(const _xmat2x3& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = _xvec3(_xvec2(0), T(1)); - } - - template - inline _xmat3::_xmat3(const _xmat3x2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - this->value[2] = _xvec3(m[2], T(1)); - } - - template - inline _xmat3::_xmat3(const _xmat2x4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(_xvec2(0), T(1)); - } - - template - inline _xmat3::_xmat3(const _xmat4x2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - this->value[2] = _xvec3(m[2], T(1)); - } - - template - inline _xmat3::_xmat3(const _xmat3x4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(m[2]); - } - - template - inline _xmat3::_xmat3(const _xmat4x3& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - } - -/* - template - inline _xmat3::_xmat3(const T* a) - { - this->value[0] = _xvec3(a[0], a[1], a[2]); - this->value[1] = _xvec3(a[3], a[4], a[5]); - this->value[2] = _xvec3(a[6], a[7], a[8]); - } -*/ - /* - // GL_GTX_euler_angles - template - inline _xmat3::_xmat3(const _xvec3 & angles) - { - T ch = cos(angles.x); - T sh = sin(angles.x); - T cp = cos(angles.y); - T sp = sin(angles.y); - T cb = cos(angles.z); - T sb = sin(angles.z); - - value[0][0] = ch * cb + sh * sp * sb; - value[0][1] = sb * cp; - value[0][2] = -sh * cb + ch * sp * sb; - value[1][0] = -ch * sb + sh * sp * cb; - value[1][1] = cb * cp; - value[1][2] = sb * sh + ch * sp * cb; - value[2][0] = sh * cp; - value[2][1] = -sp; - value[2][2] = ch * cp; - } - */ - ////////////////////////////////////////////////////////////// - // mat3 conversions - /* - template - inline _xmat3::_xmat3(const _xquat & q) - { - this->value[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; - this->value[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; - this->value[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; - - this->value[1][0] = 2 * q.x * q.y - 2 * q.w * q.z; - this->value[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z; - this->value[1][2] = 2 * q.y * q.z + 2 * q.w * q.x; - - this->value[2][0] = 2 * q.x * q.z + 2 * q.w * q.y; - this->value[2][1] = 2 * q.y * q.z - 2 * q.w * q.x; - this->value[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y; - } - */ - ////////////////////////////////////////////////////////////// - // mat3 operators - - template - inline _xmat3& _xmat3::operator=(const _xmat3& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template - inline _xmat3& _xmat3::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - inline _xmat3& _xmat3::operator+= (const _xmat3& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - inline _xmat3& _xmat3::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - inline _xmat3& _xmat3::operator-= (const _xmat3& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - inline _xmat3& _xmat3::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - inline _xmat3& _xmat3::operator*= (const _xmat3& m) - { - return (*this = *this * m); - } - - template - inline _xmat3& _xmat3::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - template - inline _xmat3& _xmat3::operator/= (const _xmat3& m) - { - return (*this = *this / m); - } - - template - inline _xmat3& _xmat3::operator++ () - { - this->value[0]++; - this->value[1]++; - this->value[2]++; - return *this; - } - - template - inline _xmat3& _xmat3::operator-- () - { - this->value[0]--; - this->value[1]--; - this->value[2]--; - return *this; - } - - template - inline _xmat3 _xmat3::_inverse() const - { - T S00 = value[0][0]; - T S01 = value[0][1]; - T S02 = value[0][2]; - - T S10 = value[1][0]; - T S11 = value[1][1]; - T S12 = value[1][2]; - - T S20 = value[2][0]; - T S21 = value[2][1]; - T S22 = value[2][2]; - - _xmat3 Inverse( - + (S11 * S22 - S21 * S12), - - (S10 * S22 - S20 * S12), - + (S10 * S21 - S20 * S11), - - (S01 * S22 - S21 * S02), - + (S00 * S22 - S20 * S02), - - (S00 * S21 - S20 * S01), - + (S01 * S12 - S11 * S02), - - (S00 * S12 - S10 * S02), - + (S00 * S11 - S10 * S01)); - - T Determinant = S00 * (S11 * S22 - S21 * S12) - - S10 * (S01 * S22 - S21 * S02) - + S20 * (S01 * S12 - S11 * S02); - - Inverse /= Determinant; - return Inverse; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat3 operator+ (const _xmat3& m, const T s) - { - return _xmat3( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template - inline _xmat3 operator+ (const T s, const _xmat3& m) - { - return _xmat3( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template - inline _xvec3 operator+ (const _xmat3& m, const _xvec3& v) - { - - } - - template - inline _xvec3 operator+ (const _xvec3& v, const _xmat3& m) - { - - } - - template - inline _xmat3 operator+ (const _xmat3& m1, const _xmat3& m2) - { - return _xmat3( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - inline _xmat3 operator- (const _xmat3& m, const T s) - { - return _xmat3( - m[0] - s, - m[1] - s, - m[2] - s); - } - - template - inline _xmat3 operator- (const T s, const _xmat3& m) - { - return _xmat3( - s - m[0], - s - m[1], - s - m[2]); - } - - template - inline _xvec3 operator- (const _xmat3& m, const _xvec3& v) - { - - } - - template - inline _xvec3 operator- (const _xvec3& v, const _xmat3& m) - { - - } - - template - inline _xmat3 operator- (const _xmat3& m1, const _xmat3& m2) - { - return _xmat3( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - inline _xmat3 operator* (const _xmat3& m, const T s) - { - return _xmat3( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template - inline _xmat3 operator* (const T s, const _xmat3& m) - { - return _xmat3( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template - inline _xvec3 operator* (const _xmat3& m, const _xvec3& v) - { - return _xvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); - } - - template - inline _xvec3 operator* (const _xvec3& v, const _xmat3& m) - { - return _xvec3( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); - } - - template - inline _xmat3 operator* (const _xmat3& m1, const _xmat3& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - - _xmat3 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - return Result; - } - - - template - inline _xmat3 operator/ (const _xmat3& m, const T s) - { - return _xmat3( - m[0] / s, - m[1] / s, - m[2] / s); - } - - template - inline _xmat3 operator/ (const T s, const _xmat3& m) - { - return _xmat3( - s / m[0], - s / m[1], - s / m[2]); - } - - template - inline _xvec3 operator/ (const _xmat3& m, const _xvec3& v) - { - return m._inverse() * v; - } - - template - inline _xvec3 operator/ (const _xvec3& v, const _xmat3& m) - { - return v * m._inverse(); - } - - template - inline _xmat3 operator/ (const _xmat3& m1, const _xmat3& m2) - { - return m1 * m2._inverse(); - } - - // Unary constant operators - template - inline const _xmat3 operator- (const _xmat3& m) - { - return _xmat3( - -m.value[0], - -m.value[1], - -m.value[2]); - } - - template - inline const _xmat3 operator-- (const _xmat3& m, int) - { - return _xmat3( - m.value[0] - T(1), - m.value[1] - T(1), - m.value[2] - T(1)); - } - - template - inline const _xmat3 operator++ (const _xmat3& m, int) - { - return _xmat3( - m.value[0] + T(1), - m.value[1] + T(1), - m.value[2] + T(1)); - } - -} //namespace detail -} //namespace glm - -#endif //__xmat3_inl__ diff --git a/experimental/sse/glm/core/_xmat3x2.h b/experimental/sse/glm/core/_xmat3x2.h deleted file mode 100644 index 488aeef2..00000000 --- a/experimental/sse/glm/core/_xmat3x2.h +++ /dev/null @@ -1,145 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-05 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat3x2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat3x2_h__ -#define __mat3x2_h__ - -namespace glm{ -namespace detail{ - - template class _xvec2; - template class _xvec3; - template class _xvec4; - template class _xmat2; - template class _xmat3; - template class _xmat4; - template class _xmat2x3; - template class _xmat2x4; - template class _xmat3x4; - template class _xmat4x2; - template class _xmat4x3; - - //!< \brief Template for 3 * 2 matrix of floating-point numbers. - template - class _xmat3x2 - { - private: - // Data - _xvec2 value[3]; - - public: - typedef T value_type; - typedef _xvec3 col_type; - typedef _xvec2 row_type; - typedef int size_type; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat3x2(); - explicit _xmat3x2(const T x); - explicit _xmat3x2( - const T x0, const T y0, - const T x1, const T y1, - const T x2, const T y2); - explicit _xmat3x2( - const _xvec2& v0, - const _xvec2& v1, - const _xvec2& v2); - - // Conversion - template - explicit _xmat3x2(const _xmat3x2& m); - - explicit _xmat3x2(const _xmat2& x); - explicit _xmat3x2(const _xmat3& x); - explicit _xmat3x2(const _xmat4& x); - explicit _xmat3x2(const _xmat2x3& x); - explicit _xmat3x2(const _xmat2x4& x); - explicit _xmat3x2(const _xmat3x4& x); - explicit _xmat3x2(const _xmat4x2& x); - explicit _xmat3x2(const _xmat4x3& x); - - // Accesses - _xvec2& operator[](int i) {return value[i];} - const _xvec2 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat3x2& operator= (const _xmat3x2& m); - _xmat3x2& operator+= (const T s); - _xmat3x2& operator+= (const _xmat3x2& m); - _xmat3x2& operator-= (const T s); - _xmat3x2& operator-= (const _xmat3x2& m); - _xmat3x2& operator*= (const T s); - _xmat3x2& operator*= (const _xmat2x3& m); - _xmat3x2& operator/= (const T s); -/* ToDo - _xmat3x2& operator/= (const _xmat2x3& m); -*/ - _xmat3x2& operator++ (); - _xmat3x2& operator-- (); - - // Unary constant operators - const _xmat3x2 operator- () const; - const _xmat3x2 operator++ (int n) const; - const _xmat3x2 operator-- (int n) const; - }; - - // Binary operators - template - _xmat3x2 operator+ (const _xmat3x2& m, const T s); - - template - _xmat3x2 operator+ (const _xmat3x2& m1, const _xmat3x2& m2); - - template - _xmat3x2 operator- (const _xmat3x2& m, const T s); - - template - _xmat3x2 operator- (const _xmat3x2& m1, const _xmat3x2& m2); - - template - _xmat3x2 operator* (const _xmat3x2& m, const T s); - - template - _xmat3x2 operator* (const T s, const _xmat3x4& m); - - template - _xvec2 operator* (const _xmat3x2& m, const _xvec3& v); - - template - _xvec3 operator* (const _xvec2& v, const _xmat3x2& m); - - template - _xmat2 operator* (const _xmat3x2& m1, const _xmat2x3& m2); - - template - _xmat2x3 operator/ (const _xmat2x3& m, const T s); - - template - _xmat2x3 operator/ (const T s, const _xmat2x3& m); -/* ToDo - template - _xvec2 operator/ (const _xmat3x2& m, const _xvec3& v); - - template - _xvec3 operator/ (const _xvec2& v, const _xmat3x2& m); - - template - _xmat2 operator/ (const _xmat2x3& m1, const _xmat3x2& m2); -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat3x2_h__ diff --git a/experimental/sse/glm/core/_xmat3x2.inl b/experimental/sse/glm/core/_xmat3x2.inl deleted file mode 100644 index 1414c681..00000000 --- a/experimental/sse/glm/core/_xmat3x2.inl +++ /dev/null @@ -1,451 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-05 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat3x2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat3x2_inl__ -#define __mat3x2_inl__ - -#include "./_xmat3x2.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat3x2::size_type _xmat3x2::col_size = 3; - template const typename _xmat3x2::size_type _xmat3x2::row_size = 2; - - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat3x2::_xmat3x2() - { - this->value[0] = _xvec2(1, 0); - this->value[1] = _xvec2(0, 1); - this->value[2] = _xvec2(0, 0); - } - - template - inline _xmat3x2::_xmat3x2(const T f) - { - this->value[0] = _xvec2(f, 0); - this->value[1] = _xvec2(0, f); - this->value[2] = _xvec2(0, 0); - } - - template - inline _xmat3x2::_xmat3x2 - ( - const T x0, const T y0, - const T x1, const T y1, - const T x2, const T y2 - ) - { - this->value[0] = _xvec2(x0, y0); - this->value[1] = _xvec2(x1, y1); - this->value[2] = _xvec2(x2, y2); - } - - template - inline _xmat3x2::_xmat3x2 - ( - const _xvec2 & v0, - const _xvec2 & v1, - const _xvec2 & v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } - - // Conversion - template - template - inline _xmat3x2::_xmat3x2(const _xmat3x2& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - } - - template - inline _xmat3x2::_xmat3x2(const _xmat2& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = _xvec2(T(0)); - } - - template - inline _xmat3x2::_xmat3x2(const _xmat3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - } - - template - inline _xmat3x2::_xmat3x2(const _xmat4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - } - - template - inline _xmat3x2::_xmat3x2(const _xmat2x3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(T(0)); - } - - template - inline _xmat3x2::_xmat3x2(const _xmat2x4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(T(0)); - } - - template - inline _xmat3x2::_xmat3x2(const _xmat3x4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - } - - template - inline _xmat3x2::_xmat3x2(const _xmat4x2& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - } - - template - inline _xmat3x2::_xmat3x2(const _xmat4x3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat3x2& _xmat3x2::operator= (const _xmat3x2& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template - inline _xmat3x2& _xmat3x2::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - inline _xmat3x2& _xmat3x2::operator+= (const _xmat3x2& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - inline _xmat3x2& _xmat3x2::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - inline _xmat3x2& _xmat3x2::operator-= (const _xmat3x2& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - inline _xmat3x2& _xmat3x2::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - inline _xmat3x2& _xmat3x2::operator*= (const _xmat2x3& m) - { - return (*this = _xmat3x2(*this * m)); - } - - template - inline _xmat3x2 & _xmat3x2::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } -/* ToDo - template - inline _xmat3x2& _xmat3x2::operator/= (const _xmat3x2& m) - { - return (*this = _xmat3x2(*this / m)); - } -*/ - template - inline _xmat3x2& _xmat3x2::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - inline _xmat3x2& _xmat3x2::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } -/* - template - inline _xmat3x2 _xmat3x2::_inverse() const - { - T S00 = value[0][0]; - T S01 = value[0][1]; - - T S10 = value[1][0]; - T S11 = value[1][1]; - - T S20 = value[2][0]; - T S21 = value[2][1]; - - _xmat3x2 Inverse( - + (S11 * S22 - S21 * S12), - - (S10 * S22 - S20 * S12), - + (S10 * S21 - S20 * S11), - - (S01 * S22 - S21 * S02), - + (S00 * S22 - S20 * S02), - - (S00 * S21 - S20 * S01), - + (S01 * S12 - S11 * S02), - - (S00 * S12 - S10 * S02), - + (S00 * S11 - S10 * S01)); - - T Determinant = S00 * (S11 * S22 - S21 * S12) - - S10 * (S01 * S22 - S21 * S02) - + S20 * (S01 * S12 - S11 * S02); - - Inverse /= Determinant; - return Inverse; - } - - template - inline _xmat2 _xmat2::_inverse() const - { - T Determinant = value[0][0] * value[1][1] - value[1][0] * value[0][1]; - - _xmat2 Inverse( - + value[1][1] / Determinant, - - value[1][0] / Determinant, - - value[0][1] / Determinant, - + value[0][0] / Determinant); - return Inverse; - } -*/ - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat3x2 _xmat3x2::operator- () const - { - return _xmat3x2( - -this->value[0], - -this->value[1], - -this->value[2]); - } - - template - inline const _xmat3x2 _xmat3x2::operator-- (int n) const - { - _xmat3x2 m = *this; - --m.value[0]; - --m.value[1]; - --m.value[2]; - return m; - } - - template - inline const _xmat3x2 _xmat3x2::operator++ (int n) const - { - _xmat3x2 m = *this; - ++m.value[0]; - ++m.value[1]; - ++m.value[2]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat3x2 operator+ (const _xmat3x2& m, const T s) - { - return _xmat3x2( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template - inline _xmat3x2 operator+ (const _xmat3x2& m1, const _xmat3x2& m2) - { - return _xmat3x2( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - inline _xmat3x2 operator- (const _xmat3x2& m, const T s) - { - return _xmat3x4( - m[0] - s, - m[1] - s, - m[2] - s); - } - - template - inline _xmat3x2 operator- (const _xmat3x2& m1, const _xmat3x2& m2) - { - return _xmat3x2( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - inline _xmat3x2 operator* (const _xmat3x2& m, const T s) - { - return _xmat3x2( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template - inline _xmat3x2 operator* (const T s, const _xmat3x2 & m) - { - return _xmat3x2( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template - inline _xvec2 operator* (const _xmat3x2& m, const _xvec3& v) - { - return _xvec2( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); - } - - template - inline _xvec3 operator* (const _xvec2& v, const _xmat3x2& m) - { - return _xvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); - } - - template - inline _xmat2 operator* (const _xmat3x2& m1, const _xmat2x3& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - - _xmat2 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - return Result; - } - - template - inline _xmat3x2 operator/ (const _xmat3x2& m, const T s) - { - return _xmat3x2( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s, - m.value[3] / s); - } - - template - inline _xmat3x2 operator/ (const T s, const _xmat3x2& m) - { - return _xmat3x2( - s / m.value[0], - s / m.value[1], - s / m.value[2], - s / m.value[3]); - } -/* ToDo - template - inline _xvec3 operator/ (const _xmat3x2& m, const _xvec2& v) - { - - } - - template - inline _xvec3 operator/ (const _xvec2& v, const _xmat3x2& m) - { - - } - - template - inline _xmat2 operator/ (const _xmat3x2& m1, const _xmat3x2& m2) - { - - } -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat3x2_inl__ diff --git a/experimental/sse/glm/core/_xmat3x4.h b/experimental/sse/glm/core/_xmat3x4.h deleted file mode 100644 index 6d40abbb..00000000 --- a/experimental/sse/glm/core/_xmat3x4.h +++ /dev/null @@ -1,145 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-05 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat3x4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat3x4_h__ -#define __mat3x4_h__ - -namespace glm{ -namespace detail{ - - template class _xvec2; - template class _xvec3; - template class _xvec4; - template class _xmat2; - template class _xmat3; - template class _xmat4; - template class _xmat2x3; - template class _xmat3x2; - template class _xmat2x4; - template class _xmat4x2; - template class _xmat4x3; - - //!< \brief Template for 3 * 4 matrix of floating-point numbers. - template - class _xmat3x4 - { - private: - // Data - _xvec4 value[3]; - - public: - typedef T value_type; - typedef _xvec3 col_type; - typedef _xvec4 row_type; - typedef int size_type; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat3x4(); - explicit _xmat3x4(const T x); - explicit _xmat3x4( - const T x0, const T y0, const T z0, const T w0, - const T x1, const T y1, const T z1, const T w1, - const T x2, const T y2, const T z2, const T w2); - explicit _xmat3x4( - const _xvec4& v0, - const _xvec4& v1, - const _xvec4& v2); - - // Conversion - template - explicit _xmat3x4(const _xmat3x4& m); - - explicit _xmat3x4(const _xmat2& x); - explicit _xmat3x4(const _xmat3& x); - explicit _xmat3x4(const _xmat4& x); - explicit _xmat3x4(const _xmat2x3& x); - explicit _xmat3x4(const _xmat3x2& x); - explicit _xmat3x4(const _xmat2x4& x); - explicit _xmat3x4(const _xmat4x2& x); - explicit _xmat3x4(const _xmat4x3& x); - - // Accesses - _xvec4& operator[](int i) {return value[i];} - const _xvec4 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat3x4& operator= (const _xmat3x4& m); - _xmat3x4& operator+= (const T s); - _xmat3x4& operator+= (const _xmat3x4& m); - _xmat3x4& operator-= (const T s); - _xmat3x4& operator-= (const _xmat3x4& m); - _xmat3x4& operator*= (const T s); - _xmat3x4& operator*= (const _xmat4x3& m); - _xmat3x4& operator/= (const T s); -/* ToDo - _xmat3x4& operator/= (const _xmat4x3& m); -*/ - _xmat3x4& operator++ (); - _xmat3x4& operator-- (); - - // Unary constant operators - const _xmat3x4 operator- () const; - const _xmat3x4 operator++ (int n) const; - const _xmat3x4 operator-- (int n) const; - }; - - // Binary operators - template - _xmat3x4 operator+ (const _xmat3x4& m, const T s); - - template - _xmat3x4 operator+ (const _xmat3x4& m1, const _xmat3x4& m2); - - template - _xmat3x4 operator- (const _xmat3x4& m, const T s); - - template - _xmat3x4 operator- (const _xmat3x4& m1, const _xmat3x4& m2); - - template - _xmat3x4 operator* (const _xmat3x4& m, const T s); - - template - _xmat3x4 operator* (const T s, const _xmat3x4& m); - - template - _xvec4 operator* (const _xmat3x4& m, const _xvec3& v); - - template - _xvec3 operator* (const _xvec4& v, const _xmat3x4& m); - - template - _xmat4 operator* (const _xmat3x4& m1, const _xmat4x3& m2); - - template - _xmat4x3 operator/ (const _xmat4x3& m, const T s); - - template - _xmat4x3 operator/ (const T s, const _xmat4x3& m); -/* ToDo - template - _xvec4 operator/ (const _xmat3x4& m, const _xvec3& v); - - template - _xvec3 operator/ (const _xvec4& v, const _xmat3x4& m); - - template - _xmat4 operator/ (const _xmat4x3& m1, const _xmat3x4& m2); -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat3x4_h__ diff --git a/experimental/sse/glm/core/_xmat3x4.inl b/experimental/sse/glm/core/_xmat3x4.inl deleted file mode 100644 index e504c5ce..00000000 --- a/experimental/sse/glm/core/_xmat3x4.inl +++ /dev/null @@ -1,434 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-05 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat3x4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat3x4_inl__ -#define __mat3x4_inl__ - -#include "./_xmat3x4.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat3x4::size_type _xmat3x4::col_size = 3; - template const typename _xmat3x4::size_type _xmat3x4::row_size = 4; - - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat3x4::_xmat3x4() - { - this->value[0] = _xvec4(1, 0, 0, 0); - this->value[1] = _xvec4(0, 1, 0, 0); - this->value[2] = _xvec4(0, 0, 1, 0); - } - - template - inline _xmat3x4::_xmat3x4(const T f) - { - this->value[0] = _xvec4(f, 0, 0, 0); - this->value[1] = _xvec4(0, f, 0, 0); - this->value[2] = _xvec4(0, 0, f, 0); - } - - template - inline _xmat3x4::_xmat3x4 - ( - const T x0, const T y0, const T z0, const T w0, - const T x1, const T y1, const T z1, const T w1, - const T x2, const T y2, const T z2, const T w2 - ) - { - this->value[0] = _xvec4(x0, y0, z0, w0); - this->value[1] = _xvec4(x1, y1, z1, w1); - this->value[2] = _xvec4(x2, y2, z2, w2); - } - - template - inline _xmat3x4::_xmat3x4 - ( - const _xvec4 & v0, - const _xvec4 & v1, - const _xvec4 & v2 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - } - - // Conversion - template - template - inline _xmat3x4::_xmat3x4(const _xmat3x4& m) - { - this->value[0] = _xvec4(m[0]); - this->value[1] = _xvec4(m[1]); - this->value[2] = _xvec4(m[2]); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - this->value[2] = _xvec4(T(0), T(0), T(1), T(0)); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - this->value[2] = _xvec4(m[2], T(0)); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat4& m) - { - this->value[0] = _xvec4(m[0]); - this->value[1] = _xvec4(m[1]); - this->value[2] = _xvec4(m[2]); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat2x3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - this->value[2] = _xvec4(T(0), T(0), T(1), T(0)); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat3x2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - this->value[2] = _xvec4(m[2], T(0), T(1)); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat2x4& m) - { - this->value[0] = _xvec4(m[0]); - this->value[1] = _xvec4(m[1]); - this->value[2] = _xvec4(T(0), T(0), T(1), T(0)); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat4x2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(T(0))); - this->value[1] = _xvec4(m[1], _xvec2(T(0))); - this->value[2] = _xvec4(m[2], _xvec2(T(1), T(0))); - } - - template - inline _xmat3x4::_xmat3x4(const _xmat4x3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - this->value[2] = _xvec4(m[2], T(0)); - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat3x4& _xmat3x4::operator= (const _xmat3x4& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template - inline _xmat3x4& _xmat3x4::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - inline _xmat3x4& _xmat3x4::operator+= (const _xmat3x4& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - inline _xmat3x4& _xmat3x4::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - inline _xmat3x4& _xmat3x4::operator-= (const _xmat3x4& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - inline _xmat3x4& _xmat3x4::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - inline _xmat3x4& _xmat3x4::operator*= (const _xmat4x3& m) - { - return (*this = _xmat3x4(*this * m)); - } - - template - inline _xmat3x4 & _xmat3x4::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } -/* ToDo - template - inline _xmat3x4& _xmat3x4::operator/= (const _xmat4x3& m) - { - return (*this = _xmat3x4(*this / m)); - } -*/ - template - inline _xmat3x4& _xmat3x4::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - inline _xmat3x4& _xmat3x4::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat3x4 _xmat3x4::operator- () const - { - return _xmat3x4( - -this->value[0], - -this->value[1], - -this->value[2]); - } - - template - inline const _xmat3x4 _xmat3x4::operator-- (int n) const - { - _xmat3x4 m = *this; - --m.value[0]; - --m.value[1]; - --m.value[2]; - return m; - } - - template - inline const _xmat3x4 _xmat3x4::operator++ (int n) const - { - _xmat3x4 m = *this; - ++m.value[0]; - ++m.value[1]; - ++m.value[2]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat3x4 operator+ (const _xmat3x4& m, const T s) - { - return _xmat3x4( - m[0] + s, - m[1] + s, - m[2] + s); - } - - template - inline _xmat3x4 operator+ (const _xmat3x4& m1, const _xmat3x4& m2) - { - return _xmat3x4( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - inline _xmat3x4 operator- (const _xmat3x4& m, const T s) - { - return _xmat3x4( - m[0] - s, - m[1] - s, - m[2] - s); - } - - template - inline _xmat3x4 operator- (const _xmat3x4& m1, const _xmat3x4& m2) - { - return _xmat3x4( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - inline _xmat3x4 operator* (const _xmat3x4& m, const T s) - { - return _xmat3x4( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template - inline _xmat3x4 operator* (const T s, const _xmat3x4 & m) - { - return _xmat3x4( - m[0] * s, - m[1] * s, - m[2] * s); - } - - template - inline _xvec4 operator* (const _xmat3x4& m, const _xvec3& v) - { - return _xvec4( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, - m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); - } - - template - inline _xvec3 operator* (const _xvec4& v, const _xmat3x4& m) - { - return _xvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template - inline _xmat4 operator* (const _xmat3x4& m1, const _xmat4x3& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA03 = m1[0][3]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA13 = m1[1][3]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA23 = m1[2][3]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; - - _xmat4 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; - return Result; - } - - template - inline _xmat3x4 operator/ (const _xmat3x4& m, const T s) - { - return _xmat3x4( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s, - m.value[3] / s); - } - - template - inline _xmat3x4 operator/ (const T s, const _xmat3x4& m) - { - return _xmat3x4( - s / m.value[0], - s / m.value[1], - s / m.value[2], - s / m.value[3]); - } -/* ToDo - template - inline _xvec3 operator/ (const _xmat4x3& m, const _xvec4& v) - { - - } - - template - inline _xvec3 operator/ (const _xvec4& v, const _xmat4x3& m) - { - - } - - template - inline _xmat4 operator/ (const _xmat3x4& m1, const _xmat4x3& m2) - { - - } -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat3x4_inl__ diff --git a/experimental/sse/glm/core/_xmat4.h b/experimental/sse/glm/core/_xmat4.h deleted file mode 100644 index a26e8874..00000000 --- a/experimental/sse/glm/core/_xmat4.h +++ /dev/null @@ -1,178 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-27 -// Updated : 2007-03-01 -// Licence : This source is under GNU LGPL licence -// File : _xmat4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xmat4_h__ -#define __xmat4_h__ - -namespace glm{ -namespace detail{ - - template class _xvec3; - template class _xvec4; - template class _xquat; - - template class _xmat2; - template class _xmat3; - template class _xmat2x4; - template class _xmat2x3; - template class _xmat3x2; - template class _xmat3x4; - template class _xmat4x2; - template class _xmat4x3; - - //!< \brief Template for 4 * 4 matrix of floating-point numbers. - template - class _xmat4 - { - private: - // Data - _xvec4 value[4]; - - public: - typedef T value_type; - typedef _xvec4 col_type; - typedef _xvec4 row_type; - typedef int size_type; - static const size_type value_size; - static const size_type col_size; - static const size_type row_size; - - _xmat4 _inverse() const; - - public: - // Constructors - _xmat4(); - explicit _xmat4(const T x); - explicit _xmat4( - const T x0, const T y0, const T z0, const T w0, - const T x1, const T y1, const T z1, const T w1, - const T x2, const T y2, const T z2, const T w2, - const T x3, const T y3, const T z3, const T w3); - explicit _xmat4(const _xvec4 & v0, - const _xvec4 & v1, - const _xvec4 & v2, - const _xvec4 & v3); - - // Conversions - template - explicit _xmat4(const _xmat4& m); - - explicit _xmat4(const _xmat2& x); - explicit _xmat4(const _xmat3& x); - explicit _xmat4(const _xmat2x3& x); - explicit _xmat4(const _xmat3x2& x); - explicit _xmat4(const _xmat2x4& x); - explicit _xmat4(const _xmat4x2& x); - explicit _xmat4(const _xmat3x4& x); - explicit _xmat4(const _xmat4x3& x); - - //explicit _xmat4(const T* a); - // GL_GTX_euler_angles - //explicit _xmat4(const _xvec3 & angle); - - // Conversion - //explicit _xmat4(const glm::_xquat & q); - - // Accesses - _xvec4& operator[](int i) {return value[i];} - const _xvec4 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat4& operator= (const _xmat4& m); - _xmat4& operator+= (const T s); - _xmat4& operator+= (const _xmat4& m); - _xmat4& operator-= (const T s); - _xmat4& operator-= (const _xmat4& m); - _xmat4& operator*= (const T s); - _xmat4& operator*= (const _xmat4& m); - _xmat4& operator/= (const T s); - _xmat4& operator/= (const _xmat4& m); - _xmat4& operator++ (); - _xmat4& operator-- (); - }; - - // Binary operators - template - inline _xmat4 operator+ (const _xmat4& m, const T s); - - template - inline _xmat4 operator+ (const T s, const _xmat4& m); - - template - inline _xvec4 operator+ (const _xmat4& m, const _xvec4& v); - - template - inline _xvec4 operator+ (const _xvec4& v, const _xmat4& m); - - template - inline _xmat4 operator+ (const _xmat4& m1, const _xmat4& m2); - - template - inline _xmat4 operator- (const _xmat4& m, const T s); - - template - inline _xmat4 operator- (const T s, const _xmat4& m); - - template - inline _xvec4 operator- (const _xmat4& m, const _xvec4& v); - - template - inline _xvec4 operator- (const _xvec4& v, const _xmat4& m); - - template - inline _xmat4 operator- (const _xmat4& m1, const _xmat4& m2); - - template - inline _xmat4 operator* (const _xmat4& m, const T s); - - template - inline _xmat4 operator* (const T s, const _xmat4& m); - - template - inline _xvec4 operator* (const _xmat4& m, const _xvec4& v); - - template - inline _xvec4 operator* (const _xvec4& v, const _xmat4& m); - - template - inline _xmat4 operator* (const _xmat4& m1, const _xmat4& m2); - - template - inline _xmat4 operator/ (const _xmat4& m, const T s); - - template - inline _xmat4 operator/ (const T s, const _xmat4& m); - - template - inline _xvec4 operator/ (const _xmat4& m, const _xvec4& v); - - template - inline _xvec4 operator/ (const _xvec4& v, const _xmat4& m); - - template - inline _xmat4 operator/ (const _xmat4& m1, const _xmat4& m2); - - // Unary constant operators - template - inline const _xmat4 operator- (const _xmat4& m); - - template - inline const _xmat4 operator-- (const _xmat4& m, int); - - template - inline const _xmat4 operator++ (const _xmat4& m, int); - -} //namespace detail -} //namespace glm - -#endif //__xmat4_h__ diff --git a/experimental/sse/glm/core/_xmat4.inl b/experimental/sse/glm/core/_xmat4.inl deleted file mode 100644 index 9e34945b..00000000 --- a/experimental/sse/glm/core/_xmat4.inl +++ /dev/null @@ -1,633 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-27 -// Updated : 2007-03-01 -// Licence : This source is under GNU LGPL licence -// File : _xmat4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat4_inl__ -#define __mat4_inl__ - -#include "./_xmat4.h" -#include "./_func.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat4::size_type _xmat4::value_size = 4; - template const typename _xmat4::size_type _xmat4::col_size = 4; - template const typename _xmat4::size_type _xmat4::row_size = 4; - - ////////////////////////////////////////////////////////////// - // mat4 constructors - - template - inline _xmat4::_xmat4() - { - this->value[0] = _xvec4(1, 0, 0, 0); - this->value[1] = _xvec4(0, 1, 0, 0); - this->value[2] = _xvec4(0, 0, 1, 0); - this->value[3] = _xvec4(0, 0, 0, 1); - } - - template - inline _xmat4::_xmat4(const T f) - { - this->value[0] = _xvec4(f, 0, 0, 0); - this->value[1] = _xvec4(0, f, 0, 0); - this->value[2] = _xvec4(0, 0, f, 0); - this->value[3] = _xvec4(0, 0, 0, f); - } - - template - inline _xmat4::_xmat4 - ( - const T x0, const T y0, const T z0, const T w0, - const T x1, const T y1, const T z1, const T w1, - const T x2, const T y2, const T z2, const T w2, - const T x3, const T y3, const T z3, const T w3 - ) - { - this->value[0] = _xvec4(x0, y0, z0, w0); - this->value[1] = _xvec4(x1, y1, z1, w1); - this->value[2] = _xvec4(x2, y2, z2, w2); - this->value[3] = _xvec4(x3, y3, z3, w3); - } - - template - inline _xmat4::_xmat4 - ( - const _xvec4& v0, - const _xvec4& v1, - const _xvec4& v2, - const _xvec4& v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - template - template - inline _xmat4::_xmat4(const _xmat4& m) - { - this->value[0] = _xvec4(m[0]); - this->value[1] = _xvec4(m[1]); - this->value[2] = _xvec4(m[2]); - this->value[3] = _xvec4(m[3]); - } - - template - inline _xmat4::_xmat4(const _xmat2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - this->value[2] = _xvec4(_xvec3(0), T(0)); - this->value[3] = _xvec4(_xvec3(0), T(1)); - } - - template - inline _xmat4::_xmat4(const _xmat3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - this->value[2] = _xvec4(m[2], T(0)); - this->value[3] = _xvec4(_xvec3(0), T(1)); - } - - template - inline _xmat4::_xmat4(const _xmat2x3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - this->value[2] = _xvec4(T(0)); - this->value[3] = _xvec4(_xvec3(0), T(1)); - } - - template - inline _xmat4::_xmat4(const _xmat3x2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - this->value[2] = _xvec4(m[2], _xvec2(0)); - this->value[3] = _xvec4(_xvec3(0), T(1)); - } - - template - inline _xmat4::_xmat4(const _xmat2x4& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = _xvec4(T(0)); - this->value[3] = _xvec4(_xvec3(0), T(1)); - } - - template - inline _xmat4::_xmat4(const _xmat4x2& m) - { - this->value[0] = _xvec4(m[0], _xvec2(0)); - this->value[1] = _xvec4(m[1], _xvec2(0)); - this->value[2] = _xvec4(T(0)); - this->value[3] = _xvec4(_xvec3(0), T(1)); - } - - template - inline _xmat4::_xmat4(const _xmat3x4& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = _xvec4(_xvec3(0), T(1)); - } - - template - inline _xmat4::_xmat4(const _xmat4x3& m) - { - this->value[0] = _xvec4(m[0], T(0)); - this->value[1] = _xvec4(m[1], T(0)); - this->value[2] = _xvec4(m[2], T(0)); - this->value[3] = _xvec4(m[3], T(1)); - } - -/* - template - inline _xmat4::_xmat4(const T* a) - { - this->value[0] = _xvec4(a[0], a[1], a[2], a[3]); - this->value[1] = _xvec4(a[4], a[5], a[6], a[7]); - this->value[2] = _xvec4(a[8], a[9], a[10], a[11]); - this->value[4] = _xvec4(a[12], a[13], a[14], a[15]); - } -*/ - /* - // GL_GTX_euler_angles - template - inline _xmat4::_xmat4(const _xvec3 & angles) - { - T ch = cos(angles.x); - T sh = sin(angles.x); - T cp = cos(angles.y); - T sp = sin(angles.y); - T cb = cos(angles.z); - T sb = sin(angles.z); - - value[0][0] = ch * cb + sh * sp * sb; - value[0][1] = sb * cp; - value[0][2] = -sh * cb + ch * sp * sb; - value[0][3] = 0.0f; - value[1][0] = -ch * sb + sh * sp * cb; - value[1][1] = cb * cp; - value[1][2] = sb * sh + ch * sp * cb; - value[1][3] = 0.0f; - value[2][0] = sh * cp; - value[2][1] = -sp; - value[2][2] = ch * cp; - value[2][3] = 0.0f; - value[3][0] = 0.0f; - value[3][1] = 0.0f; - value[3][2] = 0.0f; - value[3][3] = 1.0f; - } - */ - ////////////////////////////////////////////////////////////// - // mat4 conversion - /* - template - inline _xmat4::_xmat4(const _xquat & q) - { - *this = _xmat4(1); - this->value[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; - this->value[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; - this->value[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; - - this->value[1][0] = 2 * q.x * q.y - 2 * q.w * q.z; - this->value[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z; - this->value[1][2] = 2 * q.y * q.z + 2 * q.w * q.x; - - this->value[2][0] = 2 * q.x * q.z + 2 * q.w * q.y; - this->value[2][1] = 2 * q.y * q.z - 2 * q.w * q.x; - this->value[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y; - } - */ - ////////////////////////////////////////////////////////////// - // mat4 operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - template - inline _xmat4& _xmat4::operator= (const _xmat4& m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(T)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - inline _xmat4& _xmat4::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - inline _xmat4& _xmat4::operator+= (const _xmat4& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - inline _xmat4& _xmat4::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - inline _xmat4& _xmat4::operator-= (const _xmat4& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - inline _xmat4& _xmat4::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - inline _xmat4& _xmat4::operator*= (const _xmat4& m) - { - return (*this = *this * m); - } - - template - inline _xmat4 & _xmat4::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - template - inline _xmat4& _xmat4::operator/= (const _xmat4& m) - { - return (*this = *this / m); - } - - template - inline _xmat4& _xmat4::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template - inline _xmat4& _xmat4::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - // Private functions - template - inline _xmat4 _xmat4::_inverse() const - { - // Calculate all mat2 determinants - T SubFactor00 = this->value[2][2] * this->value[3][3] - this->value[3][2] * this->value[2][3]; - T SubFactor01 = this->value[2][1] * this->value[3][3] - this->value[3][1] * this->value[2][3]; - T SubFactor02 = this->value[2][1] * this->value[3][2] - this->value[3][1] * this->value[2][2]; - T SubFactor03 = this->value[2][0] * this->value[3][3] - this->value[3][0] * this->value[2][3]; - T SubFactor04 = this->value[2][0] * this->value[3][2] - this->value[3][0] * this->value[2][2]; - T SubFactor05 = this->value[2][0] * this->value[3][1] - this->value[3][0] * this->value[2][1]; - T SubFactor06 = this->value[1][2] * this->value[3][3] - this->value[3][2] * this->value[1][3]; - T SubFactor07 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; - T SubFactor08 = this->value[1][1] * this->value[3][2] - this->value[3][1] * this->value[1][2]; - T SubFactor09 = this->value[1][0] * this->value[3][3] - this->value[3][0] * this->value[1][3]; - T SubFactor10 = this->value[1][0] * this->value[3][2] - this->value[3][0] * this->value[1][2]; - T SubFactor11 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3]; - T SubFactor12 = this->value[1][0] * this->value[3][1] - this->value[3][0] * this->value[1][1]; - T SubFactor13 = this->value[1][2] * this->value[2][3] - this->value[2][2] * this->value[1][3]; - T SubFactor14 = this->value[1][1] * this->value[2][3] - this->value[2][1] * this->value[1][3]; - T SubFactor15 = this->value[1][1] * this->value[2][2] - this->value[2][1] * this->value[1][2]; - T SubFactor16 = this->value[1][0] * this->value[2][3] - this->value[2][0] * this->value[1][3]; - T SubFactor17 = this->value[1][0] * this->value[2][2] - this->value[2][0] * this->value[1][2]; - T SubFactor18 = this->value[1][0] * this->value[2][1] - this->value[2][0] * this->value[1][1]; - - _xmat4 Inverse( - + (this->value[1][1] * SubFactor00 - this->value[1][2] * SubFactor01 + this->value[1][3] * SubFactor02), - - (this->value[1][0] * SubFactor00 - this->value[1][2] * SubFactor03 + this->value[1][3] * SubFactor04), - + (this->value[1][0] * SubFactor01 - this->value[1][1] * SubFactor03 + this->value[1][3] * SubFactor05), - - (this->value[1][0] * SubFactor02 - this->value[1][1] * SubFactor04 + this->value[1][2] * SubFactor05), - - - (this->value[0][1] * SubFactor00 - this->value[0][2] * SubFactor01 + this->value[0][3] * SubFactor02), - + (this->value[0][0] * SubFactor00 - this->value[0][2] * SubFactor03 + this->value[0][3] * SubFactor04), - - (this->value[0][0] * SubFactor01 - this->value[0][1] * SubFactor03 + this->value[0][3] * SubFactor05), - + (this->value[0][0] * SubFactor02 - this->value[0][1] * SubFactor04 + this->value[0][2] * SubFactor05), - - + (this->value[0][1] * SubFactor06 - this->value[0][2] * SubFactor07 + this->value[0][3] * SubFactor08), - - (this->value[0][0] * SubFactor06 - this->value[0][2] * SubFactor09 + this->value[0][3] * SubFactor10), - + (this->value[0][0] * SubFactor11 - this->value[0][1] * SubFactor09 + this->value[0][3] * SubFactor12), - - (this->value[0][0] * SubFactor08 - this->value[0][1] * SubFactor10 + this->value[0][2] * SubFactor12), - - - (this->value[0][1] * SubFactor13 - this->value[0][2] * SubFactor14 + this->value[0][3] * SubFactor15), - + (this->value[0][0] * SubFactor13 - this->value[0][2] * SubFactor16 + this->value[0][3] * SubFactor17), - - (this->value[0][0] * SubFactor14 - this->value[0][1] * SubFactor16 + this->value[0][3] * SubFactor18), - + (this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18)); - - T Determinant = this->value[0][0] * Inverse[0][0] - + this->value[0][1] * Inverse[1][0] - + this->value[0][2] * Inverse[2][0] - + this->value[0][3] * Inverse[3][0]; - - Inverse /= Determinant; - return Inverse; - } - - // Binary operators - template - inline _xmat4 operator+ (const _xmat4& m, const T s) - { - return _xmat4( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - inline _xmat4 operator+ (const T s, const _xmat4& m) - { - return _xmat4( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - inline _xvec4 operator+ (const _xmat4& m, const _xvec4& v) - { - - } - - template - inline _xvec4 operator+ (const _xvec4& v, const _xmat4& m) - { - - } - - template - inline _xmat4 operator+ (const _xmat4& m1, const _xmat4& m2) - { - return _xmat4( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - inline _xmat4 operator- (const _xmat4& m, const T s) - { - return _xmat4( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template - inline _xmat4 operator- (const T s, const _xmat4& m) - { - return _xmat4( - s - m[0], - s - m[1], - s - m[2], - s - m[3]); - } - - template - inline _xvec4 operator- (const _xmat4& m, const _xvec4& v) - { - - } - - template - inline _xvec4 operator- (const _xvec4& v, const _xmat4& m) - { - - } - - template - inline _xmat4 operator- (const _xmat4& m1, const _xmat4& m2) - { - return _xmat4( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - inline _xmat4 operator* (const _xmat4& m, const T s) - { - return _xmat4( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xmat4 operator* (const T s, const _xmat4& m) - { - return _xmat4( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xvec4 operator* (const _xmat4& m, const _xvec4& v) - { - return _xvec4( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w, - m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z + m[3][3] * v.w); - } - - template - inline _xvec4 operator* (const _xvec4& v, const _xmat4& m) - { - return _xvec4( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w, - m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w); - } - - template - inline _xmat4 operator* (const _xmat4& m1, const _xmat4& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA03 = m1[0][3]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA13 = m1[1][3]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA23 = m1[2][3]; - const T SrcA30 = m1[3][0]; - const T SrcA31 = m1[3][1]; - const T SrcA32 = m1[3][2]; - const T SrcA33 = m1[3][3]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB03 = m2[0][3]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB13 = m2[1][3]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB23 = m2[2][3]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; - const T SrcB33 = m2[3][3]; - - _xmat4 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02 + SrcA33 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12 + SrcA33 * SrcB13; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22 + SrcA33 * SrcB23; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32 + SrcA30 * SrcB33; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32 + SrcA31 * SrcB33; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32 + SrcA32 * SrcB33; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32 + SrcA33 * SrcB33; - return Result; - } - - template - inline _xmat4 operator/ (const _xmat4& m, const T s) - { - return _xmat4( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } - - template - inline _xmat4 operator/ (const T s, const _xmat4& m) - { - return _xmat4( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } - - template - inline _xvec4 operator/ (const _xmat4& m, const _xvec4& v) - { - return m._inverse() * v; - } - - template - inline _xvec4 operator/ (const _xvec4& v, const _xmat4& m) - { - return v * m._inverse(); - } - - template - inline _xmat4 operator/ (const _xmat4& m1, const _xmat4& m2) - { - return m1 * m2._inverse(); - } - - // Unary constant operators - template - inline const _xmat4 operator- (const _xmat4& m) - { - return _xmat4( - -m.value[0], - -m.value[1], - -m.value[2], - -m.value[3]); - } - - template - inline const _xmat4 operator++ (const _xmat4& m, int) - { - return _xmat4( - m.value[0] + 1, - m.value[1] + 1, - m.value[2] + 1, - m.value[3] + 1); - } - - template - inline const _xmat4 operator-- (const _xmat4& m, int) - { - return _xmat4( - m.value[0] - 1, - m.value[1] - 1, - m.value[2] - 1, - m.value[3] - 1); - } - -} //namespace detail -} //namespace glm - -#endif //__mat4_inl__ diff --git a/experimental/sse/glm/core/_xmat4x2.h b/experimental/sse/glm/core/_xmat4x2.h deleted file mode 100644 index 5c2fa4e0..00000000 --- a/experimental/sse/glm/core/_xmat4x2.h +++ /dev/null @@ -1,146 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-10-01 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat4x2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat4x2_h__ -#define __mat4x2_h__ - -namespace glm{ -namespace detail{ - - template class _xvec3; - template class _xvec4; - template class _xmat2; - template class _xmat3; - template class _xmat4; - template class _xmat2x3; - template class _xmat3x2; - template class _xmat2x4; - template class _xmat3x4; - template class _xmat4x3; - - //!< \brief Template for 4 * 2 matrix of floating-point numbers. - template - class _xmat4x2 - { - private: - // Data - _xvec2 value[4]; - - public: - typedef T value_type; - typedef _xvec4 col_type; - typedef _xvec2 row_type; - typedef int size_type; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat4x2(); - explicit _xmat4x2(const T x); - explicit _xmat4x2( - const T x0, const T y0, - const T x1, const T y1, - const T x2, const T y2, - const T x3, const T y3); - explicit _xmat4x2( - const _xvec2& v0, - const _xvec2& v1, - const _xvec2& v2, - const _xvec2& v3); - - // Conversions - template - explicit _xmat4x2(const _xmat4x2& m); - - explicit _xmat4x2(const _xmat2& x); - explicit _xmat4x2(const _xmat3& x); - explicit _xmat4x2(const _xmat4& x); - explicit _xmat4x2(const _xmat2x3& x); - explicit _xmat4x2(const _xmat3x2& x); - explicit _xmat4x2(const _xmat2x4& x); - explicit _xmat4x2(const _xmat4x3& x); - explicit _xmat4x2(const _xmat3x4& x); - - // Accesses - _xvec2& operator[](int i) {return value[i];} - const _xvec2 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat4x2& operator= (const _xmat4x2& m); - _xmat4x2& operator+= (const T s); - _xmat4x2& operator+= (const _xmat4x2& m); - _xmat4x2& operator-= (const T s); - _xmat4x2& operator-= (const _xmat4x2& m); - _xmat4x2& operator*= (const T s); - _xmat4x2& operator*= (const _xmat2x4& m); - _xmat4x2& operator/= (const T s); -/* ToDo - _xmat4x2& operator/= (const _xmat2x4& m); -*/ - _xmat4x2& operator++ (); - _xmat4x2& operator-- (); - - // Unary constant operators - const _xmat4x2 operator- () const; - const _xmat4x2 operator++ (int n) const; - const _xmat4x2 operator-- (int n) const; - }; - - // Binary operators - template - _xmat4x2 operator+ (const _xmat4x2& m, const T s); - - template - _xmat4x2 operator+ (const _xmat4x2& m1, const _xmat4x2& m2); - - template - _xmat4x2 operator- (const _xmat4x2& m, const T s); - - template - _xmat4x2 operator- (const _xmat4x2& m1, const _xmat4x2& m2); - - template - _xmat4x2 operator* (const _xmat4x2& m, const T s); - - template - _xmat4x2 operator* (const T s, const _xmat4x2& m); - - template - _xvec2 operator* (const _xmat4x2& m, const _xvec4& v); - - template - _xmat4 operator* (const _xvec2& v, const _xmat4x2& m); -/* ToDo - template - _xmat2 operator* (const _xmat4x2& m1, const _xmat2x4& m2); -*/ - template - _xmat4x2 operator/ (const _xmat4x2& m, const T s); - - template - _xmat4x2 operator/ (const T s, const _xmat4x2& m); -/* ToDo - template - _xvec2 operator/ (const _xmat4x2& m, const _xvec4& v); - - template - _xvec4 operator/ (const _xvec2& v, const _xmat4x2& m); - - template - _xmat2 operator/ (const _xmat4x2& m1, const _xmat2x4& m2); -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat4x2_h__ diff --git a/experimental/sse/glm/core/_xmat4x2.inl b/experimental/sse/glm/core/_xmat4x2.inl deleted file mode 100644 index 4be38820..00000000 --- a/experimental/sse/glm/core/_xmat4x2.inl +++ /dev/null @@ -1,440 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-10-01 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat4x2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat4x2_inl__ -#define __mat4x2_inl__ - -#include "./_xmat4x2.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat4x2::size_type _xmat4x2::col_size = 4; - template const typename _xmat4x2::size_type _xmat4x2::row_size = 2; - - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat4x2::_xmat4x2() - { - this->value[0] = _xvec2(1, 0); - this->value[1] = _xvec2(0, 1); - this->value[2] = _xvec2(0, 0); - this->value[3] = _xvec2(0, 0); - } - - template - inline _xmat4x2::_xmat4x2(const T f) - { - this->value[0] = _xvec2(f, 0); - this->value[1] = _xvec2(0, f); - this->value[2] = _xvec2(0, 0); - this->value[3] = _xvec2(0, 0); - } - - template - inline _xmat4x2::_xmat4x2 - ( - const T x0, const T y0, - const T x1, const T y1, - const T x2, const T y2, - const T x3, const T y3 - ) - { - this->value[0] = _xvec2(x0, y0); - this->value[1] = _xvec2(x1, y1); - this->value[2] = _xvec2(x2, y2); - this->value[3] = _xvec2(x3, y3); - } - - template - inline _xmat4x2::_xmat4x2 - ( - const _xvec2 & v0, - const _xvec2 & v1, - const _xvec2 & v2, - const _xvec2 & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - // Conversion - template - template - inline _xmat4x2::_xmat4x2(const _xmat4x2& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - this->value[3] = _xvec2(m[3]); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat2& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - this->value[3] = _xvec2(T(0)); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - this->value[3] = _xvec2(T(0)); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - this->value[3] = _xvec2(m[3]); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat2x3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(T(0)); - this->value[3] = _xvec2(T(0)); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat3x2& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - this->value[3] = _xvec2(T(0)); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat2x4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(T(0)); - this->value[3] = _xvec2(T(0)); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat4x3& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - this->value[3] = _xvec2(m[3]); - } - - template - inline _xmat4x2::_xmat4x2(const _xmat3x4& m) - { - this->value[0] = _xvec2(m[0]); - this->value[1] = _xvec2(m[1]); - this->value[2] = _xvec2(m[2]); - this->value[3] = _xvec2(T(0)); - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat4x2& _xmat4x2::operator= (const _xmat4x2& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - inline _xmat4x2& _xmat4x2::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - inline _xmat4x2& _xmat4x2::operator+= (const _xmat4x2& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - inline _xmat4x2& _xmat4x2::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - inline _xmat4x2& _xmat4x2::operator-= (const _xmat4x2& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - inline _xmat4x2& _xmat4x2::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - inline _xmat4x2& _xmat4x2::operator*= (const _xmat2x4& m) - { - return (*this = _xmat4x2(*this * m)); - } - - template - inline _xmat4x2 & _xmat4x2::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } -/* ToDo - template - inline _xmat4x2& _xmat4x2::operator/= (const _xmat2x4& m) - { - return (*this = *this / m); - } -*/ - template - inline _xmat4x2& _xmat4x2::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - inline _xmat4x2& _xmat4x2::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat4x2 _xmat4x2::operator- () const - { - return _xmat4x2( - -this->value[0], - -this->value[1], - -this->value[2], - -this->value[3]); - } - - template - inline const _xmat4x2 _xmat4x2::operator-- (int n) const - { - _xmat4x2 m = *this; - --m.value[0]; - --m.value[1]; - --m.value[2]; - --m.value[3]; - return m; - } - - template - inline const _xmat4x2 _xmat4x2::operator++ (int n) const - { - _xmat4x2 m = *this; - ++m.value[0]; - ++m.value[1]; - ++m.value[2]; - ++m.value[3]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat4x2 operator+ (const _xmat4x2& m, const T s) - { - return _xmat4x2( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - inline _xmat4x2 operator+ (const _xmat4x2& m1, const _xmat4x2& m2) - { - return _xmat4x2( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - inline _xmat4x2 operator- (const _xmat4x2& m, const T s) - { - return _xmat4x2( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template - inline _xmat4x2 operator- (const _xmat4x2& m1, const _xmat4x2& m2) - { - return _xmat4x2( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - inline _xmat4x2 operator* (const _xmat4x2& m, const T s) - { - return _xmat4x2( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xmat4x2 operator* (const T s, const _xmat4x2 & m) - { - return _xmat4x2( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xvec2 operator* (const _xmat4x2& m, const _xvec4& v) - { - return _xvec2( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); - } - - template - inline _xvec4 operator* (const _xvec2& v, const _xmat4x2& m) - { - return _xvec4( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1], - v.x * m[2][0] + v.y * m[2][1], - v.x * m[3][0] + v.y * m[3][1]); - } - - template - inline _xmat2 operator* (const _xmat4x2& m1, const _xmat2x4& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA30 = m1[3][0]; - const T SrcA31 = m1[3][1]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB03 = m2[0][3]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB13 = m2[1][3]; - - _xmat2 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - return Result; - } - - template - inline _xmat4x2 operator/ (const _xmat4x2& m, const T s) - { - return _xmat4x2( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s, - m.value[3] / s); - } - - template - inline _xmat4x2 operator/ (const T s, const _xmat4x2& m) - { - return _xmat4x2( - s / m.value[0], - s / m.value[1], - s / m.value[2], - s / m.value[3]); - } -/* ToDo - template - inline _xmat4x2 operator/ (const _xmat4x2& m1, const _xmat2x4& m2) - { - - } - - template - inline _xmat4x2 operator/ (const _xmat2x4& m1, const _xmat4x2& m2) - { - - } -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat4x2_inl__ diff --git a/experimental/sse/glm/core/_xmat4x3.h b/experimental/sse/glm/core/_xmat4x3.h deleted file mode 100644 index 96066571..00000000 --- a/experimental/sse/glm/core/_xmat4x3.h +++ /dev/null @@ -1,146 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-08-04 -// Updated : 2006-10-01 -// Licence : This source is under GNU LGPL licence -// File : _mat4x3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat4x3_h__ -#define __mat4x3_h__ - -namespace glm{ -namespace detail{ - - template class _xvec3; - template class _xvec4; - template class _xmat2; - template class _xmat3; - template class _xmat4; - template class _xmat2x3; - template class _xmat3x2; - template class _xmat2x4; - template class _xmat4x2; - template class _xmat3x4; - - //!< \brief Template for 4 * 3 matrix of floating-point numbers. - template - class _xmat4x3 - { - private: - // Data - _xvec3 value[4]; - - public: - typedef T value_type; - typedef _xvec4 col_type; - typedef _xvec3 row_type; - typedef int size_type; - static const size_type col_size; - static const size_type row_size; - - // Constructors - _xmat4x3(); - explicit _xmat4x3(const T x); - explicit _xmat4x3( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1, - const T x2, const T y2, const T z2, - const T x3, const T y3, const T z3); - explicit _xmat4x3( - const _xvec3& v0, - const _xvec3& v1, - const _xvec3& v2, - const _xvec3& v3); - - // Conversion - template - explicit _xmat4x3(const _xmat4x3& m); - - explicit _xmat4x3(const _xmat2& x); - explicit _xmat4x3(const _xmat3& x); - explicit _xmat4x3(const _xmat4& x); - explicit _xmat4x3(const _xmat2x3& x); - explicit _xmat4x3(const _xmat3x2& x); - explicit _xmat4x3(const _xmat2x4& x); - explicit _xmat4x3(const _xmat4x2& x); - explicit _xmat4x3(const _xmat3x4& x); - - // Accesses - _xvec3& operator[](int i) {return value[i];} - const _xvec3 & operator[](int i) const {return value[i];} - // operator T*() {return &value[0][0];} - // operator const T*() const {return &value[0][0];} - operator T*() {return (T*)this;} - operator const T*() const {return (const T*)this;} - - // Unary updatable operators - _xmat4x3& operator= (const _xmat4x3& m); - _xmat4x3& operator+= (const T s); - _xmat4x3& operator+= (const _xmat4x3& m); - _xmat4x3& operator-= (const T s); - _xmat4x3& operator-= (const _xmat4x3& m); - _xmat4x3& operator*= (const T s); - _xmat4x3& operator*= (const _xmat3x4& m); - _xmat4x3& operator/= (const T s); -/* ToDo - _xmat4x3& operator/= (const _xmat3x4& m); -*/ - _xmat4x3& operator++ (); - _xmat4x3& operator-- (); - - // Unary constant operators - const _xmat4x3 operator- () const; - const _xmat4x3 operator++ (int n) const; - const _xmat4x3 operator-- (int n) const; - }; - - // Binary operators - template - _xmat4x3 operator+ (const _xmat4x3& m, const T s); - - template - _xmat4x3 operator+ (const _xmat4x3& m1, const _xmat4x3& m2); - - template - _xmat4x3 operator- (const _xmat4x3& m, const T s); - - template - _xmat4x3 operator- (const _xmat4x3& m1, const _xmat4x3& m2); - - template - _xmat4x3 operator* (const _xmat4x3& m, const T s); - - template - _xmat4x3 operator* (const T s, const _xmat4x3& m); - - template - _xvec3 operator* (const _xmat4x3& m, const _xvec4& v); - - template - _xvec4 operator* (const _xvec3& v, const _xmat4x3& m); - - template - _xmat3 operator* (const _xmat4x3& m1, const _xmat3x4& m2); - - template - _xmat4x3 operator/ (const _xmat4x3& m, const T s); - - template - _xmat4x3 operator/ (const T s, const _xmat4x3& m); -/* ToDo - template - _xvec3 operator/ (const _xmat4x3& m, const _xvec4& v); - - template - _xvec4 operator/ (const _xvec3& v, const _xmat4x3& m); - - template - _xmat3 operator/ (const _xmat4x3& m1, const _xmat3x4& m2); -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat4x3_h__ diff --git a/experimental/sse/glm/core/_xmat4x3.inl b/experimental/sse/glm/core/_xmat4x3.inl deleted file mode 100644 index 2c12f342..00000000 --- a/experimental/sse/glm/core/_xmat4x3.inl +++ /dev/null @@ -1,460 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-17 -// Updated : 2006-04-17 -// Licence : This source is under GNU LGPL licence -// File : _mat4x3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __mat4x3_inl__ -#define __mat4x3_inl__ - -#include "./_xmat4x3.h" - -namespace glm{ -namespace detail{ - - template const typename _xmat4x3::size_type _xmat4x3::col_size = 4; - template const typename _xmat4x3::size_type _xmat4x3::row_size = 3; - - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat4x3::_xmat4x3() - { - this->value[0] = _xvec3(1, 0, 0); - this->value[1] = _xvec3(0, 1, 0); - this->value[2] = _xvec3(0, 0, 1); - this->value[3] = _xvec3(0, 0, 0); - } - - template - inline _xmat4x3::_xmat4x3(const T f) - { - this->value[0] = _xvec3(f, 0, 0); - this->value[1] = _xvec3(0, f, 0); - this->value[2] = _xvec3(0, 0, f); - this->value[3] = _xvec3(0, 0, 0); - } - - template - inline _xmat4x3::_xmat4x3 - ( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1, - const T x2, const T y2, const T z2, - const T x3, const T y3, const T z3 - ) - { - this->value[0] = _xvec3(x0, y0, z0); - this->value[1] = _xvec3(x1, y1, z1); - this->value[2] = _xvec3(x2, y2, z2); - this->value[3] = _xvec3(x3, y3, z3); - } - - template - inline _xmat4x3::_xmat4x3 - ( - const _xvec3 & v0, - const _xvec3 & v1, - const _xvec3 & v2, - const _xvec3 & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - // Conversion - template - template - inline _xmat4x3::_xmat4x3(const _xmat4x3& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(m[2]); - this->value[3] = _xvec3(m[3]); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - this->value[2] = _xvec3(m[2], T(1)); - this->value[3] = _xvec3(T(0)); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat3& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(m[2]); - this->value[3] = _xvec3(T(0)); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(m[2]); - this->value[3] = _xvec3(m[3]); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat2x3& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(T(0), T(0), T(1)); - this->value[3] = _xvec3(T(0)); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat3x2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - this->value[2] = _xvec3(m[2], T(1)); - this->value[3] = _xvec3(T(0)); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat2x4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(T(0), T(0), T(1)); - this->value[3] = _xvec3(T(0)); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat4x2& m) - { - this->value[0] = _xvec3(m[0], T(0)); - this->value[1] = _xvec3(m[1], T(0)); - this->value[2] = _xvec3(m[2], T(1)); - this->value[3] = _xvec3(m[3], T(0)); - } - - template - inline _xmat4x3::_xmat4x3(const _xmat3x4& m) - { - this->value[0] = _xvec3(m[0]); - this->value[1] = _xvec3(m[1]); - this->value[2] = _xvec3(m[2]); - this->value[3] = _xvec3(T(0)); - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat4x3& _xmat4x3::operator= (const _xmat4x3& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - inline _xmat4x3& _xmat4x3::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - inline _xmat4x3& _xmat4x3::operator+= (const _xmat4x3& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - inline _xmat4x3& _xmat4x3::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - inline _xmat4x3& _xmat4x3::operator-= (const _xmat4x3& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - inline _xmat4x3& _xmat4x3::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - inline _xmat4x3& _xmat4x3::operator*= (const _xmat3x4& m) - { - return (*this = _xmat4x3(*this * m)); - } - - template - inline _xmat4x3 & _xmat4x3::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } -/* ToDo - template - inline _xmat4x3& _xmat4x3::operator/= (const _xmat3x4& m) - { - return (*this = *this / m); - } -*/ - template - inline _xmat4x3& _xmat4x3::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - inline _xmat4x3& _xmat4x3::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat4x3 _xmat4x3::operator- () const - { - return _xmat4x3( - -this->value[0], - -this->value[1], - -this->value[2], - -this->value[3]); - } - - template - inline const _xmat4x3 _xmat4x3::operator-- (int n) const - { - _xmat4x3 m = *this; - --m.value[0]; - --m.value[1]; - --m.value[2]; - --m.value[3]; - return m; - } - - template - inline const _xmat4x3 _xmat4x3::operator++ (int n) const - { - _xmat4 m = *this; - ++m.value[0]; - ++m.value[1]; - ++m.value[2]; - ++m.value[3]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat4x3 operator+ (const _xmat4x3& m, const T s) - { - return _xmat4x3( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - inline _xmat4x3 operator+ (const _xmat4x3& m1, const _xmat4x3& m2) - { - return _xmat4x3( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - inline _xmat4x3 operator- (const _xmat4x3& m, const T s) - { - return _xmat4x3( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template - inline _xmat4x3 operator- (const _xmat4x3& m1, const _xmat4x3& m2) - { - return _xmat4x3( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - inline _xmat4x3 operator* (const _xmat4x3& m, const T s) - { - return _xmat4x3( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xmat4x3 operator* (const T s, const _xmat4x3 & m) - { - return _xmat4x3( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xvec3 operator* (const _xmat4x3& m, const _xvec4& v) - { - return _xvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template - inline _xvec4 operator* (const _xvec3& v, const _xmat4x3& m) - { - return _xvec4( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], - v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], - v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); - } - - template - inline _xmat3 operator* (const _xmat4x3& m1, const _xmat3x4& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA30 = m1[3][0]; - const T SrcA31 = m1[3][1]; - const T SrcA32 = m1[3][2]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB03 = m2[0][3]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB13 = m2[1][3]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB23 = m2[2][3]; - - _xmat3 Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; - return Result; - } - - template - inline _xmat4x3 operator/ (const _xmat4x3& m, const T s) - { - return _xmat4x3( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s, - m.value[3] / s); - } - - template - inline _xmat4x3 operator/ (const T s, const _xmat4x3& m) - { - return _xmat4x3( - s / m.value[0], - s / m.value[1], - s / m.value[2], - s / m.value[3]); - } -/* ToDo - template - _xvec3 operator/ (const _xmat4x3& m, const _xvec4& v) - { - - } - - template - _xvec4 operator/ (const _xvec3& v, const _xmat4x3& m) - { - - } - - template - inline _xmat4x3 operator/ (const _xmat4x3& m1, const _xmat4x3& m2) - { - - } -*/ - -} //namespace detail -} //namespace glm - -#endif //__mat4x3_inl__ diff --git a/experimental/sse/glm/core/_xref2.h b/experimental/sse/glm/core/_xref2.h deleted file mode 100644 index 63d7eff6..00000000 --- a/experimental/sse/glm/core/_xref2.h +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-05-29 -// Updated : 2008-01-04 -// Licence : This source is under GNU LGPL licence -// File : _xref2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xref2_h__ -#define __xref2_h__ - -namespace glm{ -namespace detail{ - - template - class _xref2 - { - public: - _xref2(T& x, T& y); - _xref2& operator= (const _xref2& r); - _xref2& operator+=(const _xref2& r); - _xref2& operator-=(const _xref2& r); - _xref2& operator*=(const _xref2& r); - _xref2& operator/=(const _xref2& r); - _xref2& operator= (const _xvec2& v); - _xref2& operator+=(const _xvec2& v); - _xref2& operator-=(const _xvec2& v); - _xref2& operator*=(const _xvec2& v); - _xref2& operator/=(const _xvec2& v); - T& x; - T& y; - }; - -} //namespace detail -} //namespace glm - -#endif//__xref2_h__ diff --git a/experimental/sse/glm/core/_xref2.inl b/experimental/sse/glm/core/_xref2.inl deleted file mode 100644 index 6d6e70b2..00000000 --- a/experimental/sse/glm/core/_xref2.inl +++ /dev/null @@ -1,107 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-05-29 -// Updated : 2006-05-29 -// Licence : This source is under GNU LGPL licence -// File : _xref2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xref2_inl__ -#define __xref2_inl__ - -#include "./_xref2.h" - -namespace glm{ -namespace detail{ - - template - inline _xref2::_xref2(T& x, T& y) : - x(x), - y(y) - {} - - template - inline _xref2& _xref2::operator=(const _xref2& r) - { - x = r.x; - y = r.y; - return *this; - } - - template - inline _xref2& _xref2::operator+=(const _xref2& r) - { - x += r.x; - y += r.y; - return *this; - } - - template - inline _xref2& _xref2::operator-=(const _xref2& r) - { - x -= r.x; - y -= r.y; - return *this; - } - - template - inline _xref2& _xref2::operator*=(const _xref2& r) - { - x *= r.x; - y *= r.y; - return *this; - } - - template - inline _xref2& _xref2::operator/=(const _xref2& r) - { - x /= r.x; - y /= r.y; - return *this; - } - - template - inline _xref2& _xref2::operator=(const _xvec2& v) - { - x = v.x; - y = v.y; - return *this; - } - - template - inline _xref2& _xref2::operator+=(const _xvec2& v) - { - x += v.x; - y += v.y; - return *this; - } - - template - inline _xref2& _xref2::operator-=(const _xvec2& v) - { - x -= v.x; - y -= v.y; - return *this; - } - - template - inline _xref2& _xref2::operator*=(const _xvec2& v) - { - x *= v.x; - y *= v.y; - return *this; - } - - template - inline _xref2& _xref2::operator/=(const _xvec2& v) - { - x /= v.x; - y /= v.y; - return *this; - } - -} //namespace detail -} //namespace glm - -#endif//__xref2_inl__ diff --git a/experimental/sse/glm/core/_xref3.h b/experimental/sse/glm/core/_xref3.h deleted file mode 100644 index cea557ae..00000000 --- a/experimental/sse/glm/core/_xref3.h +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-05-29 -// Updated : 2006-05-29 -// Licence : This source is under GNU LGPL licence -// File : _xref3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xref3_h__ -#define __xref3_h__ - -namespace glm{ -namespace detail{ - - template - class _xref3 - { - public: - _xref3(T& x, T& y, T& z); - _xref3& operator= (const _xref3& r); - _xref3& operator+=(const _xref3& r); - _xref3& operator-=(const _xref3& r); - _xref3& operator*=(const _xref3& r); - _xref3& operator/=(const _xref3& r); - _xref3& operator= (const _xvec3& v); - _xref3& operator+=(const _xvec3& v); - _xref3& operator-=(const _xvec3& v); - _xref3& operator*=(const _xvec3& v); - _xref3& operator/=(const _xvec3& v); - T& x; - T& y; - T& z; - }; - -} //namespace detail -} //namespace glm - -#endif//__xref3_h__ diff --git a/experimental/sse/glm/core/_xref3.inl b/experimental/sse/glm/core/_xref3.inl deleted file mode 100644 index 7c226bd8..00000000 --- a/experimental/sse/glm/core/_xref3.inl +++ /dev/null @@ -1,118 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-05-29 -// Updated : 2006-05-29 -// Licence : This source is under GNU LGPL licence -// File : _xref3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xref3_inl__ -#define __xref3_inl__ - -#include "./_xref3.h" - -namespace glm{ -namespace detail{ - - template - inline _xref3::_xref3(T& x, T& y, T& z) : - x(x), - y(y), - z(z) - {} - - template - inline _xref3& _xref3::operator=(const _xref3& r) - { - x = r.x; - y = r.y; - z = r.z; - return *this; - } - - template - inline _xref3& _xref3::operator+=(const _xref3& r) - { - x += r.x; - y += r.y; - z += r.z; - return *this; - } - - template - inline _xref3& _xref3::operator-=(const _xref3& r) - { - x -= r.x; - y -= r.y; - z -= r.z; - return *this; - } - - template - inline _xref3& _xref3::operator*=(const _xref3& r) - { - x *= r.x; - y *= r.y; - z *= r.z; - return *this; - } - - template - inline _xref3& _xref3::operator/=(const _xref3& r) - { - x /= r.x; - y /= r.y; - z /= r.z; - return *this; - } - - template - inline _xref3& _xref3::operator=(const _xvec3& v) - { - x = v.x; - y = v.y; - z = v.z; - return *this; - } - - template - inline _xref3& _xref3::operator+=(const _xvec3& v) - { - x += v.x; - y += v.y; - z += v.z; - return *this; - } - - template - inline _xref3& _xref3::operator-=(const _xvec3& v) - { - x -= v.x; - y -= v.y; - z -= v.z; - return *this; - } - - template - inline _xref3& _xref3::operator*=(const _xvec3& v) - { - x *= v.x; - y *= v.y; - z *= v.z; - return *this; - } - - template - inline _xref3& _xref3::operator/=(const _xvec3& v) - { - x /= v.x; - y /= v.y; - z /= v.z; - return *this; - } - -} //namespace detail -} //namespace glm - -#endif//__xref3_inl__ diff --git a/experimental/sse/glm/core/_xref4.h b/experimental/sse/glm/core/_xref4.h deleted file mode 100644 index 45e817a4..00000000 --- a/experimental/sse/glm/core/_xref4.h +++ /dev/null @@ -1,40 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-05-29 -// Updated : 2006-05-29 -// Licence : This source is under GNU LGPL licence -// File : _xref4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xref4_h__ -#define __xref4_h__ - -namespace glm{ -namespace detail{ - - template - class _xref4 - { - public: - _xref4(T& x, T& y, T& z, T& w); - _xref4& operator= (const _xref4& r); - _xref4& operator+=(const _xref4& r); - _xref4& operator-=(const _xref4& r); - _xref4& operator*=(const _xref4& r); - _xref4& operator/=(const _xref4& r); - _xref4& operator= (const _xvec4& v); - _xref4& operator+=(const _xvec4& v); - _xref4& operator-=(const _xvec4& v); - _xref4& operator*=(const _xvec4& v); - _xref4& operator/=(const _xvec4& v); - T& x; - T& y; - T& z; - T& w; - }; - -} //namespace detail -} //namespace glm - -#endif//__xref4_h__ diff --git a/experimental/sse/glm/core/_xref4.inl b/experimental/sse/glm/core/_xref4.inl deleted file mode 100644 index 97d37793..00000000 --- a/experimental/sse/glm/core/_xref4.inl +++ /dev/null @@ -1,129 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-05-29 -// Updated : 2006-05-29 -// Licence : This source is under GNU LGPL licence -// File : _xref4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xref4_inl__ -#define __xref4_inl__ - -#include "./_xref4.h" - -namespace glm{ -namespace detail{ - - template - inline _xref4::_xref4(T& x, T& y, T& z, T& w) : - x(x), - y(y), - z(z), - w(w) - {} - - template - inline _xref4& _xref4::operator=(const _xref4& r) - { - x = r.x; - y = r.y; - z = r.z; - w = r.w; - return *this; - } - - template - inline _xref4& _xref4::operator+=(const _xref4& r) - { - x += r.x; - y += r.y; - z += r.z; - w += r.w; - return *this; - } - - template - inline _xref4& _xref4::operator-=(const _xref4& r) - { - x -= r.x; - y -= r.y; - z -= r.z; - w -= r.w; - return *this; - } - - template - inline _xref4& _xref4::operator*=(const _xref4& r) - { - x *= r.x; - y *= r.y; - z *= r.z; - w *= r.w; - return *this; - } - - template - inline _xref4& _xref4::operator/=(const _xref4& r) - { - x /= r.x; - y /= r.y; - z /= r.z; - w /= r.w; - return *this; - } - - template - _xref4& _xref4::operator=(const _xvec4& v) - { - x = v.x; - y = v.y; - z = v.z; - w = v.w; - return *this; - } - - template - inline _xref4& _xref4::operator+=(const _xvec4& v) - { - x += v.x; - y += v.y; - z += v.z; - w += v.w; - return *this; - } - - template - inline _xref4& _xref4::operator-=(const _xvec4& v) - { - x -= v.x; - y -= v.y; - z -= v.z; - w -= v.w; - return *this; - } - - template - inline _xref4& _xref4::operator*=(const _xvec4& v) - { - x *= v.x; - y *= v.y; - z *= v.z; - w *= v.w; - return *this; - } - - template - inline _xref4& _xref4::operator/=(const _xvec4& v) - { - x /= v.x; - y /= v.y; - z /= v.z; - w /= v.w; - return *this; - } - -} //namespace detail -} //namespace glm - -#endif//__xref4_inl__ diff --git a/experimental/sse/glm/core/_xvec2.h b/experimental/sse/glm/core/_xvec2.h deleted file mode 100644 index 520273fd..00000000 --- a/experimental/sse/glm/core/_xvec2.h +++ /dev/null @@ -1,260 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-15 -// Licence : This source is under GNU LGPL licence -// File : _xvec2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xvec2_h__ -#define __xvec2_h__ - -#include "./_cvec2.inl" - -namespace glm{ -namespace detail{ - - template - class _xvec2 : public _xvec2_base(T) - { - public: - // Common constructors - _xvec2(); - _xvec2(const _xvec2& v); - - // Swizzle constructors - _xvec2(const _xref2& r); - _xvec2(const _xvec2_base(T)& b); - - // T constructors - explicit _xvec2(const T x); - explicit _xvec2(const T a, const T b); - explicit _xvec2(const T a, const _xvec2& b); - explicit _xvec2(const T a, const _xvec3& b); - explicit _xvec2(const T a, const _xvec4& b); - explicit _xvec2(const _xvec3& a); - explicit _xvec2(const _xvec4& a); - - // U constructors - template explicit _xvec2(const U x); - template explicit _xvec2(const U a, const U b); - template explicit _xvec2(const U a, const _xvec2& b); - template explicit _xvec2(const U a, const _xvec3& b); - template explicit _xvec2(const U a, const _xvec4& b); - template explicit _xvec2(const _xvec2& a); - template explicit _xvec2(const _xvec3& a); - template explicit _xvec2(const _xvec4& a); - - // Bool constructors - explicit _xvec2(const bool x); - explicit _xvec2(const bool a, const bool b); - explicit _xvec2(const bool a, const _bvec2& b); - explicit _xvec2(const bool a, const _bvec3& b); - explicit _xvec2(const bool a, const _bvec4& b); - explicit _xvec2(const _bvec2& a); - explicit _xvec2(const _bvec3& a); - explicit _xvec2(const _bvec4& a); - - // Unary updatable operators - _xvec2& operator= (const _xvec2& v); - _xvec2& operator+=(const T s); - _xvec2& operator+=(const _xvec2& v); - _xvec2& operator-=(const T s); - _xvec2& operator-=(const _xvec2& v); - _xvec2& operator*=(const T s); - _xvec2& operator*=(const _xvec2& v); - _xvec2& operator/=(const T s); - _xvec2& operator/=(const _xvec2& v); - _xvec2& operator++(); - _xvec2& operator--(); -/* - // Bit operators - _xvec2& operator%=(const T s); - _xvec2& operator%=(const _xvec2& v); - _xvec2& operator&=(const T s); - _xvec2& operator&=(const _xvec2& v); - _xvec2& operator|=(const T s); - _xvec2& operator|=(const _xvec2& v); - _xvec2& operator^=(const T s); - _xvec2& operator^=(const _xvec2& v); - _xvec2& operator<<=(const T s); - _xvec2& operator<<=(const _xvec2& v); - _xvec2& operator>>=(const T s); - _xvec2& operator>>=(const _xvec2& v); -*/ - }; -/* - // Bit operators - template - _xvec2 operator% (const _xvec2& v, const T s); - - template - _xvec2 operator% (const T s, const _xvec2& v); - - template - _xvec2 operator% (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator& (const _xvec2& v, const T s); - - template - _xvec2 operator& (const T s, const _xvec2& v); - - template - _xvec2 operator& (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator| (const _xvec2& v, const T s); - - template - _xvec2 operator| (const T s, const _xvec2& v); - - template - _xvec2 operator| (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator^ (const _xvec2& v, const T s); - - template - _xvec2 operator^ (const T s, const _xvec2& v); - - template - _xvec2 operator^ (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator<< (const _xvec2& v, const T s); - - template - _xvec2 operator<< (const T s, const _xvec2& v); - - template - _xvec2 operator<< (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator>> (const _xvec2& v, const T s); - - template - _xvec2 operator>> (const T s, const _xvec2& v); - - template - _xvec2 operator>> (const _xvec2& v1, const _xvec2& v2); - - template - const _xvec2 operator~ (const _xvec2& v); -*/ - // Binary operators - // operator+ - template - _xvec2 operator+ (const _xvec2& v, const T s); - - template - _xvec2 operator+ (const T s, const _xvec2& v); - - template - _xvec2 operator+ (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator+ (const _xref2& v, const T s); - - template - _xvec2 operator+ (const T s, const _xref2& v); - - template - _xvec2 operator+ (const _xref2& v1, const _xref2& v2); - - template - _xvec2 operator+ (const _xvec2& v1, const _xref2& v2); - - template - _xvec2 operator+ (const _xref2& v1, const _xvec2& v2); - - // operator- - template - _xvec2 operator- (const _xvec2& v, const T s); - - template - _xvec2 operator- (const T s, const _xvec2& v); - - template - _xvec2 operator- (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator- (const _xref2& v, const T s); - - template - _xvec2 operator- (const T s, const _xref2& v); - - template - _xvec2 operator- (const _xref2& v1, const _xref2& v2); - - template - _xvec2 operator- (const _xvec2& v1, const _xref2& v2); - - template - _xvec2 operator- (const _xref2& v1, const _xvec2& v2); - - // operator* - template - _xvec2 operator* (const _xvec2& v, const T s); - - template - _xvec2 operator* (const T s, const _xvec2& v); - - template - _xvec2 operator* (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator* (const _xref2& v, const T s); - - template - _xvec2 operator* (const T s, const _xref2& v); - - template - _xvec2 operator* (const _xref2& v1, const _xref2& v2); - - template - _xvec2 operator* (const _xvec2& v1, const _xref2& v2); - - template - _xvec2 operator* (const _xref2& v1, const _xvec2& v2); - - // operator/ - template - _xvec2 operator/ (const _xvec2& v, const T s); - - template - _xvec2 operator/ (const T s, const _xvec2& v); - - template - _xvec2 operator/ (const _xvec2& v1, const _xvec2& v2); - - template - _xvec2 operator/ (const _xref2& v, const T s); - - template - _xvec2 operator/ (const T s, const _xref2& v); - - template - _xvec2 operator/ (const _xref2& v1, const _xref2& v2); - - template - _xvec2 operator/ (const _xvec2& v1, const _xref2& v2); - - template - _xvec2 operator/ (const _xref2& v1, const _xvec2& v2); - - // Unary constant operators - template - const _xvec2 operator- (const _xvec2& v); - - template - const _xvec2 operator--(const _xvec2& v, int); - - template - const _xvec2 operator++(const _xvec2& v, int); - -} //namespace detail -} //namespace glm - -#endif //__xvec2_h__ diff --git a/experimental/sse/glm/core/_xvec2.inl b/experimental/sse/glm/core/_xvec2.inl deleted file mode 100644 index 8ad49acd..00000000 --- a/experimental/sse/glm/core/_xvec2.inl +++ /dev/null @@ -1,802 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : _xvec2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __xvec2_inl__ -#define __xvec2_inl__ - -#include "./_cvec2.h" -#include "./_xvec2.h" -#include "./_bvec2.h" -#include "./_xvec3.h" -#include "./_bvec3.h" -#include "./_xvec4.h" -#include "./_bvec4.h" -#include "./_swizzle.inl" - -namespace glm{ -namespace detail{ - - // Common constructors - template - inline _xvec2::_xvec2() : - _cvec2(T(0), T(0)) - {} - - template - inline _xvec2::_xvec2(const _xvec2& v) : - _cvec2(v.x, v.y) - {} - - // Swizzle conclassor - template - inline _xvec2::_xvec2(const _xref2& r) : - _cvec2(r.x, r.y) - {} - - template - inline _xvec2::_xvec2(const _xvec2_base(T)& b) : - _cvec2(b.x, b.y) - {} - - // T constructors - template - inline _xvec2::_xvec2(const T x) : - _cvec2(x, x) - {} - - template - inline _xvec2::_xvec2(const T a, const T b) : - _cvec2(a, b) - {} - - template - inline _xvec2::_xvec2(const T a, const _xvec2& b) : - _cvec2(a, b.x) - {} - - template - inline _xvec2::_xvec2(const T a, const _xvec3& b) : - _cvec2(a, b.x) - {} - - template - inline _xvec2::_xvec2(const T a, const _xvec4& b) : - _cvec2(a, b.x) - {} - - template - inline _xvec2::_xvec2(const _xvec3& a) : - _cvec2(a.x, a.y) - {} - - template - inline _xvec2::_xvec2(const _xvec4& a) : - _cvec2(a.x, a.y) - {} - - // U constructors - template - template - inline _xvec2::_xvec2(const U x) : - _cvec2(T(x), T(x)) - {} - - template - template - inline _xvec2::_xvec2(const U a, const U b) : - _cvec2(T(a), T(b)) - {} - - template - template - inline _xvec2::_xvec2(const U a, const _xvec2& b) : - _cvec2(T(a), T(b.x)) - {} - - template - template - inline _xvec2::_xvec2(const U a, const _xvec3& b) : - _cvec2(T(a), T(b.x)) - {} - - template - template - inline _xvec2::_xvec2(const U a, const _xvec4& b) : - _cvec2(T(a), T(b.x)) - {} - - template - template - inline _xvec2::_xvec2(const _xvec2& a) : - _cvec2(T(a.x), T(a.y)) - {} - - template - template - inline _xvec2::_xvec2(const _xvec3& a) : - _cvec2(T(a.x), T(a.y)) - {} - - template - template - inline _xvec2::_xvec2(const _xvec4& a) : - _cvec2(T(a.x), T(a.y)) - {} - - // Bool constructors - template - inline _xvec2::_xvec2(const bool x) : - _cvec2(T(x), T(x)) - {} - - template - inline _xvec2::_xvec2(const bool a, const bool b) : - _cvec2(T(a), T(b)) - {} - - template - inline _xvec2::_xvec2(const bool a, const _bvec2& b) : - _cvec2(T(a), T(b.x)) - {} - - template - inline _xvec2::_xvec2(const bool a, const _bvec3& b) : - _cvec2(T(a), T(b.x)) - {} - - template - inline _xvec2::_xvec2(const bool a, const _bvec4& b) : - _cvec2(T(a), T(b.x)) - {} - - template - inline _xvec2::_xvec2(const _bvec3& a) : - _cvec2(T(a.x), T(a.y)) - {} - - template - inline _xvec2::_xvec2(const _bvec4& a) : - _cvec2(T(a.x), T(a.y)) - {} - - template - inline _xvec2::_xvec2(const _bvec2& a) : - _cvec2(T(a.x), T(a.y)) - {} - - ////////////////////////////////////////////////////////////// - // vec2 and ivec2 operators - - template - inline _xvec2& _xvec2::operator=(const _xvec2& v) - { - this->x = v.x; - this->y = v.y; - return *this; - } - - template - inline _xvec2& _xvec2::operator+= (const T s) - { - this->x += s; - this->y += s; - return *this; - } - - template - inline _xvec2& _xvec2::operator+= (const _xvec2& v) - { - this->x += v.x; - this->y += v.y; - return *this; - } - - template - inline _xvec2& _xvec2::operator-= (const T s) - { - this->x -= s; - this->y -= s; - return *this; - } - - template - inline _xvec2& _xvec2::operator-= (const _xvec2& v) - { - this->x -= v.x; - this->y -= v.y; - return *this; - } - - template - inline _xvec2& _xvec2::operator*= (const T s) - { - this->x *= s; - this->y *= s; - return *this; - } - - template - inline _xvec2& _xvec2::operator*= (const _xvec2& v) - { - this->x *= v.x; - this->y *= v.y; - return *this; - } - - template - inline _xvec2& _xvec2::operator/= (const T s) - { - this->x /= s; - this->y /= s; - return *this; - } - - template - inline _xvec2& _xvec2::operator/= (const _xvec2& v) - { - this->x /= v.x; - this->y /= v.y; - return *this; - } - - template - inline _xvec2& _xvec2::operator++ () - { - ++this->x; - ++this->y; - return *this; - } - - template - inline _xvec2& _xvec2::operator-- () - { - --this->x; - --this->y; - return *this; - } -/* - template - inline _xvec2& operator%=(const T s) - { - this->x %= s; - this->y %= s; - return *this; - } - - template - inline _xvec2& operator%=(const _xvec2& v) - { - this->x %= v.x; - this->y %= v.y; - return *this; - } - - template - inline _xvec2& operator&=(const T s) - { - this->x &= s; - this->y &= s; - return *this; - } - - template - inline _xvec2& operator&=(const _xvec2& v) - { - this->x &= v.x; - this->y &= v.y; - return *this; - } - - template - inline _xvec2& operator|=(const T s) - { - this->x |= s; - this->y |= s; - return *this; - } - - template - inline _xvec2& operator|=(const _xvec2& v) - { - this->x |= v.x; - this->y |= v.y; - return *this; - } - - template - inline _xvec2& operator^=(const T s) - { - this->x ^= s; - this->y ^= s; - return *this; - } - - template - inline _xvec2& operator^=(const _xvec2& v) - { - this->x ^= v.x; - this->y ^= v.y; - return *this; - } - - template - inline _xvec2& operator<<=(const T s) - { - this->x <<= s; - this->y <<= s; - return *this; - } - - template - inline _xvec2& operator<<=(const _xvec2& v) - { - this->x <<= v.x; - this->y <<= v.y; - return *this; - } - - template - inline _xvec2& operator>>=(const T s) - { - this->x >>= s; - this->y >>= s; - return *this; - } - - template - inline _xvec2& operator>>=(const _xvec2& v) - { - this->x >>= v.x; - this->y >>= v.y; - return *this; - } - - // Bit operators - template - inline _xvec2 operator% (const _xvec2& v, const T s) - { - return _xvec2( - v.x % s, - v.y % s); - } - - template - inline _xvec2 operator% (const T s, const _xvec2& v) - { - return _xvec2( - s % v.x, - s % v.y); - } - - template - inline _xvec2 operator% (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x % v2.x, - v1.y % v2.y); - } - - template - inline _xvec2 operator& (const _xvec2& v, const T s) - { - return _xvec2( - v.x & s, - v.y & s); - } - - template - inline _xvec2 operator& (const T s, const _xvec2& v) - { - return _xvec2( - s & v.x, - s & v.y); - } - - template - inline _xvec2 operator& (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x & v2.x, - v1.y & v2.y); - } - - template - inline _xvec2 operator| (const _xvec2& v, const T s) - { - return _xvec2( - v.x | s, - v.y | s); - } - - template - inline _xvec2 operator| (const T s, const _xvec2& v) - { - return _xvec2( - s | v.x, - s | v.y); - } - - template - inline _xvec2 operator| (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x | v2.x, - v1.y | v2.y); - } - - template - inline _xvec2 operator^ (const _xvec2& v, const T s) - { - return _xvec2( - v.x ^ s, - v.y ^ s); - } - - template - inline _xvec2 operator^ (const T s, const _xvec2& v) - { - return _xvec2( - s ^ v.x, - s ^ v.y); - } - - template - inline _xvec2 operator^ (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x ^ v2.x, - v1.y ^ v2.y); - } - - template - inline _xvec2 operator<< (const _xvec2& v, const T s) - { - return _xvec2( - v.x << s, - v.y << s); - } - - template - inline _xvec2 operator<< (const T s, const _xvec2& v) - { - return _xvec2( - s << v.x, - s << v.y); - } - - template - inline _xvec2 operator<< (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x << v2.x, - v1.y << v2.y); - } - - template - inline _xvec2 operator>> (const _xvec2& v, const T s) - { - return _xvec2( - v.x >> s, - v.y >> s); - } - - template - inline _xvec2 operator>> (const T s, const _xvec2& v) - { - return _xvec2( - s >> v.x, - s >> v.y); - } - - template - inline _xvec2 operator>> (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x >> v2.x, - v1.y >> v2.y); - } - - template - inline const _xvec2 operator~ (const _xvec2& v) - { - return _xvec2( - ~v.x, - ~v.y); - } -*/ - // Binary operators - //operator+ - template - inline _xvec2 operator+ (const _xvec2& v, const T s) - { - return _xvec2( - v.x + s, - v.y + s); - } - - template - inline _xvec2 operator+ (const T s, const _xvec2& v) - { - return _xvec2( - s + v.x, - s + v.y); - } - - template - inline _xvec2 operator+ (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x + v2.x, - v1.y + v2.y); - } - - template - inline _xvec2 operator+ (const _xref2& v, const T s) - { - return _xvec2( - v.x + s, - v.y + s); - } - - template - inline _xvec2 operator+ (const T s, const _xref2& v) - { - return _xvec2( - s + v.x, - s + v.y); - } - - template - inline _xvec2 operator+ (const _xref2& v1, const _xref2& v2) - { - return _xvec2( - v1.x + v2.x, - v1.y + v2.y); - } - - template - inline _xvec2 operator+ (const _xvec2& v1, const _xref2& v2) - { - return _xvec2( - v1.x + v2.x, - v1.y + v2.y); - } - - template - inline _xvec2 operator+ (const _xref2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x + v2.x, - v1.y + v2.y); - } - - //operator- - template - inline _xvec2 operator- (const _xvec2& v, const T s) - { - return _xvec2( - v.x - s, - v.y - s); - } - - template - inline _xvec2 operator- (const T s, const _xvec2& v) - { - return _xvec2( - s - v.x, - s - v.y); - } - - template - inline _xvec2 operator- (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x - v2.x, - v1.y - v2.y); - } - - template - inline _xvec2 operator- (const _xref2& v, const T s) - { - return _xvec2( - v.x - s, - v.y - s); - } - - template - inline _xvec2 operator- (const T s, const _xref2& v) - { - return _xvec2( - s - v.x, - s - v.y); - } - - template - inline _xvec2 operator- (const _xref2& v1, const _xref2& v2) - { - return _xvec2( - v1.x - v2.x, - v1.y - v2.y); - } - - template - inline _xvec2 operator- (const _xvec2& v1, const _xref2& v2) - { - return _xvec2( - v1.x - v2.x, - v1.y - v2.y); - } - - template - inline _xvec2 operator- (const _xref2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x - v2.x, - v1.y - v2.y); - } - - //operator* - template - inline _xvec2 operator* (const _xvec2& v, const T s) - { - return _xvec2( - v.x * s, - v.y * s); - } - - template - inline _xvec2 operator* (const T s, const _xvec2& v) - { - return _xvec2( - s * v.x, - s * v.y); - } - - template - inline _xvec2 operator* (const _xvec2& v1, const _xvec2 & v2) - { - return _xvec2( - v1.x * v2.x, - v1.y * v2.y); - } - - template - inline _xvec2 operator* (const _xref2& v, const T s) - { - return _xvec2( - v.x * s, - v.y * s); - } - - template - inline _xvec2 operator* (const T s, const _xref2& v) - { - return _xvec2( - s * v.x, - s * v.y); - } - - template - inline _xvec2 operator* (const _xref2& v1, const _xref2& v2) - { - return _xvec2( - v1.x * v2.x, - v1.y * v2.y); - } - - template - inline _xvec2 operator* (const _xvec2& v1, const _xref2& v2) - { - return _xvec2( - v1.x * v2.x, - v1.y * v2.y); - } - - template - inline _xvec2 operator* (const _xref2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x * v2.x, - v1.y * v2.y); - } - - //operator/ - template - inline _xvec2 operator/ (const _xvec2& v, const T s) - { - return _xvec2( - v.x / s, - v.y / s); - } - - template - inline _xvec2 operator/ (const T s, const _xvec2& v) - { - return _xvec2( - s / v.x, - s / v.y); - } - - template - inline _xvec2 operator/ (const _xvec2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x / v2.x, - v1.y / v2.y); - } - - template - inline _xvec2 operator/ (const _xref2& v, const T s) - { - return _xvec2( - v.x / s, - v.y / s); - } - - template - inline _xvec2 operator/ (const T s, const _xref2& v) - { - return _xvec2( - s / v.x, - s / v.y); - } - - template - inline _xvec2 operator/ (const _xref2& v1, const _xref2& v2) - { - return _xvec2( - v1.x / v2.x, - v1.y / v2.y); - } - - template - inline _xvec2 operator/ (const _xvec2& v1, const _xref2& v2) - { - return _xvec2( - v1.x / v2.x, - v1.y / v2.y); - } - - template - inline _xvec2 operator/ (const _xref2& v1, const _xvec2& v2) - { - return _xvec2( - v1.x / v2.x, - v1.y / v2.y); - } - - // Unary constant operators - template - inline const _xvec2 operator- (const _xvec2& v) - { - return _xvec2( - -v.x, - -v.y); - } - - template - inline const _xvec2 operator++ (const _xvec2& v, int) - { - return _xvec2( - v.x + T(1), - v.y + T(1)); - } - - template - inline const _xvec2 operator-- (const _xvec2& v, int) - { - return _xvec2( - v.x - T(1), - v.y - T(1)); - } - -} //namespace detail -} //namespace glm - -#endif //__xvec2_inl__ diff --git a/experimental/sse/glm/core/_xvec3.h b/experimental/sse/glm/core/_xvec3.h deleted file mode 100644 index a9a9b676..00000000 --- a/experimental/sse/glm/core/_xvec3.h +++ /dev/null @@ -1,283 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-15 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_xvec3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Optimisation note: Don't use vec3 class instead of vec4 because you think it -// whould be faster. It whouldn't be the case especially if you use SSE -// intructions set in your compiler option and/or mat4 transformations. -// An advide: test your code speed with vec3 and vec4 to select the faster. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_xvec3_h__ -#define __glm_core_xvec3_h__ - -#include "./_cvec3.inl" - -namespace glm{ -namespace detail{ - - template - class _xvec3 : public _xvec3_base(T) - { - public: - // Common constructors - _xvec3(); - _xvec3(const _xvec3& v); - - // Swizzle constructors - _xvec3(const _xref3& r); - _xvec3(const _xvec3_base(T)& b); - - // T constructors - explicit _xvec3(const T x); - explicit _xvec3(const T a, const T b, const T c); - explicit _xvec3(const T a, const T b, const _xvec2& c); - explicit _xvec3(const T a, const T b, const _xvec3& c); - explicit _xvec3(const T a, const T b, const _xvec4& c); - explicit _xvec3(const T a, const _xvec2& b); - explicit _xvec3(const T a, const _xvec3& b); - explicit _xvec3(const T a, const _xvec4& b); - explicit _xvec3(const _xvec2& a, T b); - explicit _xvec3(const _xvec2& a, const _xvec2& b); - explicit _xvec3(const _xvec2& a, const _xvec3& b); - explicit _xvec3(const _xvec2& a, const _xvec4& b); - explicit _xvec3(const _xvec4& a); - - // U constructors - template explicit _xvec3(const U x); - template explicit _xvec3(const U a, const U b, const U c); - template explicit _xvec3(const U a, const U b, const _xvec2& c); - template explicit _xvec3(const U a, const U b, const _xvec3& c); - template explicit _xvec3(const U a, const U b, const _xvec4& c); - template explicit _xvec3(const U a, const _xvec2& b); - template explicit _xvec3(const U a, const _xvec3& b); - template explicit _xvec3(const U a, const _xvec4& b); - template explicit _xvec3(const _xvec2& a, U b); - template explicit _xvec3(const _xvec2& a, const _xvec2& b); - template explicit _xvec3(const _xvec2& a, const _xvec3& b); - template explicit _xvec3(const _xvec2& a, const _xvec4& b); - template explicit _xvec3(const _xvec3& a); - template explicit _xvec3(const _xvec4& a); - - // Bool constructors - explicit _xvec3(const bool x); - explicit _xvec3(const bool a, const bool b, const bool c); - explicit _xvec3(const bool a, const bool b, const _bvec2& c); - explicit _xvec3(const bool a, const bool b, const _bvec3& c); - explicit _xvec3(const bool a, const bool b, const _bvec4& c); - explicit _xvec3(const bool a, const _bvec2& b); - explicit _xvec3(const bool a, const _bvec3& b); - explicit _xvec3(const bool a, const _bvec4& b); - explicit _xvec3(const _bvec2& a, bool b); - explicit _xvec3(const _bvec2& a, const _bvec2& b); - explicit _xvec3(const _bvec2& a, const _bvec3& b); - explicit _xvec3(const _bvec2& a, const _bvec4& b); - explicit _xvec3(const _bvec3& a); - explicit _xvec3(const _bvec4& a); - - // Unary updatable operators - _xvec3& operator= (const _xvec3& v); - _xvec3& operator+=(const T s); - _xvec3& operator+=(const _xvec3& v); - _xvec3& operator-=(const T s); - _xvec3& operator-=(const _xvec3& v); - _xvec3& operator*=(const T s); - _xvec3& operator*=(const _xvec3& v); - _xvec3& operator/=(const T s); - _xvec3& operator/=(const _xvec3& v); - _xvec3& operator++(); - _xvec3& operator--(); -/* - // Bit operators - _xvec3& operator%=(const T s); - _xvec3& operator%=(const _xvec3& v); - _xvec3& operator&=(const T s); - _xvec3& operator&=(const _xvec3& v); - _xvec3& operator|=(const T s); - _xvec3& operator|=(const _xvec3& v); - _xvec3& operator^=(const T s); - _xvec3& operator^=(const _xvec3& v); - _xvec3& operator<<=(const T s); - _xvec3& operator<<=(const _xvec3& v); - _xvec3& operator>>=(const T s); - _xvec3& operator>>=(const _xvec3& v); -*/ - }; -/* - // Bit operators - template - _xvec3 operator% (const _xvec3& v, const T s); - - template - _xvec3 operator% (const T s, const _xvec3& v); - - template - _xvec3 operator% (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator& (const _xvec3& v, const T s); - - template - _xvec3 operator& (const T s, const _xvec3& v); - - template - _xvec3 operator& (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator| (const _xvec3& v, const T s); - - template - _xvec3 operator| (const T s, const _xvec3& v); - - template - _xvec3 operator| (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator^ (const _xvec3& v, const T s); - - template - _xvec3 operator^ (const T s, const _xvec3& v); - - template - _xvec3 operator^ (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator<< (const _xvec3& v, const T s); - - template - _xvec3 operator<< (const T s, const _xvec3& v); - - template - _xvec3 operator<< (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator>> (const _xvec3& v, const T s); - - template - _xvec3 operator>> (const T s, const _xvec3& v); - - template - _xvec3 operator>> (const _xvec3& v1, const _xvec3& v2); - - template - const _xvec3 operator~ (const _xvec2& v); -*/ - // Binasy opesators - // operator+ - template - _xvec3 operator+ (const _xvec3& v, const T s); - - template - _xvec3 operator+ (const T s, const _xvec3& v); - - template - _xvec3 operator+ (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator+ (const _xref3& v, const T s); - - template - _xvec3 operator+ (const T s, const _xref3& v); - - template - _xvec3 operator+ (const _xref3& v1, const _xref3& v2); - - template - _xvec3 operator+ (const _xvec3& v1, const _xref3& v2); - - template - _xvec3 operator+ (const _xref3& v1, const _xvec3& v2); - - // operator- - template - _xvec3 operator- (const _xvec3& v, const T s); - - template - _xvec3 operator- (const T s, const _xvec3& v); - - template - _xvec3 operator- (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator- (const _xref3& v, const T s); - - template - _xvec3 operator- (const T s, const _xref3& v); - - template - _xvec3 operator- (const _xref3& v1, const _xref3& v2); - - template - _xvec3 operator- (const _xvec3& v1, const _xref3& v2); - - template - _xvec3 operator- (const _xref3& v1, const _xvec3& v2); - - // operator* - template - _xvec3 operator* (const _xvec3& v, const T s); - - template - _xvec3 operator* (const T s, const _xvec3& v); - - template - _xvec3 operator* (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator* (const _xref3& v, const T s); - - template - _xvec3 operator* (const T s, const _xref3& v); - - template - _xvec3 operator* (const _xref3& v1, const _xref3& v2); - - template - _xvec3 operator* (const _xvec3& v1, const _xref3& v2); - - template - _xvec3 operator* (const _xref3& v1, const _xvec3& v2); - - // operator/ - template - _xvec3 operator/ (const _xvec3& v, const T s); - - template - _xvec3 operator/ (const T s, const _xvec3& v); - - template - _xvec3 operator/ (const _xvec3& v1, const _xvec3& v2); - - template - _xvec3 operator/ (const _xref3& v, const T s); - - template - _xvec3 operator/ (const T s, const _xref3& v); - - template - _xvec3 operator/ (const _xref3& v1, const _xref3& v2); - - template - _xvec3 operator/ (const _xvec3& v1, const _xref3& v2); - - template - _xvec3 operator/ (const _xref3& v1, const _xvec3& v2); - - // Unary constant operators - template - const _xvec3 operator- (const _xvec3& v); - - template - const _xvec3 operator-- (const _xvec3& v, int); - - template - const _xvec3 operator++ (const _xvec3& v, int); - -} //namespace detail -} //namespace glm - -#endif//__glm_core_xvec3_h__ diff --git a/experimental/sse/glm/core/_xvec3.inl b/experimental/sse/glm/core/_xvec3.inl deleted file mode 100644 index a11ce130..00000000 --- a/experimental/sse/glm/core/_xvec3.inl +++ /dev/null @@ -1,694 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_xvec3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_xvec3_inl__ -#define __glm_core_xvec3_inl__ - -#include "./_xvec2.h" -#include "./_bvec2.h" -#include "./_xvec3.h" -#include "./_bvec3.h" -#include "./_xvec4.h" -#include "./_bvec4.h" -#include "./_swizzle.inl" - -namespace glm{ -namespace detail{ - - // Common constructors - template - inline _xvec3::_xvec3() : - _cvec3(T(0), T(0), T(0)) - {} - - template - inline _xvec3::_xvec3(const _xvec3& v) : - _cvec3(v.x, v.y, v.z) - {} - - // Swizzle constructors - template - inline _xvec3::_xvec3(const _xref3& r) : - _cvec3(r.x, r.y, r.z) - {} - - template - inline _xvec3::_xvec3(const _xvec3_base(T)& b) : - _cvec3(b.x, b.y, b.z) - {} - - // T constructors - template - inline _xvec3::_xvec3(const T x) : - _cvec3(x, x, x) - {} - - template - inline _xvec3::_xvec3(const T a, const T b, const T c) : - _cvec3(a, b, c) - {} - - template - inline _xvec3::_xvec3(const T a, const T b, const _xvec2& c) : - _cvec3(a, b, c.x) - {} - - template - inline _xvec3::_xvec3(const T a, const T b, const _xvec3& c) : - _cvec3(a, b, c.x) - {} - - template - inline _xvec3::_xvec3(const T a, const T b, const _xvec4& c) : - _cvec3(a, b, c.x) - {} - - template - inline _xvec3::_xvec3(const T a, const _xvec2& b) : - _cvec3(a, b.x, b.y) - {} - - template - inline _xvec3::_xvec3(const T a, const _xvec3& b) : - _cvec3(a, b.x, b.y) - {} - - template - inline _xvec3::_xvec3(const T a, const _xvec4& b) : - _cvec3(a, b.x, b.y) - {} - - template - inline _xvec3::_xvec3(const _xvec2& a, T b) : - _cvec3(a.x, a.y, b) - {} - - template - inline _xvec3::_xvec3(const _xvec2& a, const _xvec2& b) : - _cvec3(a.x, a.y, b.x) - {} - - template - inline _xvec3::_xvec3(const _xvec2& a, const _xvec3& b) : - _cvec3(a.x, a.y, b.x) - {} - - template - inline _xvec3::_xvec3(const _xvec2& a, const _xvec4& b) : - _cvec3(a.x, a.y, b.x) - {} - - template - inline _xvec3::_xvec3(const _xvec4& a) : - _cvec3(a.x, a.y, a.z) - {} - - // U constructors - template - template - inline _xvec3::_xvec3(const U x) : - _cvec3(T(x), T(x), T(x)) - {} - - template - template - inline _xvec3::_xvec3(const U a, const U b, const U c) : - _cvec3(T(a), T(b), T(c)) - {} - - template - template - inline _xvec3::_xvec3(const U a, const U b, const _xvec2& c) : - _cvec3(T(a), T(b), T(c.x)) - {} - - template - template - inline _xvec3::_xvec3(const U a, const U b, const _xvec3& c) : - _cvec3(T(a), T(b), T(c.x)) - {} - - template - template - inline _xvec3::_xvec3(const U a, const U b, const _xvec4& c) : - _cvec3(T(a), T(b), T(c.x)) - {} - - template - template - inline _xvec3::_xvec3(const U a, const _xvec2& b) : - _cvec3(T(a), T(b.x), T(b.y)) - {} - - template - template - inline _xvec3::_xvec3(const U a, const _xvec3& b) : - _cvec3(T(a), T(b.x), T(b.y)) - {} - - template - template - inline _xvec3::_xvec3(const U a, const _xvec4& b) : - _cvec3(T(a), T(b.x), T(b.y)) - {} - - template - template - inline _xvec3::_xvec3(const _xvec2& a, U b) : - _cvec3(T(a.x), T(a.y), T(b)) - {} - - template - template - inline _xvec3::_xvec3(const _xvec2& a, const _xvec2& b) : - _cvec3(T(a.x), T(a.y), T(b.x)) - {} - - template - template - inline _xvec3::_xvec3(const _xvec2& a, const _xvec3& b) : - _cvec3(T(a.x), T(a.y), T(b.x)) - {} - - template - template - inline _xvec3::_xvec3(const _xvec2& a, const _xvec4& b) : - _cvec3(T(a.x), T(a.y), T(b.x)) - {} - - template - template - inline _xvec3::_xvec3(const _xvec3& a) : - _cvec3(T(a.x), T(a.y), T(a.z)) - {} - - template - template - inline _xvec3::_xvec3(const _xvec4& a) : - _cvec3(T(a.x), T(a.y), T(a.z)) - {} - - // Bool constructors - template - inline _xvec3::_xvec3(const bool x) : - _cvec3(T(x), T(x), T(x)) - {} - - template - inline _xvec3::_xvec3(const bool a, const bool b, const bool c) : - _cvec3(T(a), T(b), T(c)) - {} - - template - inline _xvec3::_xvec3(const bool a, const bool b, const _bvec2& c) : - _cvec3(T(a), T(b), T(c.x)) - {} - - template - inline _xvec3::_xvec3(const bool a, const bool b, const _bvec3& c) : - _cvec3(T(a), T(b), T(c.x)) - {} - - template - inline _xvec3::_xvec3(const bool a, const bool b, const _bvec4& c) : - _cvec3(T(a), T(b), T(c.x)) - {} - - template - inline _xvec3::_xvec3(const bool a, const _bvec2& b) : - _cvec3(T(a), T(b.x), T(b.y)) - {} - - template - inline _xvec3::_xvec3(const bool a, const _bvec3& b) : - _cvec3(T(a), T(b.x), T(b.y)) - {} - - template - inline _xvec3::_xvec3(const bool a, const _bvec4& b) : - _cvec3(T(a), T(b.x), T(b.y)) - {} - - template - inline _xvec3::_xvec3(const _bvec2& a, bool b) : - _cvec3(T(a.x), T(a.y), T(b)) - {} - - template - inline _xvec3::_xvec3(const _bvec2& a, const _bvec2& b) : - _cvec3(T(a.x), T(a.y), T(b.x)) - {} - - template - inline _xvec3::_xvec3(const _bvec2& a, const _bvec3& b) : - _cvec3(T(a.x), T(a.y), T(b.x)) - {} - - template - inline _xvec3::_xvec3(const _bvec2& a, const _bvec4& b) : - _cvec3(T(a.x), T(a.y), T(b.x)) - {} - - template - inline _xvec3::_xvec3(const _bvec3& a) : - _cvec3(T(a.x), T(a.y), T(a.z)) - {} - - template - inline _xvec3::_xvec3(const _bvec4& a) : - _cvec3(T(a.x), T(a.y), T(a.z)) - {} - - ////////////////////////////////////////////////////////////// - // vec3 and ivec3 operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - template - inline _xvec3& _xvec3::operator=(const _xvec3& v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - return *this; - } - - template - inline _xvec3& _xvec3::operator+= (const T s) - { - this->x += s; - this->y += s; - this->z += s; - return *this; - } - - template - inline _xvec3& _xvec3::operator+= (const _xvec3& v) - { - this->x += v.x; - this->y += v.y; - this->z += v.z; - return *this; - } - - template - inline _xvec3& _xvec3::operator-= (const T s) - { - this->x -= s; - this->y -= s; - this->z -= s; - return *this; - } - - template - inline _xvec3& _xvec3::operator-= (const _xvec3& v) - { - this->x -= v.x; - this->y -= v.y; - this->z -= v.z; - return *this; - } - - template - inline _xvec3& _xvec3::operator*= (const T s) - { - this->x *= s; - this->y *= s; - this->z *= s; - return *this; - } - - template - inline _xvec3& _xvec3::operator*= (const _xvec3& v) - { - this->x *= v.x; - this->y *= v.y; - this->z *= v.z; - return *this; - } - - template - inline _xvec3& _xvec3::operator/= (const T s) - { - this->x /= s; - this->y /= s; - this->z /= s; - return *this; - } - - template - inline _xvec3& _xvec3::operator/= (const _xvec3& v) - { - this->x /= v.x; - this->y /= v.y; - this->z /= v.z; - return *this; - } - - template - inline _xvec3& _xvec3::operator++ () - { - this->x++; - this->y++; - this->z++; - return *this; - } - - template - inline _xvec3& _xvec3::operator-- () - { - this->x--; - this->y--; - this->z--; - return *this; - } - - // Unary constant operators - template - inline const _xvec3 operator- (const _xvec3& v) - { - return _xvec3( - -v.x, - -v.y, - -v.z); - } - - template - inline const _xvec3 operator++ (const _xvec3& v, int) - { - return _xvec3( - v.x + T(1), - v.y + T(1), - v.z + T(1)); - } - - template - inline const _xvec3 operator-- (const _xvec3& v, int) - { - return _xvec3( - v.x - T(1), - v.y - T(1), - v.z - T(1)); - } - - // Binary operators - // operator+ - template - inline _xvec3 operator+ (const _xvec3& v, const T s) - { - return _xvec3( - v.x + s, - v.y + s, - v.z + s); - } - - template - inline _xvec3 operator+ (const T s, const _xvec3& v) - { - return _xvec3( - s + v.x, - s + v.y, - s + v.z); - } - - template - inline _xvec3 operator+ (const _xvec3& v1, const _xvec3& v2) - { - return _xvec3( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z); - } - - template - inline _xvec3 operator+ (const _xref3& v, const T s) - { - return _xvec3( - v.x + s, - v.y + s, - v.z + s); - } - - template - inline _xvec3 operator+ (const T s, const _xref3& v) - { - return _xvec3( - s + v.x, - s + v.y, - s + v.z); - } - - template - inline _xvec3 operator+ (const _xref3& v1, const _xref3& v2) - { - return _xvec3( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z); - } - - template - inline _xvec3 operator+ (const _xvec3& v1, const _xref3& v2) - { - return _xvec3( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z); - } - - template - inline _xvec3 operator+ (const _xref3& v1, const _xvec3& v2) - { - return _xvec3( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z); - } - - // operator- - template - inline _xvec3 operator- (const _xvec3& v, const T s) - { - return _xvec3( - v.x - s, - v.y - s, - v.z - s); - } - - template - inline _xvec3 operator- (const T s, const _xvec3& v) - { - return _xvec3( - s - v.x, - s - v.y, - s - v.z); - } - - template - inline _xvec3 operator- (const _xvec3& v1, const _xvec3& v2) - { - return _xvec3( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z); - } - - template - inline _xvec3 operator- (const _xref3& v, const T s) - { - return _xvec3( - v.x - s, - v.y - s, - v.z - s); - } - - template - inline _xvec3 operator- (const T s, const _xref3& v) - { - return _xvec3( - s - v.x, - s - v.y, - s - v.z); - } - - template - inline _xvec3 operator- (const _xref3& v1, const _xref3& v2) - { - return _xvec3( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z); - } - - template - inline _xvec3 operator- (const _xvec3& v1, const _xref3& v2) - { - return _xvec3( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z); - } - - template - inline _xvec3 operator- (const _xref3& v1, const _xvec3& v2) - { - return _xvec3( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z); - } - - // operator* - template - inline _xvec3 operator* (const _xvec3& v, const T s) - { - return _xvec3( - v.x * s, - v.y * s, - v.z * s); - } - - template - inline _xvec3 operator* (const T s, const _xvec3& v) - { - return _xvec3( - s * v.x, - s * v.y, - s * v.z); - } - - template - inline _xvec3 operator* (const _xvec3& v1, const _xvec3 & v2) - { - return _xvec3( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z); - } - - template - inline _xvec3 operator* (const _xref3& v, const T s) - { - return _xvec3( - v.x * s, - v.y * s, - v.z * s); - } - - template - inline _xvec3 operator* (const T s, const _xref3& v) - { - return _xvec3( - s * v.x, - s * v.y, - s * v.z); - } - - template - inline _xvec3 operator* (const _xref3& v1, const _xref3& v2) - { - return _xvec3( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z); - } - - template - inline _xvec3 operator* (const _xvec3& v1, const _xref3& v2) - { - return _xvec3( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z); - } - - template - inline _xvec3 operator* (const _xref3& v1, const _xvec3& v2) - { - return _xvec3( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z); - } - - // operator/ - template - inline _xvec3 operator/ (const _xvec3& v, const T s) - { - return _xvec3( - v.x / s, - v.y / s, - v.z / s); - } - - template - inline _xvec3 operator/ (const T s, const _xvec3& v) - { - return _xvec3( - s / v.x, - s / v.y, - s / v.z); - } - - template - inline _xvec3 operator/ (const _xvec3& v1, const _xvec3& v2) - { - return _xvec3( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z); - } - - template - inline _xvec3 operator/ (const _xref3& v, const T s) - { - return _xvec3( - v.x / s, - v.y / s, - v.z / s); - } - - template - inline _xvec3 operator/ (const T s, const _xref3& v) - { - return _xvec3( - s / v.x, - s / v.y, - s / v.z); - } - - template - inline _xvec3 operator/ (const _xref3& v1, const _xref3& v2) - { - return _xvec3( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z); - } - - template - inline _xvec3 operator/ (const _xvec3& v1, const _xref3& v2) - { - return _xvec3( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z); - } - - template - inline _xvec3 operator/ (const _xref3& v1, const _xvec3& v2) - { - return _xvec3( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z); - } -} //namespace detail -} //namespace glm - -#endif//__glm_core_xvec3_inl__ diff --git a/experimental/sse/glm/core/_xvec4.h b/experimental/sse/glm/core/_xvec4.h deleted file mode 100644 index 129df9b7..00000000 --- a/experimental/sse/glm/core/_xvec4.h +++ /dev/null @@ -1,241 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-15 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_xvec4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_xvec4_h__ -#define __glm_core_xvec4_h__ - -#include "./_cvec4.inl" - -namespace glm{ -namespace detail{ - - template - class _xvec4 : public _xvec4_base(T) - { - public: - // Common constructors - _xvec4(); - _xvec4(const _xvec4& v); - - // Swizzle constructors - _xvec4(const _xref4& r); - _xvec4(const _xvec4_base(T)& b); - - // T constructors - explicit _xvec4(const T x); - explicit _xvec4(const T a, const T b, const T c, const T d); - explicit _xvec4(const T a, const T b, const T c, const _xvec2& d); - explicit _xvec4(const T a, const T b, const T c, const _xvec3& d); - explicit _xvec4(const T a, const T b, const T c, const _xvec4& d); - explicit _xvec4(const T a, const T b, const _xvec2& c); - explicit _xvec4(const T a, const T b, const _xvec3& c); - explicit _xvec4(const T a, const T b, const _xvec4& c); - explicit _xvec4(const T a, const _xvec2& b, const T c); - explicit _xvec4(const T a, const _xvec2& b, const _xvec2& c); - explicit _xvec4(const T a, const _xvec2& b, const _xvec3& c); - explicit _xvec4(const T a, const _xvec2& b, const _xvec4& c); - explicit _xvec4(const T a, const _xvec3& b); - explicit _xvec4(const T a, const _xvec4& b); - explicit _xvec4(const _xvec2& a, const T b, const T c); - explicit _xvec4(const _xvec2& a, const T b, const _xvec2& c); - explicit _xvec4(const _xvec2& a, const T b, const _xvec3& c); - explicit _xvec4(const _xvec2& a, const T b, const _xvec4& c); - explicit _xvec4(const _xvec2& a, const _xvec2& b); - explicit _xvec4(const _xvec2& a, const _xvec3& b); - explicit _xvec4(const _xvec2& a, const _xvec4& b); - explicit _xvec4(const _xvec3& a, const T b); - explicit _xvec4(const _xvec3& a, const _xvec2& b); - explicit _xvec4(const _xvec3& a, const _xvec3& b); - explicit _xvec4(const _xvec3& a, const _xvec4& b); - - // U constructors - template explicit _xvec4(const U x); - template explicit _xvec4(const U a, const U b, const U c, const U d); - template explicit _xvec4(const U a, const U b, const U c, const _xvec2& d); - template explicit _xvec4(const U a, const U b, const U c, const _xvec3& d); - template explicit _xvec4(const U a, const U b, const U c, const _xvec4& d); - template explicit _xvec4(const U a, const U b, const _xvec2& c); - template explicit _xvec4(const U a, const U b, const _xvec3& c); - template explicit _xvec4(const U a, const U b, const _xvec4& c); - template explicit _xvec4(const U a, const _xvec2& b, const U c); - template explicit _xvec4(const U a, const _xvec2& b, const _xvec2& c); - template explicit _xvec4(const U a, const _xvec2& b, const _xvec3& c); - template explicit _xvec4(const U a, const _xvec2& b, const _xvec4& c); - template explicit _xvec4(const U a, const _xvec3& b); - template explicit _xvec4(const U a, const _xvec4& b); - template explicit _xvec4(const _xvec2& a, const U b, const U c); - template explicit _xvec4(const _xvec2& a, const U b, const _xvec2& c); - template explicit _xvec4(const _xvec2& a, const U b, const _xvec3& c); - template explicit _xvec4(const _xvec2& a, const U b, const _xvec4& c); - template explicit _xvec4(const _xvec2& a, const _xvec2& b); - template explicit _xvec4(const _xvec2& a, const _xvec3& b); - template explicit _xvec4(const _xvec2& a, const _xvec4& b); - template explicit _xvec4(const _xvec3& a, const U b); - template explicit _xvec4(const _xvec3& a, const _xvec2& b); - template explicit _xvec4(const _xvec3& a, const _xvec3& b); - template explicit _xvec4(const _xvec3& a, const _xvec4& b); - template explicit _xvec4(const _xvec4& a); - - // Bool constructors - explicit _xvec4(const bool x); - explicit _xvec4(const bool a, const bool b, const bool c, const bool d); - explicit _xvec4(const bool a, const bool b, const bool c, const _bvec2& d); - explicit _xvec4(const bool a, const bool b, const bool c, const _bvec3& d); - explicit _xvec4(const bool a, const bool b, const bool c, const _bvec4& d); - explicit _xvec4(const bool a, const bool b, const _bvec2& c); - explicit _xvec4(const bool a, const bool b, const _bvec3& c); - explicit _xvec4(const bool a, const bool b, const _bvec4& c); - explicit _xvec4(const bool a, const _bvec2& b, const bool c); - explicit _xvec4(const bool a, const _bvec2& b, const _bvec2& c); - explicit _xvec4(const bool a, const _bvec2& b, const _bvec3& c); - explicit _xvec4(const bool a, const _bvec2& b, const _bvec4& c); - explicit _xvec4(const bool a, const _bvec3& b); - explicit _xvec4(const bool a, const _bvec4& b); - explicit _xvec4(const _bvec2& a, const bool b, const bool c); - explicit _xvec4(const _bvec2& a, const bool b, const _bvec2& c); - explicit _xvec4(const _bvec2& a, const bool b, const _bvec3& c); - explicit _xvec4(const _bvec2& a, const bool b, const _bvec4& c); - explicit _xvec4(const _bvec2& a, const _bvec2& b); - explicit _xvec4(const _bvec2& a, const _bvec3& b); - explicit _xvec4(const _bvec2& a, const _bvec4& b); - explicit _xvec4(const _bvec3& a, const bool b); - explicit _xvec4(const _bvec3& a, const _bvec2& b); - explicit _xvec4(const _bvec3& a, const _bvec3& b); - explicit _xvec4(const _bvec3& a, const _bvec4& b); - explicit _xvec4(const _bvec4& a); - - // Unary updatable operators - _xvec4& operator= (const _xvec4& x); - _xvec4& operator+=(const T s); - _xvec4& operator+=(const _xvec4& v); - _xvec4& operator-=(const T s); - _xvec4& operator-=(const _xvec4& v); - _xvec4& operator*=(const T s); - _xvec4& operator*=(const _xvec4& v); - _xvec4& operator/=(const T s); - _xvec4& operator/=(const _xvec4& v); - _xvec4& operator++(); - _xvec4& operator--(); - }; - - // Binary operators - // operator+ - template - _xvec4 operator+ (const _xvec4& v, const T s); - - template - _xvec4 operator+ (const T s, const _xvec4& v); - - template - _xvec4 operator+ (const _xvec4& v1, const _xvec4& v2); - - template - _xvec4 operator+ (const _xref4& v, const T s); - - template - _xvec4 operator+ (const T s, const _xref4& v); - - template - _xvec4 operator+ (const _xref4& v1, const _xref4& v2); - - template - _xvec4 operator+ (const _xvec4& v1, const _xref4& v2); - - template - _xvec4 operator+ (const _xref4& v1, const _xvec4& v2); - - // operator- - template - _xvec4 operator- (const _xvec4& v, const T s); - - template - _xvec4 operator- (const T s, const _xvec4& v); - - template - _xvec4 operator- (const _xvec4& v1, const _xvec4& v2); - - template - _xvec4 operator- (const _xref4& v, const T s); - - template - _xvec4 operator- (const T s, const _xref4& v); - - template - _xvec4 operator- (const _xref4& v1, const _xref4& v2); - - template - _xvec4 operator- (const _xvec4& v1, const _xref4& v2); - - template - _xvec4 operator- (const _xref4& v1, const _xvec4& v2); - - // operator* - template - _xvec4 operator* (const _xvec4& v, const T s); - - template - _xvec4 operator* (const T s, const _xvec4& v); - - template - _xvec4 operator* (const _xvec4& v1, const _xvec4& v2); - - template - _xvec4 operator* (const _xref4& v, const T s); - - template - _xvec4 operator* (const T s, const _xref4& v); - - template - _xvec4 operator* (const _xref4& v1, const _xref4& v2); - - template - _xvec4 operator* (const _xvec4& v1, const _xref4& v2); - - template - _xvec4 operator* (const _xref4& v1, const _xvec4& v2); - - // operator/ - template - _xvec4 operator/ (const _xvec4& v, const T s); - - template - _xvec4 operator/ (const T s, const _xvec4& v); - - template - _xvec4 operator/ (const _xvec4& v1, const _xvec4& v2); - - template - _xvec4 operator/ (const _xref4& v, const T s); - - template - _xvec4 operator/ (const T s, const _xref4& v); - - template - _xvec4 operator/ (const _xref4& v1, const _xref4& v2); - - template - _xvec4 operator/ (const _xvec4& v1, const _xref4& v2); - - template - _xvec4 operator/ (const _xref4& v1, const _xvec4& v2); - - // Unary constant operators - template - const _xvec4 operator- (const _xvec4& v); - - template - const _xvec4 operator-- (const _xvec4& v, int); - - template - const _xvec4 operator++ (const _xvec4& v, int); - -} //namespace detail -} //namespace glm - -#endif//__glm_core_xvec4_h__ diff --git a/experimental/sse/glm/core/_xvec4.inl b/experimental/sse/glm/core/_xvec4.inl deleted file mode 100644 index c73d5af5..00000000 --- a/experimental/sse/glm/core/_xvec4.inl +++ /dev/null @@ -1,1242 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-27 -// Updated : 2007-01-19 -// Licence : This source is under GNU LGPL licence -// File : glm/core/_xvec4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_core_xvec4_inl__ -#define __glm_core_xvec4_inl__ - -#include "./_xvec2.h" -#include "./_bvec2.h" -#include "./_xvec3.h" -#include "./_bvec3.h" -#include "./_xvec4.h" -#include "./_bvec4.h" -#include "./_swizzle.inl" - -namespace glm{ -namespace detail{ - - // Common constructors - template - inline _xvec4::_xvec4() : - _cvec4(T(0), T(0), T(0), T(0)) - {} - - template - inline _xvec4::_xvec4(const _xvec4& v) : - _cvec4(v.x, v.y, v.z, v.w) - {} - - // Swizzle constructors - template - inline _xvec4::_xvec4(const _xref4& r) : - _cvec4(r.x, r.y, r.z, r.w) - {} - - template - inline _xvec4::_xvec4(const _xvec4_base(T)& b) : - _cvec4(b.x, b.y, b.z, b.w) - {} - - // T constructors - template - inline _xvec4::_xvec4(const T s) : - _cvec4(s, s, s, s) - {} - - template - inline _xvec4::_xvec4(const T x, const T y, const T z, const T w) : - _cvec4(x, y, z, w) - {} - - template - inline _xvec4::_xvec4(const T s1, const T s2, const T s3, const _xvec2& v) : - _cvec4(s1, s2, s3, v.x) - {} - - template - inline _xvec4::_xvec4(const T s1, const T s2, const T s3, const _xvec3& v) : - _cvec4(s1, s2, s3, v.x) - {} - - template - inline _xvec4::_xvec4(const T s1, const T s2, const T s3, const _xvec4& v) : - _cvec4(s1, s2, s3, v.x) - {} - - template - inline _xvec4::_xvec4(const T s1, const T s2, const _xvec2& v) : - _cvec4(s1, s2, v.x, v.y) - {} - - template - inline _xvec4::_xvec4(const T s1, const T s2, const _xvec3& v) : - _cvec4(s1, s2, v.x, v.y) - {} - - template - inline _xvec4::_xvec4(const T s1, const T s2, const _xvec4& v) : - _cvec4(s1, s2, v.x, v.y) - {} - - template - inline _xvec4::_xvec4(const T s1, const _xvec2& v, const T s2) : - _cvec4(s1, v.x, v.y, s2) - {} - - template - inline _xvec4::_xvec4(const T s, const _xvec2& v1, const _xvec2& v2) : - _cvec4(s, v1.x, v1.y, v2.x) - {} - - template - inline _xvec4::_xvec4(const T s, const _xvec2& v1, const _xvec3& v2) : - _cvec4(s, v1.x, v1.y, v2.x) - {} - - template - inline _xvec4::_xvec4(const T s, const _xvec2& v1, const _xvec4& v2) : - _cvec4(s, v1.x, v1.y, v2.x) - {} - - template - inline _xvec4::_xvec4(const T s, const _xvec3& v) : - _cvec4(s, v.x, v.y, v.z) - {} - - template - inline _xvec4::_xvec4(const T s, const _xvec4& v) : - _cvec4(s, v.x, v.y, v.z) - {} - - template - inline _xvec4::_xvec4(const _xvec2& v, const T s1, const T s2) : - _cvec4(v.x, v.y, s1, s2) - {} - - template - inline _xvec4::_xvec4(const _xvec2& v1, const T s, const _xvec2& v2) : - _cvec4(v1.x, v1.y, s, v2.x) - {} - - template - inline _xvec4::_xvec4(const _xvec2& v1, const T s, const _xvec3& v2) : - _cvec4(v1.x, v1.y, s, v2.x) - {} - - template - inline _xvec4::_xvec4(const _xvec2& v1, const T s, const _xvec4& v2) : - _cvec4(v1.x, v1.y, s, v2.x) - {} - - template - inline _xvec4::_xvec4(const _xvec2& v1, const _xvec2& v2) : - _cvec4(v1.x, v1.y, v2.x, v2.y) - {} - - template - inline _xvec4::_xvec4(const _xvec2& v1, const _xvec3& v2) : - _cvec4(v1.x, v1.y, v2.x, v2.y) - {} - - template - inline _xvec4::_xvec4(const _xvec2& v1, const _xvec4& v2) : - _cvec4(v1.x, v1.y, v2.x, v2.y) - {} - - template - inline _xvec4::_xvec4(const _xvec3& v, const T s) : - _cvec4(v.x, v.y, v.z, s) - {} - - template - inline _xvec4::_xvec4(const _xvec3& v1, const _xvec2& v2) : - _cvec4(v1.x, v1.y, v1.z, v2.x) - {} - - template - inline _xvec4::_xvec4(const _xvec3& v1, const _xvec3& v2) : - _cvec4(v1.x, v1.y, v1.z, v2.x) - {} - - template - inline _xvec4::_xvec4(const _xvec3& v1, const _xvec4& v2) : - _cvec4(v1.x, v1.y, v1.z, v2.x) - {} - - // U constructors - template - template - inline _xvec4::_xvec4(const U s) : - _cvec4(T(s), T(s), T(s), T(s)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const U s2, const U s3, const U s4) : - _cvec4(T(s1), T(s2), T(s3), T(s4)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const U s2, const U s3, const _xvec2& v) : - _cvec4(T(s1), T(s2), T(s3), T(v.x)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const U s2, const U s3, const _xvec3& v) : - _cvec4(T(s1), T(s2), T(s3), T(v.x)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const U s2, const U s3, const _xvec4& v) : - _cvec4(T(s1), T(s2), T(s3), T(v.x)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const U s2, const _xvec2& v) : - _cvec4(T(s1), T(s2), T(v.x), T(v.y)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const U s2, const _xvec3& v) : - _cvec4(T(s1), T(s2), T(v.x), T(v.y)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const U s2, const _xvec4& v) : - _cvec4(T(s1), T(s2), T(v.x), T(v.y)) - {} - - template - template - inline _xvec4::_xvec4(const U s1, const _xvec2& v, const U s2) : - _cvec4(T(s1), T(v.x), T(v.y), T(s2)) - {} - - template - template - inline _xvec4::_xvec4(const U s, const _xvec2& v1, const _xvec2& v2) : - _cvec4(T(s), T(v1.x), T(v1.y), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const U s, const _xvec2& v1, const _xvec3& v2) : - _cvec4(T(s), T(v1.x), T(v1.y), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const U s, const _xvec2& v1, const _xvec4& v2) : - _cvec4(T(s), T(v1.x), T(v1.y), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const U s, const _xvec3& v) : - _cvec4(T(s), T(v.x), T(v.y), T(v.z)) - {} - - template - template - inline _xvec4::_xvec4(const U s, const _xvec4& v) : - _cvec4(T(s), T(v.x), T(v.y), T(v.z)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec2& v, const U s1, const U s2) : - _cvec4(T(v.x), T(v.y), T(s1), T(s2)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec2& v1, const U s, const _xvec2& v2) : - _cvec4(T(v1.x), T(v1.y), T(s), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec2& v1, const U s, const _xvec3& v2) : - _cvec4(T(v1.x), T(v1.y), T(s), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec2& v1, const U s, const _xvec4& v2) : - _cvec4(T(v1.x), T(v1.y), T(s), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec2& v1, const _xvec2& v2) : - _cvec4(T(v1.x), T(v1.y), T(v2.x), T(v2.y)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec2& v1, const _xvec3& v2) : - _cvec4(T(v1.x), T(v1.y), T(v2.x), T(v2.y)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec2& v1, const _xvec4& v2) : - _cvec4(T(v1.x), T(v1.y), T(v2.x), T(v2.y)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec3& v, const U s) : - _cvec4(T(v.x), T(v.y), T(v.z), T(s)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec3& v1, const _xvec2& v2) : - _cvec4(T(v1.x), T(v1.y), T(v1.z), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec3& v1, const _xvec3& v2) : - _cvec4(T(v1.x), T(v1.y), T(v1.z), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec3& v1, const _xvec4& v2) : - _cvec4(T(v1.x), T(v1.y), T(v1.z), T(v2.x)) - {} - - template - template - inline _xvec4::_xvec4(const _xvec4& v) : - _cvec4(T(v.x), T(v.y), T(v.z), T(v.w)) - {} - - // Bool constructors - template - inline _xvec4::_xvec4(const bool x) : - _cvec4(T(x), T(x), T(x), T(x)) - {} - - template - inline _xvec4::_xvec4(const bool x, const bool y, const bool z, const bool w) : - _cvec4(T(x), T(y), T(z), T(w)) - {} - - template - inline _xvec4::_xvec4(const bool s1, const bool s2, const bool s3, const _bvec2& v) : - _cvec4(T(s1), T(s2), T(s3), T(v.x)) - {} - - template - inline _xvec4::_xvec4(const bool s1, const bool s2, const bool s3, const _bvec3& v) : - _cvec4(T(s1), T(s2), T(s3), T(v.x)) - {} - - template - inline _xvec4::_xvec4(const bool s1, const bool s2, const bool s3, const _bvec4& v) : - _cvec4(T(s1), T(s2), T(s3), T(v.x)) - {} - - template - inline _xvec4::_xvec4(const bool s1, const bool s2, const _bvec2& v) : - _cvec4(T(s1), T(s2), T(v.x), T(v.y)) - {} - - template - inline _xvec4::_xvec4(const bool s1, const bool s2, const _bvec3& v) : - _cvec4(T(s1), T(s2), T(v.x), T(v.y)) - {} - - template - inline _xvec4::_xvec4(const bool s1, const bool s2, const _bvec4& v) : - _cvec4(T(s1), T(s2), T(v.x), T(v.y)) - {} - - template - inline _xvec4::_xvec4(const bool s1, const _bvec2& v, const bool s2) : - _cvec4(T(s1), T(v.x), T(v.y), T(s2)) - {} - - template - inline _xvec4::_xvec4(const bool s, const _bvec2& v1, const _bvec2& v2) : - _cvec4(T(s), T(v1.x), T(v1.y), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const bool s, const _bvec2& v1, const _bvec3& v2) : - _cvec4(T(s), T(v1.x), T(v1.y), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const bool s, const _bvec2& v1, const _bvec4& v2) : - _cvec4(T(s), T(v1.x), T(v1.y), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const bool s, const _bvec3& v) : - _cvec4(T(s), T(v.x), T(v.y), T(v.z)) - {} - - template - inline _xvec4::_xvec4(const bool s, const _bvec4& v) : - _cvec4(T(s), T(v.x), T(v.y), T(v.z)) - {} - - template - inline _xvec4::_xvec4(const _bvec2& v, const bool s1, const bool s2) : - _cvec4(T(v.x), T(v.y), T(s1), T(s2)) - {} - - template - inline _xvec4::_xvec4(const _bvec2& v1, const bool s, const _bvec2& v2) : - _cvec4(T(v1.x), T(v1.y), T(s), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const _bvec2& v1, const bool s, const _bvec3& v2) : - _cvec4(T(v1.x), T(v1.y), T(s), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const _bvec2& v1, const bool s, const _bvec4& v2) : - _cvec4(T(v1.x), T(v1.y), T(s), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const _bvec2& v1, const _bvec2& v2) : - _cvec4(T(v1.x), T(v1.y), T(v2.x), T(v2.y)) - {} - - template - inline _xvec4::_xvec4(const _bvec2& v1, const _bvec3& v2) : - _cvec4(T(v1.x), T(v1.y), T(v2.x), T(v2.y)) - {} - - template - inline _xvec4::_xvec4(const _bvec2& v1, const _bvec4& v2) : - _cvec4(T(v1.x), T(v1.y), T(v2.x), T(v2.y)) - {} - - template - inline _xvec4::_xvec4(const _bvec3& v, const bool s) : - _cvec4(T(v.x), T(v.y), T(v.z), T(s)) - {} - - template - inline _xvec4::_xvec4(const _bvec3& v1, const _bvec2& v2) : - _cvec4(T(v1.x), T(v1.y), T(v1.z), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const _bvec3& v1, const _bvec3& v2) : - _cvec4(T(v1.x), T(v1.y), T(v1.z), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const _bvec3& v1, const _bvec4& v2) : - _cvec4(T(v1.x), T(v1.y), T(v1.z), T(v2.x)) - {} - - template - inline _xvec4::_xvec4(const _bvec4& v) : - _cvec4(T(v.x), T(v.y), T(v.z), T(v.w)) - {} - - // vec4 and ivec4 operators definitions - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - template - inline _xvec4& _xvec4::operator=(const _xvec4& x) - { - this->x = x.x; - this->y = x.y; - this->z = x.z; - this->w = x.w; - return *this; - } - - template - inline _xvec4& _xvec4::operator+= (const T s) - { - this->x += s; - this->y += s; - this->z += s; - this->w += s; - return *this; - } - - template - inline _xvec4& _xvec4::operator+=(const _xvec4 & v) - { - this->x += v.x; - this->y += v.y; - this->z += v.z; - this->w += v.w; - return *this; - } - - template - inline _xvec4& _xvec4::operator-= (const T s) - { - this->x -= s; - this->y -= s; - this->z -= s; - this->w -= s; - return *this; - } - - template - inline _xvec4& _xvec4::operator-=(const _xvec4 & v) - { - this->x -= v.x; - this->y -= v.y; - this->z -= v.z; - this->w -= v.w; - return *this; - } - - template - inline _xvec4& _xvec4::operator*=(const T s) - { - this->x *= s; - this->y *= s; - this->z *= s; - this->w *= s; - return *this; - } - - template - inline _xvec4& _xvec4::operator*= (const _xvec4 & v) - { - this->x *= v.x; - this->y *= v.y; - this->z *= v.z; - this->w *= v.w; - return *this; - } - - template - inline _xvec4& _xvec4::operator/=(const T s) - { - this->x /= s; - this->y /= s; - this->z /= s; - this->w /= s; - return *this; - } - - template - inline _xvec4& _xvec4::operator/= (const _xvec4 & v) - { - this->x /= v.x; - this->y /= v.y; - this->z /= v.z; - this->w /= v.w; - return *this; - } - - template - inline _xvec4& _xvec4::operator++ () - { - ++this->x; - ++this->y; - ++this->z; - ++this->w; - return *this; - } - - template - inline _xvec4& _xvec4::operator-- () - { - --this->x; - --this->y; - --this->z; - --this->w; - return *this; - } - - // Unary constant operators - template - inline const _xvec4 operator- (const _xvec4& v) - { - return _xvec4( - -v.x, - -v.y, - -v.z, - -v.w); - } - - template - inline const _xvec4 operator++ (const _xvec4& v, int) - { - return _xvec4( - v.x + T(1), - v.y + T(1), - v.z + T(1), - v.w + T(1)); - } - - template - inline const _xvec4 operator-- (const _xvec4& v, int) - { - return _xvec4( - v.x - T(1), - v.y - T(1), - v.z - T(1), - v.w - T(1)); - } -/* - template - inline _xvec4& operator%=(const T s) - { - this->x %= s; - this->y %= s; - this->z %= s; - this->w %= s; - return *this; - } - - template - inline _xvec4& operator%=(const _xvec4& v) - { - this->x %= v.x; - this->y %= v.y; - this->z %= v.z; - this->w %= v.w; - return *this; - } - - template - inline _xvec4& operator&=(const T s) - { - this->x &= s; - this->y &= s; - this->z &= s; - this->w &= s; - return *this; - } - - template - inline _xvec4& operator&=(const _xvec4& v) - { - this->x &= v.x; - this->y &= v.y; - this->z &= v.z; - this->w &= v.w; - return *this; - } - - template - inline _xvec4& operator|=(const T s) - { - this->x |= s; - this->y |= s; - this->z |= s; - this->w |= s; - return *this; - } - - template - inline _xvec4& operator|=(const _xvec4& v) - { - this->x |= v.x; - this->y |= v.y; - this->z |= v.z; - this->w |= v.w; - return *this; - } - - template - inline _xvec4& operator^=(const T s) - { - this->x ^= s; - this->y ^= s; - this->z ^= s; - this->w ^= s; - return *this; - } - - template - inline _xvec4& operator^=(const _xvec4& v) - { - this->x ^= v.x; - this->y ^= v.y; - this->z ^= v.z; - this->w ^= v.w; - return *this; - } - - template - inline _xvec4& operator<<=(const T s) - { - this->x <<= s; - this->y <<= s; - this->z <<= s; - this->w <<= s; - return *this; - } - - template - inline _xvec4& operator<<=(const _xvec4& v) - { - this->x <<= v.x; - this->y <<= v.y; - this->z <<= v.z; - this->w <<= v.w; - return *this; - } - - template - inline _xvec4& operator>>=(const T s) - { - this->x >>= s; - this->y >>= s; - this->z >>= s; - this->w >>= s; - return *this; - } - - template - inline _xvec4& operator>>=(const _xvec4& v) - { - this->x >>= v.x; - this->y >>= v.y; - this->z >>= v.z; - this->w >>= v.w; - return *this; - } - - // Bit operators - template - inline _xvec4 operator% (const _xvec4& v, const T s) - { - return _xvec4( - v.x % s, - v.y % s, - v.z % s, - v.w % s); - } - - template - inline _xvec4 operator% (const T s, const _xvec4& v) - { - return _xvec4( - s % v.x, - s % v.y, - s % v.z, - s % v.w); - } - - template - inline _xvec4 operator% (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x % v2.x, - v1.y % v2.y, - v1.z % v2.z, - v1.w % v2.w); - } - - template - inline _xvec4 operator& (const _xvec4& v, const T s) - { - return _xvec4( - v.x & s, - v.y & s, - v.z & s, - v.w & s); - } - - template - inline _xvec4 operator& (const T s, const _xvec4& v) - { - return _xvec4( - s & v.x, - s & v.y, - s & v.z, - s & v.w); - } - - template - inline _xvec4 operator& (const _xvec4& v1, const _xvec4& v2) - { - return _xvec2( - v1.x & v2.x, - v1.y & v2.y, - v1.z & v2.z, - v1.w & v2.w); - } - - template - inline _xvec4 operator| (const _xvec4& v, const T s) - { - return _xvec4( - v.x | s, - v.y | s, - v.z | s, - v.w | s); - } - - template - inline _xvec4 operator| (const T s, const _xvec4& v) - { - return _xvec4( - s | v.x, - s | v.y, - s | v.z, - s | v.w); - } - - template - inline _xvec4 operator| (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x | v2.x, - v1.y | v2.y, - v1.z | v2.z, - v1.w | v2.w); - } - - template - inline _xvec4 operator^ (const _xvec4& v, const T s) - { - return _xvec4( - v.x ^ s, - v.y ^ s, - v.z ^ s, - v.w ^ s); - } - - template - inline _xvec4 operator^ (const T s, const _xvec4& v) - { - return _xvec4( - s ^ v.x, - s ^ v.y, - s ^ v.z, - s ^ v.w); - } - - template - inline _xvec4 operator^ (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x ^ v2.x, - v1.y ^ v2.y, - v1.z ^ v2.z, - v1.w ^ v2.w); - } - - template - inline _xvec4 operator<< (const _xvec4& v, const T s) - { - return _xvec4( - v.x << s, - v.y << s, - v.z << s, - v.w << s); - } - - template - inline _xvec4 operator<< (const T s, const _xvec4& v) - { - return _xvec4( - s << v.x, - s << v.y, - s << v.z, - s << v.w); - } - - template - inline _xvec4 operator<< (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x << v2.x, - v1.y << v2.y, - v1.z << v2.z, - v1.w << v2.w); - } - - template - inline _xvec4 operator>> (const _xvec4& v, const T s) - { - return _xvec4( - v.x >> s, - v.y >> s, - v.z >> s, - v.w >> s); - } - - template - inline _xvec4 operator>> (const T s, const _xvec4& v) - { - return _xvec4( - s >> v.x, - s >> v.y, - s >> v.z, - s >> v.w); - } - - template - inline _xvec4 operator>> (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x >> v2.x, - v1.y >> v2.y, - v1.z >> v2.z, - v1.w >> v2.w); - } - - template - inline const _xvec4 operator~ (const _xvec4& v) - { - return _xvec4( - ~v.x, - ~v.y, - ~v.z, - ~v.w); - } -*/ - // Binary operators - //operator+ - template - inline _xvec4 operator+ (const _xvec4& v, const T s) - { - return _xvec4( - v.x + s, - v.y + s, - v.z + s, - v.w + s); - } - - template - inline _xvec4 operator+ (const T s, const _xvec4& v) - { - return _xvec4( - v.x + s, - v.y + s, - v.z + s, - v.w + s); - } - - template - inline _xvec4 operator+ (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z, - v1.w + v2.w); - } - - template - inline _xvec4 operator+ (const _xref4& v, const T s) - { - return _xvec4( - v.x + s, - v.y + s, - v.z + s, - v.w + s); - } - - template - inline _xvec4 operator+ (const T s, const _xref4& v) - { - return _xvec4( - s + v.x, - s + v.y, - s + v.z, - s + v.w); - } - - template - inline _xvec4 operator+ (const _xref4& v1, const _xref4& v2) - { - return _xvec4( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z, - v1.w + v2.w); - } - - template - inline _xvec4 operator+ (const _xvec4& v1, const _xref4& v2) - { - return _xvec4( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z, - v1.w + v2.w); - } - - template - inline _xvec4 operator+ (const _xref4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z, - v1.w + v2.w); - } - - //operator- - template - inline _xvec4 operator- (const _xvec4& v, const T s) - { - return _xvec4( - v.x - s, - v.y - s, - v.z - s, - v.w - s); - } - - template - inline _xvec4 operator- (const T s, const _xvec4& v) - { - return _xvec4( - s - v.x, - s - v.y, - s - v.z, - s - v.w); - } - - template - inline _xvec4 operator- (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z, - v1.w - v2.w); - } - - template - inline _xvec4 operator- (const _xref4& v, const T s) - { - return _xvec4( - v.x - s, - v.y - s, - v.z - s, - v.w - s); - } - - template - inline _xvec4 operator- (const T s, const _xref4& v) - { - return _xvec4( - s - v.x, - s - v.y, - s - v.z, - s - v.w); - } - - template - inline _xvec4 operator- (const _xref4& v1, const _xref4& v2) - { - return _xvec4( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z, - v1.w - v2.w); - } - - template - inline _xvec4 operator- (const _xvec4& v1, const _xref4& v2) - { - return _xvec4( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z, - v1.w - v2.w); - } - - template - inline _xvec4 operator- (const _xref4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z, - v1.w - v2.w); - } - - //operator* - template - inline _xvec4 operator* (const _xvec4& v, const T s) - { - return _xvec4( - v.x * s, - v.y * s, - v.z * s, - v.w * s); - } - - template - inline _xvec4 operator* (const T s, const _xvec4& v) - { - return _xvec4( - s * v.x, - s * v.y, - s * v.z, - s * v.w); - } - - template - inline _xvec4 operator* (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z, - v1.w * v2.w); - } - - template - inline _xvec4 operator* (const _xref4& v, const T s) - { - return _xvec4( - v.x * s, - v.y * s, - v.z * s, - v.w * s); - } - - template - inline _xvec4 operator* (const T s, const _xref4& v) - { - return _xvec4( - s * v.x, - s * v.y, - s * v.z, - s * v.w); - } - - template - inline _xvec4 operator* (const _xref4& v1, const _xref4& v2) - { - return _xvec4( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z, - v1.w * v2.w); - } - - template - inline _xvec4 operator* (const _xvec4& v1, const _xref4& v2) - { - return _xvec4( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z, - v1.w * v2.w); - } - - template - inline _xvec4 operator* (const _xref4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z, - v1.w * v2.w); - } - - // operator/ - template - inline _xvec4 operator/ (const _xvec4& v, const T s) - { - return _xvec4( - v.x / s, - v.y / s, - v.z / s, - v.w / s); - } - - template - inline _xvec4 operator/ (const T s, const _xvec4& v) - { - return _xvec4( - s / v.x, - s / v.y, - s / v.z, - s / v.w); - } - - template - inline _xvec4 operator/ (const _xvec4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z, - v1.w / v2.w); - } - - template - inline _xvec4 operator/ (const _xref4& v, const T s) - { - return _xvec4( - v.x / s, - v.y / s, - v.z / s, - v.w / s); - } - - template - inline _xvec4 operator/ (const T s, const _xref4& v) - { - return _xvec4( - s / v.x, - s / v.y, - s / v.z, - s / v.w); - } - - template - inline _xvec4 operator/ (const _xref4& v1, const _xref4& v2) - { - return _xvec4( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z, - v1.w / v2.w); - } - - template - inline _xvec4 operator/ (const _xvec4& v1, const _xref4& v2) - { - return _xvec4( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z, - v1.w / v2.w); - } - - template - inline _xvec4 operator/ (const _xref4& v1, const _xvec4& v2) - { - return _xvec4( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z, - v1.w / v2.w); - } -} //namespace detail -} //namespace glm - -#endif//__glm_core_xvec4_inl__ diff --git a/experimental/sse/glm/ext/gtx.h b/experimental/sse/glm/ext/gtx.h deleted file mode 100644 index 0d71dec5..00000000 --- a/experimental/sse/glm/ext/gtx.h +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-04-03 -// Updated : 2007-08-03 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Note: -// GTX extensions are experimental extensions -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_glx__ -#define __glm_glx__ - -//#include "./gtx/array_range.h" -#include "./gtx/associated_min_max.h" -#include "./gtx/bit.h" -#include "./gtx/closest_point.h" -#include "./gtx/color_cast.h" -#include "./gtx/color_space.h" -#include "./gtx/compatibility.h" -#include "./gtx/component_wise.h" -//#include "./gtx/complex.h" -#include "./gtx/determinant.h" -#include "./gtx/double.h" -#include "./gtx/epsilon.h" -#include "./gtx/euler_angles.h" -#include "./gtx/extend.h" -#include "./gtx/extented_min_max.h" -#include "./gtx/fast_exponential.h" -#include "./gtx/fast_square_root.h" -#include "./gtx/fast_trigonometry.h" -#include "./gtx/flexible_mix.h" -#include "./gtx/gpu_shader4.h" -#include "./gtx/half.h" -#include "./gtx/handed_coordinate_space.h" -#include "./gtx/hyperbolic.h" -#include "./gtx/inertia.h" -#include "./gtx/integer.h" -#include "./gtx/intersect.h" -#include "./gtx/inverse.h" -#include "./gtx/inverse_transpose.h" -#include "./gtx/mat4x3.h" -//#include "./gtx/mat_mn.h" -#include "./gtx/matrix_access.h" -#include "./gtx/matrix_cross_product.h" -#include "./gtx/matrix_major_storage.h" -#include "./gtx/matrix_projection.h" -#include "./gtx/matrix_query.h" -#include "./gtx/matrix_selection.h" -#include "./gtx/matx.h" -#include "./gtx/mixed_product.h" -#include "./gtx/mul.h" -#include "./gtx/norm.h" -#include "./gtx/normal.h" -#include "./gtx/normalize_dot.h" -#include "./gtx/number_precision.h" -#include "./gtx/optimum_pow.h" -#include "./gtx/orthonormalize.h" -#include "./gtx/outer_product.h" -#include "./gtx/perpendicular.h" -#include "./gtx/polar_coordinates.h" -#include "./gtx/projection.h" -#include "./gtx/quaternion.h" -#include "./gtx/random.h" -#include "./gtx/rotate_vector.h" -#include "./gtx/round.h" -#include "./gtx/spline.h" -#include "./gtx/transform.h" -#include "./gtx/transform2.h" -#include "./gtx/transpose.h" -#include "./gtx/unsigned_int.h" -#include "./gtx/vector_access.h" -#include "./gtx/vector_angle.h" -#include "./gtx/vector_comp_mult.h" -#include "./gtx/vector_query.h" -#include "./gtx/vecx.h" -#include "./gtx/verbose_operator.h" - -#endif //__glm_glx__ diff --git a/experimental/sse/glm/ext/gtx/associated_min_max.h b/experimental/sse/glm/ext/gtx/associated_min_max.h deleted file mode 100644 index cd7e0bb3..00000000 --- a/experimental/sse/glm/ext/gtx/associated_min_max.h +++ /dev/null @@ -1,518 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-03-10 -// Updated : 2008-03-15 -// Licence : This source is under GNU LGPL licence -// File : gtx_associated_min_max.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_extented_min_max -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_associated_min_max__ -#define __glm_gtx_associated_min_max__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - //! Min comparison between 2 variables - template - U associatedMinGTX( - T x, U a, - T y, U b); - - //! Min comparison between 2 variables - template - detail::_xvec2 associatedMinGTX( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b); - - //! Min comparison between 2 variables - template - detail::_xvec3 associatedMinGTX( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b); - - //! Min comparison between 2 variables - template - detail::_xvec4 associatedMinGTX( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b); - - //! Min comparison between 2 variables - template - detail::_xvec2 associatedMinGTX( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b); - - //! Min comparison between 2 variables - template - detail::_xvec3 associatedMinGTX( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b); - - //! Min comparison between 2 variables - template - detail::_xvec4 associatedMinGTX( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b); - - //! Min comparison between 2 variables - template - detail::_xvec2 associatedMinGTX( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b); - - //! Min comparison between 2 variables - template - detail::_xvec3 associatedMinGTX( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b); - - //! Min comparison between 2 variables - template - detail::_xvec4 associatedMinGTX( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b); - - //! Min comparison between 3 variables - template - U associatedMinGTX( - T x, U a, - T y, U b, - T z, U c); - - //! Min comparison between 3 variables - template - detail::_xvec2 associatedMinGTX( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c); - - //! Min comparison between 3 variables - template - detail::_xvec3 associatedMinGTX( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c); - - //! Min comparison between 3 variables - template - detail::_xvec4 associatedMinGTX( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c); - - //! Min comparison between 3 variables - template - detail::_xvec2 associatedMinGTX( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b, - T z, const detail::_xvec2& c); - - //! Min comparison between 3 variables - template - detail::_xvec3 associatedMinGTX( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b, - T z, const detail::_xvec3& c); - - //! Min comparison between 3 variables - template - detail::_xvec4 associatedMinGTX( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b, - T z, const detail::_xvec4& c); - - //! Min comparison between 3 variables - template - detail::_xvec2 associatedMinGTX( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b, - const detail::_xvec2& z, U c); - - //! Min comparison between 3 variables - template - detail::_xvec3 associatedMinGTX( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b, - const detail::_xvec3& z, U c); - - //! Min comparison between 3 variables - template - detail::_xvec4 associatedMinGTX( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b, - const detail::_xvec4& z, U c); - - //! Min comparison between 4 variables - template - U associatedMinGTX( - T x, U a, - T y, U b, - T z, U c, - T w, U d); - - //! Min comparison between 4 variables - template - detail::_xvec2 associatedMinGTX( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c, - const detail::_xvec2& w, const detail::_xvec2& d); - - //! Min comparison between 4 variables - template - detail::_xvec3 associatedMinGTX( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c, - const detail::_xvec3& w, const detail::_xvec3& d); - - //! Min comparison between 4 variables - template - detail::_xvec4 associatedMinGTX( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c, - const detail::_xvec4& w, const detail::_xvec4& d); - - //! Min comparison between 4 variables - template - detail::_xvec2 associatedMinGTX( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b, - T z, const detail::_xvec2& c, - T w, const detail::_xvec2& d); - - //! Min comparison between 4 variables - template - detail::_xvec3 associatedMinGTX( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b, - T z, const detail::_xvec3& c, - T w, const detail::_xvec3& d); - - //! Min comparison between 4 variables - template - detail::_xvec4 associatedMinGTX( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b, - T z, const detail::_xvec4& c, - T w, const detail::_xvec4& d); - - //! Min comparison between 4 variables - template - detail::_xvec2 associatedMinGTX( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b, - const detail::_xvec2& z, U c, - const detail::_xvec2& w, U d); - - //! Min comparison between 4 variables - template - detail::_xvec3 associatedMinGTX( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b, - const detail::_xvec3& z, U c, - const detail::_xvec3& w, U d); - - //! Min comparison between 4 variables - template - detail::_xvec4 associatedMinGTX( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b, - const detail::_xvec4& z, U c, - const detail::_xvec4& w, U d); - - //! Max comparison between 2 variables - template - U associatedMaxGTX( - T x, U a, - T y, U b); - - //! Max comparison between 2 variables - template - detail::_xvec2 associatedMaxGTX( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b); - - //! Max comparison between 2 variables - template - detail::_xvec3 associatedMaxGTX( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b); - - //! Max comparison between 2 variables - template - detail::_xvec4 associatedMaxGTX( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b); - - //! Max comparison between 2 variables - template - detail::_xvec2 associatedMaxGTX( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b); - - //! Max comparison between 2 variables - template - detail::_xvec3 associatedMaxGTX( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b); - - //! Max comparison between 2 variables - template - detail::_xvec4 associatedMaxGTX( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b); - - //! Max comparison between 2 variables - template - detail::_xvec2 associatedMaxGTX( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b); - - //! Max comparison between 2 variables - template - detail::_xvec3 associatedMaxGTX( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b); - - //! Max comparison between 2 variables - template - detail::_xvec4 associatedMaxGTX( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b); - - //! Max comparison between 3 variables - template - U associatedMaxGTX( - T x, U a, - T y, U b, - T z, U c); - - //! Max comparison between 3 variables - template - detail::_xvec2 associatedMaxGTX( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c); - - //! Max comparison between 3 variables - template - detail::_xvec3 associatedMaxGTX( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c); - - //! Max comparison between 3 variables - template - detail::_xvec4 associatedMaxGTX( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c); - - //! Max comparison between 3 variables - template - detail::_xvec2 associatedMaxGTX( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b, - T z, const detail::_xvec2& c); - - //! Max comparison between 3 variables - template - detail::_xvec3 associatedMaxGTX( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b, - T z, const detail::_xvec3& c); - - //! Max comparison between 3 variables - template - detail::_xvec4 associatedMaxGTX( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b, - T z, const detail::_xvec4& c); - - //! Max comparison between 3 variables - template - detail::_xvec2 associatedMaxGTX( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b, - const detail::_xvec2& z, U c); - - //! Max comparison between 3 variables - template - detail::_xvec3 associatedMaxGTX( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b, - const detail::_xvec3& z, U c); - - //! Max comparison between 3 variables - template - detail::_xvec4 associatedMaxGTX( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b, - const detail::_xvec4& z, U c); - - //! Max comparison between 4 variables - template - U associatedMaxGTX( - T x, U a, - T y, U b, - T z, U c, - T w, U d); - - //! Max comparison between 4 variables - template - detail::_xvec2 associatedMaxGTX( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c, - const detail::_xvec2& w, const detail::_xvec2& d); - - //! Max comparison between 4 variables - template - detail::_xvec3 associatedMaxGTX( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c, - const detail::_xvec3& w, const detail::_xvec3& d); - - //! Max comparison between 4 variables - template - detail::_xvec4 associatedMaxGTX( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c, - const detail::_xvec4& w, const detail::_xvec4& d); - - //! Max comparison between 4 variables - template - detail::_xvec2 associatedMaxGTX( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b, - T z, const detail::_xvec2& c, - T w, const detail::_xvec2& d); - - //! Max comparison between 4 variables - template - detail::_xvec3 associatedMaxGTX( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b, - T z, const detail::_xvec3& c, - T w, const detail::_xvec3& d); - - //! Max comparison between 4 variables - template - detail::_xvec4 associatedMaxGTX( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b, - T z, const detail::_xvec4& c, - T w, const detail::_xvec4& d); - - //! Max comparison between 4 variables - template - detail::_xvec2 associatedMaxGTX( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b, - const detail::_xvec2& z, U c, - const detail::_xvec2& w, U d); - - //! Max comparison between 4 variables - template - detail::_xvec3 associatedMaxGTX( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b, - const detail::_xvec3& z, U c, - const detail::_xvec3& w, U d); - - //! Max comparison between 4 variables - template - detail::_xvec4 associatedMaxGTX( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b, - const detail::_xvec4& z, U c, - const detail::_xvec4& w, U d); - - namespace gtx - { - //! GLM_GTX_associated_min_max extension: Min and max functions that return associated values not the compared onces. - namespace associated_min_max - { - //! Min comparison between 2 variables - template - inline genTypeU associatedMin( - const genTypeT& x, const genTypeU& a, - const genTypeT& y, const genTypeU& b) - { - return associatedMinGTX(x, a, y, b); - } - - //! Min comparison between 3 variables - template - inline genTypeU associatedMin( - const genTypeT& x, const genTypeU& a, - const genTypeT& y, const genTypeU& b, - const genTypeT& z, const genTypeU& c) - { - return associatedMinGTX(x, a, y, b, z, c); - } - - //! Min comparison between 4 variables - template - inline genTypeU associatedMin( - const genTypeT& x, const genTypeU& a, - const genTypeT& y, const genTypeU& b, - const genTypeT& z, const genTypeU& c, - const genTypeT& w, const genTypeU& d) - { - return associatedMinGTX(x, a, y, b, z, c, w, d); - } - - //! Max comparison between 2 variables - template - inline genTypeU associatedMax( - const genTypeT& x, const genTypeU& a, - const genTypeT& y, const genTypeU& b) - { - return associatedMaxGTX(x, a, y, b); - } - - //! Max comparison between 3 variables - template - inline genTypeU associatedMax( - const genTypeT& x, const genTypeU& a, - const genTypeT& y, const genTypeU& b, - const genTypeT& z, const genTypeU& c) - { - return associatedMaxGTX(x, a, y, b, z, c); - } - - //! Max comparison between 4 variables - template - inline genTypeU associatedMax( - const genTypeT& x, const genTypeU& a, - const genTypeT& y, const genTypeU& b, - const genTypeT& z, const genTypeU& c, - const genTypeT& w, const genTypeU& d) - { - return associatedMaxGTX(x, a, y, b, z, c, w, d); - } - } - } -} - -#define GLM_GTX_associated_min_max namespace gtx::associated_min_max - -#include "associated_min_max.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_associated_min_max;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_associated_min_max__ diff --git a/experimental/sse/glm/ext/gtx/associated_min_max.inl b/experimental/sse/glm/ext/gtx/associated_min_max.inl deleted file mode 100644 index e3f6c10c..00000000 --- a/experimental/sse/glm/ext/gtx/associated_min_max.inl +++ /dev/null @@ -1,911 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-03-10 -// Updated : 2008-03-15 -// Licence : This source is under GNU LGPL licence -// File : gtx_associated_min_max.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // Min comparison between 2 variables - template - inline U associatedMinGTX(T x, U a, T y, U b) - { - return x < y ? a : b; - } - - template - inline detail::_xvec2 associatedMinGTX - ( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b - ) - { - detail::_xvec2 Result; - //Result.x = x[0] < y[0] ? a[0] : b[0]; - //Result.y = x[1] < y[1] ? a[1] : b[1]; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x[i] < y[i] ? a[i] : b[i]; - return Result; - } - - template - inline detail::_xvec3 associatedMinGTX - ( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x[i] < y[i] ? a[i] : b[i]; - return Result; - } - - template - inline detail::_xvec4 associatedMinGTX - ( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x[i] < y[i] ? a[i] : b[i]; - return Result; - } - - template - inline detail::_xvec2 associatedMinGTX - ( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x < y ? a[i] : b[i]; - return Result; - } - - template - inline detail::_xvec3 associatedMinGTX - ( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x < y ? a[i] : b[i]; - return Result; - } - - template - inline detail::_xvec4 associatedMinGTX - ( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x < y ? a[i] : b[i]; - return Result; - } - - template - inline detail::_xvec2 associatedMinGTX - ( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x[i] < y[i] ? a : b; - return Result; - } - - template - inline detail::_xvec3 associatedMinGTX - ( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x[i] < y[i] ? a : b; - return Result; - } - - template - inline detail::_xvec4 associatedMinGTX - ( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x[i] < y[i] ? a : b; - return Result; - } - - // Min comparison between 3 variables - template - inline U associatedMinGTX - ( - T x, U a, - T y, U b, - T z, U c - ) - { - U Result = x < y ? (x < z ? a : c) : (y < z ? b : c); - return Result; - } - - template - inline detail::_xvec2 associatedMinGTX - ( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); - return Result; - } - - template - inline detail::_xvec3 associatedMinGTX - ( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); - return Result; - } - - template - inline detail::_xvec4 associatedMinGTX - ( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); - return Result; - } - - // Min comparison between 4 variables - template - inline U associatedMinGTX - ( - T x, U a, - T y, U b, - T z, U c, - T w, U d - ) - { - T Test1 = min(x, y); - T Test2 = min(z, w);; - U Result1 = x < y ? a : b; - U Result2 = z < w ? c : d; - U Result = Test1 < Test2 ? Result1 : Result2; - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec2 associatedMinGTX - ( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c, - const detail::_xvec2& w, const detail::_xvec2& d - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]); - U Result1 = x[i] < y[i] ? a[i] : b[i]; - U Result2 = z[i] < w[i] ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec3 associatedMinGTX - ( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c, - const detail::_xvec3& w, const detail::_xvec3& d - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]); - U Result1 = x[i] < y[i] ? a[i] : b[i]; - U Result2 = z[i] < w[i] ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec4 associatedMinGTX - ( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c, - const detail::_xvec4& w, const detail::_xvec4& d - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]); - U Result1 = x[i] < y[i] ? a[i] : b[i]; - U Result2 = z[i] < w[i] ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec2 associatedMinGTX - ( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b, - T z, const detail::_xvec2& c, - T w, const detail::_xvec2& d - ) - { - T Test1 = min(x, y); - T Test2 = min(z, w); - - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - { - U Result1 = x < y ? a[i] : b[i]; - U Result2 = z < w ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec3 associatedMinGTX - ( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b, - T z, const detail::_xvec3& c, - T w, const detail::_xvec3& d - ) - { - T Test1 = min(x, y); - T Test2 = min(z, w); - - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - { - U Result1 = x < y ? a[i] : b[i]; - U Result2 = z < w ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec4 associatedMinGTX - ( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b, - T z, const detail::_xvec4& c, - T w, const detail::_xvec4& d - ) - { - T Test1 = min(x, y); - T Test2 = min(z, w); - - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - { - U Result1 = x < y ? a[i] : b[i]; - U Result2 = z < w ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec2 associatedMinGTX - ( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b, - const detail::_xvec2& z, U c, - const detail::_xvec2& w, U d - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]);; - U Result1 = x[i] < y[i] ? a : b; - U Result2 = z[i] < w[i] ? c : d; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec3 associatedMinGTX - ( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b, - const detail::_xvec3& z, U c, - const detail::_xvec3& w, U d - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]);; - U Result1 = x[i] < y[i] ? a : b; - U Result2 = z[i] < w[i] ? c : d; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Min comparison between 4 variables - template - inline detail::_xvec4 associatedMinGTX - ( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b, - const detail::_xvec4& z, U c, - const detail::_xvec4& w, U d - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]);; - U Result1 = x[i] < y[i] ? a : b; - U Result2 = z[i] < w[i] ? c : d; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 2 variables - template - inline U associatedMaxGTX(T x, U a, T y, U b) - { - return x > y ? a : b; - } - - // Max comparison between 2 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x[i] > y[i] ? a[i] : b[i]; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x[i] > y[i] ? a[i] : b[i]; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x[i] > y[i] ? a[i] : b[i]; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x > y ? a[i] : b[i]; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x > y ? a[i] : b[i]; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x > y ? a[i] : b[i]; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x[i] > y[i] ? a : b; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x[i] > y[i] ? a : b; - return Result; - } - - // Max comparison between 2 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x[i] > y[i] ? a : b; - return Result; - } - - // Max comparison between 3 variables - template - inline U associatedMaxGTX - ( - T x, U a, - T y, U b, - T z, U c - ) - { - U Result = x > y ? (x > z ? a : c) : (y > z ? b : c); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b, - T z, const detail::_xvec2& c - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b, - T z, const detail::_xvec3& c - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b, - T z, const detail::_xvec4& c - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b, - const detail::_xvec2& z, U c - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b, - const detail::_xvec3& z, U c - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); - return Result; - } - - // Max comparison between 3 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b, - const detail::_xvec4& z, U c - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); - return Result; - } - - // Max comparison between 4 variables - template - inline U associatedMaxGTX - ( - T x, U a, - T y, U b, - T z, U c, - T w, U d - ) - { - T Test1 = max(x, y); - T Test2 = max(z, w);; - U Result1 = x > y ? a : b; - U Result2 = z > w ? c : d; - U Result = Test1 > Test2 ? Result1 : Result2; - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - const detail::_xvec2& x, const detail::_xvec2& a, - const detail::_xvec2& y, const detail::_xvec2& b, - const detail::_xvec2& z, const detail::_xvec2& c, - const detail::_xvec2& w, const detail::_xvec2& d - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]); - U Result1 = x[i] > y[i] ? a[i] : b[i]; - U Result2 = z[i] > w[i] ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - const detail::_xvec3& x, const detail::_xvec3& a, - const detail::_xvec3& y, const detail::_xvec3& b, - const detail::_xvec3& z, const detail::_xvec3& c, - const detail::_xvec3& w, const detail::_xvec3& d - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]); - U Result1 = x[i] > y[i] ? a[i] : b[i]; - U Result2 = z[i] > w[i] ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - const detail::_xvec4& x, const detail::_xvec4& a, - const detail::_xvec4& y, const detail::_xvec4& b, - const detail::_xvec4& z, const detail::_xvec4& c, - const detail::_xvec4& w, const detail::_xvec4& d - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]); - U Result1 = x[i] > y[i] ? a[i] : b[i]; - U Result2 = z[i] > w[i] ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - T x, const detail::_xvec2& a, - T y, const detail::_xvec2& b, - T z, const detail::_xvec2& c, - T w, const detail::_xvec2& d - ) - { - T Test1 = max(x, y); - T Test2 = max(z, w); - - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - { - U Result1 = x > y ? a[i] : b[i]; - U Result2 = z > w ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - T x, const detail::_xvec3& a, - T y, const detail::_xvec3& b, - T z, const detail::_xvec3& c, - T w, const detail::_xvec3& d - ) - { - T Test1 = max(x, y); - T Test2 = max(z, w); - - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - { - U Result1 = x > y ? a[i] : b[i]; - U Result2 = z > w ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - T x, const detail::_xvec4& a, - T y, const detail::_xvec4& b, - T z, const detail::_xvec4& c, - T w, const detail::_xvec4& d - ) - { - T Test1 = max(x, y); - T Test2 = max(z, w); - - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - { - U Result1 = x > y ? a[i] : b[i]; - U Result2 = z > w ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec2 associatedMaxGTX - ( - const detail::_xvec2& x, U a, - const detail::_xvec2& y, U b, - const detail::_xvec2& z, U c, - const detail::_xvec2& w, U d - ) - { - detail::_xvec2 Result; - for(detail::_xvec2::size_type i = 0; i < detail::_xvec2::value_size; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]);; - U Result1 = x[i] > y[i] ? a : b; - U Result2 = z[i] > w[i] ? c : d; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec3 associatedMaxGTX - ( - const detail::_xvec3& x, U a, - const detail::_xvec3& y, U b, - const detail::_xvec3& z, U c, - const detail::_xvec3& w, U d - ) - { - detail::_xvec3 Result; - for(detail::_xvec3::size_type i = 0; i < detail::_xvec3::value_size; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]);; - U Result1 = x[i] > y[i] ? a : b; - U Result2 = z[i] > w[i] ? c : d; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } - - // Max comparison between 4 variables - template - inline detail::_xvec4 associatedMaxGTX - ( - const detail::_xvec4& x, U a, - const detail::_xvec4& y, U b, - const detail::_xvec4& z, U c, - const detail::_xvec4& w, U d - ) - { - detail::_xvec4 Result; - for(detail::_xvec4::size_type i = 0; i < detail::_xvec4::value_size; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]);; - U Result1 = x[i] > y[i] ? a : b; - U Result2 = z[i] > w[i] ? c : d; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; - } -} diff --git a/experimental/sse/glm/ext/gtx/bit.h b/experimental/sse/glm/ext/gtx/bit.h deleted file mode 100644 index 46c41259..00000000 --- a/experimental/sse/glm/ext/gtx/bit.h +++ /dev/null @@ -1,76 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-14 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/bit.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_gpu_shader4 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_bit__ -#define __glm_gtx_bit__ - -// Dependency: -#include "../../glm.h" -#include "../../ext/gtx/gpu_shader4.h" - -namespace glm -{ - template int highestBitGTX(const T value); //!< \brief Find the highest bit set to 1 in a integer variable. (From GLM_GTX_bit extension) - template detail::_xvec2 highestBitGTX(const detail::_xvec2& value); //!< \brief Find the highest bit set to 1 in a integer variable. (From GLM_GTX_bit extension) - template detail::_xvec3 highestBitGTX(const detail::_xvec3& value); //!< \brief Find the highest bit set to 1 in a integer variable. (From GLM_GTX_bit extension) - template detail::_xvec4 highestBitGTX(const detail::_xvec4& value); //!< \brief Find the highest bit set to 1 in a integer variable. (From GLM_GTX_bit extension) - - template T highestBitValueGTX(const T value); //!< \brief Find the highest bit set to 1 in a integer variable and return its value. (From GLM_GTX_bit extension) - template detail::_xvec2 highestBitValueGTX(const detail::_xvec2& value); //!< \brief Find the highest bit set to 1 in a integer variable and return its value. (From GLM_GTX_bit extension) - template detail::_xvec3 highestBitValueGTX(const detail::_xvec3& value); //!< \brief Find the highest bit set to 1 in a integer variable and return its value. (From GLM_GTX_bit extension) - template detail::_xvec4 highestBitValueGTX(const detail::_xvec4& value); //!< \brief Find the highest bit set to 1 in a integer variable and return its value. (From GLM_GTX_bit extension) - - template bool isPowerOfTwoGTX(const T value); //!< \brief Return true if the value is a power of two number. (From GLM_GTX_bit extension) - template detail::_bvec2 isPowerOfTwoGTX(const detail::_xvec2& value); //!< \brief Return true if the value is a power of two number. (From GLM_GTX_bit extension) - template detail::_bvec3 isPowerOfTwoGTX(const detail::_xvec3& value); //!< \brief Return true if the value is a power of two number. (From GLM_GTX_bit extension) - template detail::_bvec4 isPowerOfTwoGTX(const detail::_xvec4& value); //!< \brief Return true if the value is a power of two number. (From GLM_GTX_bit extension) - - template T powerOfTwoAboveGTX(const T value); //!< \brief Return the power of two number which value is just higher the input value. (From GLM_GTX_bit extension) - template detail::_xvec2 powerOfTwoAboveGTX(const detail::_xvec2& value); //!< \brief Return the power of two number which value is just higher the input value. (From GLM_GTX_bit extension) - template detail::_xvec3 powerOfTwoAboveGTX(const detail::_xvec3& value); //!< \brief Return the power of two number which value is just higher the input value. (From GLM_GTX_bit extension) - template detail::_xvec4 powerOfTwoAboveGTX(const detail::_xvec4& value); //!< \brief Return the power of two number which value is just higher the input value. (From GLM_GTX_bit extension) - - template T powerOfTwoBelowGTX(const T value); //!< \brief Return the power of two number which value is just lower the input value. (From GLM_GTX_bit extension) - template detail::_xvec2 powerOfTwoBelowGTX(const detail::_xvec2& value); //!< \brief Return the power of two number which value is just lower the input value. (From GLM_GTX_bit extension) - template detail::_xvec3 powerOfTwoBelowGTX(const detail::_xvec3& value); //!< \brief Return the power of two number which value is just lower the input value. (From GLM_GTX_bit extension) - template detail::_xvec4 powerOfTwoBelowGTX(const detail::_xvec4& value); //!< \brief Return the power of two number which value is just lower the input value. (From GLM_GTX_bit extension) - - template T powerOfTwoNearestGTX(const T value); //!< \brief Return the power of two number which value is the closet to the input value. (From GLM_GTX_bit extension) - template detail::_xvec2 powerOfTwoNearestGTX(const detail::_xvec2& value); //!< \brief Return the power of two number which value is the closet to the input value. (From GLM_GTX_bit extension) - template detail::_xvec3 powerOfTwoNearestGTX(const detail::_xvec3& value); //!< \brief Return the power of two number which value is the closet to the input value. (From GLM_GTX_bit extension) - template detail::_xvec4 powerOfTwoNearestGTX(const detail::_xvec4& value); //!< \brief Return the power of two number which value is the closet to the input value. (From GLM_GTX_bit extension) - - namespace gtx - { - //! GLM_GTX_bit extension: Allow to perform bit operations on integer values - namespace bit - { - template inline int highestBit(const T& value){return highestBitGTX(value);} //!< \brief Find the highest bit set to 1 in a integer variable. (From GLM_GTX_bit extension) - template inline T highestBitValue(const T& value){return highestBitValueGTX(value);} //!< \brief Find the highest bit set to 1 in a integer variable and return its value. (From GLM_GTX_bit extension) - template inline bool isPowerOfTwo(const T& value){return isPowerOfTwoGTX(value);} //!< \brief Return true if the value is a power of two number. (From GLM_GTX_bit extension) - template inline T powerOfTwoAbove(const T& value){return powerOfTwoAboveGTX(value);} //!< \brief Return the power of two number which value is just higher the input value. (From GLM_GTX_bit extension) - template inline T powerOfTwoBelow(const T& value){return powerOfTwoBelowGTX(value);} //!< \brief Return the power of two number which value is just lower the input value. (From GLM_GTX_bit extension) - template inline T powerOfTwoNearest(const T& value){return powerOfTwoNearestGTX(value);} //!< \brief Return the power of two number which value is the closet to the input value. (From GLM_GTX_bit extension) - } - } -} - -#define GLM_GTX_bit namespace gtx::bit - -#include "bit.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_bit;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_bit__ diff --git a/experimental/sse/glm/ext/gtx/bit.inl b/experimental/sse/glm/ext/gtx/bit.inl deleted file mode 100644 index 65f2d86c..00000000 --- a/experimental/sse/glm/ext/gtx/bit.inl +++ /dev/null @@ -1,242 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-14 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/bit.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_bit_inl__ -#define __glm_gtx_bit_inl__ - -namespace glm -{ - // highestBitGTX - template - inline int highestBitGTX(const T value) - { - T bit = -1; - for(T tmp = value; tmp; tmp >>= 1, ++bit); - return bit; - } - - template <> - inline int highestBitGTX(const int value) - { - int bit = -1; - for(int tmp = value; tmp; tmp >>= 1, ++bit); - return bit; - } - - template - inline detail::_xvec2 highestBitGTX(const detail::_xvec2& value) - { - return detail::_xvec2( - highestBitGTX(value[0]), - highestBitGTX(value[1])); - } - - template - inline detail::_xvec3 highestBitGTX(const detail::_xvec3& value) - { - return detail::_xvec3( - highestBitGTX(value[0]), - highestBitGTX(value[1]), - highestBitGTX(value[2])); - } - - template - inline detail::_xvec4 highestBitGTX(const detail::_xvec4& value) - { - return detail::_xvec4( - highestBitGTX(value[0]), - highestBitGTX(value[1]), - highestBitGTX(value[2]), - highestBitGTX(value[3])); - } - - // highestBitValueGTX - template - inline T highestBitValueGTX(const T value) - { - T tmp = value; - T result = T(0); - while(tmp) - { - result = (tmp & (~tmp + 1)); // grab lowest bit - tmp &= ~result; // clear lowest bit - } - return result; - } - - template - inline detail::_xvec2 highestBitValueGTX(const detail::_xvec2& value) - { - return detail::_xvec2( - highestBitValueGTX(value[0]), - highestBitValueGTX(value[1])); - } - - template - inline detail::_xvec3 highestBitValueGTX(const detail::_xvec3& value) - { - return detail::_xvec3( - highestBitValueGTX(value[0]), - highestBitValueGTX(value[1]), - highestBitValueGTX(value[2])); - } - - template - inline detail::_xvec4 highestBitValueGTX(const detail::_xvec4& value) - { - return detail::_xvec4( - highestBitValueGTX(value[0]), - highestBitValueGTX(value[1]), - highestBitValueGTX(value[2]), - highestBitValueGTX(value[3])); - } - - // isPowerOfTwoGTX - template - inline bool isPowerOfTwoGTX(const T value) - { - return !(value & (value - 1)); - } - - template - inline detail::_bvec2 isPowerOfTwoGTX(const detail::_xvec2& value) - { - return detail::_bvec2( - isPowerOfTwoGTX(value[0]), - isPowerOfTwoGTX(value[1])); - } - - template - inline detail::_bvec3 isPowerOfTwoGTX(const detail::_xvec3& value) - { - return detail::_bvec3( - isPowerOfTwoGTX(value[0]), - isPowerOfTwoGTX(value[1]), - isPowerOfTwoGTX(value[2])); - } - - template - inline detail::_bvec4 isPowerOfTwoGTX(const detail::_xvec4& value) - { - return detail::_bvec4( - isPowerOfTwoGTX(value[0]), - isPowerOfTwoGTX(value[1]), - isPowerOfTwoGTX(value[2]), - isPowerOfTwoGTX(value[3])); - } - - // powerOfTwoAboveGTX - template - inline T powerOfTwoAboveGTX(const T value) - { - return isPowerOfTwoGTX(value) ? value : highestBitValueGTX(value) << 1; - } - - template - inline detail::_xvec2 powerOfTwoAboveGTX(const detail::_xvec2& value) - { - return detail::_xvec2( - powerOfTwoAboveGTX(value[0]), - powerOfTwoAboveGTX(value[1])); - } - - template - inline detail::_xvec3 powerOfTwoAboveGTX(const detail::_xvec3& value) - { - return detail::_xvec3( - powerOfTwoAboveGTX(value[0]), - powerOfTwoAboveGTX(value[1]), - powerOfTwoAboveGTX(value[2])); - } - - template - inline detail::_xvec4 powerOfTwoAboveGTX(const detail::_xvec4& value) - { - return detail::_xvec4( - powerOfTwoAboveGTX(value[0]), - powerOfTwoAboveGTX(value[1]), - powerOfTwoAboveGTX(value[2]), - powerOfTwoAboveGTX(value[3])); - } - - // powerOfTwoBelowGTX - template - inline T powerOfTwoBelowGTX(const T value) - { - return isPowerOfTwoGTX(value) ? value : highestBitValueGTX(value); - } - - template - inline detail::_xvec2 powerOfTwoBelowGTX(const detail::_xvec2& value) - { - return detail::_xvec2( - powerOfTwoBelowGTX(value[0]), - powerOfTwoBelowGTX(value[1])); - } - - template - inline detail::_xvec3 powerOfTwoBelowGTX(const detail::_xvec3& value) - { - return detail::_xvec3( - powerOfTwoBelowGTX(value[0]), - powerOfTwoBelowGTX(value[1]), - powerOfTwoBelowGTX(value[2])); - } - - template - inline detail::_xvec4 powerOfTwoBelowGTX(const detail::_xvec4& value) - { - return detail::_xvec4( - powerOfTwoBelowGTX(value[0]), - powerOfTwoBelowGTX(value[1]), - powerOfTwoBelowGTX(value[2]), - powerOfTwoBelowGTX(value[3])); - } - - // powerOfTwoNearestGTX - template - inline T powerOfTwoNearestGTX(const T value) - { - if(isPowerOfTwoGTX(value)) - return value; - - T prev = highestBitValueGTX(value); - T next = prev << 1; - return (next - value) < (value - prev) ? next : prev; - } - - template - inline detail::_xvec2 powerOfTwoNearestGTX(const detail::_xvec2& value) - { - return detail::_xvec2( - powerOfTwoNearestGTX(value[0]), - powerOfTwoNearestGTX(value[1])); - } - - template - inline detail::_xvec3 powerOfTwoNearestGTX(const detail::_xvec3& value) - { - return detail::_xvec3( - powerOfTwoNearestGTX(value[0]), - powerOfTwoNearestGTX(value[1]), - powerOfTwoNearestGTX(value[2])); - } - - template - inline detail::_xvec4 powerOfTwoNearestGTX(const detail::_xvec4& value) - { - return detail::_xvec4( - powerOfTwoNearestGTX(value[0]), - powerOfTwoNearestGTX(value[1]), - powerOfTwoNearestGTX(value[2]), - powerOfTwoNearestGTX(value[3])); - } -} - -#endif//__glm_gtx_bit_inl__ diff --git a/experimental/sse/glm/ext/gtx/closest_point.h b/experimental/sse/glm/ext/gtx/closest_point.h deleted file mode 100644 index d6331757..00000000 --- a/experimental/sse/glm/ext/gtx/closest_point.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-30 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/closest_point.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_closest_point__ -#define __glm_gtx_closest_point__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - //! Find the point on a straight line which is the closet of a point. (from GLM_GTX_closest_point extension) - template - detail::_xvec3 closestPointOnLineGTX( - const detail::_xvec3& point, - const detail::_xvec3& a, - const detail::_xvec3& b); - - namespace gtx - { - //! GLM_GTX_closest_point extension: Find the point on a straight line which is the closet of a point. - namespace closest_point - { - //! Find the point on a straight line which is the closet of a point. (from GLM_GTX_closest_point extension) - template - inline detail::_xvec3 closestPointOnLine( - const detail::_xvec3& point, - const detail::_xvec3& a, - const detail::_xvec3& b) - { - return closestPointOnLineGTX(point, a, b); - } - } - } -} - -#define GLM_GTX_closest_point namespace gtx::closest_point - -#include "closest_point.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_closest_point;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_closest_point__ diff --git a/experimental/sse/glm/ext/gtx/closest_point.inl b/experimental/sse/glm/ext/gtx/closest_point.inl deleted file mode 100644 index ad082f3b..00000000 --- a/experimental/sse/glm/ext/gtx/closest_point.inl +++ /dev/null @@ -1,31 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-30 -// Updated : 2006-01-04 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/closest_point.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_closest_point_inl__ -#define __glm_gtx_closest_point_inl__ - -namespace glm -{ - template - inline detail::_xvec3 closestPointOnLineGTX(const detail::_xvec3& point, const detail::_xvec3& a, const detail::_xvec3& b) - { - T LineLength = distance(a, b); - detail::_xvec3 Vector = point - a; - detail::_xvec3 LineDirection = (b - a) / LineLength; - - // Project Vector to LineDirection to get the distance of point from a - T Distance = dot(Vector, LineDirection); - - if(Distance <= 0) return a; - if(Distance >= LineLength) return b; - return a + LineDirection * Distance; - } -} - -#endif//__glm_gtx_closest_point_inl__ diff --git a/experimental/sse/glm/ext/gtx/color_cast.h b/experimental/sse/glm/ext/gtx/color_cast.h deleted file mode 100644 index db645524..00000000 --- a/experimental/sse/glm/ext/gtx/color_cast.h +++ /dev/null @@ -1,165 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-06-21 -// Updated : 2007-08-03 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/color_cast.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_half -// - GLM_GTX_double -// - GLM_GTX_int -// - GLM_GTX_unsigned_int -// - GLM_GTX_number_precision -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_color_cast__ -#define __glm_gtx_color_cast__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/half.h" -#include "../gtx/double.h" -#include "../gtx/integer.h" -#include "../gtx/unsigned_int.h" -#include "../gtx/number_precision.h" - -namespace glm -{ - template __uint8GTX u8channel_castGTX(T a); //!< Conversion of a floating value into a 8bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint16GTX u16channel_castGTX(T a); //!< Conversion of a floating value into a 16bit unsigned int value. (From GLM_GTX_color_cast extension) - - template __uint32GTX u32_rgbx_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint32GTX u32_xrgb_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint32GTX u32_bgrx_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint32GTX u32_xbgr_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - - template __uint32GTX u32_rgba_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint32GTX u32_argb_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint32GTX u32_bgra_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint32GTX u32_abgr_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - - template __uint64GTX u64_rgbx_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint64GTX u64_xrgb_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint64GTX u64_bgrx_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint64GTX u64_xbgr_castGTX(const detail::_xvec3& c); //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - - template __uint64GTX u64_rgba_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint64GTX u64_argb_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint64GTX u64_bgra_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template __uint64GTX u64_abgr_castGTX(const detail::_xvec4& c); //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - - template __halfGTX f16_channel_castGTX(T a); //!< Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - - template detail::_xvec3<__halfGTX> f16_rgbx_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3<__halfGTX> f16_xrgb_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3<__halfGTX> f16_bgrx_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3<__halfGTX> f16_xbgr_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - - template detail::_xvec4<__halfGTX> f16_rgba_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4<__halfGTX> f16_argb_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4<__halfGTX> f16_bgra_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4<__halfGTX> f16_abgr_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - - template float f32_channel_castGTX(T a); //!< Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - - template detail::_xvec3 f32_rgbx_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3 f32_xrgb_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3 f32_bgrx_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3 f32_xbgr_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - - template detail::_xvec4 f32_rgba_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4 f32_argb_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4 f32_bgra_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4 f32_abgr_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - - template double f64_channel_castGTX(T a); //!< Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - - template detail::_xvec3 f64_rgbx_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3 f64_xrgb_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3 f64_bgrx_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec3 f64_xbgr_castGTX(T color); //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - - template detail::_xvec4 f64_rgba_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4 f64_argb_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4 f64_bgra_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template detail::_xvec4 f64_abgr_castGTX(T color); //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - - namespace gtx - { - //! GLM_GTX_color_cast extension: Conversion between two color types - namespace color_cast - { - template inline __uint8GTX u8channel_cast(T a){return u8channel_castGTX(a);} //!< Conversion of a floating value into a 8bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint16GTX u16channel_cast(T a){return u16channel_castGTX(a);} //!< Conversion of a floating value into a 16bit unsigned int value. (From GLM_GTX_color_cast extension) - - template inline __uint32GTX u32_rgbx_cast(const detail::_xvec3& c){return u32_rgbx_castGTX(c);} //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint32GTX u32_xrgb_cast(const detail::_xvec3& c){return u32_xrgb_castGTX(c);} //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint32GTX u32_bgrx_cast(const detail::_xvec3& c){return u32_bgrx_castGTX(c);} //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint32GTX u32_xbgr_cast(const detail::_xvec3& c){return u32_xbgr_castGTX(c);} //!< Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - - template inline __uint32GTX u32_rgba_cast(const detail::_xvec4& c){return u32_rgba_castGTX(c);} //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint32GTX u32_argb_cast(const detail::_xvec4& c){return u32_argb_castGTX(c);} //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint32GTX u32_bgra_cast(const detail::_xvec4& c){return u32_bgra_castGTX(c);} //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint32GTX u32_abgr_cast(const detail::_xvec4& c){return u32_abgr_castGTX(c);} //!< Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension) - - template inline __uint64GTX u64_rgbx_cast(const detail::_xvec3& c){return u32_rgbx_castGTX(c);} //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint64GTX u64_xrgb_cast(const detail::_xvec3& c){return u32_xrgb_castGTX(c);} //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint64GTX u64_bgrx_cast(const detail::_xvec3& c){return u32_bgrx_castGTX(c);} //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint64GTX u64_xbgr_cast(const detail::_xvec3& c){return u32_xbgr_castGTX(c);} //!< Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - - template inline __uint64GTX u64_rgba_cast(const detail::_xvec4& c){return u32_rgba_castGTX(c);} //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint64GTX u64_argb_cast(const detail::_xvec4& c){return u32_argb_castGTX(c);} //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint64GTX u64_bgra_cast(const detail::_xvec4& c){return u32_bgra_castGTX(c);} //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - template inline __uint64GTX u64_abgr_cast(const detail::_xvec4& c){return u32_abgr_castGTX(c);} //!< Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension) - - template inline __halfGTX f16_channel_cast(T a){return f16_channel_castGTX(a);} //!< Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - - template inline detail::_xvec3<__halfGTX> f16_rgbx_cast(T c){return f16_rgbx_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3<__halfGTX> f16_xrgb_cast(T c){return f16_xrgb_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3<__halfGTX> f16_bgrx_cast(T c){return f16_bgrx_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3<__halfGTX> f16_xbgr_cast(T c){return f16_xbgr_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - - template inline detail::_xvec4<__halfGTX> f16_rgba_cast(T c){return f16_rgba_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4<__halfGTX> f16_argb_cast(T c){return f16_argb_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4<__halfGTX> f16_bgra_cast(T c){return f16_bgra_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4<__halfGTX> f16_abgr_cast(T c){return f16_abgr_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - - template inline float f32_channel_cast(T a){return f32_channel_castGTX(a);} //!< Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - - template inline detail::_xvec3 f32_rgbx_cast(T c){return f32_rgbx_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3 f32_xrgb_cast(T c){return f32_xrgb_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3 f32_bgrx_cast(T c){return f32_bgrx_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3 f32_xbgr_cast(T c){return f32_xbgr_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - - template inline detail::_xvec4 f32_rgba_cast(T c){return f32_rgba_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4 f32_argb_cast(T c){return f32_argb_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4 f32_bgra_cast(T c){return f32_bgra_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4 f32_abgr_cast(T c){return f32_abgr_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - - template inline double f64_channel_cast(T a){return f64_channel_castGTX(a);} //!< Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension) - - template inline detail::_xvec3 f64_rgbx_cast(T c){return f64_rgbx_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3 f64_xrgb_cast(T c){return f64_xrgb_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3 f64_bgrx_cast(T c){return f64_bgrx_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec3 f64_xbgr_cast(T c){return f64_xbgr_castGTX(c);} //!< Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension) - - template inline detail::_xvec4 f64_rgba_cast(T c){return f64_rgba_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4 f64_argb_cast(T c){return f64_argb_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4 f64_bgra_cast(T c){return f64_bgra_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - template inline detail::_xvec4 f64_abgr_cast(T c){return f64_abgr_castGTX(c);} //!< Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension) - } - } -} - -#define GLM_GTX_color_cast namespace gtx::color_cast - -#include "color_cast.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_color_cast;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_color_cast__ diff --git a/experimental/sse/glm/ext/gtx/color_cast.inl b/experimental/sse/glm/ext/gtx/color_cast.inl deleted file mode 100644 index 8ee1b972..00000000 --- a/experimental/sse/glm/ext/gtx/color_cast.inl +++ /dev/null @@ -1,737 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-06-21 -// Updated : 2007-08-03 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/color_cast.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline __uint8GTX u8channel_castGTX(T a) - { - return static_cast<__uint8GTX>(a * T(255)); - } - - template - inline __uint16GTX u16channel_castGTX(T a) - { - return static_cast<__uint16GTX>(a * T(65535)); - } - - template - inline __uint32GTX u32_rgbx_castGTX(const detail::_xvec3& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec3::value_type(255)) << 0; - result += static_cast<__uint32GTX>(c.y * detail::_xvec3::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.z * detail::_xvec3::value_type(255)) << 16; - return result; - } - - template - inline __uint32GTX u32_xrgb_castGTX(const detail::_xvec3& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec3::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.y * detail::_xvec3::value_type(255)) << 16; - result += static_cast<__uint32GTX>(c.z * detail::_xvec3::value_type(255)) << 24; - return result; - } - - template - inline __uint32GTX u32_bgrx_castGTX(const detail::_xvec3& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec3::value_type(255)) << 16; - result += static_cast<__uint32GTX>(c.y * detail::_xvec3::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.z * detail::_xvec3::value_type(255)) << 0; - return result; - } - - template - inline __uint32GTX u32_xbgr_castGTX(const detail::_xvec3& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec3::value_type(255)) << 24; - result += static_cast<__uint32GTX>(c.y * detail::_xvec3::value_type(255)) << 16; - result += static_cast<__uint32GTX>(c.z * detail::_xvec3::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.w * detail::_xvec3::value_type(255)) << 0; - return result; - } - - template - inline __uint32GTX u32_rgba_castGTX(const detail::_xvec4& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec4::value_type(255)) << 0; - result += static_cast<__uint32GTX>(c.y * detail::_xvec4::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.z * detail::_xvec4::value_type(255)) << 16; - result += static_cast<__uint32GTX>(c.w * detail::_xvec4::value_type(255)) << 24; - return result; - } - - template - inline __uint32GTX u32_argb_castGTX(const detail::_xvec4& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec4::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.y * detail::_xvec4::value_type(255)) << 16; - result += static_cast<__uint32GTX>(c.z * detail::_xvec4::value_type(255)) << 24; - result += static_cast<__uint32GTX>(c.w * detail::_xvec4::value_type(255)) << 0; - return result; - } - - template - inline __uint32GTX u32_bgra_castGTX(const detail::_xvec4& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec4::value_type(255)) << 16; - result += static_cast<__uint32GTX>(c.y * detail::_xvec4::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.z * detail::_xvec4::value_type(255)) << 0; - result += static_cast<__uint32GTX>(c.w * detail::_xvec4::value_type(255)) << 24; - return result; - } - - template - inline __uint32GTX u32_abgr_castGTX(const detail::_xvec4& c) - { - __uint32GTX result = 0; - result += static_cast<__uint32GTX>(c.x * detail::_xvec4::value_type(255)) << 24; - result += static_cast<__uint32GTX>(c.y * detail::_xvec4::value_type(255)) << 16; - result += static_cast<__uint32GTX>(c.z * detail::_xvec4::value_type(255)) << 8; - result += static_cast<__uint32GTX>(c.w * detail::_xvec4::value_type(255)) << 0; - return result; - } - - template - inline __uint64GTX u64_rgbx_castGTX(const detail::_xvec3& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec3::value_type(65535)) << 0; - result += static_cast<__uint64GTX>(c.y * detail::_xvec3::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.z * detail::_xvec3::value_type(65535)) << 32; - return result; - } - - template - inline __uint64GTX u32_xrgb_castGTX(const detail::_xvec3& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec3::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.y * detail::_xvec3::value_type(65535)) << 32; - result += static_cast<__uint64GTX>(c.z * detail::_xvec3::value_type(65535)) << 48; - return result; - } - - template - inline __uint64GTX u32_bgrx_castGTX(const detail::_xvec3& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec3::value_type(65535)) << 32; - result += static_cast<__uint64GTX>(c.y * detail::_xvec3::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.z * detail::_xvec3::value_type(65535)) << 0; - return result; - } - - template - inline __uint64GTX u32_xbgr_castGTX(const detail::_xvec3& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec3::value_type(65535)) << 48; - result += static_cast<__uint64GTX>(c.y * detail::_xvec3::value_type(65535)) << 32; - result += static_cast<__uint64GTX>(c.z * detail::_xvec3::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.w * detail::_xvec3::value_type(65535)) << 0; - return result; - } - - template - inline __uint64GTX u64_rgba_castGTX(const detail::_xvec4& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec4::value_type(65535)) << 0; - result += static_cast<__uint64GTX>(c.y * detail::_xvec4::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.z * detail::_xvec4::value_type(65535)) << 32; - result += static_cast<__uint64GTX>(c.w * detail::_xvec4::value_type(65535)) << 48; - return result; - } - - template - inline __uint64GTX u64_argb_castGTX(const detail::_xvec4& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec4::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.y * detail::_xvec4::value_type(65535)) << 32; - result += static_cast<__uint64GTX>(c.z * detail::_xvec4::value_type(65535)) << 48; - result += static_cast<__uint64GTX>(c.w * detail::_xvec4::value_type(65535)) << 0; - return result; - } - - template - inline __uint64GTX u64_bgra_castGTX(const detail::_xvec4& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec4::value_type(65535)) << 32; - result += static_cast<__uint64GTX>(c.y * detail::_xvec4::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.z * detail::_xvec4::value_type(65535)) << 0; - result += static_cast<__uint64GTX>(c.w * detail::_xvec4::value_type(65535)) << 48; - return result; - } - - template - inline __uint64GTX u64_abgr_castGTX(const detail::_xvec4& c) - { - __uint64GTX result = 0; - result += static_cast<__uint64GTX>(c.x * detail::_xvec4::value_type(65535)) << 48; - result += static_cast<__uint64GTX>(c.y * detail::_xvec4::value_type(65535)) << 32; - result += static_cast<__uint64GTX>(c.z * detail::_xvec4::value_type(65535)) << 16; - result += static_cast<__uint64GTX>(c.w * detail::_xvec4::value_type(65535)) << 0; - return result; - } - - template <> - inline __halfGTX f16_channel_castGTX<__uint32GTX>(__uint32GTX color) - { - return __halfGTX(static_cast(color >> 0) / static_cast(255)); - } - -#ifdef GLM_COMPILER_VC - template <> - inline detail::_xvec3<__halfGTX> f16_rgbx_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 0) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 8) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 16) / static_cast(255)); - return result; - } - - template <> - inline detail::_xvec3<__halfGTX> f16_xrgb_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 8) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 24) / static_cast(255)); - return result; - } - - template <> - inline detail::_xvec3<__halfGTX> f16_bgrx_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 16) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 8) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 0) / static_cast(255)); - return result; - } - - template <> - inline detail::_xvec3<__halfGTX> f16_xbgr_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 24) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 8) / static_cast(255)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_rgba_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 0) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 8) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 16) / static_cast(255)); - result.w = __halfGTX(static_cast(color >> 24) / static_cast(255)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_argb_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 8) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 24) / static_cast(255)); - result.w = __halfGTX(static_cast(color >> 0) / static_cast(255)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_bgra_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 16) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 8) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 0) / static_cast(255)); - result.w = __halfGTX(static_cast(color >> 24) / static_cast(255)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_abgr_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 24) / static_cast(255)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(255)); - result.z = __halfGTX(static_cast(color >> 8) / static_cast(255)); - result.w = __halfGTX(static_cast(color >> 0) / static_cast(255)); - return result; - } -#endif//GLM_COMPILER_VC - - template <> - inline float f32_channel_castGTX<__uint8GTX>(__uint8GTX color) - { - return static_cast(color >> 0) / static_cast(255); - } - - template <> - inline detail::_xvec3 f32_rgbx_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec3 f32_xrgb_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec3 f32_bgrx_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec3 f32_xbgr_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f32_rgba_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f32_argb_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f32_bgra_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f32_abgr_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); - return result; - } - - template <> - inline double f64_channel_castGTX<__uint8GTX>(__uint8GTX color) - { - return static_cast(color >> 0) / static_cast(255); - } - - template <> - inline detail::_xvec3 f64_rgbx_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec3 f64_xrgb_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec3 f64_bgrx_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec3 f64_xbgr_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f64_rgba_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f64_argb_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f64_bgra_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); - return result; - } - - template <> - inline detail::_xvec4 f64_abgr_castGTX<__uint32GTX>(__uint32GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); - return result; - } - - template <> - inline __halfGTX f16_channel_castGTX<__uint16GTX>(__uint16GTX color) - { - return __halfGTX(static_cast(color >> 0) / static_cast(65535)); - } - -#ifdef GLM_COMPILER_VC - template <> - inline detail::_xvec3<__halfGTX> f16_rgbx_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 0) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - return result; - } - - template <> - inline detail::_xvec3<__halfGTX> f16_xrgb_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 48) / static_cast(65535)); - return result; - } - - template <> - inline detail::_xvec3<__halfGTX> f16_bgrx_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 0) / static_cast(65535)); - return result; - } - - template <> - inline detail::_xvec3<__halfGTX> f16_xbgr_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 48) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_rgba_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 0) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - result.w = __halfGTX(static_cast(color >> 48) / static_cast(65535)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_argb_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 48) / static_cast(65535)); - result.w = __halfGTX(static_cast(color >> 0) / static_cast(65535)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_bgra_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 0) / static_cast(65535)); - result.w = __halfGTX(static_cast(color >> 48) / static_cast(65535)); - return result; - } - - template <> - inline detail::_xvec4<__halfGTX> f16_abgr_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4<__halfGTX> result; - result.x = __halfGTX(static_cast(color >> 48) / static_cast(65535)); - result.y = __halfGTX(static_cast(color >> 32) / static_cast(65535)); - result.z = __halfGTX(static_cast(color >> 16) / static_cast(65535)); - result.w = __halfGTX(static_cast(color >> 0) / static_cast(65535)); - return result; - } -#endif//GLM_COMPILER_VC - - template <> - inline float f32_channel_castGTX<__uint16GTX>(__uint16GTX color) - { - return static_cast(color >> 0) / static_cast(65535); - } - - template <> - inline detail::_xvec3 f32_rgbx_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec3 f32_xrgb_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec3 f32_bgrx_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec3 f32_xbgr_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f32_rgba_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f32_argb_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f32_bgra_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f32_abgr_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); - return result; - } - - template <> - inline double f64_channel_castGTX<__uint16GTX>(__uint16GTX color) - { - return static_cast(color >> 0) / static_cast(65535); - } - - template <> - inline detail::_xvec3 f64_rgbx_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec3 f64_xrgb_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec3 f64_bgrx_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec3 f64_xbgr_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec3 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f64_rgba_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f64_argb_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f64_bgra_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); - return result; - } - - template <> - inline detail::_xvec4 f64_abgr_castGTX<__uint64GTX>(__uint64GTX color) - { - detail::_xvec4 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); - return result; - } -} diff --git a/experimental/sse/glm/ext/gtx/color_space.h b/experimental/sse/glm/ext/gtx/color_space.h deleted file mode 100644 index 979cd315..00000000 --- a/experimental/sse/glm/ext/gtx/color_space.h +++ /dev/null @@ -1,51 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2007-02-22 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/color_space.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_color_space__ -#define __glm_gtx_color_space__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xvec3 rgbColorGTX(const detail::_xvec3& hsvValue); //!< \brief Converts a color from HSV color space to its color in RGB color space (from GLM_GTX_color_space extension) - template detail::_xvec3 hsvColorGTX(const detail::_xvec3& rgbValue); //!< \brief Converts a color from RGB color space to its color in HSV color space (from GLM_GTX_color_space extension) - template detail::_xmat4 saturationGTX(const T s); //!< Build a saturation matrix (from GLM_GTX_color_space extension) - template detail::_xvec3 saturationGTX(const T s, const detail::_xvec3& color); //!< Modify the saturation of a color (from GLM_GTX_color_space extension) - template detail::_xvec4 saturationGTX(const T s, const detail::_xvec4& color); //!< Modify the saturation of a color (from GLM_GTX_color_space extension) - template T luminosityGTX(const detail::_xvec3& cColor); //!< Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals (from GLM_GTX_color_space extension) - - namespace gtx - { - //! GLM_GTX_color_space extension: Related to RVB to HSV conversions and operations - namespace color_space - { - template inline detail::_xvec3 rgbColor(const detail::_xvec3& hsvValue){return rgbColorGTX(hsvValue);} //!< \brief Converts a color from HSV color space to its color in RGB color space (from GLM_GTX_color_space extension) - template inline detail::_xvec3 hsvColor(const detail::_xvec3& rgbValue){return hsvColorGTX(rgbValue);} //!< \brief Converts a color from RGB color space to its color in HSV color space (from GLM_GTX_color_space extension) - template inline detail::_xmat4 saturation(const T s){return saturationGTX(s);} //!< Build a saturation matrix (from GLM_GTX_color_space extension) - template inline detail::_xvec3 saturation(const T s, const detail::_xvec3& color){return saturationGTX(s, color);} //!< Modify the saturation of a color (from GLM_GTX_color_space extension) - template inline detail::_xvec4 saturation(const T s, const detail::_xvec4& color){return saturationGTX(s, color);} //!< Modify the saturation of a color (from GLM_GTX_color_space extension) - template inline T luminosity(const detail::_xvec3& color){return luminosityGTX(color);} //!< Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals (from GLM_GTX_color_space extension) - } - } -} - -#define GLM_GTX_color_space namespace gtx::color_space - -#include "color_space.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_color_space;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_color_space__ diff --git a/experimental/sse/glm/ext/gtx/color_space.inl b/experimental/sse/glm/ext/gtx/color_space.inl deleted file mode 100644 index 115de1f0..00000000 --- a/experimental/sse/glm/ext/gtx/color_space.inl +++ /dev/null @@ -1,149 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2007-02-22 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/color_space.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xvec3 rgbColorGTX(const detail::_xvec3& color) - { - detail::_xvec3 hsv = color; - detail::_xvec3 rgb; - - if(hsv.y == T(0)) - // achromatic (grey) - rgb = detail::_xvec3(hsv.z); - else - { - T sector = floor(hsv.x / T(60)); - T frac = (hsv.x / T(60)) - sector; - // factorial part of h - T o = hsv.z * (T(1) - hsv.y); - T p = hsv.z * (T(1) - hsv.y * frac); - T q = hsv.z * (T(1) - hsv.y * (T(1) - frac)); - - switch(int(sector)) - { - default: - case 0: - rgb.r = hsv.z; - rgb.g = q; - rgb.b = o; - break; - case 1: - rgb.r = p; - rgb.g = hsv.z; - rgb.b = o; - break; - case 2: - rgb.r = o; - rgb.g = hsv.z; - rgb.b = q; - break; - case 3: - rgb.r = o; - rgb.g = p; - rgb.b = hsv.z; - break; - case 4: - rgb.r = q; - rgb.g = o; - rgb.b = hsv.z; - break; - case 5: - rgb.r = hsv.z; - rgb.g = o; - rgb.b = p; - break; - } - } - - return rgb; - } - - template - inline detail::_xvec3 hsvColorGTX(const detail::_xvec3& rgb) - { - detail::_xvec3 hsv = rgb; - float Min = min(min(rgb.r, rgb.g), rgb.b); - float Max = max(max(rgb.r, rgb.g), rgb.b); - float Delta = Max - Min; - - hsv.z = Max; - - if(Max != T(0)) - { - hsv.y = Delta / hsv.z; - T h = T(0); - - if(rgb.r == Max) - // between yellow & magenta - h = T(0) + T(60) * (rgb.g - rgb.b) / Delta; - else if(rgb.g == Max) - // between cyan & yellow - h = T(120) + T(60) * (rgb.b - rgb.r) / Delta; - else - // between magenta & cyan - h = T(240) + T(60) * (rgb.r - rgb.g) / Delta; - - if(h < T(0)) - hsv.x = h + T(360); - else - hsv.x = h; - } - else - { - // If r = g = b = 0 then s = 0, h is undefined - hsv.y = T(0); - hsv.x = T(0); - } - - return hsv; - } - - template - inline detail::_xmat4 saturationGTX(const T s) - { - detail::_xvec3 rgbw = detail::_xvec3(T(0.2126), T(0.7152), T(0.0722)); - - T col0 = (T(1) - s) * rgbw.r; - T col1 = (T(1) - s) * rgbw.g; - T col2 = (T(1) - s) * rgbw.b; - - detail::_xmat4 result(T(1)); - result[0][0] = col0 + s; - result[0][1] = col0; - result[0][2] = col0; - result[1][0] = col1; - result[1][1] = col1 + s; - result[1][2] = col1; - result[2][0] = col2; - result[2][1] = col2; - result[2][2] = col2 + s; - return result; - } - - template - inline detail::_xvec3 saturationGTX(const T s, const detail::_xvec3& color) - { - return detail::_xvec3(saturationGTX(s) * detail::_xvec4(color, T(0))); - } - - template - inline detail::_xvec4 saturationGTX(const T s, const detail::_xvec4& color) - { - return saturationGTX(s) * color; - } - - template - inline T luminosityGTX(const detail::_xvec3& color) - { - const detail::_xvec3 tmp = detail::_xvec3(0.33, 0.59, 0.11); - return dot(color, tmp); - } -} diff --git a/experimental/sse/glm/ext/gtx/compatibility.h b/experimental/sse/glm/ext/gtx/compatibility.h deleted file mode 100644 index 7beb9c7b..00000000 --- a/experimental/sse/glm/ext/gtx/compatibility.h +++ /dev/null @@ -1,298 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-24 -// Updated : 2007-09-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/compatibility.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_mul -// - GLM_GTX_half -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_compatibility__ -#define __glm_gtx_compatibility__ - -// Dependency: -#include "../../glm.h" -#include "../../glmsetup.h" -#include "../gtx/mul.h" -#include "../gtx/half.h" - -#ifdef GLM_COMPILER_VC -#include -#endif -#ifdef GLM_COMPILER_GCC -#include -#endif - -namespace glm -{ - template inline T lerpGTX(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility extension) - - template inline detail::_xvec2 lerpGTX(const detail::_xvec2& x, const detail::_xvec2& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility extension) - template inline detail::_xvec3 lerpGTX(const detail::_xvec3& x, const detail::_xvec3& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility extension) - template inline detail::_xvec4 lerpGTX(const detail::_xvec4& x, const detail::_xvec4& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility extension) - - template inline detail::_xvec2 lerpGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility extension) - template inline detail::_xvec3 lerpGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility extension) - template inline detail::_xvec4 lerpGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility extension) - - template inline T saturateGTX(T x){clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility extension) - template inline detail::_xvec2 saturateGTX(const detail::_xvec2& x){clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility extension) - template inline detail::_xvec3 saturateGTX(const detail::_xvec3& x){clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility extension) - template inline detail::_xvec4 saturateGTX(const detail::_xvec4& x){clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility extension) - - template inline T atan2GTX(T x, T y){atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility extension) - template inline detail::_xvec2 atan2GTX(const detail::_xvec2& x, const detail::_xvec2& y){atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility extension) - template inline detail::_xvec3 atan2GTX(const detail::_xvec3& x, const detail::_xvec3& y){atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility extension) - template inline detail::_xvec4 atan2GTX(const detail::_xvec4& x, const detail::_xvec4& y){atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility extension) - - template bool isfiniteGTX(T x); //!< \brief Determines whether the given floating-point value is finite. (From GLM_GTX_compatibility extension) - template detail::_bvec2 isfiniteGTX(const detail::_xvec2& x); //!< \brief Determines whether the given floating-point values is finite. (From GLM_GTX_compatibility extension) - template detail::_bvec3 isfiniteGTX(const detail::_xvec3& x); //!< \brief Determines whether the given floating-point values is finite. (From GLM_GTX_compatibility extension) - template detail::_bvec4 isfiniteGTX(const detail::_xvec4& x); //!< \brief Determines whether the given floating-point values is finite. (From GLM_GTX_compatibility extension) - - template bool isinfGTX(T x); //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) - template detail::_bvec2 isinfGTX(const detail::_xvec2& x); //!< \brief Determines whether the given floating-point values is infinite. (From GLM_GTX_compatibility extension) - template detail::_bvec3 isinfGTX(const detail::_xvec3& x); //!< \brief Determines whether the given floating-point values is infinite. (From GLM_GTX_compatibility extension) - template detail::_bvec4 isinfGTX(const detail::_xvec4& x); //!< \brief Determines whether the given floating-point values is infinite. (From GLM_GTX_compatibility extension) - - template bool isnanGTX(T x); //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension) - template detail::_bvec2 isnanGTX(const detail::_xvec2& x); //!< \brief Checks given floating-point values for not a number (NAN) (From GLM_GTX_compatibility extension) - template detail::_bvec3 isnanGTX(const detail::_xvec3& x); //!< \brief Checks given floating-point values for not a number (NAN) (From GLM_GTX_compatibility extension) - template detail::_bvec4 isnanGTX(const detail::_xvec4& x); //!< \brief Checks given floating-point values for not a number (NAN) (From GLM_GTX_compatibility extension) - - typedef bool bool1GTX; - typedef detail::_bvec2 bool2GTX; - typedef detail::_bvec3 bool3GTX; - typedef detail::_bvec4 bool4GTX; -/* - typedef bool bool1x1GTX; - typedef detail::_xmat2 bool2x2GTX; - typedef detail::_xmat3 bool3x3GTX; - typedef detail::_xmat4 bool4x4GTX; - - typedef detail::_xmat2x3 bool2x3GTX; - typedef detail::_xmat2x4 bool2x4GTX; - typedef detail::_xmat3x2 bool3x2GTX; - typedef detail::_xmat3x4 bool3x4GTX; - typedef detail::_xmat4x2 bool4x2GTX; - typedef detail::_xmat4x3 bool4x3GTX; -*/ - typedef int __int1GTX; - typedef detail::_xvec2 __int2GTX; - typedef detail::_xvec3 __int3GTX; - typedef detail::_xvec4 __int4GTX; - - typedef int __int1x1GTX; - typedef detail::_xmat2 __int2x2GTX; - typedef detail::_xmat3 __int3x3GTX; - typedef detail::_xmat4 __int4x4GTX; - - typedef detail::_xmat2x3 __int2x3GTX; - typedef detail::_xmat2x4 __int2x4GTX; - typedef detail::_xmat3x2 __int3x2GTX; - typedef detail::_xmat3x4 __int3x4GTX; - typedef detail::_xmat4x2 __int4x2GTX; - typedef detail::_xmat4x3 __int4x3GTX; - - typedef __halfGTX __half1GTX; - typedef detail::_xvec2<__halfGTX> __half2GTX; - typedef detail::_xvec3<__halfGTX> __half3GTX; - typedef detail::_xvec4<__halfGTX> __half4GTX; - - typedef __halfGTX __half1x1GTX; - typedef detail::_xmat2<__halfGTX> __half2x2GTX; - typedef detail::_xmat3<__halfGTX> __half3x3GTX; - typedef detail::_xmat4<__halfGTX> __half4x4GTX; - - typedef detail::_xmat2x3<__halfGTX> __half2x3GTX; - typedef detail::_xmat2x4<__halfGTX> __half2x4GTX; - typedef detail::_xmat3x2<__halfGTX> __half3x2GTX; - typedef detail::_xmat3x4<__halfGTX> __half3x4GTX; - typedef detail::_xmat4x2<__halfGTX> __half4x2GTX; - typedef detail::_xmat4x3<__halfGTX> __half4x3GTX; - - typedef float __float1GTX; - typedef detail::_xvec2 __float2GTX; - typedef detail::_xvec3 __float3GTX; - typedef detail::_xvec4 __float4GTX; - - typedef float __float1x1GTX; - typedef detail::_xmat2 __float2x2GTX; - typedef detail::_xmat3 __float3x3GTX; - typedef detail::_xmat4 __float4x4GTX; - - typedef detail::_xmat2x3 __float2x3GTX; - typedef detail::_xmat2x4 __float2x4GTX; - typedef detail::_xmat3x2 __float3x2GTX; - typedef detail::_xmat3x4 __float3x4GTX; - typedef detail::_xmat4x2 __float4x2GTX; - typedef detail::_xmat4x3 __float4x3GTX; - - typedef double __double1GTX; - typedef detail::_xvec2 __double2GTX; - typedef detail::_xvec3 __double3GTX; - typedef detail::_xvec4 __double4GTX; - - typedef double __double1x1GTX; - typedef detail::_xmat2 __double2x2GTX; - typedef detail::_xmat3 __double3x3GTX; - typedef detail::_xmat4 __double4x4GTX; - - typedef detail::_xmat2x3 __double2x3GTX; - typedef detail::_xmat2x4 __double2x4GTX; - typedef detail::_xmat3x2 __double3x2GTX; - typedef detail::_xmat3x4 __double3x4GTX; - typedef detail::_xmat4x2 __double4x2GTX; - typedef detail::_xmat4x3 __double4x3GTX; - - namespace gtx - { - //! GLM_GTX_compatibility extension: Provide functions to increase the compatibility with Cg and HLSL languages - namespace compatibility - { - template inline T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - - template inline detail::_xvec2 lerp(const detail::_xvec2& x, const detail::_xvec2& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template inline detail::_xvec3 lerp(const detail::_xvec3& x, const detail::_xvec3& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template inline detail::_xvec4 lerp(const detail::_xvec4& x, const detail::_xvec4& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - - template inline detail::_xvec2 lerp(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template inline detail::_xvec3 lerp(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template inline detail::_xvec4 lerp(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - - template inline T saturate(T x){saturateGTX(x);} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template inline detail::_xvec2 saturate(const detail::_xvec2& x){saturateGTX(x);} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template inline detail::_xvec3 saturate(const detail::_xvec3& x){saturateGTX(x);} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template inline detail::_xvec4 saturate(const detail::_xvec4& x){saturateGTX(x);} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - - template inline T atan2(T x, T y){atan(x, y);} - template inline detail::_xvec2 atan2(const detail::_xvec2& x, const detail::_xvec2& y){atan(x, y);} - template inline detail::_xvec3 atan2(const detail::_xvec3& x, const detail::_xvec3& y){atan(x, y);} - template inline detail::_xvec4 atan2(const detail::_xvec4& x, const detail::_xvec4& y){atan(x, y);} - - template inline bool isfinite(T x){return isfiniteGTX(x);} - template inline detail::_bvec2 isfinite(const detail::_xvec2& x){return isfiniteGTX(x);} - template inline detail::_bvec3 isfinite(const detail::_xvec3& x){return isfiniteGTX(x);} - template inline detail::_bvec4 isfinite(const detail::_xvec4& x){return isfiniteGTX(x);} - - template inline bool isinf(T x){return isinfGTX(x);} - template inline detail::_bvec2 isinf(const detail::_xvec2& x){return isinfGTX(x);} - template inline detail::_bvec3 isinf(const detail::_xvec3& x){return isinfGTX(x);} - template inline detail::_bvec4 isinf(const detail::_xvec4& x){return isinfGTX(x);} - - template inline bool isnan(T x){return isnanGTX(x);} - template inline detail::_bvec2 isnan(const detail::_xvec2& x){return isnanGTX(x);} - template inline detail::_bvec3 isnan(const detail::_xvec3& x){return isnanGTX(x);} - template inline detail::_bvec4 isnan(const detail::_xvec4& x){return isnanGTX(x);} - - typedef bool bool1; - typedef detail::_bvec2 bool2; - typedef detail::_bvec3 bool3; - typedef detail::_bvec4 bool4; -/* - typedef bool bool1x1; - typedef detail::_xmat2 bool2x2; - typedef detail::_xmat3 bool3x3; - typedef detail::_xmat4 bool4x4; - - typedef detail::_xmat2x3 bool2x3; - typedef detail::_xmat2x4 bool2x4; - typedef detail::_xmat3x2 bool3x2; - typedef detail::_xmat3x4 bool3x4; - typedef detail::_xmat4x2 bool4x2; - typedef detail::_xmat4x3 bool4x3; -*/ - typedef int int1; - typedef detail::_xvec2 int2; - typedef detail::_xvec3 int3; - typedef detail::_xvec4 int4; - - typedef int int1x1; - typedef detail::_xmat2 int2x2; - typedef detail::_xmat3 int3x3; - typedef detail::_xmat4 int4x4; - - typedef detail::_xmat2x3 int2x3; - typedef detail::_xmat2x4 int2x4; - typedef detail::_xmat3x2 int3x2; - typedef detail::_xmat3x4 int3x4; - typedef detail::_xmat4x2 int4x2; - typedef detail::_xmat4x3 int4x3; - - typedef __halfGTX half1; - typedef detail::_xvec2<__halfGTX> half2; - typedef detail::_xvec3<__halfGTX> half3; - typedef detail::_xvec4<__halfGTX> half4; - - typedef detail::_xmat2<__halfGTX> half2x2; - typedef detail::_xmat3<__halfGTX> half3x3; - typedef detail::_xmat4<__halfGTX> half4x4; - - typedef detail::_xmat2x3<__halfGTX> half2x3; - typedef detail::_xmat2x4<__halfGTX> half2x4; - typedef detail::_xmat3x2<__halfGTX> half3x2; - typedef detail::_xmat3x4<__halfGTX> half3x4; - typedef detail::_xmat4x2<__halfGTX> half4x2; - typedef detail::_xmat4x3<__halfGTX> half4x3; - - typedef float float1; - typedef detail::_xvec2 float2; - typedef detail::_xvec3 float3; - typedef detail::_xvec4 float4; - - typedef float float1x1; - typedef detail::_xmat2 float2x2; - typedef detail::_xmat3 float3x3; - typedef detail::_xmat4 float4x4; - - typedef detail::_xmat2x3 float2x3; - typedef detail::_xmat2x4 float2x4; - typedef detail::_xmat3x2 float3x2; - typedef detail::_xmat3x4 float3x4; - typedef detail::_xmat4x2 float4x2; - typedef detail::_xmat4x3 float4x3; - - typedef double double1; - typedef detail::_xvec2 double2; - typedef detail::_xvec3 double3; - typedef detail::_xvec4 double4; - - typedef double double1x1; - typedef detail::_xmat2 double2x2; - typedef detail::_xmat3 double3x3; - typedef detail::_xmat4 double4x4; - - typedef detail::_xmat2x3 double2x3; - typedef detail::_xmat2x4 double2x4; - typedef detail::_xmat3x2 double3x2; - typedef detail::_xmat3x4 double3x4; - typedef detail::_xmat4x2 double4x2; - typedef detail::_xmat4x3 double4x3; - } - } -} - -#define GLM_GTX_compatibility namespace gtx::compatibility - -#include "compatibility.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_compatibility;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_compatibility__ - - - - - - - - - - diff --git a/experimental/sse/glm/ext/gtx/compatibility.inl b/experimental/sse/glm/ext/gtx/compatibility.inl deleted file mode 100644 index 67da2e2b..00000000 --- a/experimental/sse/glm/ext/gtx/compatibility.inl +++ /dev/null @@ -1,132 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-16 -// Updated : 2007-09-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/compatibility.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // isfiniteGTX - template - inline bool isfiniteGTX(T x) - { -#ifdef GLM_COMPILER_VC - return _finite(x); -#endif - -#ifdef GLM_COMPILER_GCC - return std::isfinite(x); -#endif - } - - template - inline detail::_bvec2 isfiniteGTX(const detail::_xvec2& x) - { - return detail::_bvec2( - isfiniteGTX(x.x), - isfiniteGTX(x.y)); - } - - template - inline detail::_bvec3 isfiniteGTX(const detail::_xvec3& x) - { - return detail::_bvec3( - isfiniteGTX(x.x), - isfiniteGTX(x.y), - isfiniteGTX(x.z)); - } - - template - inline detail::_bvec4 isfiniteGTX(const detail::_xvec4& x) - { - return detail::_bvec4( - isfiniteGTX(x.x), - isfiniteGTX(x.y), - isfiniteGTX(x.z), - isfiniteGTX(x.w)); - } - - // isinfGTX - template - inline bool isinfGTX(T x) - { -#ifdef GLM_COMPILER_VC - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -#endif - -#ifdef GLM_COMPILER_GCC - return std::isinf(x); -#endif - } - - template - inline detail::_bvec2 isinfGTX(const detail::_xvec2& x) - { - return detail::_bvec2( - isinfGTX(x.x), - isinfGTX(x.y)); - } - - template - inline detail::_bvec3 isinfGTX(const detail::_xvec3& x) - { - return detail::_bvec3( - isinfGTX(x.x), - isinfGTX(x.y), - isinfGTX(x.z)); - } - - template - inline detail::_bvec4 isinfGTX(const detail::_xvec4& x) - { - return detail::_bvec4( - isinfGTX(x.x), - isinfGTX(x.y), - isinfGTX(x.z), - isinfGTX(x.w)); - } - - // isnanGTX - template - inline bool isnanGTX(T x) - { -#ifdef GLM_COMPILER_VC - return _isnan(x); -#endif - -#ifdef GLM_COMPILER_GCC - return std::isnan(x); -#endif - } - - template - inline detail::_bvec2 isnanGTX(const detail::_xvec2& x) - { - return detail::_bvec2( - isnanGTX(x.x), - isnanGTX(x.y)); - } - - template - inline detail::_bvec3 isnanGTX(const detail::_xvec3& x) - { - return detail::_bvec3( - isnanGTX(x.x), - isnanGTX(x.y), - isnanGTX(x.z)); - } - - template - inline detail::_bvec4 isnanGTX(const detail::_xvec4& x) - { - return detail::_bvec4( - isnanGTX(x.x), - isnanGTX(x.y), - isnanGTX(x.z), - isnanGTX(x.w)); - } -} - diff --git a/experimental/sse/glm/ext/gtx/component_wise.h b/experimental/sse/glm/ext/gtx/component_wise.h deleted file mode 100644 index c7bd7315..00000000 --- a/experimental/sse/glm/ext/gtx/component_wise.h +++ /dev/null @@ -1,49 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-05-21 -// Updated : 2007-05-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/component_wise.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_component_wise__ -#define __glm_gtx_component_wise__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template GLMvalType compAddGTX(const genType& v); //!< Add all vector components together. (From GLM_GTX_component_wise extension) - template GLMvalType compMulGTX(const genType& v); //!< Multiply all vector components together. (From GLM_GTX_component_wise extension) - - template GLMvalType compMinGTX(const genType& v); //!< Find the minimum value between single vector components. (From GLM_GTX_component_wise extension) - template GLMvalType compMaxGTX(const genType& v); //!< Find the maximum value between single vector components. (From GLM_GTX_component_wise extension) - - namespace gtx - { - //! GLM_GTX_component_wise extension: Operations between components of a type - namespace component_wise - { - template inline GLMvalType compAdd(const genType& v){return compAddGTX(v);} //!< Add all vector components together. (From GLM_GTX_component_wise extension) - template inline GLMvalType compMul(const genType& v){return compMulGTX(v);} //!< Multiply all vector components together. (From GLM_GTX_component_wise extension) - - template inline GLMvalType compMin(const genType& v){return compMinGTX(v);} //!< Find the minimum value between single vector components. (From GLM_GTX_component_wise extension) - template inline GLMvalType compMax(const genType& v){return compMaxGTX(v);} //!< Find the maximum value between single vector components. (From GLM_GTX_component_wise extension) - } - } -} - -#define GLM_GTX_component_wise namespace gtx::component_wise - -#include "component_wise.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_component_wise;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_component_wise__ diff --git a/experimental/sse/glm/ext/gtx/component_wise.inl b/experimental/sse/glm/ext/gtx/component_wise.inl deleted file mode 100644 index 3d46a627..00000000 --- a/experimental/sse/glm/ext/gtx/component_wise.inl +++ /dev/null @@ -1,85 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-05-21 -// Updated : 2007-05-21 -// Licence : This source is under GNU LGPL licence -// File : gtx_component_wise.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline GLMvalType compAddGTX(const genType& v) - { - typename genType::size_type result = typename genType::value_type(0); - for(typename genType::size_type i = 0; i < genType::value_size; ++i) - result += v[i]; - return result; - } -/* - template - inline valType compAddGTX(const genType& v) - { - valType result = valType(0); - for(sizeType i = 0; i < valSize; ++i) - result += v[i]; - return result; - } -*/ - template - inline GLMvalType compMulGTX(const genType& v) - { - typename genType::size_type result = typename genType::value_type(0); - for(typename genType::size_type i = 0; i < genType::value_size; ++i) - result *= v[i]; - return result; - } -/* - template - inline GLMvalType compMulGTX(const genType& v) - { - valType result = valType(0); - for(GLMsizeType i = 0; i < valSize; ++i) - result *= v[i]; - return result; - } -*/ - template - inline GLMvalType compMinGTX(const genType& v) - { - typename genType::size_type result = typename genType::value_type(0); - for(typename genType::size_type i = 0; i < genType::value_size; ++i) - result = min(result, v[i]); - return result; - } -/* - template - inline GLMvalType compMinGTX(const genType& v) - { - valType result = valType(0); - for(GLMsizeType i = 0; i < valSize; ++i) - result = min(result, v[i]); - return result; - } -*/ - template - inline GLMvalType compMaxGTX(const genType& v) - { - typename genType::size_type result = typename genType::value_type(0); - for(typename genType::size_type i = 0; i < genType::value_size; ++i) - result = max(result, v[i]); - return result; - } -/* - template - inline GLMvalType compMaxGTX(const genType& v) - { - GLMvalType result = GLMvalType(0); - for(GLMsizeType i = 0; i < GLMvalSize; ++i) - result = max(result, v[i]); - return result; - } -*/ -} - diff --git a/experimental/sse/glm/ext/gtx/determinant.h b/experimental/sse/glm/ext/gtx/determinant.h deleted file mode 100644 index 910fcf80..00000000 --- a/experimental/sse/glm/ext/gtx/determinant.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/determinant.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_determinant__ -#define __glm_gtx_determinant__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template T determinantGTX(const detail::_xmat2& m); //!< \brief Returns the determinant of a 2 * 2 matrix. (From GLM_GTX_determinant extension) - template T determinantGTX(const detail::_xmat3& m); //!< \brief Returns the determinant of a 3 * 3 matrix. (From GLM_GTX_determinant extension) - template T determinantGTX(const detail::_xmat4& m); //!< \brief Returns the determinant of a 4 * 4 matrix. (From GLM_GTX_determinant extension) - - namespace gtx - { - //! GLM_GTX_determinant extension: Compute the determinant of a matrix - namespace determinant - { - template inline T determinant(const detail::_xmat2& m){return determinantGTX(m);} //!< \brief Returns the determinant of a 2 * 2 matrix. (From GLM_GTX_determinant extension) - template inline T determinant(const detail::_xmat3& m){return determinantGTX(m);} //!< \brief Returns the determinant of a 3 * 3 matrix. (From GLM_GTX_determinant extension) - template inline T determinant(const detail::_xmat4& m){return determinantGTX(m);} //!< \brief Returns the determinant of a 4 * 4 matrix. (From GLM_GTX_determinant extension) - } - } -} - -#define GLM_GTX_determinant namespace gtx::determinant - -#include "determinant.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_determinant;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_determinant__ diff --git a/experimental/sse/glm/ext/gtx/determinant.inl b/experimental/sse/glm/ext/gtx/determinant.inl deleted file mode 100644 index db1bb7be..00000000 --- a/experimental/sse/glm/ext/gtx/determinant.inl +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/determinant.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline T determinantGTX(const detail::_xmat2& m) - { - return m[0][0] * m[1][1] - m[1][0] * m[0][1]; - } - - template - inline T determinantGTX(const detail::_xmat3& m) - { - return m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - } - - template - inline T determinantGTX(const detail::_xmat4& m) - { - T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - - detail::_xvec4 DetCof( - + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); - - return m[0][0] * DetCof[0] - + m[0][1] * DetCof[1] - + m[0][2] * DetCof[2] - + m[0][3] * DetCof[3]; - } -} diff --git a/experimental/sse/glm/ext/gtx/double.h b/experimental/sse/glm/ext/gtx/double.h deleted file mode 100644 index ee142a87..00000000 --- a/experimental/sse/glm/ext/gtx/double.h +++ /dev/null @@ -1,80 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-03-20 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/double.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_quaternion -/////////////////////////////////////////////////////////////////////////////////////////////////// -// ToDo: -// - Finish to declare extension functions -// - Nothing define -// - Study extension dependencies -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Note: -// - This implementation doesn't need to redefine all build-in functions to -// support double based type. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_double__ -#define __glm_gtx_double__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/quaternion.h" - -namespace glm -{ - typedef detail::_xvec2 __fvec2GTX; //!< \brief Vector of 2 single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec3 __fvec3GTX; //!< \brief Vector of 3 single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec4 __fvec4GTX; //!< \brief Vector of 4 single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat2 __fmat2GTX; //!< \brief 2 * 2 matrix of single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat3 __fmat3GTX; //!< \brief 3 * 3 matrix of single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat4 __fmat4GTX; //!< \brief 4 * 4 matrix of single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xquat __fquatGTX; //!< \brief quaternion of single-precision floating-point numbers. (from GLM_GTX_double extension) - - typedef detail::_xvec2 __dvec2GTX; //!< \brief Vector of 2 double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec3 __dvec3GTX; //!< \brief Vector of 3 double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec4 __dvec4GTX; //!< \brief Vector of 4 double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat2 __dmat2GTX; //!< \brief 2 * 2 matrix of double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat3 __dmat3GTX; //!< \brief 3 * 3 matrix of double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat4 __dmat4GTX; //!< \brief 4 * 4 matrix of double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xquat __dquatGTX; //!< \brief quaternion of double-precision floating-point numbers. (from GLM_GTX_double extension) - - namespace gtx - { - //! GLM_GTX_double_float extension: Add support for double precision flotting-point types - namespace double_float - { - typedef detail::_xvec2 fvec2; //!< \brief Vector of 2 single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec3 fvec3; //!< \brief Vector of 3 single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec4 fvec4; //!< \brief Vector of 4 single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat2 fmat2; //!< \brief 2 * 2 matrix of single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat3 fmat3; //!< \brief 3 * 3 matrix of single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat4 fmat4; //!< \brief 4 * 4 matrix of single-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xquat fquat; //!< \brief quaternion of single-precision floating-point numbers. (from GLM_GTX_double extension) - - typedef detail::_xvec2 dvec2; //!< \brief Vector of 2 double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec3 dvec3; //!< \brief Vector of 3 double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xvec4 dvec4; //!< \brief Vector of 4 double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat2 dmat2; //!< \brief 2 * 2 matrix of double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat3 dmat3; //!< \brief 3 * 3 matrix of double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xmat4 dmat4; //!< \brief 4 * 4 matrix of double-precision floating-point numbers. (from GLM_GTX_double extension) - typedef detail::_xquat dquat; //!< \brief quaternion of double-precision floating-point numbers. (from GLM_GTX_double extension) - } - } -} - -#define GLM_GTX_double namespace gtx::double_float - -#include "double.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_double;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_double__ diff --git a/experimental/sse/glm/ext/gtx/double.inl b/experimental/sse/glm/ext/gtx/double.inl deleted file mode 100644 index 6856e51b..00000000 --- a/experimental/sse/glm/ext/gtx/double.inl +++ /dev/null @@ -1,13 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/double.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/experimental/sse/glm/ext/gtx/epsilon.h b/experimental/sse/glm/ext/gtx/epsilon.h deleted file mode 100644 index c4a824eb..00000000 --- a/experimental/sse/glm/ext/gtx/epsilon.h +++ /dev/null @@ -1,100 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/epsilon.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_double -// - GLM_GTX_half -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_epsilon__ -#define __glm_gtx_epsilon__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/double.h" -#include "../gtx/half.h" - -namespace glm -{ - template bool equalEpsilonGTX(const T x, const T y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template bool notEqualEpsilonGTX(const T x, const T y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - - template detail::_bvec2 equalEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec3 equalEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec4 equalEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec2 notEqualEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec3 notEqualEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec4 notEqualEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const T epsilon); //!< \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - - template detail::_bvec2 equalEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& epsilon); //!< \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec3 equalEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& epsilon); //!< \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec4 equalEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& epsilon); //!< \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec2 notEqualEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& epsilon); //!< \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec3 notEqualEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& epsilon); //!< \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template detail::_bvec4 notEqualEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& epsilon); //!< \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) -/* - template - class epsilonGTX - { - public: - epsilonGTX() : value(std::EPSILON){} - epsilonGTX(const T& value) : value(value){} - - private: - T value; - }; -*/ - namespace gtx - { - //! GLM_GTX_epsilon extension: Comparaison functions for a user defined epsilon values. - namespace epsilon - { - //! \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template inline bool equalEpsilon(const T x, const T y, const T epsilon){return equalEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template inline bool notEqualEpsilon(const T x, const T y, const T epsilon){return notEqualEpsilonGTX(x, y, epsilon);} - - //! \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec2 equalEpsilon(const detail::_xvec2& x, const detail::_xvec2& y, const T epsilon){return equalEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec3 equalEpsilon(const detail::_xvec3& x, const detail::_xvec3& y, const T epsilon){return equalEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec4 equalEpsilon(const detail::_xvec4& x, const detail::_xvec4& y, const T epsilon){return equalEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec2 notEqualEpsilon(const detail::_xvec2& x, const detail::_xvec2& y, const T epsilon){return notEqualEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec3 notEqualEpsilon(const detail::_xvec3& x, const detail::_xvec3& y, const T epsilon){return notEqualEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec4 notEqualEpsilon(const detail::_xvec4& x, const detail::_xvec4& y, const T epsilon){return notEqualEpsilonGTX(x, y, epsilon);} - - //! \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec2 equalEpsilon(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& epsilon){return equalEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec3 equalEpsilon(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& epsilon){return equalEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| < epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec4 equalEpsilon(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& epsilon){return equalEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec2 notEqualEpsilon(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& epsilon){return notEqualEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec3 notEqualEpsilon(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& epsilon){return notEqualEpsilonGTX(x, y, epsilon);} - //! \brief Returns the component-wise compare of |x - y| >= epsilon (from GLM_GTX_epsilon extension) - template inline detail::_bvec4 notEqualEpsilon(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& epsilon){return notEqualEpsilonGTX(x, y, epsilon);} - } - } -} - -#define GLM_GTX_epsilon namespace gtx::epsilon - -#include "epsilon.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_epsilon;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_epsilon__ diff --git a/experimental/sse/glm/ext/gtx/epsilon.inl b/experimental/sse/glm/ext/gtx/epsilon.inl deleted file mode 100644 index 856df095..00000000 --- a/experimental/sse/glm/ext/gtx/epsilon.inl +++ /dev/null @@ -1,131 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-01-16 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/epsilon.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline bool equalEpsilonGTX(T x, T y, T epsilon) - { - return abs(x - y) < epsilon; - } - - template - inline bool notEqualEpsilonGTX(T x, T y, T epsilon) - { - return abs(x - y) >= epsilon; - } - - template - inline detail::_bvec2 equalEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const T epsilon) - { - return detail::_bvec2( - abs(x.x - y.x) < epsilon, - abs(y.y - y.y) < epsilon); - } - - template - inline detail::_bvec3 equalEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const T epsilon) - { - return detail::_bvec3( - abs(x.x - y.x) < epsilon, - abs(y.y - y.y) < epsilon, - abs(y.z - y.z) < epsilon); - } - - template - inline detail::_bvec4 equalEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const T epsilon) - { - return detail::_bvec4( - abs(x.x - y.x) < epsilon, - abs(y.y - y.y) < epsilon, - abs(y.z - y.z) < epsilon, - abs(y.w - y.w) < epsilon); - } - - template - inline detail::_bvec2 notEqualEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const T epsilon) - { - return detail::_bvec2( - abs(x.x - y.x) >= epsilon, - abs(y.y - y.y) >= epsilon); - } - - template - inline detail::_bvec3 notEqualEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const T epsilon) - { - return detail::_bvec3( - abs(x.x - y.x) >= epsilon, - abs(y.y - y.y) >= epsilon, - abs(y.z - y.z) >= epsilon); - } - - template - inline detail::_bvec4 notEqualEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const T epsilon) - { - return detail::_bvec4( - abs(x.x - y.x) >= epsilon, - abs(y.y - y.y) >= epsilon, - abs(y.z - y.z) >= epsilon, - abs(y.w - y.w) >= epsilon); - } - - template - inline detail::_bvec2 equalEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& epsilon) - { - return detail::_bvec2( - abs(x.x - y.x) < epsilon.x, - abs(y.y - y.y) < epsilon.y); - } - - template - inline detail::_bvec3 equalEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& epsilon) - { - return detail::_bvec3( - abs(x.x - y.x) < epsilon.x, - abs(y.y - y.y) < epsilon.y, - abs(y.z - y.z) < epsilon.z); - } - - template - inline detail::_bvec4 equalEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& epsilon) - { - return detail::_bvec4( - abs(x.x - y.x) < epsilon.x, - abs(y.y - y.y) < epsilon.y, - abs(y.z - y.z) < epsilon.z, - abs(y.w - y.w) < epsilon.w); - } - - template - inline detail::_bvec2 notEqualEpsilonGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& epsilon) - { - return detail::_bvec2( - abs(x.x - y.x) >= epsilon.x, - abs(y.y - y.y) >= epsilon.y); - } - - template - inline detail::_bvec3 notEqualEpsilonGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& epsilon) - { - return detail::_bvec3( - abs(x.x - y.x) >= epsilon.x, - abs(y.y - y.y) >= epsilon.y, - abs(y.z - y.z) >= epsilon.z); - } - - template - inline detail::_bvec4 notEqualEpsilonGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& epsilon) - { - return detail::_bvec4( - abs(x.x - y.x) >= epsilon.x, - abs(y.y - y.y) >= epsilon.y, - abs(y.z - y.z) >= epsilon.z, - abs(y.w - y.w) >= epsilon.w); - } -} diff --git a/experimental/sse/glm/ext/gtx/euler_angles.h b/experimental/sse/glm/ext/gtx/euler_angles.h deleted file mode 100644 index b564b192..00000000 --- a/experimental/sse/glm/ext/gtx/euler_angles.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2007-08-14 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/euler_angles.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_double -// - GLM_GTX_half -/////////////////////////////////////////////////////////////////////////////////////////////////// -// ToDo: -// - mat2 mat2GTX(const vec2& angles) undefined -// - mat3 mat3GTX(const vec2& angles) undefined -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_euler_angles__ -#define __glm_gtx_euler_angles__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/double.h" - -namespace glm -{ - template detail::_xmat2 orientate2GTX(const T angle); //!< \brief Creates a 2 * 2 rotation matrix from angle (from GLM_GTX_euler_angles extension) - template detail::_xmat3 orientate3GTX(const T angle); //!< \brief Creates a 3 * 3 rotation matrix from angle (from GLM_GTX_euler_angles extension) - template detail::_xmat3 orientate3GTX(const detail::_xvec3& angles); //!< \brief Creates a 3 * 3 rotation matrix from angles (from GLM_GTX_euler_angles extension) - template detail::_xmat4 orientate4GTX(const detail::_xvec3& angles); //!< \brief Creates a 4 * 4 rotation matrix from angles (from GLM_GTX_euler_angles extension) - - namespace gtx - { - //! GLM_GTX_euler_angles extension: Build matrices from euler angles. - namespace euler_angles - { - template inline detail::_xmat2 orientate2(const T angle){return orientate2GTX(angle);} //!< \brief Creates a 2 * 2 rotation matrix from angle (from GLM_GTX_euler_angles extension) - template inline detail::_xmat3 orientate3(const T angle){return orientate3GTX(angle);} //!< \brief Creates a 3 * 3 rotation matrix from angle (from GLM_GTX_euler_angles extension) - template inline detail::_xmat3 orientate3(const detail::_xvec3& angles){return orientate3GTX(angles);} //!< \brief Creates a 3 * 3 rotation matrix from angles (from GLM_GTX_euler_angles extension) - template inline detail::_xmat4 orientate4(const detail::_xvec3& angles){return orientate4GTX(angles);} //!< \brief Creates a 4 * 4 rotation matrix from angles (from GLM_GTX_euler_angles extension) - } - } -} - -#define GLM_GTX_euler_angles namespace gtx::euler_angles - -#include "euler_angles.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_euler_angles;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_euler_angles__ diff --git a/experimental/sse/glm/ext/gtx/euler_angles.inl b/experimental/sse/glm/ext/gtx/euler_angles.inl deleted file mode 100644 index d260d765..00000000 --- a/experimental/sse/glm/ext/gtx/euler_angles.inl +++ /dev/null @@ -1,97 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2007-08-14 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/euler_angles.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat2 orientate2GTX(const T angle) - { - T c = cos(angle); - T s = sin(angle); - - detail::_xmat2 Result; - Result[0][0] = c; - Result[0][1] = s; - Result[1][0] = -s; - Result[1][1] = c; - return Result; - } - - template - inline detail::_xmat3 orientate3GTX(const T angle) - { - T c = cos(angle); - T s = sin(angle); - - detail::_xmat3 Result; - Result[0][0] = c; - Result[0][1] = s; - Result[0][2] = 0.0f; - Result[1][0] = -s; - Result[1][1] = c; - Result[1][2] = 0.0f; - Result[2][0] = 0.0f; - Result[2][1] = 0.0f; - Result[2][2] = 1.0f; - return Result; - } - - template - inline detail::_xmat3 orientate3GTX(const detail::_xvec3& angles) - { - T tmp_ch = cos(angles.x); - T tmp_sh = sin(angles.x); - T tmp_cp = cos(angles.y); - T tmp_sp = sin(angles.y); - T tmp_cb = cos(angles.z); - T tmp_sb = sin(angles.z); - - detail::_xmat3 Result; - Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; - Result[0][1] = tmp_sb * tmp_cp; - Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; - Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; - Result[1][1] = tmp_cb * tmp_cp; - Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; - Result[2][0] = tmp_sh * tmp_cp; - Result[2][1] = -tmp_sp; - Result[2][2] = tmp_ch * tmp_cp; - return Result; - } - - template - inline detail::_xmat4 orientate4GTX(const detail::_xvec3& angles) - { - T tmp_ch = cos(angles.x); - T tmp_sh = sin(angles.x); - T tmp_cp = cos(angles.y); - T tmp_sp = sin(angles.y); - T tmp_cb = cos(angles.z); - T tmp_sb = sin(angles.z); - - detail::_xmat4 Result; - Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; - Result[0][1] = tmp_sb * tmp_cp; - Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; - Result[0][3] = T(0); - Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; - Result[1][1] = tmp_cb * tmp_cp; - Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; - Result[1][3] = T(0); - Result[2][0] = tmp_sh * tmp_cp; - Result[2][1] = -tmp_sp; - Result[2][2] = tmp_ch * tmp_cp; - Result[2][3] = T(0); - Result[3][0] = T(0); - Result[3][1] = T(0); - Result[3][2] = T(0); - Result[3][3] = T(1); - return Result; - } -} diff --git a/experimental/sse/glm/ext/gtx/extend.h b/experimental/sse/glm/ext/gtx/extend.h deleted file mode 100644 index 0ccba557..00000000 --- a/experimental/sse/glm/ext/gtx/extend.h +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-07 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/extend.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_extend__ -#define __glm_gtx_extend__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template genType extendGTX(const genType& Origin, const genType& Source, const T Length); //!< \brief Extends of Length the Origin position using the (Source - Origin) direction (from GLM_GTX_extend extension) - - namespace gtx - { - //! GLM_GTX_extend extension: Extend a position from a source to a position at a defined length. - namespace extend - { - template inline genType extend(const genType& Origin, const genType& Source, const T Length){return extendGTX(Origin, Source, Length);} //!< \brief Extends of Length the Origin position using the (Source - Origin) direction (from GLM_GTX_extend extension) - } - } -} - -#define GLM_GTX_extend namespace gtx::extend - -#include "extend.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_extend;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_extend__ diff --git a/experimental/sse/glm/ext/gtx/extend.inl b/experimental/sse/glm/ext/gtx/extend.inl deleted file mode 100644 index f6da5d5d..00000000 --- a/experimental/sse/glm/ext/gtx/extend.inl +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-07 -// Updated : 2006-01-07 -// Licence : This source is under GNU LGPL licence -// File : gtx_extend.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM version 1.0 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - T extendGTX(const T Origin, const T Source, const T Distance) - { - return Origin + (Source - Origin) * Distance; - } - - template - detail::_xvec2 extendGTX(const detail::_xvec2& Origin, const detail::_xvec2& Source, const T Distance) - { - return Origin + (Source - Origin) * Distance; - } - - template - detail::_xvec3 extendGTX(const detail::_xvec3& Origin, const detail::_xvec3& Source, const T Distance) - { - return Origin + (Source - Origin) * Distance; - } - - template - detail::_xvec4 extendGTX(const detail::_xvec4& Origin, const detail::_xvec4& Source, const T Distance) - { - return Origin + (Source - Origin) * Distance; - } -} diff --git a/experimental/sse/glm/ext/gtx/extented_min_max.h b/experimental/sse/glm/ext/gtx/extented_min_max.h deleted file mode 100644 index 14b83524..00000000 --- a/experimental/sse/glm/ext/gtx/extented_min_max.h +++ /dev/null @@ -1,105 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-14 -// Updated : 2007-08-14 -// Licence : This source is under GNU LGPL licence -// File : gtx_extented_min_max.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_half -// - GLM_GTX_double -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_extented_min_max__ -#define __glm_gtx_extented_min_max__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/half.h" -#include "../gtx/double.h" - -namespace glm -{ - template detail::_xvec2 minGTX(const detail::_xvec2& x, const T y, const T z); //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 minGTX(const detail::_xvec3& x, const T y, const T z); //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 minGTX(const detail::_xvec4& x, const T y, const T z); //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template detail::_xvec2 minGTX(const detail::_xvec2& x, const T y, const T z, const T w); //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 minGTX(const detail::_xvec3& x, const T y, const T z, const T w); //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 minGTX(const detail::_xvec4& x, const T y, const T z, const T w); //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - - template detail::_xvec2 minGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z); //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 minGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z); //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 minGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z); //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template detail::_xvec2 minGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z, const detail::_xvec2& w); //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 minGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z, const detail::_xvec3& w); //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 minGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z, const detail::_xvec4& w); //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - - template detail::_xvec2 maxGTX(const detail::_xvec2& x, const T y, const T z); //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 maxGTX(const detail::_xvec3& x, const T y, const T z); //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 maxGTX(const detail::_xvec4& x, const T y, const T z); //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template detail::_xvec2 maxGTX(const detail::_xvec2& x, const T y, const T z, const T w); //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 maxGTX(const detail::_xvec3& x, const T y, const T z, const T w); //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 maxGTX(const detail::_xvec4& x, const T y, const T z, const T w); //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - - template detail::_xvec2 maxGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z); //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 maxGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z); //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 maxGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z); //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template detail::_xvec2 maxGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z, const detail::_xvec2& w); //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec3 maxGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z, const detail::_xvec3& w); //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template detail::_xvec4 maxGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z, const detail::_xvec4& w); //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - - namespace gtx - { - //! GLM_GTX_extented_min_max extension: Min and max functions for 3 to 4 parameters. - namespace extented_min_max - { - template inline detail::_xvec2 min(const detail::_xvec2& x, const T y, const T z){return minGTX(x, y, z);} //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 min(const detail::_xvec3& x, const T y, const T z){return minGTX(x, y, z);} //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 min(const detail::_xvec4& x, const T y, const T z){return minGTX(x, y, z);} //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template inline detail::_xvec2 min(const detail::_xvec2& x, const T y, const T z, const T w){return minGTX(x, y, z, w);} //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 min(const detail::_xvec3& x, const T y, const T z, const T w){return minGTX(x, y, z, w);} //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 min(const detail::_xvec4& x, const T y, const T z, const T w){return minGTX(x, y, z, w);} //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - - template inline detail::_xvec2 min(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z){return minGTX(x, y, z);} //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 min(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z){return minGTX(x, y, z);} //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 min(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z){return minGTX(x, y, z);} //!< Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template inline detail::_xvec2 min(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z, const detail::_xvec2& w){return minGTX(x, y, z, w);} //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 min(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z, const detail::_xvec3& w){return minGTX(x, y, z, w);} //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 min(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z, const detail::_xvec4& w){return minGTX(x, y, z, w);} //!< Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - - template inline detail::_xvec2 max(const detail::_xvec2& x, const T y, const T z){return maxGTX(x, y, z);} //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 max(const detail::_xvec3& x, const T y, const T z){return maxGTX(x, y, z);} //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 max(const detail::_xvec4& x, const T y, const T z){return maxGTX(x, y, z);} //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template inline detail::_xvec2 max(const detail::_xvec2& x, const T y, const T z, const T w){return maxGTX(x, y, z, w);} //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 max(const detail::_xvec3& x, const T y, const T z, const T w){return maxGTX(x, y, z, w);} //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 max(const detail::_xvec4& x, const T y, const T z, const T w){return maxGTX(x, y, z, w);} //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - - template inline detail::_xvec2 max(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z){return maxGTX(x, y, z);} //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 max(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z){return maxGTX(x, y, z);} //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 max(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z){return maxGTX(x, y, z);} //!< Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension) - - template inline detail::_xvec2 max(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z, const detail::_xvec2& w){return maxGTX(x, y, z, w);} //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec3 max(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z, const detail::_xvec3& w){return maxGTX(x, y, z, w);} //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - template inline detail::_xvec4 max(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z, const detail::_xvec4& w){return maxGTX(x, y, z, w);} //!< Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension) - } - } -} - -#define GLM_GTX_extented_min_max namespace gtx::extented_min_max - -#include "extented_min_max.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_extented_min_max;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_extented_min_max__ diff --git a/experimental/sse/glm/ext/gtx/extented_min_max.inl b/experimental/sse/glm/ext/gtx/extented_min_max.inl deleted file mode 100644 index 14c3e2ac..00000000 --- a/experimental/sse/glm/ext/gtx/extented_min_max.inl +++ /dev/null @@ -1,155 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-14 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : gtx_extented_min_max.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xvec2 minGTX(const detail::_xvec2& x, const T y, const T z) - { - return min(x, min(y, z)); - } - - template - inline detail::_xvec3 minGTX(const detail::_xvec3& x, const T y, const T z) - { - return min(x, min(y, z)); - } - - template - inline detail::_xvec4 minGTX(const detail::_xvec4& x, const T y, const T z) - { - return min(x, min(y, z)); - } - - template - inline detail::_xvec2 minGTX(const detail::_xvec2& x, const T y, const T z, const T w) - { - return min(x, min(y, min(z, w))); - } - - template - inline detail::_xvec3 minGTX(const detail::_xvec3& x, const T y, const T z, const T w) - { - return min(x, min(y, min(z, w))); - } - - template - inline detail::_xvec4 minGTX(const detail::_xvec4& x, const T y, const T z, const T w) - { - return min(x, min(y, min(z, w))); - } - - template - inline detail::_xvec2 minGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z) - { - return min(x, min(y, z)); - } - - template - inline detail::_xvec3 minGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z) - { - return min(x, min(y, z)); - } - - template - inline detail::_xvec4 minGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z) - { - return min(x, min(y, z)); - } - - template - inline detail::_xvec2 minGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z, const detail::_xvec2& w) - { - return min(min(x, y), min(z, w)); - } - - template - inline detail::_xvec3 minGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z, const detail::_xvec3& w) - { - return min(min(x, y), min(z, w)); - } - - template - inline detail::_xvec4 minGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z, const detail::_xvec4& w) - { - return min(min(x, y), min(z, w)); - } - - template - inline detail::_xvec2 maxGTX(const detail::_xvec2& x, const T y, const T z) - { - return max(x, max(y, z)); - } - - template - inline detail::_xvec3 maxGTX(const detail::_xvec3& x, const T y, const T z) - { - return max(x, max(y, z)); - } - - template - inline detail::_xvec4 maxGTX(const detail::_xvec4& x, const T y, const T z) - { - return max(x, max(y, z)); - } - - template - inline detail::_xvec2 maxGTX(const detail::_xvec2& x, const T y, const T z, const T w) - { - return max(max(x, y), max(z, w)); - } - - template - inline detail::_xvec3 maxGTX(const detail::_xvec3& x, const T y, const T z, const T w) - { - return max(max(x, y), max(z, w)); - } - - template - inline detail::_xvec4 maxGTX(const detail::_xvec4& x, const T y, const T z, const T w) - { - return max(max(x, y), max(z, w)); - } - - template - inline detail::_xvec2 maxGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z) - { - return max(max(x, y), z); - } - - template - inline detail::_xvec3 maxGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z) - { - return max(max(x, y), z); - } - - template - inline detail::_xvec4 maxGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z) - { - return max(max(x, y), z); - } - - template - inline detail::_xvec2 maxGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& z, const detail::_xvec2& w) - { - return max(max(x, y), max(z, w)); - } - - template - inline detail::_xvec3 maxGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& z, const detail::_xvec3& w) - { - return max(max(x, y), max(z, w)); - } - - template - inline detail::_xvec4 maxGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& z, const detail::_xvec4& w) - { - return max(max(x, y), max(z, w)); - } -} diff --git a/experimental/sse/glm/ext/gtx/fast_exponential.h b/experimental/sse/glm/ext/gtx/fast_exponential.h deleted file mode 100644 index c273e137..00000000 --- a/experimental/sse/glm/ext/gtx/fast_exponential.h +++ /dev/null @@ -1,84 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-09 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/fast_exponential.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_half -// - GLM_GTX_double -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_fast_exponential__ -#define __glm_gtx_fast_exponential__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/half.h" -#include "../gtx/double.h" - -namespace glm -{ - template T fastPowGTX(const T x, const T y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec2 fastPowGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec3 fastPowGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec4 fastPowGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - - template T fastPowGTX(const T x, int y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec2 fastPowGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec3 fastPowGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec4 fastPowGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - - template T fastExpGTX(const T x); //!< Faster than the common exp function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec2 fastExpGTX(const detail::_xvec2& x); //!< Faster than the common exp function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec3 fastExpGTX(const detail::_xvec3& x); //!< Faster than the common exp function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec4 fastExpGTX(const detail::_xvec4& x); //!< Faster than the common exp function but less accurate (From GLM_GTX_fast_exponential extension) - - template T fastLogGTX(const T x); //!< Faster than the common log function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec2 fastLogGTX(const detail::_xvec2& x); //!< Faster than the common log function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec3 fastLogGTX(const detail::_xvec3& x); //!< Faster than the common log function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec4 fastLogGTX(const detail::_xvec4& x); //!< Faster than the common log function but less accurate (From GLM_GTX_fast_exponential extension) - - template T fastExp2GTX(const T x); //!< Faster than the common exp2 function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec2 fastExp2GTX(const detail::_xvec2& x); //!< Faster than the common exp2 function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec3 fastExp2GTX(const detail::_xvec3& x); //!< Faster than the common exp2 function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec4 fastExp2GTX(const detail::_xvec4& x); //!< Faster than the common exp2 function but less accurate (From GLM_GTX_fast_exponential extension) - - template T fastLog2GTX(const T x); //!< Faster than the common log2 function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec2 fastLog2GTX(const detail::_xvec2& x); //!< Faster than the common log2 function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec3 fastLog2GTX(const detail::_xvec3& x); //!< Faster than the common log2 function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec4 fastLog2GTX(const detail::_xvec4& x); //!< Faster than the common log2 function but less accurate (From GLM_GTX_fast_exponential extension) - - template T fastLnGTX(const T x); //!< Faster than the common ln function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec2 fastLnGTX(const detail::_xvec2& x); //!< Faster than the common ln function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec3 fastLnGTX(const detail::_xvec3& x); //!< Faster than the common ln function but less accurate (From GLM_GTX_fast_exponential extension) - template detail::_xvec4 fastLnGTX(const detail::_xvec4& x); //!< Faster than the common ln function but less accurate (From GLM_GTX_fast_exponential extension) - - namespace gtx - { - //! GLM_GTX_fast_exponential extension: Fast but less accurate implementations of exponential based functions. - namespace fast_exponential - { - template inline T fastPow(const T& x, const T& y){return fastPowGTX(x, y);} //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template inline T fastPow(const T& x, const U& y){return fastPowGTX(x, y);} //!< Faster than the common pow function but less accurate (From GLM_GTX_fast_exponential extension) - template inline T fastExp(const T& x){return fastExpGTX(x);} //!< Faster than the common exp function but less accurate (From GLM_GTX_fast_exponential extension) - template inline T fastLog(const T& x){return fastLogGTX(x);} //!< Faster than the common log function but less accurate (From GLM_GTX_fast_exponential extension) - template inline T fastExp2(const T& x){return fastExp2GTX(x);} //!< Faster than the common exp2 function but less accurate (From GLM_GTX_fast_exponential extension) - template inline T fastLog2(const T& x){return fastLog2GTX(x);} //!< Faster than the common log2 function but less accurate (From GLM_GTX_fast_exponential extension) - template inline T fastLn(const T& x){return fastLnGTX(x);} //!< Faster than the common ln function but less accurate (From GLM_GTX_fast_exponential extension) - } - } -} - -#define GLM_GTX_fast_exponential namespace gtx::fast_exponential - -#include "fast_exponential.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_fast_exponential;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_fast_exponential__ diff --git a/experimental/sse/glm/ext/gtx/fast_exponential.inl b/experimental/sse/glm/ext/gtx/fast_exponential.inl deleted file mode 100644 index c13248de..00000000 --- a/experimental/sse/glm/ext/gtx/fast_exponential.inl +++ /dev/null @@ -1,265 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-09 -// Updated : 2006-01-09 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/fast_exponential.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // fastPowGTX: - template - inline T fastPowGTX(const T x, const T y) - { - return exp(y * log(x)); - } - - template - inline detail::_xvec2 fastPowGTX(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - fastPowGTX(x.x, y.x), - fastPowGTX(x.y, y.y)); - } - - template - inline detail::_xvec3 fastPowGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - fastPowGTX(x.x, y.x), - fastPowGTX(x.y, y.y), - fastPowGTX(x.z, y.z)); - } - - template - inline detail::_xvec4 fastPowGTX(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - fastPowGTX(x.x, y.x), - fastPowGTX(x.y, y.y), - fastPowGTX(x.z, y.z), - fastPowGTX(x.w, y.w)); - } - - template - inline T fastPowGTX(const T x, int y) - { - T f = T(1); - for(int i = 0; i < y; ++i) - f *= x; - return f; - } - - template - inline detail::_xvec2 fastPowGTX(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - fastPowGTX(x.x, y.x), - fastPowGTX(x.y, y.y)); - } - - template - inline detail::_xvec3 fastPowGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - fastPowGTX(x.x, y.x), - fastPowGTX(x.y, y.y), - fastPowGTX(x.z, y.z)); - } - - template - inline detail::_xvec4 fastPowGTX(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - fastPowGTX(x.x, y.x), - fastPowGTX(x.y, y.y), - fastPowGTX(x.z, y.z), - fastPowGTX(x.w, y.w)); - } - - // fastExpGTX - // Note: This function provides accurate results only for value between -1 and 1, else avoid it. - template - inline T fastExpGTX(const T x) - { - // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. - // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); - T x2 = x * x; - T x3 = x2 * x; - T x4 = x3 * x; - T x5 = x4 * x; - return T(1) + x + (x2 * T(0.5)) + (x3 * T(0.1666666667)) + (x4 * T(0.041666667)) + (x5 * T(0.008333333333)); - } -/* // Try to handle all values of float... but often shower than std::exp, glm::floor and the loop kill the performance - inline float fastExpGTX(float x) - { - const float e = 2.718281828f; - const float IntegerPart = floor(x); - const float FloatPart = x - IntegerPart; - float z = 1.f; - - for(int i = 0; i < int(IntegerPart); ++i) - z *= e; - - const float x2 = FloatPart * FloatPart; - const float x3 = x2 * FloatPart; - const float x4 = x3 * FloatPart; - const float x5 = x4 * FloatPart; - return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); - } - - // Increase accuracy on number bigger that 1 and smaller than -1 but it's not enough for high and negative numbers - inline float fastExpGTX(float x) - { - // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. - // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); - float x2 = x * x; - float x3 = x2 * x; - float x4 = x3 * x; - float x5 = x4 * x; - float x6 = x5 * x; - float x7 = x6 * x; - float x8 = x7 * x; - return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)+ (x6 * 0.00138888888888f) + (x7 * 0.000198412698f) + (x8 * 0.0000248015873f);; - } -*/ - template - inline detail::_xvec2 fastExpGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastExpGTX(x.x), - fastExpGTX(x.y)); - } - - template - inline detail::_xvec3 fastExpGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastExpGTX(x.x), - fastExpGTX(x.y), - fastExpGTX(x.z)); - } - - template - inline detail::_xvec4 fastExpGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastExpGTX(x.x), - fastExpGTX(x.y), - fastExpGTX(x.z), - fastExpGTX(x.w)); - } - - // fastLogGTX - template - inline T fastLogGTX(const T x) - { - return std::log(x); - } - - /* Slower than the VC7.1 function... - inline float fastLogGTX(float x) - { - float y1 = (x - 1.0f) / (x + 1.0f); - float y2 = y1 * y1; - return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f))); - } - */ - - template - inline detail::_xvec2 fastLogGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastLnGTX(x.x), - fastLnGTX(x.y)); - } - - template - inline detail::_xvec3 fastLogGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastLnGTX(x.x), - fastLnGTX(x.y), - fastLnGTX(x.z)); - } - - template - inline detail::_xvec4 fastLogGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastLnGTX(x.x), - fastLnGTX(x.y), - fastLnGTX(x.z), - fastLnGTX(x.w)); - } - - //fastExp2GTX, ln2 = 0.69314718055994530941723212145818f - template - inline T fastExp2GTX(const T x) - { - return fastExpGTX(0.69314718055994530941723212145818f * x); - } - - template - inline detail::_xvec2 fastExp2GTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastExp2GTX(x.x), - fastExp2GTX(x.y)); - } - - template - inline detail::_xvec3 fastExp2GTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastExp2GTX(x.x), - fastExp2GTX(x.y), - fastExp2GTX(x.z)); - } - - template - inline detail::_xvec4 fastExp2GTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastExp2GTX(x.x), - fastExp2GTX(x.y), - fastExp2GTX(x.z), - fastExp2GTX(x.w)); - } - - // fastLog2GTX, ln2 = 0.69314718055994530941723212145818f - template - inline T fastLog2GTX(const T x) - { - return fastLogGTX(x) / 0.69314718055994530941723212145818f; - } - - template - inline detail::_xvec2 fastLog2GTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastLog2GTX(x.x), - fastLog2GTX(x.y)); - } - - template - inline detail::_xvec3 fastLog2GTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastLog2GTX(x.x), - fastLog2GTX(x.y), - fastLog2GTX(x.z)); - } - - template - inline detail::_xvec4 fastLog2GTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastLog2GTX(x.x), - fastLog2GTX(x.y), - fastLog2GTX(x.z), - fastLog2GTX(x.w)); - } -} diff --git a/experimental/sse/glm/ext/gtx/fast_square_root.h b/experimental/sse/glm/ext/gtx/fast_square_root.h deleted file mode 100644 index 3f3d3cf7..00000000 --- a/experimental/sse/glm/ext/gtx/fast_square_root.h +++ /dev/null @@ -1,72 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-04 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/fast_square_root.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Note: -// - Sqrt optimisation based on Newton's method, -// www.gamedev.net/community/forums/topic.asp?topic id=139956 -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_fast_square_root__ -#define __glm_gtx_fast_square_root__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template T fastSqrtGTX(const T x); //!< Faster than the common sqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec2 fastSqrtGTX(const detail::_xvec2& x); //!< Faster than the common sqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec3 fastSqrtGTX(const detail::_xvec3& x); //!< Faster than the common sqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec4 fastSqrtGTX(const detail::_xvec4& x); //!< Faster than the common sqrt function but less accurate (From GLM_GTX_fast_square_root extension) - - template T fastInverseSqrtGTX(const T x); //!< Faster than the common inversesqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec2 fastInverseSqrtGTX(const detail::_xvec2& x); //!< Faster than the common inversesqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec3 fastInverseSqrtGTX(const detail::_xvec3& x); //!< Faster than the common inversesqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec4 fastInverseSqrtGTX(const detail::_xvec4& x); //!< Faster than the common inversesqrt function but less accurate (From GLM_GTX_fast_square_root extension) - - template T fastLengthGTX(const T x); //!< Faster than the common length function but less accurate (From GLM_GTX_fast_square_root extension) - template T fastLengthGTX(const detail::_xvec2& x); //!< Faster than the common length function but less accurate (From GLM_GTX_fast_square_root extension) - template T fastLengthGTX(const detail::_xvec3& x); //!< Faster than the common length function but less accurate (From GLM_GTX_fast_square_root extension) - template T fastLengthGTX(const detail::_xvec4& x); //!< Faster than the common length function but less accurate (From GLM_GTX_fast_square_root extension) - - template T fastDistanceGTX(const T x, const T y); //!< Faster than the common distance function but less accurate (From GLM_GTX_fast_square_root extension) - template T fastDistanceGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< Faster than the common distance function but less accurate (From GLM_GTX_fast_square_root extension) - template T fastDistanceGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< Faster than the common distance function but less accurate (From GLM_GTX_fast_square_root extension) - template T fastDistanceGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< Faster than the common distance function but less accurate (From GLM_GTX_fast_square_root extension) - - template T fastNormalizeGTX(const T x); //!< Faster than the common normalize function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec2 fastNormalizeGTX(const detail::_xvec2& x); //!< Faster than the common normalize function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec3 fastNormalizeGTX(const detail::_xvec3& x); //!< Faster than the common normalize function but less accurate (From GLM_GTX_fast_square_root extension) - template detail::_xvec4 fastNormalizeGTX(const detail::_xvec4& x); //!< Faster than the common normalize function but less accurate (From GLM_GTX_fast_square_root extension) - - namespace gtx - { - //! GLM_GTX_fast_square_root extension: Fast but less accurate implementations of square root based functions. - namespace fast_square_root - { - template inline T fastSqrt(const T& x){return fastSqrtGTX(x);} //!< Faster than the common sqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template inline T fastInverseSqrt(const T& x){return fastInverseSqrtGTX(x);} //!< Faster than the common inversesqrt function but less accurate (From GLM_GTX_fast_square_root extension) - template inline T fastLength(const T& x){return fastLengthGTX(x);} //!< Faster than the common length function but less accurate (From GLM_GTX_fast_square_root extension) - template inline T fastDistance(const T& x, const T& y){return fastDistanceGTX(x, y);} //!< Faster than the common distance function but less accurate (From GLM_GTX_fast_square_root extension) - template inline T fastNormalize(const T& x){return fastNormalizeGTX(x);} //!< Faster than the common normalize function but less accurate (From GLM_GTX_fast_square_root extension) - } - } -} - -#define GLM_GTX_fast_square_root namespace gtx::fast_square_root - -#include "fast_square_root.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_fast_square_root;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_fast_square_root__ diff --git a/experimental/sse/glm/ext/gtx/fast_square_root.inl b/experimental/sse/glm/ext/gtx/fast_square_root.inl deleted file mode 100644 index 57a0bcb0..00000000 --- a/experimental/sse/glm/ext/gtx/fast_square_root.inl +++ /dev/null @@ -1,165 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-04 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/fast_square_root.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // fastSqrtGTX - template - inline T fastSqrtGTX(const T x) - { - return 1.0f / fastInverseSqrtGTX(x); - } - - template - inline detail::_xvec2 fastSqrtGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastSqrtGTX(x.x), - fastSqrtGTX(x.y)); - } - - template - inline detail::_xvec3 fastSqrtGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastSqrtGTX(x.x), - fastSqrtGTX(x.y), - fastSqrtGTX(x.z)); - } - - template - inline detail::_xvec4 fastSqrtGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastSqrtGTX(x.x), - fastSqrtGTX(x.y), - fastSqrtGTX(x.z), - fastSqrtGTX(x.w)); - } - - // fastInversesqrtGTX - template - inline T fastInverseSqrtGTX(const T x) - { - float xhalf = 0.5f * x; - int i = *(int*)&x; - i = 0x5f375a86 - (i >> 1); - x = *(float*)&i; - x = x * (1.5f - xhalf * x * x); - return T(x); - } - - template - inline detail::_xvec2 fastInverseSqrtGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastInverseSqrtGTX(x.x), - fastInverseSqrtGTX(x.y)); - } - - template - inline detail::_xvec3 fastInverseSqrtGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastInverseSqrtGTX(x.x), - fastInverseSqrtGTX(x.y), - fastInverseSqrtGTX(x.z)); - } - - template - inline detail::_xvec4 fastInverseSqrtGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastInverseSqrtGTX(x.x), - fastInverseSqrtGTX(x.y), - fastInverseSqrtGTX(x.z), - fastInverseSqrtGTX(x.w)); - } - - // fastLengthGTX - template - inline T fastLengthGTX(const T x) - { - return abs(x); - } - - template - inline T fastLengthGTX(const detail::_xvec2& x) - { - T sqr = x.x * x.x + x.y * x.y; - return fastSqrtGTX(sqr); - } - - template - inline T fastLengthGTX(const detail::_xvec3& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z; - return fastSqrtGTX(sqr); - } - - template - inline T fastLengthGTX(const detail::_xvec4& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; - return fastSqrtGTX(sqr); - } - - // fastDistanceGTX - template - inline T fastDistanceGTX(const T x, const T y) - { - return fastLengthGTX(y - x); - } - - template - inline T fastDistanceGTX(const detail::_xvec2& x, const detail::_xvec2& y) - { - return fastLengthGTX(y - x); - } - - template - inline T fastDistanceGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return fastLengthGTX(y - x); - } - - template - inline T fastDistanceGTX(const detail::_xvec4& x, const detail::_xvec4& y) - { - return fastLengthGTX(y - x); - } - - // fastNormalizeGTX - template - inline T fastNormalizeGTX(const T x) - { - return x > 0.0f ? 1.0f : -1.0f; - } - - template - inline detail::_xvec2 fastNormalizeGTX(const detail::_xvec2& x) - { - T sqr = x.x * x.x + x.y * x.y; - return x * fastInverseSqrtGTX(sqr); - } - - template - inline detail::_xvec3 fastNormalizeGTX(const detail::_xvec3& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z; - return x * fastInverseSqrtGTX(sqr); - } - - template - inline detail::_xvec4 fastNormalizeGTX(const detail::_xvec4& x) - { - T sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; - return x * fastInverseSqrtGTX(sqr); - } -} diff --git a/experimental/sse/glm/ext/gtx/fast_trigonometry.h b/experimental/sse/glm/ext/gtx/fast_trigonometry.h deleted file mode 100644 index a4e0cc0a..00000000 --- a/experimental/sse/glm/ext/gtx/fast_trigonometry.h +++ /dev/null @@ -1,80 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-08 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/fast_trigonometry.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_fast_trigonometry__ -#define __glm_gtx_fast_trigonometry__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template T fastSinGTX(const T angle); //!< Faster than the common sin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec2 fastSinGTX(const detail::_xvec2& angle); //!< Faster than the common sin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec3 fastSinGTX(const detail::_xvec3& angle); //!< Faster than the common sin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec4 fastSinGTX(const detail::_xvec4& angle); //!< Faster than the common sin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - - template T fastCosGTX(const T angle); //!< Faster than the common cos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec2 fastCosGTX(const detail::_xvec2& angle); //!< Faster than the common cos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec3 fastCosGTX(const detail::_xvec3& angle); //!< Faster than the common cos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec4 fastCosGTX(const detail::_xvec4& angle); //!< Faster than the common cos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - - template T fastTanGTX(const T angle); //!< Faster than the common tan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec2 fastTanGTX(const detail::_xvec2& angle); //!< Faster than the common tan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec3 fastTanGTX(const detail::_xvec3& angle); //!< Faster than the common tan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec4 fastTanGTX(const detail::_xvec4& angle); //!< Faster than the common tan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - - template T fastAsinGTX(const T x); //!< Faster than the common asin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec2 fastAsinGTX(const detail::_xvec2& x); //!< Faster than the common asin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec3 fastAsinGTX(const detail::_xvec3& x); //!< Faster than the common asin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec4 fastAsinGTX(const detail::_xvec4& x); //!< Faster than the common asin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - - template T fastAcosGTX(const T x); //!< Faster than the common acos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec2 fastAcosGTX(const detail::_xvec2& x); //!< Faster than the common acos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec3 fastAcosGTX(const detail::_xvec3& x); //!< Faster than the common acos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec4 fastAcosGTX(const detail::_xvec4& x); //!< Faster than the common acos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - - template T fastAtanGTX(const T y, const T x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec2 fastAtanGTX(const detail::_xvec2& y, const detail::_xvec2& x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec3 fastAtanGTX(const detail::_xvec3& y, const detail::_xvec3& x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec4 fastAtanGTX(const detail::_xvec4& y, const detail::_xvec4& x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - - template T fastAtanGTX(const T y_over_x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec2 fastAtanGTX(const detail::_xvec2& y_over_x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec3 fastAtanGTX(const detail::_xvec3& y_over_x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template detail::_xvec4 fastAtanGTX(const detail::_xvec4& y_over_x); //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - - namespace gtx - { - //! GLM_GTX_fast_trigonometry extension: Fast but less accurate implementations of trigonometric functions. - namespace fast_trigonometry - { - template inline T fastSin(const T& angle){return fastSinGTX(angle);} //!< Faster than the common sin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template inline T fastCos(const T& angle){return fastCosGTX(angle);} //!< Faster than the common cos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template inline T fastTan(const T& angle){return fastTanGTX(angle);} //!< Faster than the common tan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template inline T fastAsin(const T& angle){return fastAsinGTX(angle);} //!< Faster than the common asin function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template inline T fastAcos(const T& angle){return fastAcosGTX(angle);} //!< Faster than the common acos function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template inline T fastAtan(const T& y, const T& x){return fastAtanGTX(y, x);} //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - template inline T fastAtan(const T& angle){return fastAtanGTX(angle);} //!< Faster than the common atan function but less accurate. Defined between -2pi and 2pi. (From GLM_GTX_fast_trigonometry extension) - } - } -} - -#define GLM_GTX_fast_trigonometry namespace gtx::fast_trigonometry - -#include "fast_trigonometry.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_fast_trigonometry;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_fast_trigonometry__ diff --git a/experimental/sse/glm/ext/gtx/fast_trigonometry.inl b/experimental/sse/glm/ext/gtx/fast_trigonometry.inl deleted file mode 100644 index 2101b667..00000000 --- a/experimental/sse/glm/ext/gtx/fast_trigonometry.inl +++ /dev/null @@ -1,243 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-08 -// Updated : 2006-01-08 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/fast_trigonometry.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // sin - template - inline T fastSinGTX(const T x) - { - return x - ((x * x * x) / T(6)) + ((x * x * x * x * x) / T(120)) - ((x * x * x * x * x * x * x) / T(5040)); - } - - template - inline detail::_xvec2 fastSinGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastSinGTX(x.x), - fastSinGTX(x.y)); - } - - template - inline detail::_xvec3 fastSinGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastSinGTX(x.x), - fastSinGTX(x.y), - fastSinGTX(x.z)); - } - - template - inline detail::_xvec4 fastSinGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastSinGTX(x.x), - fastSinGTX(x.y), - fastSinGTX(x.z), - fastSinGTX(x.w)); - } - - // cos - template - inline T fastCosGTX(const T x) - { - return T(1) - (x * x * T(0.5)) + (x * x * x * x * T(0.041666666666)) - (x * x * x * x * x * x * T(0.00138888888888)); - } - - template - inline detail::_xvec2 fastCosGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastCosGTX(x.x), - fastCosGTX(x.y)); - } - - template - inline detail::_xvec3 fastCosGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastCosGTX(x.x), - fastCosGTX(x.y), - fastCosGTX(x.z)); - } - - template - inline detail::_xvec4 fastCosGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastCosGTX(x.x), - fastCosGTX(x.y), - fastCosGTX(x.z), - fastCosGTX(x.w)); - } - - // tan - template - inline T fastTanGTX(const T x) - { - return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539)); - } - - template - inline detail::_xvec2 fastTanGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastTanGTX(x.x), - fastTanGTX(x.y)); - } - - template - inline detail::_xvec3 fastTanGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastTanGTX(x.x), - fastTanGTX(x.y), - fastTanGTX(x.z)); - } - - template - inline detail::_xvec4 fastTanGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastTanGTX(x.x), - fastTanGTX(x.y), - fastTanGTX(x.z), - fastTanGTX(x.w)); - } - - // asin - template - inline T fastAsinGTX(const T x) - { - return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159)); - } - - template detail::_xvec2 fastAsinGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastAsinGTX(x.x), - fastAsinGTX(x.y)); - } - - template detail::_xvec3 fastAsinGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastAsinGTX(x.x), - fastAsinGTX(x.y), - fastAsinGTX(x.z)); - } - - template detail::_xvec4 fastAsinGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastAsinGTX(x.x), - fastAsinGTX(x.y), - fastAsinGTX(x.z), - fastAsinGTX(x.w)); - } - - // acos - template - inline T fastAcosGTX(const T x) - { - return T(1.5707963267948966192313216916398) - fastAsinGTX(x); //(PI / 2) - } - - template detail::_xvec2 fastAcosGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastAcosGTX(x.x), - fastAcosGTX(x.y)); - } - - template detail::_xvec3 fastAcosGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastAcosGTX(x.x), - fastAcosGTX(x.y), - fastAcosGTX(x.z)); - } - - template detail::_xvec4 fastAcosGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastAcosGTX(x.x), - fastAcosGTX(x.y), - fastAcosGTX(x.z), - fastAcosGTX(x.w)); - } - - // atan - template - inline T fastAtanGTX(const T y, const T x) - { - T sgn = sign(y) * sign(x); - return abs(fastAtanGTX(y / x)) * sgn; - } - - template - inline detail::_xvec2 fastAtanGTX(const detail::_xvec2& y, const detail::_xvec2& x) - { - return detail::_xvec2( - fastAtanGTX(y.x, x.x), - fastAtanGTX(y.y, x.y)); - } - - template - inline detail::_xvec3 fastAtanGTX(const detail::_xvec3& y, const detail::_xvec3& x) - { - return detail::_xvec3( - fastAtanGTX(y.x, x.x), - fastAtanGTX(y.y, x.y), - fastAtanGTX(y.z, x.z)); - } - - template - inline detail::_xvec4 fastAtanGTX(const detail::_xvec4& y, const detail::_xvec4& x) - { - return detail::_xvec4( - fastAtanGTX(y.x, x.x), - fastAtanGTX(y.y, x.y), - fastAtanGTX(y.z, x.z), - fastAtanGTX(y.w, x.w)); - } - - template - inline T fastAtanGTX(const T x) - { - return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909)); - } - - template - inline detail::_xvec2 fastAtanGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - fastAtanGTX(x.x), - fastAtanGTX(x.y)); - } - - template - inline detail::_xvec3 fastAtanGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - fastAtanGTX(x.x), - fastAtanGTX(x.y), - fastAtanGTX(x.z)); - } - - template - inline detail::_xvec4 fastAtanGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - fastAtanGTX(x.x), - fastAtanGTX(x.y), - fastAtanGTX(x.z), - fastAtanGTX(x.w)); - } -} diff --git a/experimental/sse/glm/ext/gtx/flexible_mix.h b/experimental/sse/glm/ext/gtx/flexible_mix.h deleted file mode 100644 index 687a98ad..00000000 --- a/experimental/sse/glm/ext/gtx/flexible_mix.h +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-09-21 -// Updated : 2007-09-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/flexible_mix.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_flexible_mix__ -#define __glm_gtx_flexible_mix__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template T mixGTX(T x, T y, U a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - template detail::_xvec2 mixGTX(const detail::_xvec2& x, const detail::_xvec2& y, U a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - template detail::_xvec3 mixGTX(const detail::_xvec3& x, const detail::_xvec3& y, U a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - template detail::_xvec4 mixGTX(const detail::_xvec4& x, const detail::_xvec4& y, U a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - template detail::_xvec2 mixGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - template detail::_xvec3 mixGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - template detail::_xvec4 mixGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& a); //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - - namespace gtx - { - //! GLM_GTX_flexible_mix extension: More flexible functions for linear interpolations - namespace flexible_mix - { - template T mix(T x, T y, U a){return mixGTX(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using a values. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_flexible_mix extension) - } - } -} - -#define GLM_GTX_flexible_mix namespace gtx::flexible_mix - -#include "flexible_mix.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_flexible_mix;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_flexible_mix__ diff --git a/experimental/sse/glm/ext/gtx/flexible_mix.inl b/experimental/sse/glm/ext/gtx/flexible_mix.inl deleted file mode 100644 index d9af0244..00000000 --- a/experimental/sse/glm/ext/gtx/flexible_mix.inl +++ /dev/null @@ -1,58 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-09-21 -// Updated : 2007-09-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/flexible_mix.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // mix - template - inline T mixGTX(T x, T y, T a) - { - return T(x * (U(1) - a) + y * a); - } - - template - inline detail::_xvec2 mixGTX(const detail::_xvec2& x, const detail::_xvec2& y, U a) - { - return detail::_xvec2(detail::_xvec2(x) * (U(1) - a) + detail::_xvec2(y) * a); - //return x * (U(1) - a) + y * a; - } - - template - inline detail::_xvec3 mixGTX(const detail::_xvec3& x, const detail::_xvec3& y, U a) - { - return detail::_xvec3(detail::_xvec3(x) * (U(1) - a) + detail::_xvec3(y) * a); - //return x * (U(1) - a) + y * a; - //return mix(x, y, _xvec3(a)); - } - - template - inline detail::_xvec4 mixGTX(const detail::_xvec4& x, const detail::_xvec4& y, U a) - { - return detail::_xvec4(detail::_xvec4(x) * (U(1) - a) + detail::_xvec4(y) * a); - //return x * (U(1) - a) + y * a; - } - - template - inline detail::_xvec2 mixGTX(const detail::_xvec2& x, const detail::_xvec2& y, const detail::_xvec2& a) - { - return detail::_xvec2(detail::_xvec2(x) * (U(1) - a) + detail::_xvec2(y) * a); - } - - template - inline detail::_xvec3 mixGTX(const detail::_xvec3& x, const detail::_xvec3& y, const detail::_xvec3& a) - { - return detail::_xvec3(detail::_xvec3(x) * (U(1) - a) + detail::_xvec3(y) * a); - } - - template - inline detail::_xvec4 mixGTX(const detail::_xvec4& x, const detail::_xvec4& y, const detail::_xvec4& a) - { - return detail::_xvec4(detail::_xvec4(x) * (U(1) - a) + detail::_xvec4(y) * a); - } -} diff --git a/experimental/sse/glm/ext/gtx/gpu_shader4.h b/experimental/sse/glm/ext/gtx/gpu_shader4.h deleted file mode 100644 index 4c588527..00000000 --- a/experimental/sse/glm/ext/gtx/gpu_shader4.h +++ /dev/null @@ -1,169 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-11-13 -// Updated : 2007-08-20 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/gpu_shader4.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_round -// - GLM_GTX_half -// - GLM_GTX_double -// - GLM_GTX_integer -/////////////////////////////////////////////////////////////////////////////////////////////////// -// ToDo: -// - Defined all the extensions -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Comment: -// This extension is based on GL_EXT_gpu_shader4 extension -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_gpu_shader4__ -#define __glm_gtx_gpu_shader4__ - -// Dependency: -#include "../../glm.h" -#include "../../ext/gtx/round.h" -#include "../../ext/gtx/half.h" - -namespace glm -{ - __halfGTX truncateGTX(__halfGTX x); //!< \brief Computes the truncate value of x (from GLM_GTX_gpu_shader4 extension) - float truncateGTX(float x); //!< \brief Computes the truncate value of x (from GLM_GTX_gpu_shader4 extension) - double truncateGTX(double x); //!< \brief Computes the truncate value of x (from GLM_GTX_gpu_shader4 extension) - template genType truncateGTX(const genType& x); //!< \brief Computes the component-wise truncate value of x (from GLM_GTX_gpu_shader4 extension) - - unsigned int powGTX(unsigned int x, unsigned int y); //!< \brief Returns x raised to the y power. (from GLM_GTX_gpu_shader4 extension) - unsigned int sqrtGTX(unsigned int x); //!< \brief Returns the positive square root of x. (from GLM_GTX_gpu_shader4 extension) - - typedef detail::_xvec2 __uvec2GTX; //!< \brief Vector of 2 half-precision floating-point numbers. (From GLM_GTX_gpu_shader4 extension) - typedef detail::_xvec3 __uvec3GTX; //!< \brief Vector of 3 half-precision floating-point numbers. (From GLM_GTX_gpu_shader4 extension) - typedef detail::_xvec4 __uvec4GTX; //!< \brief Vector of 4 half-precision floating-point numbers. (From GLM_GTX_gpu_shader4 extension) - - namespace gtx - { - //! GLM_GTX_gpu_shader4 extension: Implementation of GL_EXT_gpu_shader4 for GLM - namespace gpu_shader4 - { - template genType truncate(const genType& x){return truncateGTX(x);} //!< \brief Computes the component-wise truncate value of x (from GLM_GTX_gpu_shader4 extension) - - typedef detail::_xvec2 uvec2; //!< \brief Vector of 2 half-precision floating-point numbers. (From GLM_GTX_gpu_shader4 extension) - typedef detail::_xvec3 uvec3; //!< \brief Vector of 3 half-precision floating-point numbers. (From GLM_GTX_gpu_shader4 extension) - typedef detail::_xvec4 uvec4; //!< \brief Vector of 4 half-precision floating-point numbers. (From GLM_GTX_gpu_shader4 extension) - - // vec2 bit operators - template detail::_xvec2& operator%=(detail::_xvec2& r, const T s); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator%=(detail::_xvec2& r, const detail::_xvec2& v); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator&=(detail::_xvec2& r, const T s); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator&=(detail::_xvec2& r, const detail::_xvec2& v); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator|=(detail::_xvec2& r, const T s); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator|=(detail::_xvec2& r, const detail::_xvec2& v); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator^=(detail::_xvec2& r, const T s); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator^=(detail::_xvec2& r, const detail::_xvec2& v); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator<<=(detail::_xvec2& r, const T s); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator<<=(detail::_xvec2& r, const detail::_xvec2& v); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator>>=(detail::_xvec2& r, const T s); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2& operator>>=(detail::_xvec2& r, const detail::_xvec2& v); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - - template detail::_xvec2 operator% (const detail::_xvec2& v, const T s); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator% (const T s, const detail::_xvec2& v); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator% (const detail::_xvec2& v1, const detail::_xvec2& v2); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator& (const detail::_xvec2& v, const T s); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator& (const T s, const detail::_xvec2& v); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator& (const detail::_xvec2& v1, const detail::_xvec2& v2); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator| (const detail::_xvec2& v, const T s); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator| (const T s, const detail::_xvec2& v); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator| (const detail::_xvec2& v1, const detail::_xvec2& v2); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator^ (const detail::_xvec2& v, const T s); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator^ (const T s, const detail::_xvec2& v); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator^ (const detail::_xvec2& v1, const detail::_xvec2& v2); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator<< (const detail::_xvec2& v, const T s); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator<< (const T s, const detail::_xvec2& v); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator<< (const detail::_xvec2& v1, const detail::_xvec2& v2); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator>> (const detail::_xvec2& v, const T s); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator>> (const T s, const detail::_xvec2& v); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec2 operator>> (const detail::_xvec2& v1, const detail::_xvec2& v2); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template const detail::_xvec2 operator~ (const detail::_xvec2& v); - - // vec3 bit operators - template detail::_xvec3& operator%=(detail::_xvec3& r, const T s); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator%=(detail::_xvec3& r, const detail::_xvec3& v); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator&=(detail::_xvec3& r, const T s); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator&=(detail::_xvec3& r, const detail::_xvec3& v); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator|=(detail::_xvec3& r, const T s); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator|=(detail::_xvec3& r, const detail::_xvec3& v); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator^=(detail::_xvec3& r, const T s); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator^=(detail::_xvec3& r, const detail::_xvec3& v); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator<<=(detail::_xvec3& r, const T s); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator<<=(detail::_xvec3& r, const detail::_xvec3& v); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator>>=(detail::_xvec3& r, const T s); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3& operator>>=(detail::_xvec3& r, const detail::_xvec3& v); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - - template detail::_xvec3 operator% (const detail::_xvec3& v, const T s); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator% (const T s, const detail::_xvec3& v); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator% (const detail::_xvec3& v1, const detail::_xvec3& v2); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator& (const detail::_xvec3& v, const T s); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator& (const T s, const detail::_xvec3& v); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator& (const detail::_xvec3& v1, const detail::_xvec3& v2); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator| (const detail::_xvec3& v, const T s); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator| (const T s, const detail::_xvec3& v); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator| (const detail::_xvec3& v1, const detail::_xvec3& v2); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator^ (const detail::_xvec3& v, const T s); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator^ (const T s, const detail::_xvec3& v); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator^ (const detail::_xvec3& v1, const detail::_xvec3& v2); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator<< (const detail::_xvec3& v, const T s); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator<< (const T s, const detail::_xvec3& v); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator<< (const detail::_xvec3& v1, const detail::_xvec3& v2); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator>> (const detail::_xvec3& v, const T s); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator>> (const T s, const detail::_xvec3& v); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec3 operator>> (const detail::_xvec3& v1, const detail::_xvec3& v2); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template const detail::_xvec3 operator~ (const detail::_xvec3& v); //!< \brief bitwise negation operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - - // vec4 bit operators - template detail::_xvec4& operator%=(detail::_xvec4& r, const T s); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator%=(detail::_xvec4& r, const detail::_xvec4& v); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator&=(detail::_xvec4& r, const T s); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator&=(detail::_xvec4& r, const detail::_xvec4& v); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator|=(detail::_xvec4& r, const T s); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator|=(detail::_xvec4& r, const detail::_xvec4& v); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator^=(detail::_xvec4& r, const T s); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator^=(detail::_xvec4& r, const detail::_xvec4& v); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator<<=(detail::_xvec4& r, const T s); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator<<=(detail::_xvec4& r, const detail::_xvec4& v); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator>>=(detail::_xvec4& r, const T s); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4& operator>>=(detail::_xvec4& r, const detail::_xvec4& v); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - - template detail::_xvec4 operator% (const detail::_xvec4& v, const T s); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator% (const T s, const detail::_xvec4& v); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator% (const detail::_xvec4& v1, const detail::_xvec4& v2); //!< \brief Modulus operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator& (const detail::_xvec4& v, const T s); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator& (const T s, const detail::_xvec4& v); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator& (const detail::_xvec4& v1, const detail::_xvec4& v2); //!< \brief bitwise AND operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator| (const detail::_xvec4& v, const T s); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator| (const T s, const detail::_xvec4& v); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator| (const detail::_xvec4& v1, const detail::_xvec4& v2); //!< \brief bitwise inclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator^ (const detail::_xvec4& v, const T s); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator^ (const T s, const detail::_xvec4& v); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator^ (const detail::_xvec4& v1, const detail::_xvec4& v2); //!< \brief bitwise exclusive OR operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator<< (const detail::_xvec4& v, const T s); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator<< (const T s, const detail::_xvec4& v); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator<< (const detail::_xvec4& v1, const detail::_xvec4& v2); //!< \brief bitwise left shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator>> (const detail::_xvec4& v, const T s); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator>> (const T s, const detail::_xvec4& v); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template detail::_xvec4 operator>> (const detail::_xvec4& v1, const detail::_xvec4& v2); //!< \brief bitwise right shift operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - template const detail::_xvec4 operator~ (const detail::_xvec4& v); //!< \brief bitwise negation operator for integer vectors. (From GLM_GTX_gpu_shader4 extension) - } - } -} - -#define GLM_GTX_gpu_shader4 namespace gtx::gpu_shader4 - -#include "gpu_shader4.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_gpu_shader4;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_gpu_shader4__ diff --git a/experimental/sse/glm/ext/gtx/gpu_shader4.inl b/experimental/sse/glm/ext/gtx/gpu_shader4.inl deleted file mode 100644 index e3ffea03..00000000 --- a/experimental/sse/glm/ext/gtx/gpu_shader4.inl +++ /dev/null @@ -1,949 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-11-13 -// Updated : 2007-08-20 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/gpu_shader4.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - inline __halfGTX truncateGTX(__halfGTX x) - { - return __halfGTX(float(int(x + __halfGTX(0.5)))); - } - - inline float truncateGTX(float x) - { - return float(int(x + float(0.5))); - } - - inline double truncateGTX(double x) - { - return double(int(x + double(0.5))); - } - - template - inline detail::_xvec2 truncateGTX(const detail::_xvec2& x) - { - detail::_xvec2 result; - result[1] = T(int(x[1] + T(0.5))); - result[2] = T(int(x[2] + T(0.5))); - return result; - } - - template - inline detail::_xvec3 truncateGTX(const detail::_xvec3& x) - { - detail::_xvec3 result; - result[0] = T(int(x[0] + T(0.5))); - result[1] = T(int(x[1] + T(0.5))); - result[2] = T(int(x[2] + T(0.5))); - return result; - } - - template - inline detail::_xvec4 truncateGTX(const detail::_xvec4& x) - { - detail::_xvec4 result; - result[0] = T(int(x[0] + T(0.5))); - result[1] = T(int(x[1] + T(0.5))); - result[2] = T(int(x[2] + T(0.5))); - result[3] = T(int(x[3] + T(0.5))); - return result; - } - - namespace gtx - { - namespace gpu_shader4 - { - // vec2 bit operators - template - inline detail::_xvec2& operator%=(detail::_xvec2& r, const T s) - { - r.x %= s; - r.y %= s; - return r; - } - - template - inline detail::_xvec2& operator%=(detail::_xvec2& r, const detail::_xvec2& v) - { - r.x %= v.x; - r.y %= v.y; - return r; - } - - template - inline detail::_xvec2& operator&=(detail::_xvec2& r, const T s) - { - r.x &= s; - r.y &= s; - return r; - } - - template - inline detail::_xvec2& operator&=(detail::_xvec2& r, const detail::_xvec2& v) - { - r.x &= v.x; - r.y &= v.y; - return r; - } - - template - inline detail::_xvec2& operator|=(detail::_xvec2& r, const T s) - { - r.x |= s; - r.y |= s; - return r; - } - - template - inline detail::_xvec2& operator|=(detail::_xvec2& r, const detail::_xvec2& v) - { - r.x |= v.x; - r.y |= v.y; - return r; - } - - template - inline detail::_xvec2& operator^=(detail::_xvec2& r, const T s) - { - r.x ^= s; - r.y ^= s; - return r; - } - - template - inline detail::_xvec2& operator^=(detail::_xvec2& r, const detail::_xvec2& v) - { - r.x ^= v.x; - r.y ^= v.y; - return r; - } - - template - inline detail::_xvec2& operator<<=(detail::_xvec2& r, const T s) - { - r.x <<= s; - r.y <<= s; - return r; - } - - template - inline detail::_xvec2& operator<<=(detail::_xvec2& r, const detail::_xvec2& v) - { - r.x <<= v.x; - r.y <<= v.y; - return r; - } - - template - inline detail::_xvec2& operator>>=(detail::_xvec2& r, const T s) - { - r.x >>= s; - r.y >>= s; - return r; - } - - template - inline detail::_xvec2& operator>>=(detail::_xvec2& r, const detail::_xvec2& v) - { - r.x >>= v.x; - r.y >>= v.y; - return r; - } - - template - inline detail::_xvec2 operator% (const detail::_xvec2& v, const T s) - { - return detail::_xvec2( - v.x % s, - v.y % s); - } - - template - inline detail::_xvec2 operator% (const T s, const detail::_xvec2& v) - { - return detail::_xvec2( - s % v.x, - s % v.y); - } - - template - inline detail::_xvec2 operator% (const detail::_xvec2& v1, const detail::_xvec2& v2) - { - return detail::_xvec2( - v1.x % v2.x, - v1.y % v2.y); - } - - template - inline detail::_xvec2 operator& (const detail::_xvec2& v, const T s) - { - return detail::_xvec2( - v.x & s, - v.y & s); - } - - template - inline detail::_xvec2 operator& (const T s, const detail::_xvec2& v) - { - return detail::_xvec2( - s & v.x, - s & v.y); - } - - template - inline detail::_xvec2 operator& (const detail::_xvec2& v1, const detail::_xvec2& v2) - { - return detail::_xvec2( - v1.x & v2.x, - v1.y & v2.y); - } - - template - inline detail::_xvec2 operator| (const detail::_xvec2& v, const T s) - { - return detail::_xvec2( - v.x | s, - v.y | s); - } - - template - inline detail::_xvec2 operator| (const T s, const detail::_xvec2& v) - { - return detail::_xvec2( - s | v.x, - s | v.y); - } - - template - inline detail::_xvec2 operator| (const detail::_xvec2& v1, const detail::_xvec2& v2) - { - return detail::_xvec2( - v1.x | v2.x, - v1.y | v2.y); - } - - template - inline detail::_xvec2 operator^ (const detail::_xvec2& v, const T s) - { - return detail::_xvec2( - v.x ^ s, - v.y ^ s); - } - - template - inline detail::_xvec2 operator^ (const T s, const detail::_xvec2& v) - { - return detail::_xvec2( - s ^ v.x, - s ^ v.y); - } - - template - inline detail::_xvec2 operator^ (const detail::_xvec2& v1, const detail::_xvec2& v2) - { - return detail::_xvec2( - v1.x ^ v2.x, - v1.y ^ v2.y); - } - - template - inline detail::_xvec2 operator<< (const detail::_xvec2& v, const T s) - { - return detail::_xvec2( - v.x << s, - v.y << s); - } - - template - inline detail::_xvec2 operator<< (const T s, const detail::_xvec2& v) - { - return detail::_xvec2( - s << v.x, - s << v.y); - } - - template - inline detail::_xvec2 operator<< (const detail::_xvec2& v1, const detail::_xvec2& v2) - { - return detail::_xvec2( - v1.x << v2.x, - v1.y << v2.y); - } - - template - inline detail::_xvec2 operator>> (const detail::_xvec2& v, const T s) - { - return detail::_xvec2( - v.x >> s, - v.y >> s); - } - - template - inline detail::_xvec2 operator>> (const T s, const detail::_xvec2& v) - { - return detail::_xvec2( - s >> v.x, - s >> v.y); - } - - template - inline detail::_xvec2 operator>> (const detail::_xvec2& v1, const detail::_xvec2& v2) - { - return detail::_xvec2( - v1.x >> v2.x, - v1.y >> v2.y); - } - - template - inline const detail::_xvec2 operator~ (const detail::_xvec2& v) - { - return detail::_xvec2( - ~v.x, - ~v.y); - } - - // vec3 bit operators - template - inline detail::_xvec3& operator%=(detail::_xvec3& r, const T s) - { - r.x &= s; - r.y &= s; - r.z &= s; - return r; - } - - template - inline detail::_xvec3& operator%=(detail::_xvec3& r, const detail::_xvec3& v) - { - r.x &= v.x; - r.y &= v.y; - r.z &= v.z; - return r; - } - - template - inline detail::_xvec3& operator&=(detail::_xvec3& r, const T s) - { - r.x &= s; - r.y &= s; - r.z &= s; - return r; - } - - template - inline detail::_xvec3& operator&=(detail::_xvec3& r, const detail::_xvec3& v) - { - r.x &= v.x; - r.y &= v.y; - r.z &= v.z; - return r; - } - - template - inline detail::_xvec3& operator|=(detail::_xvec3& r, const T s) - { - r.x |= s; - r.y |= s; - r.z |= s; - return r; - } - - template - inline detail::_xvec3& operator|=(detail::_xvec3& r, const detail::_xvec3& v) - { - r.x |= v.x; - r.y |= v.y; - r.z |= v.z; - return r; - } - - template - inline detail::_xvec3& operator^=(detail::_xvec3& r, const T s) - { - r.x ^= s; - r.y ^= s; - r.z ^= s; - return r; - } - - template - inline detail::_xvec3& operator^=(detail::_xvec3& r, const detail::_xvec3& v) - { - r.x ^= v.x; - r.y ^= v.y; - r.z ^= v.z; - return r; - } - - template - inline detail::_xvec3& operator<<=(detail::_xvec3& r, const T s) - { - r.x <<= s; - r.y <<= s; - r.z <<= s; - return r; - } - - template - inline detail::_xvec3& operator<<=(detail::_xvec3& r, const detail::_xvec3& v) - { - r.x <<= v.x; - r.y <<= v.y; - r.z <<= v.z; - return r; - } - - template - inline detail::_xvec3& operator>>=(detail::_xvec3& r, const T s) - { - r.x >>= s; - r.y >>= s; - r.z >>= s; - return r; - } - - template - inline detail::_xvec3& operator>>=(detail::_xvec3& r, const detail::_xvec3& v) - { - r.x >>= v.x; - r.y >>= v.y; - r.z >>= v.z; - return r; - } - - template - inline detail::_xvec3 operator% (const detail::_xvec3& v, const T s) - { - return detail::_xvec3( - v.x % s, - v.y % s, - v.z % s); - } - - template - inline detail::_xvec3 operator% (const T s, const detail::_xvec3& v) - { - return detail::_xvec3( - s % v.x, - s % v.y, - s % v.z); - } - - template - inline detail::_xvec3 operator% (const detail::_xvec3& v1, const detail::_xvec3& v2) - { - return detail::_xvec3( - v1.x % v2.x, - v1.y % v2.y, - v1.z % v2.z); - } - - template - inline detail::_xvec3 operator& (const detail::_xvec3& v, const T s) - { - return detail::_xvec3( - v.x & s, - v.y & s, - v.z & s); - } - - template - inline detail::_xvec3 operator& (const T s, const detail::_xvec3& v) - { - return detail::_xvec3( - s & v.x, - s & v.y, - s & v.z); - } - - template - inline detail::_xvec3 operator& (const detail::_xvec3& v1, const detail::_xvec3& v2) - { - return detail::_xvec2( - v1.x & v2.x, - v1.y & v2.y, - v1.z & v2.z); - } - - template - inline detail::_xvec3 operator| (const detail::_xvec3& v, const T s) - { - return detail::_xvec3( - v.x | s, - v.y | s, - v.z | s); - } - - template - inline detail::_xvec3 operator| (const T s, const detail::_xvec3& v) - { - return detail::_xvec3( - s | v.x, - s | v.y, - s | v.z); - } - - template - inline detail::_xvec3 operator| (const detail::_xvec3& v1, const detail::_xvec3& v2) - { - return detail::_xvec3( - v1.x | v2.x, - v1.y | v2.y, - v1.z | v2.z); - } - - template - inline detail::_xvec3 operator^ (const detail::_xvec3& v, const T s) - { - return detail::_xvec3( - v.x ^ s, - v.y ^ s, - v.z ^ s); - } - - template - inline detail::_xvec3 operator^ (const T s, const detail::_xvec3& v) - { - return detail::_xvec3( - s ^ v.x, - s ^ v.y, - s ^ v.z); - } - - template - inline detail::_xvec3 operator^ (const detail::_xvec3& v1, const detail::_xvec3& v2) - { - return detail::_xvec3( - v1.x ^ v2.x, - v1.y ^ v2.y, - v1.z ^ v2.z); - } - - template - inline detail::_xvec3 operator<< (const detail::_xvec3& v, const T s) - { - return detail::_xvec3( - v.x << s, - v.y << s, - v.z << s); - } - - template - inline detail::_xvec3 operator<< (const T s, const detail::_xvec3& v) - { - return detail::_xvec3( - s << v.x, - s << v.y, - s << v.z); - } - - template - inline detail::_xvec3 operator<< (const detail::_xvec3& v1, const detail::_xvec3& v2) - { - return detail::_xvec3( - v1.x << v2.x, - v1.y << v2.y, - v1.z << v2.z); - } - - template - inline detail::_xvec3 operator>> (const detail::_xvec3& v, const T s) - { - return detail::_xvec3( - v.x >> s, - v.y >> s, - v.z >> s); - } - - template - inline detail::_xvec3 operator>> (const T s, const detail::_xvec3& v) - { - return detail::_xvec3( - s >> v.x, - s >> v.y, - s >> v.z); - } - - template - inline detail::_xvec3 operator>> (const detail::_xvec3& v1, const detail::_xvec3& v2) - { - return detail::_xvec3( - v1.x >> v2.x, - v1.y >> v2.y, - v1.z >> v2.z); - } - - template - inline const detail::_xvec3 operator~ (const detail::_xvec3& v) - { - return detail::_xvec3( - ~v.x, - ~v.y, - ~v.z); - } - - // vec4 bit operators - template - inline detail::_xvec4& operator%=(detail::_xvec4& r, const T s) - { - r.x %= s; - r.y %= s; - r.z %= s; - r.w %= s; - return r; - } - - template - inline detail::_xvec4& operator%=(detail::_xvec4& r, const detail::_xvec4& v) - { - r.x %= v.x; - r.y %= v.y; - r.z %= v.z; - r.w %= v.w; - return r; - } - - template - inline detail::_xvec4& operator&=(detail::_xvec4& r, const T s) - { - r.x &= s; - r.y &= s; - r.z &= s; - r.w &= s; - return r; - } - - template - inline detail::_xvec4& operator&=(detail::_xvec4& r, const detail::_xvec4& v) - { - r.x &= v.x; - r.y &= v.y; - r.z &= v.z; - r.w &= v.w; - return r; - } - - template - inline detail::_xvec4& operator|=(detail::_xvec4& r, const T s) - { - r.x |= s; - r.y |= s; - r.z |= s; - r.w |= s; - return r; - } - - template - inline detail::_xvec4& operator|=(detail::_xvec4& r, const detail::_xvec4& v) - { - r.x |= v.x; - r.y |= v.y; - r.z |= v.z; - r.w |= v.w; - return r; - } - - template - inline detail::_xvec4& operator^=(detail::_xvec4& r, const T s) - { - r.x ^= s; - r.y ^= s; - r.z ^= s; - r.w ^= s; - return r; - } - - template - inline detail::_xvec4& operator^=(detail::_xvec4& r, const detail::_xvec4& v) - { - r.x ^= v.x; - r.y ^= v.y; - r.z ^= v.z; - r.w ^= v.w; - return r; - } - - template - inline detail::_xvec4& operator<<=(detail::_xvec4& r, const T s) - { - r.x <<= s; - r.y <<= s; - r.z <<= s; - r.w <<= s; - return r; - } - - template - inline detail::_xvec4& operator<<=(detail::_xvec4& r, const detail::_xvec4& v) - { - r.x <<= v.x; - r.y <<= v.y; - r.z <<= v.z; - r.w <<= v.w; - return r; - } - - template - inline detail::_xvec4& operator>>=(detail::_xvec4& r, const T s) - { - r.x >>= s; - r.y >>= s; - r.z >>= s; - r.w >>= s; - return r; - } - - template - inline detail::_xvec4& operator>>=(detail::_xvec4& r, const detail::_xvec4& v) - { - r.x >>= v.x; - r.y >>= v.y; - r.z >>= v.z; - r.w >>= v.w; - return r; - } - - template - inline detail::_xvec4 operator% (const detail::_xvec4& v, const T s) - { - return detail::_xvec4( - v.x % s, - v.y % s, - v.z % s, - v.w % s); - } - - template - inline detail::_xvec4 operator% (const T s, const detail::_xvec4& v) - { - return detail::_xvec4( - s % v.x, - s % v.y, - s % v.z, - s % v.w); - } - - template - inline detail::_xvec4 operator% (const detail::_xvec4& v1, const detail::_xvec4& v2) - { - return detail::_xvec4( - v1.x % v2.x, - v1.y % v2.y, - v1.z % v2.z, - v1.w % v2.w); - } - - template - inline detail::_xvec4 operator& (const detail::_xvec4& v, const T s) - { - return detail::_xvec4( - v.x & s, - v.y & s, - v.z & s, - v.w & s); - } - - template - inline detail::_xvec4 operator& (const T s, const detail::_xvec4& v) - { - return detail::_xvec4( - s & v.x, - s & v.y, - s & v.z, - s & v.w); - } - - template - inline detail::_xvec4 operator& (const detail::_xvec4& v1, const detail::_xvec4& v2) - { - return detail::_xvec4( - v1.x & v2.x, - v1.y & v2.y, - v1.z & v2.z, - v1.w & v2.w); - } - - template - inline detail::_xvec4 operator| (const detail::_xvec4& v, const T s) - { - return detail::_xvec4( - v.x | s, - v.y | s, - v.z | s, - v.w | s); - } - - template - inline detail::_xvec4 operator| (const T s, const detail::_xvec4& v) - { - return detail::_xvec4( - s | v.x, - s | v.y, - s | v.z, - s | v.w); - } - - template - inline detail::_xvec4 operator| (const detail::_xvec4& v1, const detail::_xvec4& v2) - { - return detail::_xvec4( - v1.x | v2.x, - v1.y | v2.y, - v1.z | v2.z, - v1.w | v2.w); - } - - template - inline detail::_xvec4 operator^ (const detail::_xvec4& v, const T s) - { - return detail::_xvec4( - v.x ^ s, - v.y ^ s, - v.z ^ s, - v.w ^ s); - } - - template - inline detail::_xvec4 operator^ (const T s, const detail::_xvec4& v) - { - return detail::_xvec4( - s ^ v.x, - s ^ v.y, - s ^ v.z, - s ^ v.w); - } - - template - inline detail::_xvec4 operator^ (const detail::_xvec4& v1, const detail::_xvec4& v2) - { - return detail::_xvec4( - v1.x ^ v2.x, - v1.y ^ v2.y, - v1.z ^ v2.z, - v1.w ^ v2.w); - } - - template - inline detail::_xvec4 operator<< (const detail::_xvec4& v, const T s) - { - return detail::_xvec4( - v.x << s, - v.y << s, - v.z << s, - v.w << s); - } - - template - inline detail::_xvec4 operator<< (const T s, const detail::_xvec4& v) - { - return detail::_xvec4( - s << v.x, - s << v.y, - s << v.z, - s << v.w); - } - - template - inline detail::_xvec4 operator<< (const detail::_xvec4& v1, const detail::_xvec4& v2) - { - return detail::_xvec4( - v1.x << v2.x, - v1.y << v2.y, - v1.z << v2.z, - v1.w << v2.w); - } - - template - inline detail::_xvec4 operator>> (const detail::_xvec4& v, const T s) - { - return detail::_xvec4( - v.x >> s, - v.y >> s, - v.z >> s, - v.w >> s); - } - - template - inline detail::_xvec4 operator>> (const T s, const detail::_xvec4& v) - { - return detail::_xvec4( - s >> v.x, - s >> v.y, - s >> v.z, - s >> v.w); - } - - template - inline detail::_xvec4 operator>> (const detail::_xvec4& v1, const detail::_xvec4& v2) - { - return detail::_xvec4( - v1.x >> v2.x, - v1.y >> v2.y, - v1.z >> v2.z, - v1.w >> v2.w); - } - - template - inline const detail::_xvec4 operator~ (const detail::_xvec4& v) - { - return detail::_xvec4( - ~v.x, - ~v.y, - ~v.z, - ~v.w); - } - } - } - -/* - inline half truncate(half x) - { - return half(float(int(x + half(0.5)))); - } - - inline float truncate(float x) - { - return float(int(x + float(0.5))); - } - - inline double truncate(double x) - { - return double(int(x + double(0.5))); - } - - template - inline detail::_xvec2 truncate(const detail::_xvec2& x) - { - detail::_xvec2 result; - result[1] = T(int(x[1] + T(0.5))); - result[2] = T(int(x[2] + T(0.5))); - return result; - } - - template - inline detail::_xvec3 truncate(const detail::_xvec3& x) - { - detail::_xvec3 result; - result[0] = T(int(x[0] + T(0.5))); - result[1] = T(int(x[1] + T(0.5))); - result[2] = T(int(x[2] + T(0.5))); - return result; - } - - template - inline detail::_xvec4 truncate(const detail::_xvec4& x) - { - detail::_xvec4 result; - result[0] = T(int(x[0] + T(0.5))); - result[1] = T(int(x[1] + T(0.5))); - result[2] = T(int(x[2] + T(0.5))); - result[3] = T(int(x[3] + T(0.5))); - return result; - } -*/ -} diff --git a/experimental/sse/glm/ext/gtx/half.h b/experimental/sse/glm/ext/gtx/half.h deleted file mode 100644 index c63ced4f..00000000 --- a/experimental/sse/glm/ext/gtx/half.h +++ /dev/null @@ -1,405 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/half.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_quaternion -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Copyright: -// This half implementation is based on OpenEXR witch is Copyright (c) 2002, -// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_half__ -#define __glm_gtx_half__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/quaternion.h" - -namespace glm -{ - namespace detail - { - struct hdata - { - hdata() : data(0) {} - hdata(const hdata& value); - hdata(float value); - - operator float(); - - short data; - }; - - float _toFloat32(hdata value); - hdata _toFloat16(float value); - - union uif - { - int i; - float f; - }; - - //! \brief Type for half-precision floating-point numbers. (From GLM_GTX_half extension) - class _halfGTX - { - public: - // Constructors - _halfGTX(); - _halfGTX(float s); - _halfGTX(double s); - _halfGTX(int s); - _halfGTX(bool s); - _halfGTX(detail::hdata value) : - data(value) - {} - - operator float() const; - operator double() const; - operator int() const; - operator detail::hdata() const; - - // Operators - _halfGTX& operator=(_halfGTX s); - _halfGTX& operator=(float s); - _halfGTX operator+ (_halfGTX s) const; - _halfGTX& operator+= (_halfGTX s); - _halfGTX operator+ (float s) const; - _halfGTX& operator+= (float s); - _halfGTX operator- (_halfGTX s) const; - _halfGTX& operator-= (_halfGTX s); - _halfGTX operator- (float s) const; - _halfGTX& operator-= (float s); - _halfGTX operator* (_halfGTX s) const; - _halfGTX& operator*= (_halfGTX s); - _halfGTX operator* (float s) const; - _halfGTX& operator*= (float s); - _halfGTX operator/ (_halfGTX s) const; - _halfGTX& operator/= (_halfGTX s); - _halfGTX operator/ (float s) const; - _halfGTX& operator/= (float s); - _halfGTX operator- () const; - _halfGTX operator++ (); - _halfGTX operator++ (int n) const; - _halfGTX operator-- (); - _halfGTX operator-- (int n) const; - - bool operator< (const _halfGTX& s) const; - bool operator> (const _halfGTX& s) const; - bool operator<=(const _halfGTX& s) const; - bool operator>=(const _halfGTX& s) const; - bool operator==(const _halfGTX& s) const; - bool operator!=(const _halfGTX& s) const; - - detail::hdata _data() const{return data;} - - private: - detail::hdata data; - }; - - class _hvec3GTX; - class _hvec4GTX; - - class _hvec2GTX : public _cvec2 > - { - public: - // Common constructors - _hvec2GTX(); - _hvec2GTX(const _hvec2GTX& v); - - // Swizzle constructors - _hvec2GTX(const _xref2& r); - - // T constructors - explicit _hvec2GTX(const _halfGTX x); - explicit _hvec2GTX(const _halfGTX a, const _halfGTX b); - explicit _hvec2GTX(const _halfGTX a, const _hvec2GTX& b); - explicit _hvec2GTX(const _halfGTX a, const _hvec3GTX& b); - explicit _hvec2GTX(const _halfGTX a, const _hvec4GTX& b); - explicit _hvec2GTX(const _hvec3GTX& a); - explicit _hvec2GTX(const _hvec4GTX& a); - - // U constructors - template explicit _hvec2GTX(const U x); - template explicit _hvec2GTX(const U a, const U b); - template explicit _hvec2GTX(const U a, const _xvec2& b); - template explicit _hvec2GTX(const U a, const _xvec3& b); - template explicit _hvec2GTX(const U a, const _xvec4& b); - template explicit _hvec2GTX(const _xvec2& a); - template explicit _hvec2GTX(const _xvec3& a); - template explicit _hvec2GTX(const _xvec4& a); - - // Bool constructors - explicit _hvec2GTX(const bool x); - explicit _hvec2GTX(const bool a, const bool b); - explicit _hvec2GTX(const bool a, const _bvec2& b); - explicit _hvec2GTX(const bool a, const _bvec3& b); - explicit _hvec2GTX(const bool a, const _bvec4& b); - explicit _hvec2GTX(const _bvec2& a); - explicit _hvec2GTX(const _bvec3& a); - explicit _hvec2GTX(const _bvec4& a); - - // Unary updatable operators - _hvec2GTX& operator= (const _hvec2GTX& v); - _hvec2GTX& operator+=(const _halfGTX s); - _hvec2GTX& operator+=(const _hvec2GTX& v); - _hvec2GTX& operator-=(const _halfGTX s); - _hvec2GTX& operator-=(const _hvec2GTX& v); - _hvec2GTX& operator*=(const _halfGTX s); - _hvec2GTX& operator*=(const _hvec2GTX& v); - _hvec2GTX& operator/=(const _halfGTX s); - _hvec2GTX& operator/=(const _hvec2GTX& v); - _hvec2GTX& operator++(); - _hvec2GTX& operator--(); - }; - - class _hvec3GTX : public _cvec3, _xref3 > - { - public: - // Common constructors - _hvec3GTX(); - _hvec3GTX(const _hvec3GTX& v); - - // Swizzle constructors - _hvec3GTX(const _xref3& r); - - // T constructors - explicit _hvec3GTX(const _halfGTX a); - explicit _hvec3GTX(const _halfGTX a, const _halfGTX b, const _halfGTX c); - explicit _hvec3GTX(const _halfGTX a, const _halfGTX b, const _hvec2GTX& c); - explicit _hvec3GTX(const _halfGTX a, const _halfGTX b, const _hvec3GTX& c); - explicit _hvec3GTX(const _halfGTX a, const _halfGTX b, const _hvec4GTX& c); - explicit _hvec3GTX(const _halfGTX a, const _hvec2GTX& b); - explicit _hvec3GTX(const _halfGTX a, const _hvec3GTX& b); - explicit _hvec3GTX(const _halfGTX a, const _hvec4GTX& b); - explicit _hvec3GTX(const _hvec2GTX& a, _halfGTX b); - explicit _hvec3GTX(const _hvec2GTX& a, const _hvec2GTX& b); - explicit _hvec3GTX(const _hvec2GTX& a, const _hvec3GTX& b); - explicit _hvec3GTX(const _hvec2GTX& a, const _hvec4GTX& b); - explicit _hvec3GTX(const _hvec4GTX& a); - - // U constructors - template explicit _hvec3GTX(const U x); - template explicit _hvec3GTX(const U a, const U b, const U c); - template explicit _hvec3GTX(const U a, const U b, const _xvec2& c); - template explicit _hvec3GTX(const U a, const U b, const _xvec3& c); - template explicit _hvec3GTX(const U a, const U b, const _xvec4& c); - template explicit _hvec3GTX(const U a, const _xvec2& b); - template explicit _hvec3GTX(const U a, const _xvec3& b); - template explicit _hvec3GTX(const U a, const _xvec4& b); - template explicit _hvec3GTX(const _xvec2& a, U b); - template explicit _hvec3GTX(const _xvec2& a, const _xvec2& b); - template explicit _hvec3GTX(const _xvec2& a, const _xvec3& b); - template explicit _hvec3GTX(const _xvec2& a, const _xvec4& b); - template explicit _hvec3GTX(const _xvec3& a); - template explicit _hvec3GTX(const _xvec4& a); - - // Bool constructors - explicit _hvec3GTX(const bool a); - explicit _hvec3GTX(const bool a, const bool b, const bool c); - explicit _hvec3GTX(const bool a, const bool b, const _bvec2& c); - explicit _hvec3GTX(const bool a, const bool b, const _bvec3& c); - explicit _hvec3GTX(const bool a, const bool b, const _bvec4& c); - explicit _hvec3GTX(const bool a, const _bvec2& b); - explicit _hvec3GTX(const bool a, const _bvec3& b); - explicit _hvec3GTX(const bool a, const _bvec4& b); - explicit _hvec3GTX(const _bvec2& a, bool b); - explicit _hvec3GTX(const _bvec2& a, const _bvec2& b); - explicit _hvec3GTX(const _bvec2& a, const _bvec3& b); - explicit _hvec3GTX(const _bvec2& a, const _bvec4& b); - explicit _hvec3GTX(const _bvec3& a); - explicit _hvec3GTX(const _bvec4& a); - - // Unary updatable operators - _hvec3GTX& operator= (const _hvec3GTX& v); - _hvec3GTX& operator+=(const _halfGTX s); - _hvec3GTX& operator+=(const _hvec3GTX& v); - _hvec3GTX& operator-=(const _halfGTX s); - _hvec3GTX& operator-=(const _hvec3GTX& v); - _hvec3GTX& operator*=(const _halfGTX s); - _hvec3GTX& operator*=(const _hvec3GTX& v); - _hvec3GTX& operator/=(const _halfGTX s); - _hvec3GTX& operator/=(const _hvec3GTX& v); - _hvec3GTX& operator++(); - _hvec3GTX& operator--(); - }; - - class _hvec4GTX : public _cvec4, _xref3, _xref4 > - { - public: - // Common constructors - _hvec4GTX(); - _hvec4GTX(const _hvec4GTX& v); - - // Swizzle constructors - _hvec4GTX(const _xref4& r); - - // T constructors - explicit _hvec4GTX(const _halfGTX a); - explicit _hvec4GTX(const _halfGTX a, const _halfGTX b, const _halfGTX c, const _halfGTX d); - explicit _hvec4GTX(const _halfGTX a, const _halfGTX b, const _halfGTX c, const _hvec2GTX& d); - explicit _hvec4GTX(const _halfGTX a, const _halfGTX b, const _halfGTX c, const _hvec3GTX& d); - explicit _hvec4GTX(const _halfGTX a, const _halfGTX b, const _halfGTX c, const _hvec4GTX& d); - explicit _hvec4GTX(const _halfGTX a, const _halfGTX b, const _hvec2GTX& c); - explicit _hvec4GTX(const _halfGTX a, const _halfGTX b, const _hvec3GTX& c); - explicit _hvec4GTX(const _halfGTX a, const _halfGTX b, const _hvec4GTX& c); - explicit _hvec4GTX(const _halfGTX a, const _hvec2GTX& b, const _halfGTX c); - explicit _hvec4GTX(const _halfGTX a, const _hvec2GTX& b, const _hvec2GTX& c); - explicit _hvec4GTX(const _halfGTX a, const _hvec2GTX& b, const _hvec3GTX& c); - explicit _hvec4GTX(const _halfGTX a, const _hvec2GTX& b, const _hvec4GTX& c); - explicit _hvec4GTX(const _halfGTX a, const _hvec3GTX& b); - explicit _hvec4GTX(const _halfGTX a, const _hvec4GTX& b); - explicit _hvec4GTX(const _hvec2GTX& a, const _halfGTX b, const _halfGTX c); - explicit _hvec4GTX(const _hvec2GTX& a, const _halfGTX b, const _hvec2GTX& c); - explicit _hvec4GTX(const _hvec2GTX& a, const _halfGTX b, const _hvec3GTX& c); - explicit _hvec4GTX(const _hvec2GTX& a, const _halfGTX b, const _hvec4GTX& c); - explicit _hvec4GTX(const _hvec2GTX& a, const _hvec2GTX& b); - explicit _hvec4GTX(const _hvec2GTX& a, const _hvec3GTX& b); - explicit _hvec4GTX(const _hvec2GTX& a, const _hvec4GTX& b); - explicit _hvec4GTX(const _hvec3GTX& a, const _halfGTX b); - explicit _hvec4GTX(const _hvec3GTX& a, const _hvec2GTX& b); - explicit _hvec4GTX(const _hvec3GTX& a, const _hvec3GTX& b); - explicit _hvec4GTX(const _hvec3GTX& a, const _hvec4GTX& b); - - // U constructors - template explicit _hvec4GTX(const U x); - template explicit _hvec4GTX(const U a, const U b, const U c, const U d); - template explicit _hvec4GTX(const U a, const U b, const U c, const _xvec2& d); - template explicit _hvec4GTX(const U a, const U b, const U c, const _xvec3& d); - template explicit _hvec4GTX(const U a, const U b, const U c, const _xvec4& d); - template explicit _hvec4GTX(const U a, const U b, const _xvec2& c); - template explicit _hvec4GTX(const U a, const U b, const _xvec3& c); - template explicit _hvec4GTX(const U a, const U b, const _xvec4& c); - template explicit _hvec4GTX(const U a, const _xvec2& b, const U c); - template explicit _hvec4GTX(const U a, const _xvec2& b, const _xvec2& c); - template explicit _hvec4GTX(const U a, const _xvec2& b, const _xvec3& c); - template explicit _hvec4GTX(const U a, const _xvec2& b, const _xvec4& c); - template explicit _hvec4GTX(const U a, const _xvec3& b); - template explicit _hvec4GTX(const U a, const _xvec4& b); - template explicit _hvec4GTX(const _xvec2& a, const U b, const U c); - template explicit _hvec4GTX(const _xvec2& a, const U b, const _xvec2& c); - template explicit _hvec4GTX(const _xvec2& a, const U b, const _xvec3& c); - template explicit _hvec4GTX(const _xvec2& a, const U b, const _xvec4& c); - template explicit _hvec4GTX(const _xvec2& a, const _xvec2& b); - template explicit _hvec4GTX(const _xvec2& a, const _xvec3& b); - template explicit _hvec4GTX(const _xvec2& a, const _xvec4& b); - template explicit _hvec4GTX(const _xvec3& a, const U b); - template explicit _hvec4GTX(const _xvec3& a, const _xvec2& b); - template explicit _hvec4GTX(const _xvec3& a, const _xvec3& b); - template explicit _hvec4GTX(const _xvec3& a, const _xvec4& b); - template explicit _hvec4GTX(const _xvec4& a); - - // Bool constructors - explicit _hvec4GTX(const bool x); - explicit _hvec4GTX(const bool a, const bool b, const bool c, const bool d); - explicit _hvec4GTX(const bool a, const bool b, const bool c, const _bvec2& d); - explicit _hvec4GTX(const bool a, const bool b, const bool c, const _bvec3& d); - explicit _hvec4GTX(const bool a, const bool b, const bool c, const _bvec4& d); - explicit _hvec4GTX(const bool a, const bool b, const _bvec2& c); - explicit _hvec4GTX(const bool a, const bool b, const _bvec3& c); - explicit _hvec4GTX(const bool a, const bool b, const _bvec4& c); - explicit _hvec4GTX(const bool a, const _bvec2& b, const bool c); - explicit _hvec4GTX(const bool a, const _bvec2& b, const _bvec2& c); - explicit _hvec4GTX(const bool a, const _bvec2& b, const _bvec3& c); - explicit _hvec4GTX(const bool a, const _bvec2& b, const _bvec4& c); - explicit _hvec4GTX(const bool a, const _bvec3& b); - explicit _hvec4GTX(const bool a, const _bvec4& b); - explicit _hvec4GTX(const _bvec2& a, const bool b, const bool c); - explicit _hvec4GTX(const _bvec2& a, const bool b, const _bvec2& c); - explicit _hvec4GTX(const _bvec2& a, const bool b, const _bvec3& c); - explicit _hvec4GTX(const _bvec2& a, const bool b, const _bvec4& c); - explicit _hvec4GTX(const _bvec2& a, const _bvec2& b); - explicit _hvec4GTX(const _bvec2& a, const _bvec3& b); - explicit _hvec4GTX(const _bvec2& a, const _bvec4& b); - explicit _hvec4GTX(const _bvec3& a, const bool b); - explicit _hvec4GTX(const _bvec3& a, const _bvec2& b); - explicit _hvec4GTX(const _bvec3& a, const _bvec3& b); - explicit _hvec4GTX(const _bvec3& a, const _bvec4& b); - explicit _hvec4GTX(const _bvec4& a); - - // Unary updatable operators - _hvec4GTX& operator= (const _hvec4GTX& x); - _hvec4GTX& operator+=(const _halfGTX s); - _hvec4GTX& operator+=(const _hvec4GTX& v); - _hvec4GTX& operator-=(const _halfGTX s); - _hvec4GTX& operator-=(const _hvec4GTX& v); - _hvec4GTX& operator*=(const _halfGTX s); - _hvec4GTX& operator*=(const _hvec4GTX& v); - _hvec4GTX& operator/=(const _halfGTX s); - _hvec4GTX& operator/=(const _hvec4GTX& v); - _hvec4GTX& operator++(); - _hvec4GTX& operator--(); - }; - } - - typedef detail::_halfGTX __halfGTX; //!< \brief Type for half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef detail::_xvec2 __hvec2GTX; //!< \brief Vector of 2 half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef detail::_xvec3 __hvec3GTX; //!< \brief Vector of 3 half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef detail::_xvec4 __hvec4GTX; //!< \brief Vector of 4 half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef detail::_xmat2 __hmat2GTX; //!< \brief 2 * 2 matrix of half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef detail::_xmat3 __hmat3GTX; //!< \brief 3 * 3 matrix of half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef detail::_xmat4 __hmat4GTX; //!< \brief 4 * 4 matrix of half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef detail::_xquat __hquatGTX; //!< \brief Quaternion of half-precision floating-point numbers. (from GLM_GTX_half extension) - - __halfGTX cosGTX(__halfGTX x); - __hvec2GTX cosGTX(const __hvec2GTX& x); - __hvec3GTX cosGTX(const __hvec3GTX& x); - __hvec4GTX cosGTX(const __hvec4GTX& x); - - __halfGTX sinGTX(__halfGTX x); - __hvec2GTX sinGTX(const __hvec2GTX& x); - __hvec3GTX sinGTX(const __hvec3GTX& x); - __hvec4GTX sinGTX(const __hvec4GTX& x); - - __halfGTX tanGTX(__halfGTX x); - __hvec2GTX tanGTX(const __hvec2GTX& x); - __hvec3GTX tanGTX(const __hvec3GTX& x); - __hvec4GTX tanGTX(const __hvec4GTX& x); - - namespace gtx - { - //! GLM_GTX_half extension: Add support for half precision flotting-point types - namespace half - { - typedef __halfGTX half; //!< \brief Type for half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef __hvec2GTX hvec2; //!< \brief Vector of 2 half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef __hvec3GTX hvec3; //!< \brief Vector of 3 half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef __hvec4GTX hvec4; //!< \brief Vector of 4 half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef __hmat2GTX hmat2; //!< \brief 2 * 2 matrix of half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef __hmat3GTX hmat3; //!< \brief 3 * 3 matrix of half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef __hmat4GTX hmat4; //!< \brief 4 * 4 matrix of half-precision floating-point numbers. (From GLM_GTX_half extension) - typedef __hquatGTX hquat; //!< \brief Quaternion of half-precision floating-point numbers. (From GLM_GTX_half extension) - - inline __halfGTX cos(__halfGTX x){return cosGTX(x);} //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - inline __hvec2GTX cos(const __hvec2GTX& x){return cosGTX(x);} //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - inline __hvec3GTX cos(const __hvec3GTX& x){return cosGTX(x);} //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - inline __hvec4GTX cos(const __hvec4GTX& x){return cosGTX(x);} //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - - inline __halfGTX sin(__halfGTX x){return sinGTX(x);} //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - inline __hvec2GTX sin(const __hvec2GTX& x){return sinGTX(x);} //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - inline __hvec3GTX sin(const __hvec3GTX& x){return sinGTX(x);} //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - inline __hvec4GTX sin(const __hvec4GTX& x){return sinGTX(x);} //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_half extension) - - inline __halfGTX tan(__halfGTX x){return tanGTX(x);} //!< \brief The standard trigonometric tangent function. (From GLM_GTX_half extension) - inline __hvec2GTX tan(const __hvec2GTX& x){return tanGTX(x);} //!< \brief The standard trigonometric tangent function. (From GLM_GTX_half extension) - inline __hvec3GTX tan(const __hvec3GTX& x){return tanGTX(x);} //!< \brief The standard trigonometric tangent function. (From GLM_GTX_half extension) - inline __hvec4GTX tan(const __hvec4GTX& x){return tanGTX(x);} //!< \brief The standard trigonometric tangent function. (From GLM_GTX_half extension) - } - } -} - -#define GLM_GTX_half namespace gtx::half - -#include "half.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_half;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_half__ diff --git a/experimental/sse/glm/ext/gtx/half.inl b/experimental/sse/glm/ext/gtx/half.inl deleted file mode 100644 index d68e4b19..00000000 --- a/experimental/sse/glm/ext/gtx/half.inl +++ /dev/null @@ -1,1248 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/half.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#define GLM_HALF_OP(A, B, O) _toFloat16(_toFloat32(A) O _toFloat32(B)) -#define GLM_HALF_OP_1(A, B, O) _toFloat16(_toFloat32(A) O float(B)) -#define GLM_HALF_OP_2(A, O, B) _toFloat16(_toFloat32(A) O _toFloat32(B)) - -namespace glm -{ - inline __halfGTX cosGTX(__halfGTX x) - { - return __halfGTX(cos(float(x))); - } - - inline __hvec2GTX cosGTX(const __hvec2GTX& x) - { - return __hvec2GTX( - cos(float(x.x)), - cos(float(x.y))); - } - - inline __hvec3GTX cosGTX(const __hvec3GTX& x) - { - return __hvec3GTX( - cos(float(x.x)), - cos(float(x.y)), - cos(float(x.z))); - } - - inline __hvec4GTX cosGTX(const __hvec4GTX& x) - { - return __hvec4GTX( - cos(float(x.x)), - cos(float(x.y)), - cos(float(x.z)), - cos(float(x.w))); - } - - inline __halfGTX sinGTX(__halfGTX x) - { - return __halfGTX(sin(float(x))); - } - - inline __hvec2GTX sinGTX(const __hvec2GTX& x) - { - return __hvec2GTX( - sin(float(x.x)), - sin(float(x.y))); - } - - inline __hvec3GTX sinGTX(const __hvec3GTX& x) - { - return __hvec3GTX( - sin(float(x.x)), - sin(float(x.y)), - sin(float(x.z))); - } - - inline __hvec4GTX sinGTX(const __hvec4GTX& x) - { - return __hvec4GTX( - sin(float(x.x)), - sin(float(x.y)), - sin(float(x.z)), - sin(float(x.w))); - } - - inline __halfGTX tanGTX(__halfGTX x) - { - return __halfGTX(tan(float(x))); - } - - inline __hvec2GTX tanGTX(const __hvec2GTX& x) - { - return __hvec2GTX( - __halfGTX(tan(float(x.x))), - __halfGTX(tan(float(x.y)))); - } - - inline __hvec3GTX tanGTX(const __hvec3GTX& x) - { - return __hvec3GTX( - __halfGTX(tan(float(x.x))), - __halfGTX(tan(float(x.y))), - __halfGTX(tan(float(x.z)))); - } - - inline __hvec4GTX tanGTX(const __hvec4GTX& x) - { - return __hvec4GTX( - __halfGTX(tan(float(x.x))), - __halfGTX(tan(float(x.y))), - __halfGTX(tan(float(x.z))), - __halfGTX(tan(float(x.w)))); - } - - namespace detail - { - inline hdata::hdata(const hdata& value) : - data(value.data) - {} - - inline hdata::hdata(float value) : - data(_toFloat16(value).data) - {} - - inline hdata::operator float () - { - return _toFloat32(data); - } - - inline float _overflow() - { - volatile float f = 1e10; - - for(int i = 0; i < 10; ++i) - f *= f; // this will overflow before - // the for­loop terminates - return f; - } - - inline float _toFloat32(hdata HData) - { - short value = HData.data; - - int s = (value >> 15) & 0x00000001; - int e = (value >> 10) & 0x0000001f; - int m = value & 0x000003ff; - - if(e == 0) - { - if(m == 0) - { - // - // Plus or minus zero - // - - uif result; - result.i = s << 31; - return result.f; - } - else - { - // - // Denormalized number -- renormalize it - // - - while(!(m & 0x00000400)) - { - m <<= 1; - e -= 1; - } - - e += 1; - m &= ~0x00000400; - } - } - else if(e == 31) - { - if(m == 0) - { - // - // Positive or negative infinity - // - - uif result; - result.i = (s << 31) | 0x7f800000; - return result.f; - } - else - { - // - // Nan -- preserve sign and significand bits - // - - uif result; - result.i = (s << 31) | 0x7f800000 | (m << 13); - return result.f; - } - } - - // - // Normalized number - // - - e = e + (127 - 15); - m = m << 13; - - // - // Assemble s, e and m. - // - - uif Result; - Result.i = (s << 31) | (e << 23) | m; - return Result.f; - } - - inline hdata _toFloat16(float f) - { - uif Entry; - Entry.f = f; - int i = Entry.i; - - // - // Our floating point number, f, is represented by the bit - // pattern in integer i. Disassemble that bit pattern into - // the sign, s, the exponent, e, and the significand, m. - // Shift s into the position where it will go in in the - // resulting _halfGTX number. - // Adjust e, accounting for the different exponent bias - // of float and _halfGTX (127 versus 15). - // - - register int s = (i >> 16) & 0x00008000; - register int e = ((i >> 23) & 0x000000ff) - (127 - 15); - register int m = i & 0x007fffff; - - // - // Now reassemble s, e and m into a _halfGTX: - // - - if(e <= 0) - { - if(e < -10) - { - // - // E is less than -10. The absolute value of f is - // less than __halfGTX_MIN (f may be a small normalized - // float, a denormalized float or a zero). - // - // We convert f to a _halfGTX zero. - // - - return 0; - } - - // - // E is between -10 and 0. F is a normalized float, - // whose magnitude is less than __halfGTX_NRM_MIN. - // - // We convert f to a denormalized _halfGTX. - // - - m = (m | 0x00800000) >> (1 - e); - - // - // Round to nearest, round "0.5" up. - // - // Rounding may cause the significand to overflow and make - // our number normalized. Because of the way a _halfGTX's bits - // are laid out, we don't have to treat this case separately; - // the code below will handle it correctly. - // - - if(m & 0x00001000) m += 0x00002000; - - // - // Assemble the _halfGTX from s, e (zero) and m. - // - - hdata HData; - HData.data = s | (m >> 13); - return HData; - } - else if(e == 0xff - (127 - 15)) - { - if(m == 0) - { - // - // F is an infinity; convert f to a _halfGTX - // infinity with the same sign as f. - // - - hdata HData; - HData.data = s | 0x7c00; - return HData; - } - else - { - // - // F is a NAN; we produce a _halfGTX NAN that preserves - // the sign bit and the 10 leftmost bits of the - // significand of f, with one exception: If the 10 - // leftmost bits are all zero, the NAN would turn - // into an infinity, so we have to set at least one - // bit in the significand. - // - - m >>= 13; - - hdata HData; - HData.data = s | 0x7c00 | m | (m == 0); - return HData; - } - } - else - { - // - // E is greater than zero. F is a normalized float. - // We try to convert f to a normalized _halfGTX. - // - - // - // Round to nearest, round "0.5" up - // - - if(m & 0x00001000) - { - m += 0x00002000; - - if(m & 0x00800000) - { - m = 0; // overflow in significand, - e += 1; // adjust exponent - } - } - - // - // Handle exponent overflow - // - - if (e > 30) - { - _overflow(); // Cause a hardware floating point overflow; - - hdata HData; - HData.data = s | 0x7c00; - return HData; - // if this returns, the _halfGTX becomes an - } // infinity with the same sign as f. - - // - // Assemble the _halfGTX from s, e and m. - // - - hdata HData; - HData.data = s | (e << 10) | (m >> 13); - return HData; - } - } - - inline _halfGTX::_halfGTX() - {} - - inline _halfGTX::_halfGTX(float s) - { - if(s == 0) - data = 0; - else - data = _toFloat16(s).data; - } - - inline _halfGTX::_halfGTX(double s) - { - if(s == 0) - data.data = 0; - else - data = _toFloat16(float(s)).data; - } - - inline _halfGTX::_halfGTX(int s) - { - data = _toFloat16(float(s)); - } - - inline _halfGTX::_halfGTX(bool s) - { - data = _toFloat16(float(s)); - } - - inline _halfGTX::operator float() const - { - return _toFloat32(data); - } - - inline _halfGTX::operator double() const - { - return double(_toFloat32(data)); - } - - inline _halfGTX::operator int() const - { - return int(_toFloat32(data)); - } - - inline _halfGTX::operator hdata() const - { - return data; - } - - inline _halfGTX& _halfGTX::operator=(_halfGTX h) - { - data = h.data; - return *this; - } - - inline _halfGTX& _halfGTX::operator=(float f) - { - *this = _halfGTX(f); - return *this; - } - - inline _halfGTX _halfGTX::operator+(_halfGTX h) const - { - return _halfGTX(float(*this) + float(h)); - } - - inline _halfGTX& _halfGTX::operator+=(_halfGTX h) - { - *this = _halfGTX(float(*this) + float(h)); - return *this; - } - - inline _halfGTX _halfGTX::operator+(float f) const - { - return _halfGTX(float(*this) + f); - } - - inline _halfGTX& _halfGTX::operator+=(float f) - { - *this = _halfGTX(float(*this) + f); - return *this; - } - - inline _halfGTX _halfGTX::operator-(_halfGTX h) const - { - return _halfGTX(float(*this) - float(h)); - } - - inline _halfGTX& _halfGTX::operator-=(_halfGTX h) - { - *this = _halfGTX(float(*this) - float(h)); - return *this; - } - - inline _halfGTX _halfGTX::operator-(float f) const - { - return _halfGTX(float(*this) - f); - } - - inline _halfGTX& _halfGTX::operator-=(float f) - { - *this = _halfGTX (float (*this) - f); - return *this; - } - - inline _halfGTX _halfGTX::operator*(_halfGTX h) const - { - return _halfGTX(float(*this) * float(h)); - } - - inline _halfGTX& _halfGTX::operator*=(_halfGTX h) - { - *this = _halfGTX (float (*this) * float (h)); - return *this; - } - - inline _halfGTX _halfGTX::operator*(float f) const - { - return _halfGTX(float(*this) * f); - } - - inline _halfGTX& _halfGTX::operator*=(float f) - { - *this = _halfGTX (float (*this) * f); - return *this; - } - - inline _halfGTX _halfGTX::operator/(_halfGTX h) const - { - return _halfGTX(float(*this) / float(h)); - } - - inline _halfGTX& _halfGTX::operator/=(_halfGTX h) - { - *this = _halfGTX (float (*this) / float (h)); - return *this; - } - - inline _halfGTX _halfGTX::operator/(float f) const - { - return _halfGTX(float(*this) / f); - } - - inline _halfGTX& _halfGTX::operator/=(float f) - { - *this = _halfGTX (float (*this) / f); - return *this; - } - - inline _halfGTX _halfGTX::operator-() const - { - float Result = -_toFloat32(data); - return _halfGTX(Result); - } - - inline bool _halfGTX::operator< (const _halfGTX& s) const - { - return _toFloat32(data) < _toFloat32(s.data); - } - - inline bool _halfGTX::operator> (const _halfGTX& s) const - { - return _toFloat32(data) > _toFloat32(s.data); - } - - inline bool _halfGTX::operator<=(const _halfGTX& s) const - { - return _toFloat32(data) <= _toFloat32(s.data); - } - - inline bool _halfGTX::operator>=(const _halfGTX& s) const - { - return _toFloat32(data) >= _toFloat32(s.data); - } - - inline bool _halfGTX::operator==(const _halfGTX& s) const - { - return data.data == s.data.data; - } - - inline bool _halfGTX::operator!=(const _halfGTX& s) const - { - return data.data != s.data.data; - } - - // Common constructors - inline _hvec2GTX::_hvec2GTX() : - _cvec2(0, 0) - {} - - inline _hvec2GTX::_hvec2GTX(const _hvec2GTX& v) : - _cvec2(v.x, v.y) - {} - - // Swizzle conclassor - inline _hvec2GTX::_hvec2GTX(const _xref2& r) : - _cvec2(r.x, r.y) - {} - - // T constructors - inline _hvec2GTX::_hvec2GTX(const _halfGTX x) : - _cvec2(x._data(), x._data()) - {} - - inline _hvec2GTX::_hvec2GTX(const _halfGTX a, const _halfGTX b) : - _cvec2(a._data(), b._data()) - {} - - inline _hvec2GTX::_hvec2GTX(const _halfGTX a, const _hvec2GTX& b) : - _cvec2(a._data(), b.x) - {} - - inline _hvec2GTX::_hvec2GTX(const _halfGTX a, const _hvec3GTX& b) : - _cvec2(a._data(), b.x) - {} - - inline _hvec2GTX::_hvec2GTX(const _halfGTX a, const _hvec4GTX& b) : - _cvec2(a._data(), b.x) - {} - - inline _hvec2GTX::_hvec2GTX(const _hvec3GTX& a) : - _cvec2(a.x, a.y) - {} - - inline _hvec2GTX::_hvec2GTX(const _hvec4GTX& a) : - _cvec2(a.x, a.y) - {} - - // U constructors - template - inline _hvec2GTX::_hvec2GTX(const U x) : - _cvec2(_halfGTX(x)._data(), _halfGTX(x)._data()) - {} - - template - inline _hvec2GTX::_hvec2GTX(const U a, const U b) : - _cvec2(_halfGTX(a)._data(), _halfGTX(b)._data()) - {} - - template - inline _hvec2GTX::_hvec2GTX(const U a, const _xvec2& b) : - _cvec2(T(a), T(b.x)) - {} - - template - inline _hvec2GTX::_hvec2GTX(const U a, const _xvec3& b) : - _cvec2(T(a), T(b.x)) - {} - - template - inline _hvec2GTX::_hvec2GTX(const U a, const _xvec4& b) : - _cvec2(T(a), T(b.x)) - {} - - template - inline _hvec2GTX::_hvec2GTX(const _xvec2& a) : - _cvec2(_halfGTX(a.x)._data(), _halfGTX(a.y)._data()) - {} - - template - inline _hvec2GTX::_hvec2GTX(const _xvec3& a) : - _cvec2(T(a.x), T(a.y)) - {} - - template - inline _hvec2GTX::_hvec2GTX(const _xvec4& a) : - _cvec2(T(a.x), T(a.y)) - {} - - // Bool constructors - inline _hvec2GTX::_hvec2GTX(const bool a) : - _cvec2(a, a) - {} - - inline _hvec2GTX::_hvec2GTX(const bool a, const bool b) : - _cvec2(a, b) - {} - - inline _hvec2GTX::_hvec2GTX(const bool a, const _bvec2& b) : - _cvec2(a, b.x) - {} - - inline _hvec2GTX::_hvec2GTX(const bool a, const _bvec3& b) : - _cvec2(a, b.x) - {} - - inline _hvec2GTX::_hvec2GTX(const bool a, const _bvec4& b) : - _cvec2(a, b.x) - {} - - inline _hvec2GTX::_hvec2GTX(const _bvec3& a) : - _cvec2(a.x, a.y) - {} - - inline _hvec2GTX::_hvec2GTX(const _bvec4& a) : - _cvec2(a.x, a.y) - {} - - inline _hvec2GTX::_hvec2GTX(const _bvec2& a) : - _cvec2(a.x, a.y) - {} - - ////////////////////////////////////////////////////////////// - // vec2 and ivec2 operators - - inline _hvec2GTX& _hvec2GTX::operator=(const _hvec2GTX& v) - { - this->x = v.x; - this->y = v.y; - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator+= (const _halfGTX s) - { - this->x = (_halfGTX(this->x) + s)._data(); - this->y = (_halfGTX(this->y) + s)._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator+= (const _hvec2GTX& v) - { - this->x = (_halfGTX(this->x) + _halfGTX(v.x))._data(); - this->y = (_halfGTX(this->y) + _halfGTX(v.y))._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator-= (const _halfGTX s) - { - this->x = (_halfGTX(this->x) - s)._data(); - this->y = (_halfGTX(this->y) - s)._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator-= (const _hvec2GTX& v) - { - this->x = (_halfGTX(this->x) - _halfGTX(v.x))._data(); - this->y = (_halfGTX(this->y) - _halfGTX(v.y))._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator*= (const _halfGTX s) - { - this->x = (_halfGTX(this->x) * s)._data(); - this->y = (_halfGTX(this->y) * s)._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator*= (const _hvec2GTX& v) - { - this->x = (_halfGTX(this->x) * _halfGTX(v.x))._data(); - this->y = (_halfGTX(this->y) * _halfGTX(v.y))._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator/= (const _halfGTX s) - { - this->x = (_halfGTX(this->x) / s)._data(); - this->y = (_halfGTX(this->y) / s)._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator/= (const _hvec2GTX& v) - { - this->x = (_halfGTX(this->x) / _halfGTX(v.x))._data(); - this->y = (_halfGTX(this->y) / _halfGTX(v.y))._data(); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator++ () - { - this->x = _toFloat16(_toFloat32(this->x) + 1.0f); - this->y = _toFloat16(_toFloat32(this->y) + 1.0f); - return *this; - } - - inline _hvec2GTX& _hvec2GTX::operator-- () - { - this->x = _toFloat16(_toFloat32(this->x) - 1.0f); - this->y = _toFloat16(_toFloat32(this->y) - 1.0f); - return *this; - } - - // Binary operators - inline _hvec2GTX operator+ (const _hvec2GTX& v, const _halfGTX s) - { - return _hvec2GTX( - _halfGTX(v.x) + s, - _halfGTX(v.y) + s); - } - - inline _hvec2GTX operator+ (const _halfGTX s, const _hvec2GTX& v) - { - return _hvec2GTX( - _halfGTX(v.x) + s, - _halfGTX(v.y) + s); - } - - inline _hvec2GTX operator+ (const _hvec2GTX& v1, const _hvec2GTX& v2) - { - return _hvec2GTX( - _halfGTX(v1.x) + _halfGTX(v2.x), - _halfGTX(v1.y) + _halfGTX(v2.y)); - } - - inline _hvec2GTX operator- (const _hvec2GTX& v, const _halfGTX s) - { - return _hvec2GTX( - _halfGTX(v.x) - s, - _halfGTX(v.y) - s); - } - - inline _hvec2GTX operator- (const _halfGTX s, const _hvec2GTX& v) - { - return _hvec2GTX( - _halfGTX(v.x) - s, - _halfGTX(v.y) - s); - } - - inline _hvec2GTX operator- (const _hvec2GTX& v1, const _hvec2GTX& v2) - { - return _hvec2GTX( - _halfGTX(v1.x) - _halfGTX(v2.x), - _halfGTX(v1.y) - _halfGTX(v2.y)); - } - - inline _hvec2GTX operator* (const _hvec2GTX& v, const _halfGTX s) - { - return _hvec2GTX( - _halfGTX(v.x) * s, - _halfGTX(v.y) * s); - } - - inline _hvec2GTX operator* (const _halfGTX s, const _hvec2GTX& v) - { - return _hvec2GTX( - s * _halfGTX(v.x), - s * _halfGTX(v.y)); - } - - inline _hvec2GTX operator* (const _hvec2GTX& v1, const _hvec2GTX& v2) - { - return _hvec2GTX( - _halfGTX(v1.x) * _halfGTX(v2.x), - _halfGTX(v1.y) * _halfGTX(v2.y)); - } - - inline _hvec2GTX operator/ (const _hvec2GTX& v, const _halfGTX s) - { - return _hvec2GTX( - _halfGTX(v.x) / s, - _halfGTX(v.y) / s); - } - - inline _hvec2GTX operator/ (const _halfGTX s, const _hvec2GTX& v) - { - return _hvec2GTX( - s / _halfGTX(v.x), - s / _halfGTX(v.y)); - } - - inline _hvec2GTX operator/ (const _hvec2GTX& v1, const _hvec2GTX& v2) - { - return _hvec2GTX( - _halfGTX(v1.x) / _halfGTX(v2.x), - _halfGTX(v1.y) / _halfGTX(v2.y)); - } - - // Unary constant operators - inline const _hvec2GTX operator- (const _hvec2GTX& v) - { - return _hvec2GTX( - -_halfGTX(v.x), - -_halfGTX(v.y)); - } - - inline const _hvec2GTX operator++ (const _hvec2GTX& v, int) - { - return _hvec2GTX( - _halfGTX(v.x) + _halfGTX(1), - _halfGTX(v.y) + _halfGTX(1)); - } - - inline const _hvec2GTX operator-- (const _hvec2GTX& v, int) - { - return _hvec2GTX( - _halfGTX(v.x) - _halfGTX(1), - _halfGTX(v.y) - _halfGTX(1)); - } - - //////////////////////////////////////////////////////// - // _hvec3GTX - // Common constructors - inline _hvec3GTX::_hvec3GTX() : - _cvec3(0, 0, 0) - {} - - inline _hvec3GTX::_hvec3GTX(const _hvec3GTX& v) : - _cvec3(v.x, v.y, v.z) - {} - - // Swizzle constructors - inline _hvec3GTX::_hvec3GTX(const _xref3& r) : - _cvec3(r.x, r.y, r.z) - {} - - // T constructors - inline _hvec3GTX::_hvec3GTX(const _halfGTX x) : - _cvec3(x, x, x) - {} - - inline _hvec3GTX::_hvec3GTX(const _halfGTX a, const _halfGTX b, const _halfGTX c) : - _cvec3(a, b, c) - {} - - inline _hvec3GTX::_hvec3GTX(const _halfGTX a, const _halfGTX b, const _hvec2GTX& c) : - _cvec3(a, b, c.x) - {} - - inline _hvec3GTX::_hvec3GTX(const _halfGTX a, const _halfGTX b, const _hvec3GTX& c) : - _cvec3(a, b, c.x) - {} - - inline _hvec3GTX::_hvec3GTX(const _halfGTX a, const _halfGTX b, const _hvec4GTX& c) : - _cvec3(a, b, c.x) - {} - - inline _hvec3GTX::_hvec3GTX(const _halfGTX a, const _hvec2GTX& b) : - _cvec3(a, b.x, b.y) - {} - - inline _hvec3GTX::_hvec3GTX(const _halfGTX a, const _hvec3GTX& b) : - _cvec3(a, b.x, b.y) - {} - - inline _hvec3GTX::_hvec3GTX(const _halfGTX a, const _hvec4GTX& b) : - _cvec3(a, b.x, b.y) - {} - - inline _hvec3GTX::_hvec3GTX(const _hvec2GTX& a, _halfGTX b) : - _cvec3(a.x, a.y, b) - {} - - inline _hvec3GTX::_hvec3GTX(const _hvec2GTX& a, const _hvec2GTX& b) : - _cvec3(a.x, a.y, b.x) - {} - - inline _hvec3GTX::_hvec3GTX(const _hvec2GTX& a, const _hvec3GTX& b) : - _cvec3(a.x, a.y, b.x) - {} - - inline _hvec3GTX::_hvec3GTX(const _hvec2GTX& a, const _hvec4GTX& b) : - _cvec3(a.x, a.y, b.x) - {} - - inline _hvec3GTX::_hvec3GTX(const _hvec4GTX& a) : - _cvec3(a.x, a.y, a.z) - {} - - // U constructors - template - inline _hvec3GTX::_hvec3GTX(const U x) : - _cvec3(_halfGTX(x)._data(), _halfGTX(x)._data(), _halfGTX(x)._data()) - {} - - template - inline _hvec3GTX::_hvec3GTX(const U a, const U b, const U c) : - _cvec3(_halfGTX(a)._data(), _halfGTX(b)._data(), _halfGTX(c)._data()) - {} - - template - inline _hvec3GTX::_hvec3GTX(const U a, const U b, const _xvec2& c) : - _cvec3(_halfGTX(a)._data(), _halfGTX(b)._data(), _halfGTX(c.x)._data()) - {} - - template - inline _hvec3GTX::_hvec3GTX(const U a, const U b, const _xvec3& c) : - _cvec3(_toFloat16(float(a)), _toFloat16(float(b)), _toFloat16(float(c.x))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const U a, const U b, const _xvec4& c) : - _cvec3(_toFloat16(float(a)), _toFloat16(float(b)), _toFloat16(float(c.x))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const U a, const _xvec2& b) : - _cvec3(_toFloat16(float(a)), _toFloat16(float(b.x)), _toFloat16(float(b.y))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const U a, const _xvec3& b) : - _cvec3(_toFloat16(float(a)), _toFloat16(float(b.x)), _toFloat16(float(b.y))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const U a, const _xvec4& b) : - _cvec3(_toFloat16(float(a)), _toFloat16(float(b.x)), _toFloat16(float(b.y))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const _xvec2& a, U b) : - _cvec3(_toFloat16(float(a.x)), _toFloat16(float(a.y)), _toFloat16(float(b))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const _xvec2& a, const _xvec2& b) : - _cvec3(_toFloat16(float(a.x)), _toFloat16(float(a.y)), _toFloat16(float(b.x))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const _xvec2& a, const _xvec3& b) : - _cvec3(_toFloat16(float(a.x)), _toFloat16(float(a.y)), _toFloat16(float(b.x))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const _xvec2& a, const _xvec4& b) : - _cvec3(_toFloat16(float(a.x)), _toFloat16(float(a.y)), _toFloat16(float(b.x))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const _xvec3& a) : - _cvec3(_toFloat16(float(a.x)), _toFloat16(float(a.y)), _toFloat16(float(a.z))) - {} - - template - inline _hvec3GTX::_hvec3GTX(const _xvec4& a) : - _cvec3(_toFloat16(float(a.x)), _toFloat16(float(a.y)), _toFloat16(float(a.z))) - {} - - // Bool constructors - inline _hvec3GTX::_hvec3GTX(const bool x) : - _cvec3(float(x), float(x), float(x)) - {} - - inline _hvec3GTX::_hvec3GTX(const bool a, const bool b, const bool c) : - _cvec3(float(a), float(b), float(c)) - {} - - inline _hvec3GTX::_hvec3GTX(const bool a, const bool b, const _bvec2& c) : - _cvec3(float(a), float(b), float(c.x)) - {} - - inline _hvec3GTX::_hvec3GTX(const bool a, const bool b, const _bvec3& c) : - _cvec3(float(a), float(b), float(c.x)) - {} - - inline _hvec3GTX::_hvec3GTX(const bool a, const bool b, const _bvec4& c) : - _cvec3(float(a), float(b), float(c.x)) - {} - - inline _hvec3GTX::_hvec3GTX(const bool a, const _bvec2& b) : - _cvec3(float(a), float(b.x), float(b.y)) - {} - - inline _hvec3GTX::_hvec3GTX(const bool a, const _bvec3& b) : - _cvec3(float(a), float(b.x), float(b.y)) - {} - - inline _hvec3GTX::_hvec3GTX(const bool a, const _bvec4& b) : - _cvec3(float(a), float(b.x), float(b.y)) - {} - - inline _hvec3GTX::_hvec3GTX(const _bvec2& a, bool b) : - _cvec3(float(a.x), float(a.y), float(b)) - {} - - inline _hvec3GTX::_hvec3GTX(const _bvec2& a, const _bvec2& b) : - _cvec3(float(a.x), float(a.y), float(b.x)) - {} - - inline _hvec3GTX::_hvec3GTX(const _bvec2& a, const _bvec3& b) : - _cvec3(float(a.x), float(a.y), float(b.x)) - {} - - inline _hvec3GTX::_hvec3GTX(const _bvec2& a, const _bvec4& b) : - _cvec3(float(a.x), float(a.y), float(b.x)) - {} - - inline _hvec3GTX::_hvec3GTX(const _bvec3& a) : - _cvec3(float(a.x), float(a.y), float(a.z)) - {} - - inline _hvec3GTX::_hvec3GTX(const _bvec4& a) : - _cvec3(float(a.x), float(a.y), float(a.z)) - {} - - ////////////////////////////////////////////////////////////// - // hvec3 operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - inline _hvec3GTX& _hvec3GTX::operator=(const _hvec3GTX& v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator+= (const _halfGTX s) - { - this->x = GLM_HALF_OP(this->x, s._data(), +); - this->y = GLM_HALF_OP(this->y, s._data(), +); - this->z = GLM_HALF_OP(this->z, s._data(), +); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator+= (const _hvec3GTX& v) - { - this->x = GLM_HALF_OP(this->x, v.x, +); - this->y = GLM_HALF_OP(this->y, v.y, +); - this->z = GLM_HALF_OP(this->z, v.z, +); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator-= (const _halfGTX s) - { - this->x = GLM_HALF_OP(this->x, s._data(), -); - this->y = GLM_HALF_OP(this->y, s._data(), -); - this->z = GLM_HALF_OP(this->z, s._data(), -); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator-= (const _hvec3GTX& v) - { - this->x = GLM_HALF_OP(this->x, v.x, -); - this->y = GLM_HALF_OP(this->y, v.y, -); - this->z = GLM_HALF_OP(this->z, v.z, -); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator*= (const _halfGTX s) - { - this->x = GLM_HALF_OP(this->x, s._data(), *); - this->y = GLM_HALF_OP(this->y, s._data(), *); - this->z = GLM_HALF_OP(this->z, s._data(), *); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator*= (const _hvec3GTX& v) - { - this->x = GLM_HALF_OP(this->x, v.x, *); - this->y = GLM_HALF_OP(this->y, v.y, *); - this->z = GLM_HALF_OP(this->z, v.z, *); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator/= (const _halfGTX s) - { - this->x = GLM_HALF_OP(this->x, s._data(), /); - this->y = GLM_HALF_OP(this->y, s._data(), /); - this->z = GLM_HALF_OP(this->z, s._data(), /); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator/= (const _hvec3GTX& v) - { - this->x = GLM_HALF_OP(this->x, v.x, /); - this->y = GLM_HALF_OP(this->y, v.y, /); - this->z = GLM_HALF_OP(this->z, v.z, /); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator++ () - { - this->x = GLM_HALF_OP_1(this->x, 1.0f, +); - this->y = GLM_HALF_OP_1(this->y, 1.0f, +); - this->z = GLM_HALF_OP_1(this->z, 1.0f, +); - return *this; - } - - inline _hvec3GTX& _hvec3GTX::operator-- () - { - this->x = GLM_HALF_OP_1(this->x, 1.0f, -); - this->y = GLM_HALF_OP_1(this->y, 1.0f, -); - this->z = GLM_HALF_OP_1(this->z, 1.0f, -); - return *this; - } - - // Unary constant operators - inline const _hvec3GTX operator- (const _hvec3GTX& v) - { - return _hvec3GTX( - _toFloat16(-_toFloat32(v.x)), - _toFloat16(-_toFloat32(v.y)), - _toFloat16(-_toFloat32(v.z))); - } - - inline const _hvec3GTX operator++ (const _hvec3GTX& v, int) - { - return _hvec3GTX( - GLM_HALF_OP_1(v.x, 1.0f, +), - GLM_HALF_OP_1(v.y, 1.0f, +), - GLM_HALF_OP_1(v.z, 1.0f, +)); - } - - inline const _hvec3GTX operator-- (const _hvec3GTX& v, int) - { - return _hvec3GTX( - GLM_HALF_OP_1(v.x, 1.0f, -), - GLM_HALF_OP_1(v.y, 1.0f, -), - GLM_HALF_OP_1(v.z, 1.0f, -)); - } - - // Binary operators - inline _hvec3GTX operator+ (const _hvec3GTX& v, const _halfGTX s) - { - return _hvec3GTX( - GLM_HALF_OP_2(v.x, +, s), - GLM_HALF_OP_2(v.y, +, s), - GLM_HALF_OP_2(v.z, +, s)); - } - - inline _hvec3GTX operator+ (const _halfGTX s, const _hvec3GTX& v) - { - return _hvec3GTX( - GLM_HALF_OP_2(s, +, v.x), - GLM_HALF_OP_2(s, +, v.y), - GLM_HALF_OP_2(s, +, v.z)); - } - - inline _hvec3GTX operator+ (const _hvec3GTX& v1, const _hvec3GTX& v2) - { - return _hvec3GTX( - GLM_HALF_OP_2(v1.x, +, v2.x), - GLM_HALF_OP_2(v1.y, +, v2.y), - GLM_HALF_OP_2(v1.z, +, v2.z)); - } - - inline _hvec3GTX operator- (const _hvec3GTX& v, const _halfGTX s) - { - return _hvec3GTX( - GLM_HALF_OP_2(v.x, -, s), - GLM_HALF_OP_2(v.y, -, s), - GLM_HALF_OP_2(v.z, -, s)); - } - - inline _hvec3GTX operator- (const _halfGTX s, const _hvec3GTX& v) - { - return _hvec3GTX( - GLM_HALF_OP_2(s, -, v.x), - GLM_HALF_OP_2(s, -, v.y), - GLM_HALF_OP_2(s, -, v.z)); - } - - inline _hvec3GTX operator- (const _hvec3GTX& v1, const _hvec3GTX& v2) - { - return _hvec3GTX( - GLM_HALF_OP_2(v1.x, -, v2.x), - GLM_HALF_OP_2(v1.y, -, v2.y), - GLM_HALF_OP_2(v1.z, -, v2.z)); - } - - inline _hvec3GTX operator* (const _hvec3GTX& v, const _halfGTX s) - { - return _hvec3GTX( - GLM_HALF_OP_2(v.x, *, s), - GLM_HALF_OP_2(v.y, *, s), - GLM_HALF_OP_2(v.z, *, s)); - } - - inline _hvec3GTX operator* (const _halfGTX s, const _hvec3GTX& v) - { - return _hvec3GTX( - GLM_HALF_OP_2(s, *, v.x), - GLM_HALF_OP_2(s, *, v.y), - GLM_HALF_OP_2(s, *, v.z)); - } - - inline _hvec3GTX operator* (const _hvec3GTX& v1, const _hvec3GTX & v2) - { - return _hvec3GTX( - GLM_HALF_OP_2(v1.x, *, v2.x), - GLM_HALF_OP_2(v1.y, *, v2.y), - GLM_HALF_OP_2(v1.z, *, v2.z)); - } - - inline _hvec3GTX operator/ (const _hvec3GTX& v, const _halfGTX s) - { - return _hvec3GTX( - GLM_HALF_OP_2(v.x, /, s), - GLM_HALF_OP_2(v.y, /, s), - GLM_HALF_OP_2(v.z, /, s)); - } - - inline _hvec3GTX operator/ (const _halfGTX s, const _hvec3GTX& v) - { - return _hvec3GTX( - GLM_HALF_OP_2(s, /, v.x), - GLM_HALF_OP_2(s, /, v.y), - GLM_HALF_OP_2(s, /, v.z)); - } - - inline _hvec3GTX operator/ (const _hvec3GTX& v1, const _hvec3GTX& v2) - { - return _hvec3GTX( - GLM_HALF_OP_2(v1.x, /, v2.x), - GLM_HALF_OP_2(v1.y, /, v2.y), - GLM_HALF_OP_2(v1.z, /, v2.z)); - } - } -} diff --git a/experimental/sse/glm/ext/gtx/handed_coordinate_space.h b/experimental/sse/glm/ext/gtx/handed_coordinate_space.h deleted file mode 100644 index fbcbd7d7..00000000 --- a/experimental/sse/glm/ext/gtx/handed_coordinate_space.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/handed_coordinate_space.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_handed_coordinate_space__ -#define __glm_gtx_handed_coordinate_space__ - -// Dependency: -#include "../../glm.h" - -#define GLM_GTX_handed_coordinate_space_supported - -namespace glm -{ - template bool rightHandedGTX(const detail::_xvec3& tangent, const detail::_xvec3& binormal, const detail::_xvec3& normal); //!< Return if a trihedron right handed or not (From GLM_GTX_handed_coordinate_space extension) - template bool leftHandedGTX(const detail::_xvec3& tangent, const detail::_xvec3& binormal, const detail::_xvec3& normal); //!< Return if a trihedron left handed or not (From GLM_GTX_handed_coordinate_space extension) - - namespace gtx - { - //! GLM_GTX_handed_coordinate_space extension: To know if a triedron is right or left handed - namespace handed_coordinate_space - { - template inline bool rightHanded(const detail::_xvec3& tangent, const detail::_xvec3& binormal, const detail::_xvec3& normal){return rightHandedGTX(tangent, binormal, normal);} //!< Return if a trihedron right handed or not (From GLM_GTX_handed_coordinate_space extension) - template inline bool leftHanded(const detail::_xvec3& tangent, const detail::_xvec3& binormal, const detail::_xvec3& normal){return leftHandedGTX(tangent, binormal, normal);} //!< Return if a trihedron left handed or not (From GLM_GTX_handed_coordinate_space extension) - } - } -} - -#define GLM_GTX_handed_coordinate_space namespace gtx::handed_coordinate_space - -#include "handed_coordinate_space.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_handed_coordinate_space;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_handed_coordinate_space__ diff --git a/experimental/sse/glm/ext/gtx/handed_coordinate_space.inl b/experimental/sse/glm/ext/gtx/handed_coordinate_space.inl deleted file mode 100644 index ce5954f2..00000000 --- a/experimental/sse/glm/ext/gtx/handed_coordinate_space.inl +++ /dev/null @@ -1,23 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/handed_coordinate_space.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline bool rightHandedGTX(const detail::_xvec3& tangent, const detail::_xvec3& binormal, const detail::_xvec3& normal) - { - return dot(cross(normal, tangent), binormal) > T(0); - } - - template - inline bool leftHandedGTX(const detail::_xvec3& tangent, const detail::_xvec3& binormal, const detail::_xvec3& normal) - { - return dot(cross(normal, tangent), binormal) < T(0); - } -} diff --git a/experimental/sse/glm/ext/gtx/hyperbolic.h b/experimental/sse/glm/ext/gtx/hyperbolic.h deleted file mode 100644 index 042629d7..00000000 --- a/experimental/sse/glm/ext/gtx/hyperbolic.h +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-25 -// Updated : 2007-01-26 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/hyperbolic.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_hyperbolic__ -#define __glm_gtx_hyperbolic__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template T sinhGTX(const T angle); //!< \brief The trigonometric hyperbolic sine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec2 sinhGTX(const detail::_xvec2& angle); //!< \brief The standard trigonometric hyperbolic sine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec3 sinhGTX(const detail::_xvec3& angle); //!< \brief The standard trigonometric hyperbolic sine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec4 sinhGTX(const detail::_xvec4& angle); //!< \brief The standard trigonometric hyperbolic sine function. (From GLM_GTX_hyperbolic extension) - - template T coshGTX(const T angle); //!< \brief The trigonometric hyperbolic cosine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec2 coshGTX(const detail::_xvec2& angle); //!< \brief The standard trigonometric hyperbolic cosine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec3 coshGTX(const detail::_xvec3& angle); //!< \brief The standard trigonometric hyperbolic cosine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec4 coshGTX(const detail::_xvec4& angle); //!< \brief The standard trigonometric hyperbolic cosine function. (From GLM_GTX_hyperbolic extension) - - template T tanhGTX(const T angle); //!< \brief The trigonometric hyperbolic tangent function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec2 tanhGTX(const detail::_xvec2& angle); //!< \brief The standard trigonometric hyperbolic tangent function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec3 tanhGTX(const detail::_xvec3& angle); //!< \brief The standard trigonometric hyperbolic tangent function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec4 tanhGTX(const detail::_xvec4& angle); //!< \brief The standard trigonometric hyperbolic tangent function. (From GLM_GTX_hyperbolic extension) - - template T asinhGTX(const T angle); //!< \brief The trigonometric hyperbolic asine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec2 asinhGTX(const detail::_xvec2& angle); //!< \brief The trigonometric hyperbolic asine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec3 asinhGTX(const detail::_xvec3& angle); //!< \brief The trigonometric hyperbolic asine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec4 asinhGTX(const detail::_xvec4& angle); //!< \brief The trigonometric hyperbolic asine function. (From GLM_GTX_hyperbolic extension) - - template T acoshGTX(const T angle); //!< \brief The trigonometric hyperbolic acosine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec2 acoshGTX(const detail::_xvec2& angle); //!< \brief The trigonometric hyperbolic acosine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec3 acoshGTX(const detail::_xvec3& angle); //!< \brief The trigonometric hyperbolic acosine function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec4 acoshGTX(const detail::_xvec4& angle); //!< \brief The trigonometric hyperbolic acosine function. (From GLM_GTX_hyperbolic extension) - - template T atanhGTX(const T angle); //!< \brief The trigonometric hyperbolic atangente function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec2 atanhGTX(const detail::_xvec2& angle); //!< \brief The trigonometric hyperbolic atangente function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec3 atanhGTX(const detail::_xvec3& angle); //!< \brief The trigonometric hyperbolic atangente function. (From GLM_GTX_hyperbolic extension) - template detail::_xvec4 atanhGTX(const detail::_xvec4& angle); //!< \brief The trigonometric hyperbolic atangente function. (From GLM_GTX_hyperbolic extension) - - namespace gtx - { - //! GLM_GTX_hyperbolic extension: Add hyperbolic functions - namespace hyperbolic - { - template inline T sinh(const T& angle){return sinhGTX(angle);} //!< \brief The trigonometric hyperbolic sine function. (From GLM_GTX_hyperbolic extension) - template inline T cosh(const T& angle){return coshGTX(angle);} //!< \brief The trigonometric hyperbolic cosine function. (From GLM_GTX_hyperbolic extension) - template inline T tanh(const T& angle){return tanhGTX(angle);} //!< \brief The trigonometric hyperbolic tangent function. (From GLM_GTX_hyperbolic extension) - - template inline T asinh(const T& x){return asinhGTX(x);} //!< \brief The trigonometric hyperbolic asine function. (From GLM_GTX_hyperbolic extension) - template inline T acosh(const T& x){return asinhGTX(x);} //!< \brief The trigonometric hyperbolic acosine function. (From GLM_GTX_hyperbolic extension) - template inline T atanh(const T& x){return asinhGTX(x);} //!< \brief The trigonometric hyperbolic atangente function. (From GLM_GTX_hyperbolic extension) - } - } -} - -#define GLM_GTX_hyperbolic namespace gtx::hyperbolic - -#include "hyperbolic.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_hyperbolic;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_hyperbolic__ diff --git a/experimental/sse/glm/ext/gtx/hyperbolic.inl b/experimental/sse/glm/ext/gtx/hyperbolic.inl deleted file mode 100644 index 494420d2..00000000 --- a/experimental/sse/glm/ext/gtx/hyperbolic.inl +++ /dev/null @@ -1,219 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-25 -// Updated : 2007-01-26 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/hyperbolic.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // sinh - template - inline T sinh(const T angle) - { - return std::sinh(angle); - } - - template - inline detail::_xvec2 sinh(const detail::_xvec2& angle) - { - return detail::_xvec2( - sinh(angle.x), - sinh(angle.y)); - } - - template - inline detail::_xvec3 sinh(const detail::_xvec3& angle) - { - return detail::_xvec3( - sinh(angle.x), - sinh(angle.y), - sinh(angle.z)); - } - - template - inline detail::_xvec4 sinh(const detail::_xvec4& angle) - { - return detail::_xvec4( - sinh(angle.x), - sinh(angle.y), - sinh(angle.z), - sinh(angle.w)); - } - - // cosh - template - inline T cosh(const T angle) - { - return std::cosh(angle); - } - - template - inline detail::_xvec2 cosh(const detail::_xvec2& angle) - { - return detail::_xvec2( - cosh(angle.x), - cosh(angle.y)); - } - - template - inline detail::_xvec3 cosh(const detail::_xvec3& angle) - { - return detail::_xvec3( - cosh(angle.x), - cosh(angle.y), - cosh(angle.z)); - } - - template - inline detail::_xvec4 cosh(const detail::_xvec4& angle) - { - return detail::_xvec4( - cosh(angle.x), - cosh(angle.y), - cosh(angle.z), - cosh(angle.w)); - } - - // tanh - template - inline T tanh(const T angle) - { - return std::tanh(angle); - } - - template - inline detail::_xvec2 tanh(const detail::_xvec2& angle) - { - return detail::_xvec2( - tanh(angle.x), - tanh(angle.y)); - } - - template - inline detail::_xvec3 tanh(const detail::_xvec3& angle) - { - return detail::_xvec3( - tanh(angle.x), - tanh(angle.y), - tanh(angle.z)); - } - - template - inline detail::_xvec4 tanh(const detail::_xvec4& angle) - { - return detail::_xvec4( - tanh(angle.x), - tanh(angle.y), - tanh(angle.z), - tanh(angle.w)); - } - - // asinh - template - inline T asinh(const T x) - { - return (x < T(0) ? T(-1) : (x > T(0) ? T(1) : T(0))) * log(abs(x) + sqrt(T(1) + x * x)); - } - - template - inline detail::_xvec2 asinh(const detail::_xvec2& x) - { - return detail::_xvec2( - asinh(x.x), - asinh(x.y)); - } - - template - inline detail::_xvec3 asinh(const detail::_xvec3& x) - { - return detail::_xvec3( - asinh(x.x), - asinh(x.y), - asinh(x.z)); - } - - template - inline detail::_xvec4 asinh(const detail::_xvec4& x) - { - return detail::_xvec4( - asinh(x.x), - asinh(x.y), - asinh(x.z), - asinh(x.w)); - } - - // acosh - template - inline T acosh(const T x) - { - if(x < T(1)) - return T(0); - return log(x + sqrt(x * x - T(1))); - } - - template - inline detail::_xvec2 acosh(const detail::_xvec2& x) - { - return detail::_xvec2( - acosh(x.x), - acosh(x.y)); - } - - template - inline detail::_xvec3 acosh(const detail::_xvec3& x) - { - return detail::_xvec3( - acosh(x.x), - acosh(x.y), - acosh(x.z)); - } - - template - inline detail::_xvec4 acosh(const detail::_xvec4& x) - { - return detail::_xvec4( - acosh(x.x), - acosh(x.y), - acosh(x.z), - acosh(x.w)); - } - - // atanh - template - inline T atanh(const T x) - { - if(abs(x) >= T(1)) - return 0; - return T(0.5) * log((T(1) + x) / (T(1) - x)); - } - - template - inline detail::_xvec2 atanh(const detail::_xvec2& x) - { - return detail::_xvec2( - atanh(x.x), - atanh(x.y)); - } - - template - inline detail::_xvec3 atanh(const detail::_xvec3& x) - { - return detail::_xvec3( - atanh(x.x), - atanh(x.y), - atanh(x.z)); - } - - template - inline detail::_xvec4 atanh(const detail::_xvec4& x) - { - return detail::_xvec4( - atanh(x.x), - atanh(x.y), - atanh(x.z), - atanh(x.w)); - } -} diff --git a/experimental/sse/glm/ext/gtx/inertia.h b/experimental/sse/glm/ext/gtx/inertia.h deleted file mode 100644 index 5d9965fc..00000000 --- a/experimental/sse/glm/ext/gtx/inertia.h +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/inertia.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_inertia__ -#define __glm_gtx_inertia__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat3 boxInertia3GTX(const T Mass, const detail::_xvec3& Scale); //!< Build an inertia matrix for a box (From GLM_GTX_inertia extension) - template detail::_xmat4 boxInertia4GTX(const T Mass, const detail::_xvec3& Scale); //!< Build an inertia matrix for a box (From GLM_GTX_inertia extension) - template detail::_xmat3 diskInertia3GTX(const T Mass, const T Radius); //!< Build an inertia matrix for a disk (From GLM_GTX_inertia extension) - template detail::_xmat4 diskInertia4GTX(const T Mass, const T Radius); //!< Build an inertia matrix for a disk (From GLM_GTX_inertia extension) - template detail::_xmat3 ballInertia3GTX(const T Mass, const T Radius); //!< Build an inertia matrix for a ball (From GLM_GTX_inertia extension) - template detail::_xmat4 ballInertia4GTX(const T Mass, const T Radius); //!< Build an inertia matrix for a ball (From GLM_GTX_inertia extension) - template detail::_xmat3 sphereInertia3GTX(const T Mass, const T Radius); //!< Build an inertia matrix for a sphere (From GLM_GTX_inertia extension) - template detail::_xmat4 sphereInertia4GTX(const T Mass, const T Radius); //!< Build an inertia matrix for a sphere (From GLM_GTX_inertia extension) - - namespace gtx - { - //! GLM_GTX_inertia extension: Create inertia matrices - namespace inertia - { - template inline detail::_xmat3 boxInertia3(const T Mass, const detail::_xvec3& Scale){return boxInertia3GTX(Mass, Scale);} //!< Build an inertia matrix for a box (From GLM_GTX_inertia extension) - template inline detail::_xmat4 boxInertia4(const T Mass, const detail::_xvec3& Scale){return boxInertia$GTX(Mass, Scale);} //!< Build an inertia matrix for a box (From GLM_GTX_inertia extension) - template inline detail::_xmat3 diskInertia3(const T Mass, const T Radius){return diskInertia3GTX(Mass, Radius);} //!< Build an inertia matrix for a disk (From GLM_GTX_inertia extension) - template inline detail::_xmat4 diskInertia4(const T Mass, const T Radius){return diskInertia4GTX(Mass, Radius);} //!< Build an inertia matrix for a disk (From GLM_GTX_inertia extension) - template inline detail::_xmat3 ballInertia3(const T Mass, const T Radius){return ballInertia3GTX(Mass, Radius);} //!< Build an inertia matrix for a ball (From GLM_GTX_inertia extension) - template inline detail::_xmat4 ballInertia4(const T Mass, const T Radius){return ballInertia4GTX(Mass, Radius);} //!< Build an inertia matrix for a ball (From GLM_GTX_inertia extension) - template inline detail::_xmat3 sphereInertia3(const T Mass, const T Radius){return sphereInertia3GTX(Mass, Radius);} //!< Build an inertia matrix for a sphere (From GLM_GTX_inertia extension) - template inline detail::_xmat4 sphereInertia4(const T Mass, const T Radius){return sphereInertia4GTX(Mass, Radius);} //!< Build an inertia matrix for a sphere (From GLM_GTX_inertia extension) - } - } -} - -#define GLM_GTX_inertia namespace gtx::inertia - -#include "inertia.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_inertia;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_inertia__ diff --git a/experimental/sse/glm/ext/gtx/inertia.inl b/experimental/sse/glm/ext/gtx/inertia.inl deleted file mode 100644 index 8a5d1184..00000000 --- a/experimental/sse/glm/ext/gtx/inertia.inl +++ /dev/null @@ -1,82 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-21 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/inertia.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat3 boxInertia3GTX(const T Mass, const detail::_xvec3& Scale) - { - detail::_xmat3 Result(T(1)); - Result[0][0] = (Scale.y * Scale.y + Scale.z * Scale.z) * Mass / T(12); - Result[1][1] = (Scale.x * Scale.x + Scale.z * Scale.z) * Mass / T(12); - Result[2][2] = (Scale.x * Scale.x + Scale.y * Scale.y) * Mass / T(12); - return Result; - } - - template - inline detail::_xmat4 boxInertia4GTX(const T Mass, const detail::_xvec3& Scale) - { - detail::_xmat4 Result(T(1)); - Result[0][0] = (Scale.y * Scale.y + Scale.z * Scale.z) * Mass / T(12); - Result[1][1] = (Scale.x * Scale.x + Scale.z * Scale.z) * Mass / T(12); - Result[2][2] = (Scale.x * Scale.x + Scale.y * Scale.y) * Mass / T(12); - return Result; - } - - template - inline detail::_xmat3 diskInertia3GTX(const T Mass, const T Radius) - { - T a = Mass * Radius * Radius / T(2); - detail::_xmat3 Result(a); - Result[2][2] *= T(2); - return Result; - } - - template - inline detail::_xmat4 diskInertia4GTX(const T Mass, const T Radius) - { - T a = Mass * Radius * Radius / T(2); - detail::_xmat4 Result(a); - Result[2][2] *= T(2); - Result[3][3] = T(1); - return Result; - } - - template - inline detail::_xmat3 ballInertia3GTX(const T Mass, const T Radius) - { - T a = T(2) * Mass * Radius * Radius / T(5); - return detail::_xmat3(a); - } - - template - inline detail::_xmat4 ballInertia4GTX(const T Mass, const T Radius) - { - T a = T(2) * Mass * Radius * Radius / T(5); - detail::_xmat4 Result(a); - Result[3][3] = T(1); - return Result; - } - - template - inline detail::_xmat3 sphereInertia3GTX(const T Mass, const T Radius) - { - T a = T(2) * Mass * Radius * Radius / T(3); - return detail::_xmat3(a); - } - - template - inline detail::_xmat4 sphereInertia4GTX(const T Mass, const T Radius) - { - T a = T(2) * Mass * Radius * Radius / T(3); - detail::_xmat4 Result(a); - Result[3][3] = T(1); - return Result; - } -} diff --git a/experimental/sse/glm/ext/gtx/integer.h b/experimental/sse/glm/ext/gtx/integer.h deleted file mode 100644 index c4bfb0bb..00000000 --- a/experimental/sse/glm/ext/gtx/integer.h +++ /dev/null @@ -1,104 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-24 -// Updated : 2006-11-14 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/integer.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_integer__ -#define __glm_gtx_integer__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - int absGTX(int x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_integer extension) - template T absGTX(T x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_integer extension) - template detail::_xvec2 absGTX(const detail::_xvec2& x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_integer extension) - template detail::_xvec3 absGTX(const detail::_xvec3& x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_integer extension) - template detail::_xvec4 absGTX(const detail::_xvec4& x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_integer extension) - - template genType signGTX(const genType& x); //!< \brief Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. (From GLM_GTX_integer extension) - - template T minGTX(T x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec2 minGTX(const detail::_xvec2& x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec3 minGTX(const detail::_xvec3& x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec4 minGTX(const detail::_xvec4& x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec2 minGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec3 minGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec4 minGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_integer extension) - - template T maxGTX(T x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec2 maxGTX(const detail::_xvec2& x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec3 maxGTX(const detail::_xvec3& x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec4 maxGTX(const detail::_xvec4& x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec2 maxGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec3 maxGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_integer extension) - template detail::_xvec4 maxGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_integer extension) - - template T clampGTX(T x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_integer extension) - template detail::_xvec2 clampGTX(const detail::_xvec2& x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_integer extension) - template detail::_xvec3 clampGTX(const detail::_xvec3& x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_integer extension) - template detail::_xvec4 clampGTX(const detail::_xvec4& x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_integer extension) - template detail::_xvec2 clampGTX(const detail::_xvec2& x, const detail::_xvec2& minVal, const detail::_xvec2& maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_integer extension) - template detail::_xvec3 clampGTX(const detail::_xvec3& x, const detail::_xvec3& minVal, const detail::_xvec3& maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_integer extension) - template detail::_xvec4 clampGTX(const detail::_xvec4& x, const detail::_xvec4& minVal, const detail::_xvec4& maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_integer extension) - - int powGTX(int x, int y); //!< \brief Returns x raised to the y power. (From GLM_GTX_integer extension) - template T powGTX(T x, T y); //!< \brief Returns x raised to the y power. (From GLM_GTX_integer extension) - template detail::_xvec2 powGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Returns x raised to the y power. (From GLM_GTX_integer extension) - template detail::_xvec3 powGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns x raised to the y power. (From GLM_GTX_integer extension) - template detail::_xvec4 powGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Returns x raised to the y power. (From GLM_GTX_integer extension) - - int sqrtGTX(int x); //!< \brief Returns the positive square root of x. (From GLM_GTX_integer extension) - template T sqrtGTX(T x); //!< \brief Returns the positive square root of x. (From GLM_GTX_integer extension) - template detail::_xvec2 sqrtGTX(const detail::_xvec2& x); //!< \brief Returns the positive square root of x. (From GLM_GTX_integer extension) - template detail::_xvec3 sqrtGTX(const detail::_xvec3& x); //!< \brief Returns the positive square root of x. (From GLM_GTX_integer extension) - template detail::_xvec4 sqrtGTX(const detail::_xvec4& x); //!< \brief Returns the positive square root of x. (From GLM_GTX_integer extension) - - int modGTX(int x, int y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - //template T modGTX(T x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - template detail::_xvec2 modGTX(const detail::_xvec2& x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - template detail::_xvec3 modGTX(const detail::_xvec3& x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - template detail::_xvec4 modGTX(const detail::_xvec4& x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - template detail::_xvec2 modGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - template detail::_xvec3 modGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - template detail::_xvec4 modGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - - template T factorialGTX(T x); //!< \brief Return the factorial value of a number (!12 max, integer only) - template detail::_xvec2 factorialGTX(const detail::_xvec2& x); //!< \brief Return the factorial value of a number (!12 max, integer only) - template detail::_xvec3 factorialGTX(const detail::_xvec3& x); //!< \brief Return the factorial value of a number (!12 max, integer only) - template detail::_xvec4 factorialGTX(const detail::_xvec4& x); //!< \brief Return the factorial value of a number (!12 max, integer only) - - namespace gtx - { - //! GLM_GTX_integer extension: Add support for integer for core functions - namespace integer - { - inline int abs(int x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_integer extension) - inline int pow(int x, int y){return powGTX(x, y);} //!< \brief Returns x raised to the y power. (From GLM_GTX_integer extension) - inline int sqrt(int x){return sqrtGTX(x);} //!< \brief Returns the positive square root of x. (From GLM_GTX_integer extension) - inline int mod(int x, int y){return modGTX(x, y);} //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_integer extension) - template inline T factorial(T x){return factorialGTX(x);} //!< \brief Return the factorial value of a number (!12 max, integer only) - template inline detail::_xvec2 factorial(const detail::_xvec2& x){return factorialGTX(x);} //!< \brief Return the factorial value of a number (!12 max, integer only) - template inline detail::_xvec3 factorial(const detail::_xvec3& x){return factorialGTX(x);} //!< \brief Return the factorial value of a number (!12 max, integer only) - template inline detail::_xvec4 factorial(const detail::_xvec4& x){return factorialGTX(x);} //!< \brief Return the factorial value of a number (!12 max, integer only) - } - } -} - -#define GLM_GTX_integer namespace gtx::integer - -#include "integer.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_integer;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_integer__ diff --git a/experimental/sse/glm/ext/gtx/integer.inl b/experimental/sse/glm/ext/gtx/integer.inl deleted file mode 100644 index 2b5a8f37..00000000 --- a/experimental/sse/glm/ext/gtx/integer.inl +++ /dev/null @@ -1,284 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-24 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/integer.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - // absGTX - inline int absGTX(int x) - { - return ((x >> 31) ^ x) - (x >> 31); - } - - template - inline T absGTX(T x) - { - return x >= T(0) ? x : -x; - } - - template - inline detail::_xvec2 absGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - absGTX(x.x), - absGTX(x.y)); - } - - template - inline detail::_xvec3 absGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - absGTX(x.x), - absGTX(x.y), - absGTX(x.z)); - } - - template - inline detail::_xvec4 absGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - absGTX(x.x), - absGTX(x.y), - absGTX(x.z), - absGTX(x.w)); - } - - // signGTX - template inline genType signGTX(const genType& x){return sign(x);} - - // minGTX - // test: - /* - inline int minGTX(int x, int y) - { - return (x + y - absGTX(x - y)) >> 1; - } - */ - template inline T minGTX(T x, T y) {return min(x, y);} - template inline detail::_xvec2 minGTX(const detail::_xvec2& x, T y) {return min(x, y);} - template inline detail::_xvec3 minGTX(const detail::_xvec3& x, T y) {return min(x, y);} - template inline detail::_xvec4 minGTX(const detail::_xvec4& x, T y) {return min(x, y);} - template inline detail::_xvec2 minGTX(const detail::_xvec2& x, const detail::_xvec2& y) {return min(x, y);} - template inline detail::_xvec3 minGTX(const detail::_xvec3& x, const detail::_xvec3& y) {return min(x, y);} - template inline detail::_xvec4 minGTX(const detail::_xvec4& x, const detail::_xvec4& y) {return min(x, y);} - - // maxGTX - template inline T maxGTX(T x, T y) {return max(x, y);} - template inline detail::_xvec2 maxGTX(const detail::_xvec2& x, T y) {return max(x, y);} - template inline detail::_xvec3 maxGTX(const detail::_xvec3& x, T y) {return max(x, y);} - template inline detail::_xvec4 maxGTX(const detail::_xvec4& x, T y) {return max(x, y);} - template inline detail::_xvec2 maxGTX(const detail::_xvec2& x, const detail::_xvec2& y) {return max(x, y);} - template inline detail::_xvec3 maxGTX(const detail::_xvec3& x, const detail::_xvec3& y) {return max(x, y);} - template inline detail::_xvec4 maxGTX(const detail::_xvec4& x, const detail::_xvec4& y) {return max(x, y);} - - // clampGTX - template inline T clampGTX(T x, T minVal, T maxVal) {return min(max(x, minVal), maxVal);} - template inline detail::_xvec2 clampGTX(const detail::_xvec2& x, T minVal, T maxVal) {return min(max(x, minVal), maxVal);} - template inline detail::_xvec3 clampGTX(const detail::_xvec3& x, T minVal, T maxVal) {return min(max(x, minVal), maxVal);} - template inline detail::_xvec4 clampGTX(const detail::_xvec4& x, T minVal, T maxVal) {return min(max(x, minVal), maxVal);} - template inline detail::_xvec2 clampGTX(const detail::_xvec2& x, const detail::_xvec2& minVal, const detail::_xvec2& maxVal) {return min(max(x, minVal), maxVal);} - template inline detail::_xvec3 clampGTX(const detail::_xvec3& x, const detail::_xvec3& minVal, const detail::_xvec3& maxVal) {return min(max(x, minVal), maxVal);} - template inline detail::_xvec4 clampGTX(const detail::_xvec4& x, const detail::_xvec4& minVal, const detail::_xvec4& maxVal) {return min(max(x, minVal), maxVal);} - - // powGTX - inline int powGTX(int x, int y) - { - if(y == 0) - return 1; - int result = x; - for(int i = 1; i < y; ++i) - result *= x; - return result; - } - - template - inline T powGTX(T x, T y) - { - return std::pow(x, y); - } - - template - inline detail::_xvec2 powGTX(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - powGTX(x.x, y.x), - powGTX(x.y, y.y)); - } - - template - inline detail::_xvec3 powGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - powGTX(x.x, y.x), - powGTX(x.y, y.y), - powGTX(x.z, y.z)); - } - - template - inline detail::_xvec4 powGTX(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - powGTX(x.x, y.x), - powGTX(x.y, y.y), - powGTX(x.z, y.z), - powGTX(x.w, y.w)); - } - - // sqrtGTX: From Christopher J. Musial, An integer square root, Graphics Gems, 1990, page 387 - inline int sqrtGTX(int x) - { - if(x <= 1) return x; - - int NextTrial = x >> 1; - int CurrentAnswer; - - do - { - CurrentAnswer = NextTrial; - NextTrial = (NextTrial + x / NextTrial) >> 1; - } while(NextTrial < CurrentAnswer); - - return CurrentAnswer; - } - - template - inline T sqrtGTX(T x) - { - return std::sqrt(x); - } - - template - inline detail::_xvec2 sqrtGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - sqrtGTX(x.x), - sqrtGTX(x.y)); - } - - template - inline detail::_xvec3 sqrtGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - sqrtGTX(x.x), - sqrtGTX(x.y), - sqrtGTX(x.z)); - } - - template - inline detail::_xvec4 sqrtGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - sqrtGTX(x.x), - sqrtGTX(x.y), - sqrtGTX(x.z), - sqrtGTX(x.w)); - } - - // modGTX - inline int modGTX(int x, int y) - { - return x - y * (x / y); - } -/* - template - inline T modGTX(T x, T y) - { - return x - y * (x / y); - } -*/ - template - inline detail::_xvec2 modGTX(const detail::_xvec2& x, T y) - { - return detail::_xvec2( - modGTX(x.x, y), - modGTX(x.y, y)); - } - - template - inline detail::_xvec3 modGTX(const detail::_xvec3& x, T y) - { - return detail::_xvec3( - modGTX(x.x, y), - modGTX(x.y, y), - modGTX(x.z, y)); - } - - template - inline detail::_xvec4 modGTX(const detail::_xvec4& x, T y) - { - return detail::_xvec4( - modGTX(x.x, y), - modGTX(x.y, y), - modGTX(x.z, y), - modGTX(x.w, y)); - } - - template - inline detail::_xvec2 modGTX(const detail::_xvec2& x, const detail::_xvec2& y) - { - return detail::_xvec2( - modGTX(x.x, y.x), - modGTX(x.y, y.y)); - } - - template - inline detail::_xvec3 modGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return detail::_xvec3( - modGTX(x.x, y.x), - modGTX(x.y, y.y), - modGTX(x.z, y.z)); - } - - template - inline detail::_xvec4 modGTX(const detail::_xvec4& x, const detail::_xvec4& y) - { - return detail::_xvec4( - modGTX(x.x, y.x), - modGTX(x.y, y.y), - modGTX(x.z, y.z), - modGTX(x.w, y.w)); - } - - // factorial (!12 max, integer only) - template - inline T factorialGTX(T x) - { - T Result; - for(Result = 1; x > 1; --x) - Result *= x; - return Result; - } - - template - inline detail::_xvec2 factorialGTX(const detail::_xvec2& x) - { - return detail::_xvec2( - factorialGTX(x.x), - factorialGTX(x.y)); - } - - template - inline detail::_xvec3 factorialGTX(const detail::_xvec3& x) - { - return detail::_xvec3( - factorialGTX(x.x), - factorialGTX(x.y), - factorialGTX(x.z)); - } - - template - inline detail::_xvec4 factorialGTX(const detail::_xvec4& x) - { - return detail::_xvec4( - factorialGTX(x.x), - factorialGTX(x.y), - factorialGTX(x.z), - factorialGTX(x.w)); - } -} diff --git a/experimental/sse/glm/ext/gtx/intersect.h b/experimental/sse/glm/ext/gtx/intersect.h deleted file mode 100644 index f9c182a2..00000000 --- a/experimental/sse/glm/ext/gtx/intersect.h +++ /dev/null @@ -1,107 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-04-03 -// Updated : 2007-04-03 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/intersect.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_closest_point -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_intersect__ -#define __glm_gtx_intersect__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/closest_point.h" - -namespace glm -{ - //! Compute the intersection of a ray and a triangle (From GLM_GTX_intersect extension) - template - bool intersectRayTriangleGTX( - const genType& orig, const genType& dir, - const genType& vert0, const genType& vert1, const genType& vert2, - genType& position); - - //! Compute the intersection of a line and a triangle (From GLM_GTX_intersect extension) - template - bool intersectLineTriangleGTX( - const genType& orig, const genType& dir, - const genType& vert0, const genType& vert1, const genType& vert2, - genType& position); - - //! Compute the intersection of a ray and a sphere (From GLM_GTX_intersect extension) - template - bool intersectRaySphereGTX( - const genType& orig, const genType& dir, - const genType& center, GLMvalType radius, - genType& position, genType& normal); - - //! Compute the intersection of a line and a sphere (From GLM_GTX_intersect extension) - template - bool intersectLineSphereGTX( - const genType& point0, const genType& point1, - const genType& center, GLMvalType radius, - genType& position, genType& normal); - - namespace gtx - { - //! GLM_GTX_intersect extension: Add intersection functions - namespace intersect - { - //! Compute the intersection of a ray and a triangle (From GLM_GTX_intersect extension) - template - inline bool intersectRayTriangle( - const genType& orig, const genType& dir, - const genType& vert0, const genType& vert1, const genType& vert2, - genType& position) - { - return intersectRayTriangleGTX(orig, dir, vert0, vert1, vert2, position); - } - - //! Compute the intersection of a line and a triangle (From GLM_GTX_intersect extension) - template - inline bool intersectLineTriangle( - const genType& orig, const genType& dir, - const genType& vert0, const genType& vert1, const genType& vert2, - genType& position) - { - return intersectLineTriangleGTX(orig, dir, vert0, vert1, vert2, position); - } - - //! Compute the intersection of a ray and a sphere (From GLM_GTX_intersect extension) - template - inline bool intersectRaySphere( - const genType& orig, const genType& dir, - const genType& center, GLMvalType radius, - genType& position, genType& normal) - { - return intersectRaySphereGTX(orig, dir, center, radius, position, normal); - } - - //! Compute the intersection of a line and a sphere (From GLM_GTX_intersect extension) - template - inline bool intersectLineSphere( - const genType& point0, const genType& point1, - const genType& center, GLMvalType radius, - genType& position, genType& normal) - { - return intersectLineSphereGTX(point0, point1, center, radius, position, normal); - } - } - } -} - -#define GLM_GTX_intersect namespace gtx::intersect - -#include "intersect.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_intersect;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_intersect__ diff --git a/experimental/sse/glm/ext/gtx/intersect.inl b/experimental/sse/glm/ext/gtx/intersect.inl deleted file mode 100644 index 1fdbb4ca..00000000 --- a/experimental/sse/glm/ext/gtx/intersect.inl +++ /dev/null @@ -1,148 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-04-03 -// Updated : 2007-04-03 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/intersect.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline bool intersectRayTriangleGTX( - const genType& orig, const genType& dir, - const genType& vert0, const genType& vert1, const genType& vert2, - genType& position) - { -// typename genType::size_type result = typename genType::value_type(0); -// typename genType::value_type pouet; - - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - - genType edge1 = vert1 - vert0; - genType edge2 = vert2 - vert0; - - genType pvec = cross(dir, edge2); - - float det = dot(edge1, pvec); - if(det < Epsilon) - return false; - - genType tvec = orig - vert0; - - position.y = dot(tvec, pvec); - if (position.y < typename genType::value_type(0) || position.y > det) - return genType::value_type(0); - - genType qvec = cross(tvec, edge1); - - position.z = dot(dir, qvec); - if (position.z < typename genType::value_type(0) || position.y + position.z > det) - return genType::value_type(0); - - position.x = dot(edge2, qvec); - position *= typename genType::value_type(1) / det; - - return typename genType::value_type(1); - } - - template - inline bool intersectLineTriangleGTX( - const genType& orig, const genType& dir, - const genType& vert0, const genType& vert1, const genType& vert2, - genType& position) - { - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - - genType edge1 = vert1 - vert0; - genType edge2 = vert2 - vert0; - - genType pvec = cross(dir, edge2); - - float det = dot(edge1, pvec); - - if (det > -Epsilon && det < Epsilon) - return false; - float inv_det = typename genType::value_type(1) / det; - - genType tvec = orig - vert0; - - position.y = dot(tvec, pvec) * inv_det; - if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1)) - return false; - - genType qvec = cross(tvec, edge1); - - position.z = dot(dir, qvec) * inv_det; - if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1)) - return false; - - position.x = dot(edge2, qvec) * inv_det; - - return true; - } - - template - inline bool intersectRaySphereGTX( - const genType& orig, const genType& dir, - const genType& center, GLMvalType radius, - genType& position, genType& normal) - { - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - - typename genType::value_type a = dot(position, position); - typename genType::value_type b = typename genType::value_type(2) * dot(center, dir); - typename genType::value_type c = dot(center, center) - radius * radius; - typename genType::value_type d = b * b - typename genType::value_type(4) * a * c; - typename genType::value_type e = sqrt(d); - typename genType::value_type x1 = (-b - e) / (typename genType::value_type(2) * a); - typename genType::value_type x2 = (-b - e) / (typename genType::value_type(2) * a); - - if(x1 > Epsilon) - { - position = orig + dir * radius; - normal = (position - center) / radius; - return true; - } - else if(x2 > Epsilon) - { - position = orig + dir * radius; - normal = (position - center) / radius; - return true; - } - return false; - } - - template - inline bool intersectLineSphereGTX( - const genType& point0, const genType& point1, - const genType& center, GLMvalType radius, - genType& position, genType& normal) - { - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - - genType dir = point1 - point0; - typename genType::value_type a = dot(position, position); - typename genType::value_type b = typename genType::value_type(2) * dot(center, dir); - typename genType::value_type c = dot(center, center) - radius * radius; - typename genType::value_type d = b * b - typename genType::value_type(4) * a * c; - typename genType::value_type e = sqrt(d); - typename genType::value_type x1 = (-b - e) / (typename genType::value_type(2) * a); - typename genType::value_type x2 = (-b - e) / (typename genType::value_type(2) * a); - - if(x1 > Epsilon) - { - position = center + dir * radius; - normal = (position - center) / radius; - return true; - } - else if(x2 > Epsilon) - { - position = center + dir * radius; - normal = (position - center) / radius; - return true; - } - return false; - } -} diff --git a/experimental/sse/glm/ext/gtx/inverse.h b/experimental/sse/glm/ext/gtx/inverse.h deleted file mode 100644 index fa77665d..00000000 --- a/experimental/sse/glm/ext/gtx/inverse.h +++ /dev/null @@ -1,61 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2007-09-09 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/inverse.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_transpose -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_inverse__ -#define __glm_gtx_inverse__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/transpose.h" - -namespace glm -{ - template detail::_xmat2 inverseGTX(const detail::_xmat2& m); //!< Compute the inverse of a generic 2x2 matrix (From GLM_GTX_inverse extension) - template detail::_xmat3 inverseGTX(const detail::_xmat3& m); //!< Compute the inverse of a generic 3x3 matrix (From GLM_GTX_inverse extension) - template detail::_xmat4 inverseGTX(const detail::_xmat4& m); //!< Compute the inverse of a generic 4x4 matrix (From GLM_GTX_inverse extension) - - template detail::_xmat3 inverseTransformGTX(const detail::_xmat3& m); //!< Compute the inverse of a transformation 4x4 matrix (From GLM_GTX_inverse extension) - template detail::_xmat4 inverseTransformGTX(const detail::_xmat4& m); //!< Compute the inverse of a transformation 4x4 matrix (From GLM_GTX_inverse extension) - -// template detail::_xmat2 affineInverseGTX(const detail::_xmat2& m); -// template detail::_xmat3 affineInverseGTX(const detail::_xmat3& m); -// template detail::_xmat4 affineInverseGTX(const detail::_xmat4& m); - - namespace gtx - { - //! GLM_GTX_inverse extension: Inverse matrix functions - namespace inverse - { - template detail::_xmat2 inverse(const detail::_xmat2& m){return inverseGTX(m);} //!< Compute the inverse of a generic 2x2 matrix (From GLM_GTX_inverse extension) - template detail::_xmat3 inverse(const detail::_xmat3& m){return inverseGTX(m);} //!< Compute the inverse of a generic 3x3 matrix (From GLM_GTX_inverse extension) - template detail::_xmat4 inverse(const detail::_xmat4& m){return inverseGTX(m);} //!< Compute the inverse of a generic 4x4 matrix (From GLM_GTX_inverse extension) - - template detail::_xmat3 inverseTransform(const detail::_xmat3& m){return inverseTransformGTX(m);} //!< Compute the inverse of a transformation 3x3 matrix (From GLM_GTX_inverse extension) - template detail::_xmat4 inverseTransform(const detail::_xmat4& m){return inverseTransformGTX(m);} //!< Compute the inverse of a transformation 4x4 matrix (From GLM_GTX_inverse extension) - -// template detail::_xmat2 affineInverse(const detail::_xmat2& m){return affineInverseGTX(m);} -// template detail::_xmat3 affineInverse(const detail::_xmat3& m){return affineInverseGTX(m);} -// template detail::_xmat4 affineInverse(const detail::_xmat4& m){return affineInverseGTX(m);} - } - } -} - -#define GLM_GTX_inverse namespace gtx::inverse - -#include "inverse.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_inverse;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_inverse__ diff --git a/experimental/sse/glm/ext/gtx/inverse.inl b/experimental/sse/glm/ext/gtx/inverse.inl deleted file mode 100644 index 53dac0fd..00000000 --- a/experimental/sse/glm/ext/gtx/inverse.inl +++ /dev/null @@ -1,184 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2007-09-09 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/inverse.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat2 inverseGTX(const detail::_xmat2& m) - { - T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; - - detail::_xmat2 Inverse( - + m[1][1] / Determinant, - - m[1][0] / Determinant, - - m[0][1] / Determinant, - + m[0][0] / Determinant); - - return Inverse; - } - - template - inline detail::_xmat3 inverseGTX(const detail::_xmat3& m) - { - T Determinant = m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - - detail::_xmat3 Inverse; - Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); - Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); - Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); - Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); - Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); - Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); - Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); - Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); - Inverse /= Determinant; - - return Inverse; - } - - template - inline detail::_xmat4 inverseGTX(const detail::_xmat4& m) - { - T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - T SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - T SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - T SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - T SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - T SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - T SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - T SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - T SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - T SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - detail::_xmat4 Inverse( - + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02), - + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08), - - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15), - - - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04), - - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10), - + (m[0][0] * SubFactor13 - m[0][2] * SubFactor16 + m[0][3] * SubFactor17), - - + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05), - + (m[0][0] * SubFactor11 - m[0][1] * SubFactor09 + m[0][3] * SubFactor12), - - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18), - - - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05), - + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05), - - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor12), - + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18)); - - T Determinant = m[0][0] * Inverse[0][0] - + m[0][1] * Inverse[1][0] - + m[0][2] * Inverse[2][0] - + m[0][3] * Inverse[3][0]; - - Inverse /= Determinant; - - return Inverse; - } - - template - inline detail::_xmat3 inverseTransformGTX(const detail::_xmat3& m) - { - detail::_xmat3 Result; - Result[2] = detail::_xvec3(0, 0, 1); - Result = transposeGTX(Result); - detail::_xvec3 Translation = Result * -m[3]; - Result[2] = Translation; - return Result; - } - - template - inline detail::_xmat4 inverseTransformGTX(const detail::_xmat4& m) - { - detail::_xmat4 Result; - Result[3] = detail::_xvec4(0, 0, 0, 1); - Result = transposeGTX(Result); - detail::_xvec4 Translation = Result * -m[3]; - Result[3] = Translation; - return Result; - } - -/* - template - inline detail::_xmat2 affineInverseGTX(const detail::_xmat2& m) - { - T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; - - detail::_xmat2 Inverse( - + m[1][1] / Determinant, - - m[1][0] / Determinant, - - m[0][1] / Determinant, - + m[0][0] / Determinant); - - return Inverse; - } - - template - inline detail::_xmat3 affineInverseGTX(const detail::_xmat3& m) - { - detail::_xmat3 Result; - return Result; - } - - template - inline detail::_xmat4 affineInverseGTX(const detail::_xmat4& m) - { - #define ACCUMULATE() \ - if(Temp >= T(0)) Positive += Temp; \ - else Negative += Temp - - float Positive = T(0), Negative = T(0); - float Temp = T(0); - - Temp = m[0][0] * m[1][1] * m[2][2]; - ACCUMULATE(); - Temp = m[1][0] * m[2][1] * m[0][2]; - ACCUMULATE(); - Temp = m[2][0] * m[0][1] * m[1][2]; - ACCUMULATE(); - Temp = m[2][0] * m[1][1] * m[2][0]; - ACCUMULATE(); - Temp = m[1][0] * m[0][1] * m[2][2]; - ACCUMULATE(); - Temp = m[0][0] * m[2][1] * m[1][2]; - ACCUMULATE(); - float Det = 1.0f / (Positive + Negative); - - //Temp = Det / (Positive - Negative); - detail::_xmat4 Result; - Result[0][0] = (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * Det; - Result[0][1] = (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * Det; - Result[0][2] = (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * Det; - Result[1][0] = (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * Det; - Result[1][1] = (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * Det; - Result[1][2] = (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * Det; - Result[2][0] = (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * Det; - Result[2][1] = (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * Det; - Result[2][2] = (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * Det; - return Result; - } -*/ -} diff --git a/experimental/sse/glm/ext/gtx/inverse_transpose.h b/experimental/sse/glm/ext/gtx/inverse_transpose.h deleted file mode 100644 index ab8dcd0e..00000000 --- a/experimental/sse/glm/ext/gtx/inverse_transpose.h +++ /dev/null @@ -1,43 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-04 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/inverse_transpose.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_inverse_transpose__ -#define __glm_gtx_inverse_transpose__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat2 inverseTransposeGTX(const detail::_xmat2& m); //!< Compute the inverse transpose of a generic 2x2 matrix (From GLM_GTX_inverse extension) - template detail::_xmat3 inverseTransposeGTX(const detail::_xmat3& m); //!< Compute the inverse transpose of a generic 3x3 matrix (From GLM_GTX_inverse extension) - template detail::_xmat4 inverseTransposeGTX(const detail::_xmat4& m); //!< Compute the inverse transpose of a generic 4x4 matrix (From GLM_GTX_inverse extension) - - namespace gtx - { - //! GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions - namespace inverse_transpose - { - template inline T inverseTranspose(const T& m){return inverseTransposeGTX(m);} //!< Compute the inverse transpose of a matrix (From GLM_GTX_inverse extension) - } - } -} - -#define GLM_GTX_inverse_transpose namespace gtx::inverse_transpose - -#include "inverse_transpose.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_inverse_transpose;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_inverse_transpose__ diff --git a/experimental/sse/glm/ext/gtx/inverse_transpose.inl b/experimental/sse/glm/ext/gtx/inverse_transpose.inl deleted file mode 100644 index 9136142e..00000000 --- a/experimental/sse/glm/ext/gtx/inverse_transpose.inl +++ /dev/null @@ -1,101 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-04 -// Updated : 2006-01-04 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/inverse_transpose.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat2 inverseTransposeGTX(const detail::_xmat2& m) - { - T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; - - detail::_xmat2 Inverse( - + m[1][1] / Determinant, - - m[0][1] / Determinant, - - m[1][0] / Determinant, - + m[0][0] / Determinant); - - return Inverse; - } - - template - inline detail::_xmat3 inverseTransposeGTX(const detail::_xmat3& m) - { - T Determinant = m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - - detail::_xmat3 Inverse; - Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); - Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); - Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); - Inverse[1][0] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); - Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); - Inverse[1][2] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); - Inverse[2][0] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - Inverse[2][1] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); - Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); - Inverse /= Determinant; - - return Inverse; - } - - template - inline detail::_xmat4 inverseTransposeGTX(const detail::_xmat4& m) - { - T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - T SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - T SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - T SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - T SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - T SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - T SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - T SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - T SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - T SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - detail::_xmat4 Inverse; - Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); - Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); - Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); - Inverse[0][3] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05); - - Inverse[1][0] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02); - Inverse[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04); - Inverse[1][2] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05); - Inverse[1][3] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05); - - Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); - Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); - Inverse[2][2] = + (m[0][0] * SubFactor11 - m[0][1] * SubFactor09 + m[0][3] * SubFactor12); - Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor12); - - Inverse[3][0] = - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15); - Inverse[3][1] = + (m[0][0] * SubFactor13 - m[0][2] * SubFactor16 + m[0][3] * SubFactor17); - Inverse[3][2] = - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18); - Inverse[3][3] = + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18); - - T Determinant = m[0][0] * Inverse[0][0] - + m[0][1] * Inverse[1][0] - + m[0][2] * Inverse[2][0] - + m[0][3] * Inverse[3][0]; - - Inverse /= Determinant; - - return Inverse; - } -} diff --git a/experimental/sse/glm/ext/gtx/mat4x3.h b/experimental/sse/glm/ext/gtx/mat4x3.h deleted file mode 100644 index d25c2daa..00000000 --- a/experimental/sse/glm/ext/gtx/mat4x3.h +++ /dev/null @@ -1,134 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-27 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/mat4x3.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_mat4x3__ -#define __glm_gtx_mat4x3__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template class _xvec3; - template class _xvec4; - - template class _xmat4x3GTX - { - private: - // Data - _xvec3 value[4]; - - public: - // Constructors - _xmat4x3GTX(); - explicit _xmat4x3GTX(const T x); - explicit _xmat4x3GTX( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1, - const T x2, const T y2, const T z2, - const T x3, const T y3, const T z3); - explicit _xmat4x3GTX( - const _xvec3& v0, - const _xvec3& v1, - const _xvec3& v2, - const _xvec3& v3); - - // Accesses - _xvec3& operator[](int i) {return value[i];} - const _xvec3 & operator[](int i) const {return value[i];} - operator T*() {return &value[0][0];} - operator const T*() const {return &value[0][0];} - - // Unary updatable operators - _xmat4x3GTX& operator= (const _xmat4x3GTX& m); - _xmat4x3GTX& operator+= (const T s); - _xmat4x3GTX& operator+= (const _xmat4x3GTX& m); - _xmat4x3GTX& operator-= (const T s); - _xmat4x3GTX& operator-= (const _xmat4x3GTX& m); - _xmat4x3GTX& operator*= (const T s); - _xmat4x3GTX& operator*= (const _xmat4x3GTX& m); - _xmat4x3GTX& operator/= (const T s); - // ToDo - //_xmat4x3GTX& operator/= (const _xmat4x3GTX& m); - _xmat4x3GTX& operator++ (); - _xmat4x3GTX& operator-- (); - - // Unary constant operators - const _xmat4x3GTX operator- () const; - const _xmat4x3GTX operator++ (int n) const; - const _xmat4x3GTX operator-- (int n) const; - }; - - // Binary operators - template - _xmat4x3GTX operator+ (const _xmat4x3GTX& m, const T s); - - template - _xmat4x3GTX operator+ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2); - - template - _xmat4x3GTX operator- (const _xmat4x3GTX& m, const T s); - - template - _xmat4x3GTX operator- (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2); - - template - _xmat4x3GTX operator* (const _xmat4x3GTX& m, const T s); - - template - _xmat4x3GTX operator* (const T s, const _xmat4x3GTX& m); - - template - _xvec3 operator* (const _xmat4x3GTX& m, const _xvec4& v); - - template - _xvec3 operator* (const _xvec4& v, const _xmat4x3GTX& m); - - template - _xmat4x3GTX operator* (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2); - - template - _xmat4x3GTX operator/ (const _xmat4x3GTX& m, const T s); - - template - _xmat4x3GTX operator/ (const T s, const _xmat4x3GTX& m); -/* - template - _xvec3 operator/ (const _xmat4x3GTX& m, const _xvec4& v); - - template - _xvec3 operator/ (const _xvec4& v, const _xmat4x3GTX& m); -*/ - template - _xmat4x3GTX operator/ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2); - - typedef _xmat4x3GTX __mat4x3GTX; //!< - Deprecated - 4 * 3 matrix of floating-point numbers. (From GLM_GTX_mat4x3 extension) - - namespace gtx - { - //! GLM_GTX_mat4x3 extension: Deprecated - namespace mat4x3 - { - typedef _xmat4x3GTX mat4x3; //!< - Deprecated - 4 * 3 matrix of floating-point numbers. (From GLM_GTX_mat4x3 extension) - } - } -} //namespace glm - -#define GLM_GTX_mat4x3 namespace gtx::mat4x3 - -#include "mat4x3.inl" -/* Deprecated -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_mat4x3;} -#endif//GLM_GTX_INCLUDED -*/ -#endif //__glm_gtx_mat4x3__ diff --git a/experimental/sse/glm/ext/gtx/mat4x3.inl b/experimental/sse/glm/ext/gtx/mat4x3.inl deleted file mode 100644 index 27d8c459..00000000 --- a/experimental/sse/glm/ext/gtx/mat4x3.inl +++ /dev/null @@ -1,405 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-17 -// Updated : 2006-04-17 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/mat4x3.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - ////////////////////////////////////////////////////////////// - // Constructors - - template - inline _xmat4x3GTX::_xmat4x3GTX() - { - this->value[0] = _xvec3(1, 0, 0); - this->value[1] = _xvec3(0, 1, 0); - this->value[2] = _xvec3(0, 0, 1); - this->value[3] = _xvec3(0, 0, 0); - } - - template - inline _xmat4x3GTX::_xmat4x3GTX(const T f) - { - this->value[0] = _xvec3(f, 0, 0); - this->value[1] = _xvec3(0, f, 0); - this->value[2] = _xvec3(0, 0, f); - this->value[3] = _xvec3(0, 0, 0); - } - - template - inline _xmat4x3GTX::_xmat4x3GTX - ( - const T x0, const T y0, const T z0, - const T x1, const T y1, const T z1, - const T x2, const T y2, const T z2, - const T x3, const T y3, const T z3 - ) - { - this->value[0] = _xvec3(x0, y0, z0); - this->value[1] = _xvec3(x1, y1, z1); - this->value[2] = _xvec3(x2, y2, z2); - this->value[3] = _xvec3(x3, y3, z3); - } - - template - inline _xmat4x3GTX::_xmat4x3GTX - ( - const _xvec3 & v0, - const _xvec3 & v1, - const _xvec3 & v2, - const _xvec3 & v3 - ) - { - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; - } - - ////////////////////////////////////////////////////////////// - // Unary updatable operators - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator= (const _xmat4x3GTX& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator+= (const T s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator+= (const _xmat4x3GTX& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator-= (const T s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator-= (const _xmat4x3GTX& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator*= (const T s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator*= (const _xmat4x3GTX& m) - { - return (*this = *this * m); - } - - template - inline _xmat4x3GTX & _xmat4x3GTX::operator/= (const T s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } -/* - template - inline _xmat4x3GTX& _xmat4x3GTX::operator/= (const _xmat4x3GTX& m) - { - return (*this = *this / m); - } -*/ - template - inline _xmat4x3GTX& _xmat4x3GTX::operator++ () - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - inline _xmat4x3GTX& _xmat4x3GTX::operator-- () - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - ////////////////////////////////////////////////////////////// - // Unary constant operators - template - inline const _xmat4x3GTX _xmat4x3GTX::operator- () const - { - return _xmat4x3GTX( - -this->value[0], - -this->value[1], - -this->value[2], - -this->value[3]); - } - - template - inline const _xmat4x3GTX _xmat4x3GTX::operator-- (int n) const - { - _xmat4x3GTX m = *this; - --m.value[0]; - --m.value[1]; - --m.value[2]; - --m.value[3]; - return m; - } - - template - inline const _xmat4x3GTX _xmat4x3GTX::operator++ (int n) const - { - detail::_xmat4 m = *this; - ++m.value[0]; - ++m.value[1]; - ++m.value[2]; - ++m.value[3]; - return m; - } - - ////////////////////////////////////////////////////////////// - // Binary operators - - template - inline _xmat4x3GTX operator+ (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - inline _xmat4x3GTX operator+ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - return _xmat4x3GTX( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - inline _xmat4x3GTX operator- (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template - inline _xmat4x3GTX operator- (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - return _xmat4x3GTX( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - inline _xmat4x3GTX operator* (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xmat4x3GTX operator* (const T s, const _xmat4x3GTX & m) - { - return _xmat4x3GTX( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - inline _xvec3 operator* (const _xmat4x3GTX& m, const _xvec4& v) - { - return _xvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template - inline _xvec3 operator* (const _xvec4& v, const _xmat4x3GTX& m) - { - return _xvec3( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template - inline _xmat4x3GTX operator* (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA30 = m1[3][0]; - const T SrcA31 = m1[3][1]; - const T SrcA32 = m1[3][2]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; - - _xmat4x3GTX Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32 + SrcA30; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32 + SrcA31; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32 + SrcA32; - return Result; - } - - template - inline _xmat4x3GTX operator/ (const _xmat4x3GTX& m, const T s) - { - return _xmat4x3GTX( - m.value[0] / s, - m.value[1] / s, - m.value[2] / s, - m.value[3] / s); - } -/* - template - inline _xmat4x3GTX operator/ (const T s, const _xmat4x3GTX& m) - { - return _xmat4x3GTX( - s / m.value[0], - s / m.value[1], - s / m.value[2], - s / m.value[3]); - } - - template - _xvec3 operator/ (const _xmat4x3GTX& m, const _xvec4& v) - { - - } - - template - _xvec3 operator/ (const _xvec4& v, const _xmat4x3GTX& m) - { - - } -*/ - - template - inline _xmat4x3GTX operator/ (const _xmat4x3GTX& m1, const _xmat4x3GTX& m2) - { - T SubFactor01 = m2[2][1] * m2[3][2] - m2[3][1] * m2[2][2]; - T SubFactor02 = m2[2][0] * m2[3][2] - m2[3][0] * m2[2][2]; - T SubFactor03 = m2[2][0] * m2[3][1] - m2[3][0] * m2[2][1]; - T SubFactor04 = m2[1][1] * m2[3][2] - m2[3][1] * m2[1][2]; - T SubFactor05 = m2[1][0] * m2[3][2] - m2[3][0] * m2[1][2]; - T SubFactor06 = m2[1][0] * m2[3][1] - m2[3][0] * m2[1][1]; - T SubFactor07 = m2[1][1] * m2[2][2] - m2[2][1] * m2[1][2]; - T SubFactor08 = m2[1][0] * m2[2][2] - m2[2][0] * m2[1][2]; - T SubFactor09 = m2[1][0] * m2[2][1] - m2[2][0] * m2[1][1]; - - _xmat4x3GTX Inverse( - + m2[1][3] * SubFactor01, - - m2[1][3] * SubFactor02, - + m2[1][3] * SubFactor03, - -(m2[1][0] * SubFactor01 - m2[1][1] * SubFactor02 + m2[1][2] * SubFactor03), - - - m2[0][3] * SubFactor01, - + m2[0][3] * SubFactor02, - - m2[0][3] * SubFactor03, - +(m2[0][0] * SubFactor02 - m2[0][1] * SubFactor02 + m2[0][2] * SubFactor03), - - + m2[0][3] * SubFactor04, - - m2[0][3] * SubFactor05, - + m2[0][3] * SubFactor06, - -(m2[0][0] * SubFactor04 - m2[0][1] * SubFactor05 + m2[0][2] * SubFactor06), - - - m2[0][3] * SubFactor07, - + m2[0][3] * SubFactor08, - - m2[0][3] * SubFactor09, - +(m2[0][0] * SubFactor07 - m2[0][1] * SubFactor08 + m2[0][2] * SubFactor09)); - - T Determinant = m2[0][0] * Inverse[0][0] - + m2[0][1] * Inverse[1][0] - + m2[0][2] * Inverse[2][0] - + m2[0][3] * Inverse[3][0]; - - Inverse /= Determinant; - - return m1 * Inverse; - } - -} //namespace glm diff --git a/experimental/sse/glm/ext/gtx/matrix_access.h b/experimental/sse/glm/ext/gtx/matrix_access.h deleted file mode 100644 index 0a23797a..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_access.h +++ /dev/null @@ -1,43 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-27 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_access.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_matrix_access__ -#define __glm_gtx_matrix_access__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template genType rowGTX(const genType& m, int index, const GLMrowType& x); //!< Set a specific row to a matrix (From GLM_GTX_matrix_access extension) - template genType columnGTX(const genType& m, int index, const GLMcolType& x); //!< Set a specific column to a matrix (From GLM_GTX_matrix_access extension) - - namespace gtx - { - //! GLM_GTX_matrix_access extension: Set a column or a row of a matrix - namespace matrix_access - { - template inline genType row(const genType& m, int index, const GLMrowType& x){return rowGTX(m, index, x);} //!< Set a specific row to a matrix (From GLM_GTX_matrix_access extension) - template inline genType column(const genType& m, int index, const GLMcolType& x){return columnGTX(m, index, x);} //!< Set a specific column to a matrix (From GLM_GTX_matrix_access extension) - } - } -} - -#define GLM_GTX_matrix_access namespace gtx::matrix_access - -#include "matrix_access.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_matrix_access;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_matrix_access__ diff --git a/experimental/sse/glm/ext/gtx/matrix_access.inl b/experimental/sse/glm/ext/gtx/matrix_access.inl deleted file mode 100644 index 5091e9cb..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_access.inl +++ /dev/null @@ -1,83 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-27 -// Updated : 2005-12-27 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_access.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline genType rowGTX(const genType& m, int index, const GLMrowType& x) - { - genType Result = m; - for(typename genType::size_type i = 0; i < genType::row_size; ++i) - Result[i][index] = x[i]; - return Result; - } - - template - inline genType columnGTX(const genType& m, int index, const GLMcolType& x) - { - genType Result = m; - Result[index] = x; - return Result; - } -/* - template - inline _xmat2 rowGTX(const _xmat2& m, int index, const _xvec2& x) - { - _xmat2 Result = m; - Result[0][index] = x[0]; - Result[1][index] = x[1]; - return Result; - } - - template - inline _xmat3 rowGTX(const _xmat3& m, int index, const _xvec3& x) - { - _xmat3 Result = m; - Result[0][index] = x[0]; - Result[1][index] = x[1]; - Result[2][index] = x[2]; - return Result; - } - - template - inline _xmat4 rowGTX(const _xmat4& m, int index, const _xvec4& x) - { - _xmat4 Result = m; - Result[0][index] = x[0]; - Result[1][index] = x[1]; - Result[2][index] = x[2]; - Result[3][index] = x[3]; - return Result; - } - - template - inline _xmat2 columnGTX(const _xmat2 & m, int index, const _xvec2& x) - { - _xmat2 Result = m; - Result[index] = x; - return Result; - } - - template - inline _xmat3 columnGTX(const _xmat3 & m, int index, const _xvec3& x) - { - _xmat3 Result = m; - Result[index] = x; - return Result; - } - - template - inline _xmat4 columnGTX(const _xmat4 & m, int index, const _xvec4& x) - { - _xmat4 Result = m; - Result[index] = x; - return Result; - } -*/ -} diff --git a/experimental/sse/glm/ext/gtx/matrix_cross_product.h b/experimental/sse/glm/ext/gtx/matrix_cross_product.h deleted file mode 100644 index dc20176c..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_cross_product.h +++ /dev/null @@ -1,43 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_cross_product.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_matrix_cross_product__ -#define __glm_gtx_matrix_cross_product__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat3 matrixCross3GTX(const detail::_xvec3& x); //!< Build a cross product matrix (From GLM_GTX_matrix_cross_product extension) - template detail::_xmat4 matrixCross4GTX(const detail::_xvec3& x); //!< Build a cross product matrix (From GLM_GTX_matrix_cross_product extension) - - namespace gtx - { - //! GLM_GTX_matrix_cross_product: Build cross product matrices - namespace matrix_cross_product - { - template inline detail::_xmat3 matrixCross3(const detail::_xvec3& x){return matrixCross3GTX(x);} //!< Build a cross product matrix (From GLM_GTX_matrix_cross_product extension) - template inline detail::_xmat4 matrixCross4(const detail::_xvec3& x){return matrixCross4GTX(x);} //!< Build a cross product matrix (From GLM_GTX_matrix_cross_product extension) - } - } -} - -#define GLM_GTX_matrix_cross_product namespace gtx::matrix_cross_product - -#include "matrix_cross_product.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_matrix_cross_product;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_matrix_cross_product__ diff --git a/experimental/sse/glm/ext/gtx/matrix_cross_product.inl b/experimental/sse/glm/ext/gtx/matrix_cross_product.inl deleted file mode 100644 index d2f7c835..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_cross_product.inl +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_cross_product.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat3 matrixCross3GTX(const detail::_xvec3& x) - { - detail::_xmat3 Result(T(0)); - Result[0][1] = x.z; - Result[1][0] = -x.z; - Result[0][2] = -x.y; - Result[2][0] = x.y; - Result[1][2] = x.x; - Result[2][1] = -x.x; - return Result; - } - - template - inline detail::_xmat4 matrixCross4GTX(const detail::_xvec3& x) - { - detail::_xmat4 Result(T(0)); - Result[0][1] = x.z; - Result[1][0] = -x.z; - Result[0][2] = -x.y; - Result[2][0] = x.y; - Result[1][2] = x.x; - Result[2][1] = -x.x; - return Result; - } -} diff --git a/experimental/sse/glm/ext/gtx/matrix_major_storage.h b/experimental/sse/glm/ext/gtx/matrix_major_storage.h deleted file mode 100644 index 6dc1fff2..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_major_storage.h +++ /dev/null @@ -1,65 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-19 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_major_storage.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_matrix_major_storage__ -#define __glm_gtx_matrix_major_storage__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat2 rowMajor2GTX(const detail::_xvec2& v1, const detail::_xvec2& v2); //!< Build a row major matrix from row vectors (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat2 rowMajor2GTX(const detail::_xmat2& m); //!< Build a row major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat3 rowMajor3GTX(const detail::_xvec3& v1, const detail::_xvec3& v2, const detail::_xvec3& v3); //!< Build a row major matrix from row vectors (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat3 rowMajor3GTX(const detail::_xmat3& m); //!< Build a row major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat4 rowMajor4GTX(const detail::_xvec4& v1, const detail::_xvec4& v2, const detail::_xvec4& v3, const detail::_xvec4& v4); //!< Build a row major matrix from row vectors (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat4 rowMajor4GTX(const detail::_xmat4& m); //!< Build a row major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - - template detail::_xmat2 colMajor2GTX(const detail::_xvec2& v1, const detail::_xvec2& v2); //!< Build a column major matrix from column vectors (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat2 colMajor2GTX(const detail::_xmat2& m); //!< Build a column major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat3 colMajor3GTX(const detail::_xvec3& v1, const detail::_xvec3& v2, const detail::_xvec3& v3); //!< Build a column major matrix from column vectors (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat3 colMajor3GTX(const detail::_xmat3& m); //!< Build a column major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat4 colMajor4GTX(const detail::_xvec4& v1, const detail::_xvec4& v2, const detail::_xvec4& v3, const detail::_xvec4& v4); //!< Build a column major matrix from column vectors (From GLM_GTX_matrix_major_storage extension) - template detail::_xmat4 colMajor4GTX(const detail::_xmat4& m); //!< Build a column major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - - namespace gtx - { - //! GLM_GTX_matrix_cross_product: Build matrices with specific matrix order, row or column - namespace matrix_major_storage - { - template inline detail::_xmat2 rowMajor2(const detail::_xvec2& v1, const detail::_xvec2& v2){return rowMajor2GTX(v1, v2);} //!< Build a row major matrix from row vectors (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat2 rowMajor2(const detail::_xmat2& m){return rowMajor2GTX(m);} //!< Build a row major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat3 rowMajor3(const detail::_xvec3& v1, const detail::_xvec3& v2, const detail::_xvec3& v3){return rowMajor3GTX(v1, v2, v3);} //!< Build a row major matrix from row vectors (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat3 rowMajor3(const detail::_xmat3& m){return rowMajor3GTX(m);} //!< Build a row major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat4 rowMajor4(const detail::_xvec4& v1, const detail::_xvec4& v2, const detail::_xvec4& v3, const detail::_xvec4& v4){return rowMajor4GTX(v1, v2, v3, v4);} //!< Build a row major matrix from row vectors (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat4 rowMajor4(const detail::_xmat4& m){return rowMajor4GTX(m);} //!< Build a row major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - - template inline detail::_xmat2 colMajor2(const detail::_xvec2& v1, const detail::_xvec2& v2){return colMajor2GTX(v1, v2);} //!< Build a column major matrix from column vectors (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat2 colMajor2(const detail::_xmat2& m){return colMajor2GTX(m);} //!< Build a column major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat3 colMajor3(const detail::_xvec3& v1, const detail::_xvec3& v2, const detail::_xvec3& v3){return colMajor2GTX(v1, v2, v3);} //!< Build a column major matrix from column vectors (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat3 colMajor3(const detail::_xmat3& m){return colMajor3GTX(m);} //!< Build a column major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat4 colMajor4(const detail::_xvec4& v1, const detail::_xvec4& v2, const detail::_xvec4& v3, const detail::_xvec4& v4){return colMajor2GTX(v1, v2, v3, v4);} //!< Build a column major matrix from column vectors (From GLM_GTX_matrix_major_storage extension) - template inline detail::_xmat4 colMajor4(const detail::_xmat4& m){return colMajor4GTX(m);} //!< Build a column major matrix from other matrix (From GLM_GTX_matrix_major_storage extension) - } - } -} - -#define GLM_GTX_matrix_major_storage namespace gtx::matrix_major_storage - -#include "matrix_major_storage.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_matrix_major_storage;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_matrix_major_storage__ diff --git a/experimental/sse/glm/ext/gtx/matrix_major_storage.inl b/experimental/sse/glm/ext/gtx/matrix_major_storage.inl deleted file mode 100644 index 61a082e7..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_major_storage.inl +++ /dev/null @@ -1,170 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-19 -// Updated : 2008-05-01 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_major_storage.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat2 rowMajor2GTX( - const detail::_xvec2& v1, - const detail::_xvec2& v2) - { - detail::_xmat2 Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - return Result; - } - - template - inline detail::_xmat2 rowMajor2GTX( - const detail::_xmat2& m) - { - detail::_xmat2 Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - return Result; - } - - template - inline detail::_xmat3 rowMajor3GTX( - const detail::_xvec3& v1, - const detail::_xvec3& v2, - const detail::_xvec3& v3) - { - detail::_xmat3 Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[2][0] = v1.z; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - Result[2][1] = v2.z; - Result[0][2] = v3.x; - Result[1][2] = v3.y; - Result[2][2] = v3.z; - return Result; - } - - template - inline detail::_xmat3 rowMajor3GTX( - const detail::_xmat3& m) - { - detail::_xmat3 Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - return Result; - } - - template - inline detail::_xmat4 rowMajor4GTX( - const detail::_xvec4& v1, - const detail::_xvec4& v2, - const detail::_xvec4& v3, - const detail::_xvec4& v4) - { - detail::_xmat4 Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[2][0] = v1.z; - Result[3][0] = v1.w; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - Result[2][1] = v2.z; - Result[3][1] = v2.w; - Result[0][2] = v3.x; - Result[1][2] = v3.y; - Result[2][2] = v3.z; - Result[3][2] = v3.w; - Result[0][3] = v4.x; - Result[1][3] = v4.y; - Result[2][3] = v4.z; - Result[3][3] = v4.w; - return Result; - } - - template - inline detail::_xmat4 rowMajor4GTX( - const detail::_xmat4& m) - { - detail::_xmat4 Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[0][3] = m[3][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[1][3] = m[3][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - Result[2][3] = m[3][2]; - Result[3][0] = m[0][3]; - Result[3][1] = m[1][3]; - Result[3][2] = m[2][3]; - Result[3][3] = m[3][3]; - return Result; - } - - template - inline detail::_xmat2 colMajor2GTX( - const detail::_xvec2& v1, - const detail::_xvec2& v2) - { - return detail::_xmat2(v1, v2); - } - - template - inline detail::_xmat2 colMajor2GTX( - const detail::_xmat2& m) - { - return detail::_xmat2(m); - } - - template - inline detail::_xmat3 colMajor3GTX( - const detail::_xvec3& v1, - const detail::_xvec3& v2, - const detail::_xvec3& v3) - { - return detail::_xmat3(v1, v2, v3); - } - - template - inline detail::_xmat3 colMajor3GTX( - const detail::_xmat3& m) - { - return detail::_xmat3(m); - } - - template - inline detail::_xmat4 colMajor4GTX( - const detail::_xvec4& v1, - const detail::_xvec4& v2, - const detail::_xvec4& v3, - const detail::_xvec4& v4) - { - return detail::_xmat4(v1, v2, v3, v4); - } - - template - inline detail::_xmat4 colMajor4GTX(const detail::_xmat4& m) - { - return detail::_xmat4(m); - } -} diff --git a/experimental/sse/glm/ext/gtx/matrix_projection.h b/experimental/sse/glm/ext/gtx/matrix_projection.h deleted file mode 100644 index 1453d915..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_projection.h +++ /dev/null @@ -1,53 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_projection.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_matrix_projection__ -#define __glm_gtx_matrix_projection__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat4 ortho2DGTX(T left, T right, T bottom, T top); //!< \brief Creates a matrix for projecting two-dimensional coordinates onto the screen (from GLM_GTX_matrix_projection extension) - template detail::_xmat4 ortho3DGTX(T left, T right, T bottom, T top, T zNear, T zFar); //!< \brief Creates a matrix for an orthographic parallel viewing volume (from GLM_GTX_matrix_projection extension) - template detail::_xmat4 perspectiveGTX(T fovy, T aspect, T zNear, T zFar); //!< \brief Creates a matrix for a symmetric perspective-view frustum (from GLM_GTX_matrix_projection extension) - template detail::_xmat4 infinitePerspectiveGTX(T fovy, T aspect, T zNear); //!< \brief Creates a matrix for a symmetric perspective-view frustum with far plane at infinite (from GLM_GTX_matrix_projection extension) - template detail::_xmat4 tweakedInfinitePerspectiveGTX(T fovy, T aspect, T zNear); //!< \brief Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping (from GLM_GTX_matrix_projection extension) - template detail::_xvec3 projectGTX(const detail::_xvec3& obj, const detail::_xmat4& model, const detail::_xmat4& proj, const detail::_xvec4& viewport); //!< \brief Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates (from GLM_GTX_matrix_projection extension) - template detail::_xvec3 unProjectGTX(const detail::_xvec3& win, const detail::_xmat4& model, const detail::_xmat4& proj, const detail::_xvec4& viewport); //!< \brief Map the specified window coordinates (win.x, win.y, win.z) into object coordinates (from GLM_GTX_matrix_projection extension) - - namespace gtx - { - //! GLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices - namespace matrix_projection - { - template inline detail::_xmat4 ortho2D(T left, T right, T bottom, T top){return ortho2DGTX(left, right, bottom, top);} //!< \brief Creates a matrix for projecting two-dimensional coordinates onto the screen (from GLM_GTX_matrix_projection extension) - template inline detail::_xmat4 ortho3D(T left, T right, T bottom, T top, T zNear, T zFar){return ortho2DGTX(left, right, bottom, top, zNear, zFar);} //!< \brief Creates a matrix for an orthographic parallel viewing volume (from GLM_GTX_matrix_projection extension) - template inline detail::_xmat4 perspective(T fovy, T aspect, T zNear, T zFar){return perspectiveGTX(fovy, aspect, zNear, zFar);} //!< \brief Creates a matrix for a symmetric perspective-view frustum (from GLM_GTX_matrix_projection extension) - template inline detail::_xmat4 infinitePerspective(T fovy, T aspect, T zNear){return infinitePerspectiveGTX(fovy, aspect, zNear);} //!< \brief Creates a matrix for a symmetric perspective-view frustum with far plane at infinite (from GLM_GTX_matrix_projection extension) - template inline detail::_xmat4 tweakedInfinitePerspective(T fovy, T aspect, T zNear){return tweakedInfinitePerspectiveGTX(fovy, aspect, zNear);} //!< \brief Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping (from GLM_GTX_matrix_projection extension) - template inline detail::_xvec3 project(const detail::_xvec3& obj, const detail::_xmat4& model, const detail::_xmat4& proj, const detail::_xvec4& viewport){return projectGTX(obj, model, proj, viewport);} //!< \brief Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates (from GLM_GTX_matrix_projection extension) - template inline detail::_xvec3 unProject(const detail::_xvec3& win, const detail::_xmat4& model, const detail::_xmat4& proj, const detail::_xvec4& viewport){return unProjectGTX(win, model, proj, viewport);} //!< \brief Map the specified window coordinates (win.x, win.y, win.z) into object coordinates (from GLM_GTX_matrix_projection extension) - } - } -} - -#define GLM_GTX_matrix_projection namespace gtx::matrix_projection - -#include "matrix_projection.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_matrix_projection;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_matrix_projection__ diff --git a/experimental/sse/glm/ext/gtx/matrix_projection.inl b/experimental/sse/glm/ext/gtx/matrix_projection.inl deleted file mode 100644 index 6d3512b8..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_projection.inl +++ /dev/null @@ -1,135 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_projection.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat4 perspectiveGTX(T fovy, T aspect, T zNear, T zFar) - { - T range = tan(radians(fovy / 2)) * zNear; - T left = -range * aspect; - T right = range * aspect; - T bottom = -range; - T top = range; - - detail::_xmat4 Result(T(0)); - Result[0][0] = (2 * zNear) / (right - left); - Result[1][1] = (2 * zNear) / (top - bottom); - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[2][3] = -1; - Result[3][2] = - (2 * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - inline detail::_xmat4 infinitePerspectiveGTX(T fovy, T aspect, T zNear) - { - T range = tan(radians(fovy / 2)) * zNear; - T left = -range * aspect; - T right = range * aspect; - T bottom = -range; - T top = range; - - detail::_xmat4 Result(T(0)); - Result[0][0] = (2 * zNear) / (right - left); - Result[1][1] = (2 * zNear) / (top - bottom); - Result[2][2] = -1; - Result[2][3] = -1; - Result[3][2] = - 2 * zNear; - return Result; - } - - template - inline detail::_xmat4 tweakedInfinitePerspectiveGTX(T fovy, T aspect, T zNear) - { - T range = tan(radians(fovy / 2)) * zNear; - T left = -range * aspect; - T right = range * aspect; - T bottom = -range; - T top = range; - - detail::_xmat4 Result(T(0)); - Result[0][0] = (2 * zNear) / (right - left); - Result[1][1] = (2 * zNear) / (top - bottom); - Result[2][2] = T(0.0001f) -1; - Result[2][3] = -1; - Result[3][2] = - (0.0001f - 2) * zNear; - return Result; - } - - template - inline detail::_xmat4 ortho2DGTX(T left, T right, T bottom, T top) - { - detail::_xmat4 Result(1); - Result[0][0] = 2 / (right - left); - Result[1][1] = 2 / (top - bottom); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - return Result; - } - - template - inline detail::_xmat4 ortho3DGTX(T left, T right, T bottom, T top, T zNear, T zFar) - { - detail::_xmat4 Result(1); - Result[0][0] = 2 / (right - left); - Result[1][1] = 2 / (top - bottom); - Result[2][2] = 2 / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); - return Result; - } -/* - template - _xvec3 projectGTX(const _xvec3& obj, const _xmat4& model, const _xmat4& proj, const _xvec4& view) - { - _xvec4 v = proj * model * _xvec4(obj, 1); - return _xvec3(T(view.x) + T(view.z) * (v.x + 1) / 2, T(view.y) + T(view.w) * (v.y + 1) / 2, (v.z + 1) / 2); - } -*/ - template - inline detail::_xvec3 projectGTX(const detail::_xvec3& obj, const detail::_xmat4& model, const detail::_xmat4& proj, const detail::_xvec4& viewport) - { - detail::_xvec4 tmp = detail::_xvec4(obj, T(1.0)); - tmp = model * tmp; - tmp = proj * tmp; - - tmp /= tmp.w; - tmp = tmp * T(0.5) + T(0.5); - tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); - tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); - - return detail::_xvec3(tmp); - } -/* - template - _xvec3 unProjectGTX(const _xvec3& win, const _xmat4& model, const _xmat4& proj, const _xvec4& view) - { - _xvec4 v(2 * (win.x - T(view.x)) / view.z - 1, 2 * (win.y - T(view.y)) / view.w - 1, 2 * win.z - 1, 1); - return _xvec3(inverseGTX(proj * model) * v); - } -*/ - template - inline detail::_xvec3 unProjectGTX(const detail::_xvec3& win, const detail::_xmat4& model, const detail::_xmat4& proj, const detail::_xvec4& viewport) - { - detail::_xmat4 inverse = inverseGTX(proj * model); - - detail::_xvec4 tmp = detail::_xvec4(win, T(1)); - tmp.x = (tmp.x - viewport[0]) / viewport[2]; - tmp.y = (tmp.y - viewport[1]) / viewport[3]; - tmp = tmp * T(2) - T(1); - - detail::_xvec4 obj = inverse * tmp; - obj /= obj.w; - - return detail::_xvec3(obj); - } - -} diff --git a/experimental/sse/glm/ext/gtx/matrix_query.h b/experimental/sse/glm/ext/gtx/matrix_query.h deleted file mode 100644 index f4149c11..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_query.h +++ /dev/null @@ -1,62 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-05 -// Updated : 2007-03-05 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_query.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_matrix_query__ -#define __glm_gtx_matrix_query__ - -// Dependency: -#include "../../glm.h" -#include - -namespace glm -{ - template bool isNullGTX(const detail::_xmat2& m, const T epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix a null matrix (from GLM_GTX_matrix_query extension) - template bool isNullGTX(const detail::_xmat3& m, const T epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix a null matrix (from GLM_GTX_matrix_query extension) - template bool isNullGTX(const detail::_xmat4& m, const T epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix a null matrix (from GLM_GTX_matrix_query extension) - - template bool isIdentityGTX(const genType& m, const typename genType::value_type epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix an identity matrix (from GLM_GTX_matrix_query extension) - - template bool isNormalizedGTX(const detail::_xmat2& m, const T epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension) - template bool isNormalizedGTX(const detail::_xmat3& m, const T epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension) - template bool isNormalizedGTX(const detail::_xmat4& m, const T epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension) - - template bool isOrthogonalGTX(const genType& m, const typename genType::value_type epsilon = std::numeric_limits::epsilon()); //!< Return if a matrix an orthonormalized matrix (from GLM_GTX_matrix_query extension) - - namespace gtx - { - //! GLM_GTX_matrix_query: Query to evaluate matrices properties - namespace matrix_query - { - template inline bool isNull(const detail::_xmat2& m, const T epsilon = std::numeric_limits::epsilon()){return isNullGTX(m, epsilon);} //!< Return if a matrix a null matrix (from GLM_GTX_matrix_query extension) - template inline bool isNull(const detail::_xmat3& m, const T epsilon = std::numeric_limits::epsilon()){return isNullGTX(m, epsilon);} //!< Return if a matrix a null matrix (from GLM_GTX_matrix_query extension) - template inline bool isNull(const detail::_xmat4& m, const T epsilon = std::numeric_limits::epsilon()){return isNullGTX(m, epsilon);} //!< Return if a matrix a null matrix (from GLM_GTX_matrix_query extension) - - template inline bool isIdentity(const genType& m, const typename genType::value_type epsilon = std::numeric_limits::epsilon()){return isIdentityGTX(m, epsilon);} //!< Return if a matrix an identity matrix (from GLM_GTX_matrix_query extension) - - template inline bool isNormalized(const detail::_xmat2& m, const T epsilon = std::numeric_limits::epsilon()){return isNormalizedGTX(m, epsilon);} //!< Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension) - template inline bool isNormalized(const detail::_xmat3& m, const T epsilon = std::numeric_limits::epsilon()){return isNormalizedGTX(m, epsilon);} //!< Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension) - template inline bool isNormalized(const detail::_xmat4& m, const T epsilon = std::numeric_limits::epsilon()){return isNormalizedGTX(m, epsilon);} //!< Return if a matrix a normalized matrix (from GLM_GTX_matrix_query extension) - - template inline bool isOrthogonal(const genType& m, const typename genType::value_type epsilon = std::numeric_limits::epsilon()){return isOrthogonalGTX(m, epsilon);} //!< Return if a matrix an orthonormalized matrix (from GLM_GTX_matrix_query extension) - } - } -} - -#define GLM_GTX_matrix_query namespace gtx::matrix_query - -#include "matrix_query.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_matrix_query;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_matrix_query__ diff --git a/experimental/sse/glm/ext/gtx/matrix_query.inl b/experimental/sse/glm/ext/gtx/matrix_query.inl deleted file mode 100644 index 2341c5bb..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_query.inl +++ /dev/null @@ -1,255 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-05 -// Updated : 2007-03-05 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_query.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ -/* - template - inline bool isNullGTX(const genType& m, const typename genType::value_type epsilon) - { - bool result = true; - for(genType::value_type i = genType::value_type(0); result && i < genType::col_size; ++i) - result = isNullGTX(m[i], epsilon); - return result; - } -*/ - template - inline bool isNullGTX(const detail::_xmat2& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 2 ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template - inline bool isNullGTX(const detail::_xmat3& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 3 ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template - inline bool isNullGTX(const detail::_xmat4& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 4 ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template - inline bool isIdentityGTX(const genType& m, const typename genType::value_type epsilon) - { - bool result = true; - for(typename genType::value_type i = typename genType::value_type(0); result && i < genType::col_size; ++i) - { - for(typename genType::value_type j = typename genType::value_type(0); result && j < i ; ++j) - result = abs(m[i][j]) <= epsilon; - if(result) - result = abs(m[i][i] - typename genType::value_type(1)) <= epsilon; - for(typename genType::value_type j = i + typename genType::value_type(1); result && j < genType::row_size; ++j) - result = abs(m[i][j]) <= epsilon; - } - return result; - } -/* - template - inline bool isIdentityGTX(const _xmat2& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 2; ++i) - { - for(int j = 0; result && j < i ; ++j) - result = abs(m[i][j]) <= epsilon; - if(result) - result = abs(m[i][i] - T(1)) <= epsilon; - for(int j = i + 1; result && j < 2; ++j) - result = abs(m[i][j]) <= epsilon; - } - return result; - } - - template - inline bool isIdentityGTX(const _xmat3& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 3; ++i) - { - for(int j = 0; result && j < i ; ++j) - result = abs(m[i][j]) <= epsilon; - if(result) - result = abs(m[i][i] - T(1)) <= epsilon; - for(int j = i + 1; result && j < 3; ++j) - result = abs(m[i][j]) <= epsilon; - } - return result; - } - - template - inline bool isIdentityGTX(const _xmat4& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 4; ++i) - { - for(int j = 0; result && j < i ; ++j) - result = abs(m[i][j]) <= epsilon; - if(result) - result = abs(m[i][i] - T(1)) <= epsilon; - for(int j = i + 1; result && j < 4; ++j) - result = abs(m[i][j]) <= epsilon; - } - return result; - } -*/ -/* - template - inline bool isNormalizedGTX(const genType& m, const typename genType::value_type epsilon) - { - bool result = true; - for(genType::value_type i = genType::value_type(0); result && i < genType::col_size; ++i) - result = isNormalized(m[i], epsilon); - for(genType::value_type i = genType::value_type(0); result && i < genType::row_size; ++i) - { - vecType v; - for(genType::value_type j = genType::value_type(0); j < genType::col_size; ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } -*/ - - template - inline bool isNormalizedGTX(const detail::_xmat2& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 2; ++i) - result = isNormalized(m[i], epsilon); - for(int i = 0; result && i < 2; ++i) - { - detail::_xvec2 v; - for(int j = 0; j < 2; ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template - inline bool isNormalizedGTX(const detail::_xmat3& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 3; ++i) - result = isNormalized(m[i], epsilon); - for(int i = 0; result && i < 3; ++i) - { - detail::_xvec3 v; - for(int j = 0; j < 3; ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template - inline bool isNormalizedGTX(const detail::_xmat4& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 4; ++i) - result = isNormalized(m[i], epsilon); - for(int i = 0; result && i < 4; ++i) - { - detail::_xvec4 v; - for(int j = 0; j < 4; ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template - inline bool isOrthogonalGTX(const genType& m, const typename genType::value_type epsilon) - { - bool result = true; - for(int i = 0; result && i < genType::col_size - 1; ++i) - for(int j= i + 1; result && j < genType::col_size; ++j) - result = areOrthogonal(m[i], m[j], epsilon); - - if(result) - { - genType tmp = transpose(m); - for(int i = 0; result && i < genType::col_size - 1 ; ++i) - for(int j = i + 1; result && j < genType::col_size; ++j) - result = areOrthogonal(tmp[i], tmp[j], epsilon); - } - return result; - } - -/* - template - inline bool isOrthogonalGTX(const _xmat2& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 2 - 1; ++i) - for(int j= i + 1; result && j < 2; ++j) - result = areOrthogonal(m[i], m[j], epsilon); - - if(result) - { - _xmat2 tmp = transpose(m); - for(int i = 0; result && i < 2 - 1 ; ++i) - for(int j = i + 1; result && j < 2; ++j) - result = areOrthogonal(tmp[i], tmp[j], epsilon); - } - return result; - } - - template - inline bool isOrthogonalGTX(const _xmat3& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 3 - 1; ++i) - for(int j= i + 1; result && j < 3; ++j) - result = areOrthogonal(m[i], m[j], epsilon); - - if(result) - { - _xmat3 tmp = transpose(m); - for(int i = 0; result && i < 3 - 1 ; ++i) - for(int j = i + 1; result && j < 3; ++j) - result = areOrthogonal(tmp[i], tmp[j], epsilon); - } - return result; - } - - template - inline bool isOrthogonalGTX(const _xmat4& m, const T epsilon) - { - bool result = true; - for(int i = 0; result && i < 4 - 1; ++i) - for(int j= i + 1; result && j < 4; ++j) - result = areOrthogonal(m[i], m[j], epsilon); - - if(result) - { - _xmat4 tmp = transpose(m); - for(int i = 0; result && i < 4 - 1 ; ++i) - for(int j = i + 1; result && j < 4; ++j) - result = areOrthogonal(tmp[i], tmp[j], epsilon); - } - return result; - } -*/ -} diff --git a/experimental/sse/glm/ext/gtx/matrix_selection.h b/experimental/sse/glm/ext/gtx/matrix_selection.h deleted file mode 100644 index 2760bcf5..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_selection.h +++ /dev/null @@ -1,51 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_selection.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_matrix_selection__ -#define __glm_gtx_matrix_selection__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xvec2 rowGTX(const detail::_xmat2& m, int index); //!< \brief Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the row index (from GLM_GTX_matrix_selection extension) - template detail::_xvec3 rowGTX(const detail::_xmat3& m, int index); //!< \brief Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the row index (from GLM_GTX_matrix_selection extension) - template detail::_xvec4 rowGTX(const detail::_xmat4& m, int index); //!< \brief Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the row index (from GLM_GTX_matrix_selection extension) - template detail::_xvec2 columnGTX(const detail::_xmat2& m, int index); //!< \brief Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the column index (from GLM_GTX_matrix_selection extension) - template detail::_xvec3 columnGTX(const detail::_xmat3& m, int index); //!< \brief Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the column index (from GLM_GTX_matrix_selection extension) - template detail::_xvec4 columnGTX(const detail::_xmat4& m, int index); //!< \brief Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the column index (from GLM_GTX_matrix_selection extension) - - namespace gtx - { - //! GLM_GTX_matrix_selection extension: Access to matrix columns or rows. - namespace matrix_selection - { - template detail::_xvec2 row(const detail::_xmat2& m, int index){return rowGTX(m, index);} //!< \brief Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the row index (from GLM_GTX_matrix_selection extension) - template detail::_xvec3 row(const detail::_xmat3& m, int index){return rowGTX(m, index);} //!< \brief Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the row index (from GLM_GTX_matrix_selection extension) - template detail::_xvec4 row(const detail::_xmat4& m, int index){return rowGTX(m, index);} //!< \brief Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the row index (from GLM_GTX_matrix_selection extension) - template detail::_xvec2 column(const detail::_xmat2& m, int index){return columnGTX(m, index);} //!< \brief Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the column index (from GLM_GTX_matrix_selection extension) - template detail::_xvec3 column(const detail::_xmat3& m, int index){return columnGTX(m, index);} //!< \brief Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the column index (from GLM_GTX_matrix_selection extension) - template detail::_xvec4 column(const detail::_xmat4& m, int index){return columnGTX(m, index);} //!< \brief Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the column index (from GLM_GTX_matrix_selection extension) - } - } -} - -#define GLM_GTX_matrix_selection namespace gtx::matrix_selection - -#include "matrix_selection.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_matrix_selection;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_matrix_selection__ diff --git a/experimental/sse/glm/ext/gtx/matrix_selection.inl b/experimental/sse/glm/ext/gtx/matrix_selection.inl deleted file mode 100644 index 5d68cc01..00000000 --- a/experimental/sse/glm/ext/gtx/matrix_selection.inl +++ /dev/null @@ -1,63 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matrix_selection.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ -/* - template - GLMrowType rowGTX(const genType& m, int index) - { - GLMrowType result; - for(typename genType::size_type i = 0; i < genType::row_size; ++i) - result[i] = m[i][index]; - return result; - } - - template - GLMcolType columnGTX(const genType& m, int index) - { - return m[index]; - } -*/ - template - inline detail::_xvec2 rowGTX(const detail::_xmat2& m, int index) - { - return detail::_xvec2(m[0][index], m[1][index]); - } - - template - inline detail::_xvec3 rowGTX(const detail::_xmat3& m, int index) - { - return detail::_xvec3(m[0][index], m[1][index], m[2][index]); - } - - template - inline detail::_xvec4 rowGTX(const detail::_xmat4& m, int index) - { - return detail::_xvec4(m[0][index], m[1][index], m[2][index], m[3][index]); - } - - template - inline detail::_xvec2 columnGTX(const detail::_xmat2& m, int index) - { - return m[index]; - } - - template - inline detail::_xvec3 columnGTX(const detail::_xmat3& m, int index) - { - return m[index]; - } - - template - inline detail::_xvec4 columnGTX(const detail::_xmat4& m, int index) - { - return m[index]; - } -} diff --git a/experimental/sse/glm/ext/gtx/matx.h b/experimental/sse/glm/ext/gtx/matx.h deleted file mode 100644 index 79b357e5..00000000 --- a/experimental/sse/glm/ext/gtx/matx.h +++ /dev/null @@ -1,184 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-03-01 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matx.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_vecx -// - GLM_GTX_matrix_selection -// - GLM_GTX_matrix_access -// - GLM_GTX_mul -// - GLM_GTX_inverse_transpose -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_matx__ -#define __glm_gtx_matx__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/vecx.h" - -namespace glm{ -namespace detail{ - - template - class _xmatxGTX - { - private: - // Data - _xvecxGTX value[N]; - - public: - _xmatxGTX _inverse() const; - - public: - typedef T value_type; - typedef int size_type; - static const size_type value_size; - - // Constructors - _xmatxGTX(); - explicit _xmatxGTX(const T x); - - // Accesses - _xvecxGTX& operator[](int i) {return value[i];} - const _xvecxGTX & operator[](int i) const {return value[i];} - operator T*() {return &value[0][0];} - operator const T*() const {return &value[0][0];} - - // Unary updatable operators - _xmatxGTX& operator= (const _xmatxGTX& m); - _xmatxGTX& operator+= (const T s); - _xmatxGTX& operator+= (const _xmatxGTX& m); - _xmatxGTX& operator-= (const T s); - _xmatxGTX& operator-= (const _xmatxGTX& m); - _xmatxGTX& operator*= (const T s); - _xmatxGTX& operator*= (const _xmatxGTX& m); - _xmatxGTX& operator/= (const T s); - _xmatxGTX& operator/= (const _xmatxGTX& m); - _xmatxGTX& operator++ (); - _xmatxGTX& operator-- (); - }; - - // Binary operators - template - _xmatxGTX operator+ (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator+ (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator+ (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator+ (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator+ (const _xmatxGTX& m1, const _xmatxGTX& m2); - - template - _xmatxGTX operator- (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator- (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator- (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator- (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator- (const _xmatxGTX& m1, const _xmatxGTX& m2); - - template - _xmatxGTX operator* (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator* (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator* (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator* (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator* (const _xmatxGTX& m1, const _xmatxGTX& m2); - - template - _xmatxGTX operator/ (const _xmatxGTX& m, const T s); - - template - _xmatxGTX operator/ (const T s, const _xmatxGTX& m); - - template - _xvecxGTX operator/ (const _xmatxGTX& m, const _xvecxGTX& v); - - template - _xvecxGTX operator/ (const _xvecxGTX& v, const _xmatxGTX& m); - - template - _xmatxGTX operator/ (const _xmatxGTX& m1, const _xmatxGTX& m2); - - // Unary constant operators - template - const _xmatxGTX operator- (const _xmatxGTX& m); - - template - const _xmatxGTX operator-- (const _xmatxGTX& m, int); - - template - const _xmatxGTX operator++ (const _xmatxGTX& m, int); - -}//namespace detail - - // Extension functions - template detail::_xmatxGTX matrixCompMultGTX(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y); //!< Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (from GLM_GTX_matx extension) - template detail::_xmatxGTX outerProductGTX(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r); //!< Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (from GLM_GTX_matx extension) - template detail::_xmatxGTX transposeGTX(const detail::_xmatxGTX& x); //!< Returns the transposed matrix of x. (from GLM_GTX_matx extension) - - template T determinantGTX(const detail::_xmatxGTX& m); //!< Returns the determinant of a 2 * 2 matrix. (from GLM_GTX_matx extension) - template detail::_xmatxGTX inverseTransposeGTX(const detail::_xmatxGTX & m); //!< Compute the inverse of a transformation 4x4 matrix (From GLM_GTX_matx extension) - - template void columnGTX(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v); //!< Set a specific column to a matrix (From GLM_GTX_matx extension) - template void rowGTX(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v); //!< Set a specific row to a matrix (From GLM_GTX_matx extension) - - template detail::_xvecxGTX columnGTX(const detail::_xmatxGTX& m, int ColIndex); //!< Get a specific column to a matrix (From GLM_GTX_matx extension) - template detail::_xvecxGTX rowGTX(const detail::_xmatxGTX& m, int RowIndex); //!< Get a specific row to a matrix (From GLM_GTX_matx extension) - - namespace gtx - { - //! GLM_GTX_matx extension: - Work in progress - NxN matrix types. - namespace matx - { - // Matrix Functions - template inline detail::_xmatxGTX matrixCompMult(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y){return matrixCompMult(x, y);} //!< Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j]. (from GLM_GTX_matx extension) - template inline detail::_xmatxGTX outerProduct(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r){return outerProductGTX(c, r);} //!< Treats the first parameter c as a column vector and the second parameter r as a row vector and does a linear algebraic matrix multiply c * r. (from GLM_GTX_matx extension) - template inline detail::_xmatxGTX transpose(const detail::_xmatxGTX& x){return transposeGTX(x);} //!< Returns the transposed matrix of x. (from GLM_GTX_matx extension) - - template inline T determinant(const detail::_xmatxGTX& m){return determinantGTX(m);} //!< Returns the determinant of a 2 * 2 matrix. (from GLM_GTX_matx extension) - template inline detail::_xmatxGTX inverseTranspose(const detail::_xmatxGTX& m){return inverseTransposeGTX(m);} //!< Compute the inverse of a transformation 4x4 matrix (From GLM_GTX_matx extension) - - template inline void column(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v){setColumnGTX(m, v);} //!< Set a specific column to a matrix (From GLM_GTX_matx extension) - template inline void row(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v){setRowGTX(m, v);} //!< Set a specific row to a matrix (From GLM_GTX_matx extension) - - template inline detail::_xvecxGTX column(const detail::_xmatxGTX& m, int ColIndex){return column(m, ColIndex);} //!< Get a specific column to a matrix (From GLM_GTX_matx extension) - template inline detail::_xvecxGTX row(const detail::_xmatxGTX& m, int RowIndex){return row(m, RowIndex);} //!< Get a specific row to a matrix (From GLM_GTX_matx extension) - } - } -} - -#define GLM_GTX_matx namespace gtx::matx - -#include "matx.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_matx;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_matx__ diff --git a/experimental/sse/glm/ext/gtx/matx.inl b/experimental/sse/glm/ext/gtx/matx.inl deleted file mode 100644 index 62e85720..00000000 --- a/experimental/sse/glm/ext/gtx/matx.inl +++ /dev/null @@ -1,479 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-02-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/matx.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - -namespace glm{ -namespace detail{ - - template const typename _xmatxGTX::size_type _xmatxGTX::value_size = N; - - ////////////////////////////////////////////////////////////// - // _xmatxGTX constructors - - template - inline _xmatxGTX::_xmatxGTX() - { - for(int i = 0; i < N; ++i) - this->value[i][i] = T(0); - } - - template - inline _xmatxGTX::_xmatxGTX(const T f) - { - for(int i = 0; i < N; ++i) - this->value[i][i] = f; - } - - ////////////////////////////////////////////////////////////// - // _xmatxGTX operators - - // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared - template - inline _xmatxGTX& _xmatxGTX::operator= (const _xmatxGTX& m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(T)); - for(int i = 0; i < N; ++i) - this->value[i] = m[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator+= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] += s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator+= (const _xmatxGTX& m) - { - for(int i = 0; i < N; ++i) - this->value[i] += m[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator-= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] -= s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator-= (const _xmatxGTX& m) - { - for(int i = 0; i < N; ++i) - this->value[i] -= m[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator*= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] *= s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator*= (const _xmatxGTX& m) - { - return (*this = *this * m); - } - - template - inline _xmatxGTX& _xmatxGTX::operator/= (const T s) - { - for(int i = 0; i < N; ++i) - this->value[i] /= s; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator/= (const _xmatxGTX& m) - { - return (*this = *this / m); - } - - template - inline _xmatxGTX& _xmatxGTX::operator-- () - { - for(int i = 0; i < N; ++i) - --this->value[i]; - return *this; - } - - template - inline _xmatxGTX& _xmatxGTX::operator++ () - { - for(int i = 0; i < N; ++i) - ++this->value[i]; - return *this; - } - - // Private functions - template - inline _xmatxGTX _xmatxGTX::_inverse() const - { - _xmatxGTX Result = *this; - - int ColIndex[N]; - int RowIndex[N]; - bool Pivoted[N]; - memset(ColIndex, 0, N * sizeof(int)); - memset(RowIndex, 0, N * sizeof(int)); - memset(Pivoted, 0, N * sizeof(bool)); - - int iRow = 0, iCol = 0; - - // elimination by full pivoting - for(int i0 = 0; i0 < N; i0++) - { - // search matrix (excluding pivoted rows) for maximum absolute entry - T fMax = T(0); - for(int i1 = 0; i1 < N; i1++) - { - if(Pivoted[i1]) - continue; - - for(int i2 = 0; i2 < N; i2++) - { - if(Pivoted[i2]) - continue; - - T Abs = abs(Result[i1][i2]); - if(Abs > fMax) - { - fMax = Abs; - iRow = i1; - iCol = i2; - } - } - } - - if(fMax == T(0)) - { - return _xmatxGTX(1.0f); // Error - } - - Pivoted[iCol] = true; - - // swap rows so that A[iCol][iCol] contains the pivot entry - if(iRow != iCol) - { - _xvecxGTX Row = rowGTX(Result, iRow); - _xvecxGTX Col = rowGTX(Result, iCol); - rowGTX(Result, iRow, Col); - rowGTX(Result, iCol, Row); - } - - // keep track of the permutations of the rows - RowIndex[i0] = iRow; - ColIndex[i0] = iCol; - - // scale the row so that the pivot entry is 1 - T fInv = T(1) / Result[iCol][iCol]; - Result[iCol][iCol] = T(1); - for(int i2 = 0; i2 < N; i2++) - Result[iCol][i2] *= fInv; - - // zero out the pivot column locations in the other rows - for(int i1 = 0; i1 < N; ++i1) - { - if(i1 == iCol) - continue; - - T Tmp = Result[i1][iCol]; - Result[i1][iCol] = T(0); - for(int i2 = 0; i2 < N; i2++) - Result[i1][i2] -= Result[iCol][i2] * Tmp; - } - } - - // reorder rows so that A[][] stores the inverse of the original matrix - for(int i1 = N-1; i1 >= 0; --i1) - { - if(RowIndex[i1] == ColIndex[i1]) - continue; - for(int i2 = 0; i2 < N; ++i2) - std::swap(Result[i2][RowIndex[i1]], Result[i2][ColIndex[i1]]); - } - - return Result; - } - - // Binary operators - template - inline _xmatxGTX operator+ (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] + s; - return result; - } - - template - inline _xmatxGTX operator+ (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s + m[i]; - return result; - } -/* - template - inline _xvec4 operator+ (const _xmatxGTX& m, const _xvec4& v) - { - - } - - template - inline _xvec4 operator+ (const _xvec4& v, const _xmatxGTX& m) - { - - } -*/ - template - inline _xmatxGTX operator+ (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m1[i] + m2[i]; - return result; - } - - template - inline _xmatxGTX operator- (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] - s; - return result; - } - - template - inline _xmatxGTX operator- (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s - m[i]; - return result; - } -/* - template - inline _xvec4 operator- (const _xmatxGTX& m, const _xvec4& v) - { - - } - - template - inline _xvec4 operator- (const _xvec4& v, const _xmatxGTX& m) - { - - } -*/ - template - inline _xmatxGTX operator- (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m1[i] - m2[i]; - return result; - } - - template - inline _xmatxGTX operator* (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] * s; - return result; - } - - template - inline _xmatxGTX operator* (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s * m[i]; - return result; - } - - template - inline _xvecxGTX operator* (const _xmatxGTX& m, const _xvecxGTX& v) - { - _xvecxGTX result(T(0)); - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j] += m[i][j] * v[i]; - return result; - } - - template - inline _xvecxGTX operator* (const _xvecxGTX& v, const _xmatxGTX& m) - { - _xvecxGTX result(T(0)); - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j] += m[j][i] * v[i]; - return result; - } - - template - inline _xmatxGTX operator* (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - _xmatxGTX Result(T(0)); - for(int k = 0; k < N; ++k) - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - Result[k][j] += m1[i][j] * m2[k][i]; - return Result; - } - - template - inline _xmatxGTX operator/ (const _xmatxGTX& m, const T s) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] / s; - return result; - } - - template - inline _xmatxGTX operator/ (const T s, const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = s / m[i]; - return result; - } - - template - inline _xvecxGTX operator/ (const _xmatxGTX& m, const _xvecxGTX& v) - { - return m._inverse() * v; - } - - template - inline _xvecxGTX operator/ (const _xvecxGTX& v, const _xmatxGTX& m) - { - return v * m._inverse(); - } - - template - inline _xmatxGTX operator/ (const _xmatxGTX& m1, const _xmatxGTX& m2) - { - return m1 * m2._inverse(); - } - - // Unary constant operators - template - inline const _xmatxGTX operator- (const _xmatxGTX& m) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = -m[i]; - return result; - } - - template - inline const _xmatxGTX operator++ (const _xmatxGTX& m, int) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] + T(1); - return result; - } - - template - inline const _xmatxGTX operator-- (const _xmatxGTX& m, int) - { - _xmatxGTX result; - for(int i = 0; i < N; ++i) - result[i] = m[i] - T(1); - return result; - } -}//namespace detail - - // Matrix Functions - template - inline detail::_xmatxGTX matrixCompMultGTX(const detail::_xmatxGTX& x, const detail::_xmatxGTX& y) - { - detail::_xmatxGTX result; - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j][i] = x[j][i] * y[j][i]; - return result; - } - - template - inline detail::_xmatxGTX outerProductGTX(const detail::_xvecxGTX& c, const detail::_xvecxGTX& r) - { - detail::_xmatxGTX result; - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j][i] = c[i] * r[j]; - return result; - } - - template - inline detail::_xmatxGTX transposeGTX(const detail::_xmatxGTX& m) - { - detail::_xmatxGTX result; - for(int j = 0; j < N; ++j) - for(int i = 0; i < N; ++i) - result[j][i] = m[i][j]; - return result; - } - - template - inline T determinantGTX(const detail::_xmatxGTX& m) - { - - } - - template - inline detail::_xmatxGTX inverseTransposeGTX(const detail::_xmatxGTX& m) - { - - } - - template - inline void columnGTX(detail::_xmatxGTX& m, int ColIndex, const detail::_xvecxGTX& v) - { - m[ColIndex] = v; - } - - template - inline void rowGTX(detail::_xmatxGTX& m, int RowIndex, const detail::_xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - m[i][RowIndex] = v[i]; - } - - template - inline detail::_xvecxGTX columnGTX(const detail::_xmatxGTX& m, int ColIndex) - { - return m[ColIndex]; - } - - template - inline detail::_xvecxGTX rowGTX(const detail::_xmatxGTX& m, int RowIndex) - { - detail::_xvecxGTX v; - for(int i = 0; i < N; ++i) - v[i] = m[i][RowIndex]; - return v; - } -} //namespace glm diff --git a/experimental/sse/glm/ext/gtx/mixed_product.h b/experimental/sse/glm/ext/gtx/mixed_product.h deleted file mode 100644 index 1c37cc2c..00000000 --- a/experimental/sse/glm/ext/gtx/mixed_product.h +++ /dev/null @@ -1,54 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-04-03 -// Updated : 2007-04-03 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/mixed_product.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_mixed_product__ -#define __glm_gtx_mixed_product__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - //! Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) - template - GLMvalType mixedProductGTX( - const genType& v1, - const genType& v2, - const genType& v3); - - namespace gtx - { - //! GLM_GTX_mixed_product extension: Mixed product of 3 vectors. - namespace mixed_product - { - //! Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) - template - inline GLMvalType mixedProduct( - const genType& v1, - const genType& v2, - const genType& v3) - { - return mixedProductGTX(v1, v2, v3); - } - } - } -} - -#define GLM_GTX_mixed_product namespace gtx::mixed_product - -#include "mixed_product.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_mixed_product;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_mixed_product__ diff --git a/experimental/sse/glm/ext/gtx/mixed_product.inl b/experimental/sse/glm/ext/gtx/mixed_product.inl deleted file mode 100644 index 18258d40..00000000 --- a/experimental/sse/glm/ext/gtx/mixed_product.inl +++ /dev/null @@ -1,28 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-04-03 -// Updated : 2007-04-03 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/mixed_product.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline GLMvalType mixedProductGTX( - const genType& v1, - const genType& v2, - const genType& v3) - { - return dot(cross(v1, v2), v3); - } -} - - - - - - - - diff --git a/experimental/sse/glm/ext/gtx/mul.h b/experimental/sse/glm/ext/gtx/mul.h deleted file mode 100644 index b410873f..00000000 --- a/experimental/sse/glm/ext/gtx/mul.h +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-20 -// Updated : 2007-04-04 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/mul.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Comment: -// - Extension for Cg compatibility -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_mul__ -#define __glm_gtx_mul__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template genType mulGTX(const genType& a, const genType& b); //!< Product of 2 matrices (From GLM_GTX_mul extension) - template GLMcolType mulGTX(const genType& m, const GLMcolType& v); //!< Product of a matrix and a vector (From GLM_GTX_mul extension) - template GLMcolType mulGTX(const GLMcolType& v, const genType& m); //!< Product of a vector and a matrix (From GLM_GTX_mul extension) - - namespace gtx - { - //! GLM_GTX_mul extension: mul function for Cg and HLSL compatibility. - namespace mul - { - template inline genType mul(const genType& a, const genType& b); //!< Product of 2 matrices (From GLM_GTX_mul extension) - template inline GLMcolType mul(const genType& m, const GLMcolType& v); //!< Product of a matrix and a vector (From GLM_GTX_mul extension) - template inline GLMcolType mul(const GLMcolType& v, const genType& m); //!< Product of a vector and a matrix (From GLM_GTX_mul extension) - } - } -} - -#define GLM_GTX_mul namespace gtx::mul - -#include "mul.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_mul;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_mul__ diff --git a/experimental/sse/glm/ext/gtx/mul.inl b/experimental/sse/glm/ext/gtx/mul.inl deleted file mode 100644 index e58c7aa8..00000000 --- a/experimental/sse/glm/ext/gtx/mul.inl +++ /dev/null @@ -1,85 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-04-20 -// Updated : 2007-04-04 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/mul.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline genType mulGTX(const genType& a, const genType& b) - { - return a * b; - } - - template - inline GLMcolType mulGTX(const genType& m, const GLMcolType& v) - { - return m * v; - } - - template - inline GLMcolType mulGTX(const GLMcolType& v, const genType& m) - { - return v * m; - } -} - -/* - template - inline _xmat2 mulGTX(const _xmat2& a, const _xmat2& b) - { - return a * b; - } - - template - inline _xmat3 mulGTX(const _xmat3& a, const _xmat3& b) - { - return a * b; - } - - template - inline _xmat4 mulGTX(const _xmat4& a, const _xmat4& b) - { - return a * b; - } - - template - inline _xvec2 mulGTX(const _xmat2& m, const _xvec2& v) - { - return m * v; - } - - template - inline _xvec3 mulGTX(const _xmat3& m, const _xvec3& v) - { - return m * v; - } - - template - inline _xvec4 mulGTX(const _xmat4& m, const _xvec4& v) - { - return m * v; - } - - template - inline _xvec2 mulGTX(const _xvec2& v, const _xmat2& m) - { - return v * m; - } - - template - inline _xvec3 mulGTX(const _xvec3& v, const _xmat3& m) - { - return v * m; - } - - template - inline _xvec4 mulGTX(const _xvec4& v, const _xmat4& m) - { - return v * m; - } -*/ diff --git a/experimental/sse/glm/ext/gtx/norm.h b/experimental/sse/glm/ext/gtx/norm.h deleted file mode 100644 index d1b7aee6..00000000 --- a/experimental/sse/glm/ext/gtx/norm.h +++ /dev/null @@ -1,58 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/norm.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_quaternion -// - GLM_GTX_double -/////////////////////////////////////////////////////////////////////////////////////////////////// -// ToDo: -// - Study the validity of the notion of length2 to quaternion -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_norm__ -#define __glm_gtx_norm__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/double.h" -#include "../gtx/quaternion.h" - -namespace glm -{ - template T length2GTX(const T x); //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template T length2GTX(const detail::_xvec2& x); //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template T length2GTX(const detail::_xvec3& x); //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template T length2GTX(const detail::_xvec4& x); //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template T length2GTX(const detail::_xquat& q); //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template T l1NormGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Returns the L1 norm between x and y (from GLM_GTX_norm extension) - - namespace gtx - { - //! GLM_GTX_norm extension: Varius way to compute vector norms. - namespace norm - { - template inline T length2(const T x){return length2GTX(x);} //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template inline T length2(const detail::_xvec2& x){return length2GTX(x);} //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template inline T length2(const detail::_xvec3& x){return length2GTX(x);} //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template inline T length2(const detail::_xvec4& x){return length2GTX(x);} //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template inline T length2(const detail::_xquat& q){return length2GTX(q);} //!< \brief Returns the squared length of x (from GLM_GTX_norm extension) - template inline T l1Norm(const detail::_xvec3& x, const detail::_xvec3& y){return l1NormGTX(x, y);} //!< \brief Returns the L1 norm between x and y (from GLM_GTX_norm extension) - } - } -} - -#define GLM_GTX_norm namespace gtx::norm - -#include "norm.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_norm;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_norm__ diff --git a/experimental/sse/glm/ext/gtx/norm.inl b/experimental/sse/glm/ext/gtx/norm.inl deleted file mode 100644 index 07097501..00000000 --- a/experimental/sse/glm/ext/gtx/norm.inl +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/norm.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline T length2GTX(const T x) - { - return x * x; - } - - template - inline T length2GTX(const detail::_xvec2& x) - { - return dot(x, x); - } - - template - inline T length2GTX(const detail::_xvec3& x) - { - return dot(x, x); - } - - template - inline T length2GTX(const detail::_xvec4& x) - { - return dot(x, x); - } - - template - inline T length2GTX(const detail::_xquat& q) - { - return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; - } - - template - inline T l1NormGTX(const detail::_xvec3& a, const detail::_xvec3& b) - { - return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); - } -} diff --git a/experimental/sse/glm/ext/gtx/normal.h b/experimental/sse/glm/ext/gtx/normal.h deleted file mode 100644 index 6dca85a2..00000000 --- a/experimental/sse/glm/ext/gtx/normal.h +++ /dev/null @@ -1,41 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/normal.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_normal__ -#define __glm_gtx_normal__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template _xvec3 triangleNormalGTX(const _xvec3& p1, const _xvec3& p2, const _xvec3& p3); //!< /brief Computes triangle normal from triangle points. (from GLM_GTX_normal extension) - - namespace gtx - { - //! GLM_GTX_normal extension: Compute the normal of a triangle. - namespace normal - { - template inline _xvec3 triangleNormal(const _xvec3& p1, const _xvec3& p2, const _xvec3& p3){return triangleNormalGTX(p1, p2, p3);} //!< /brief Computes triangle normal from triangle points. (from GLM_GTX_normal extension) - } - } -} - -#define GLM_GTX_normal namespace gtx::normal - -#include "normal.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_normal;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_normal__ diff --git a/experimental/sse/glm/ext/gtx/normal.inl b/experimental/sse/glm/ext/gtx/normal.inl deleted file mode 100644 index 2b50cc84..00000000 --- a/experimental/sse/glm/ext/gtx/normal.inl +++ /dev/null @@ -1,17 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/normal.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline _xvec3 triangleNormalGTX(const _xvec3& p1, const _xvec3& p2, const _xvec3& p3) - { - return normalize(cross(p1 - p2, p1 - p3)); - } -} diff --git a/experimental/sse/glm/ext/gtx/normalize_dot.h b/experimental/sse/glm/ext/gtx/normalize_dot.h deleted file mode 100644 index a12c1042..00000000 --- a/experimental/sse/glm/ext/gtx/normalize_dot.h +++ /dev/null @@ -1,52 +0,0 @@ -////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-09-28 -// Updated : 2008-01-05 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/normalize_dot.h -////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_fast_square_root -////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_normalize_dot__ -#define __glm_gtx_normalize_dot__ - -// Dependency: -#include "../../glm.h" -#include "../../ext/gtx/fast_square_root.h" - -namespace glm -{ - template T normalizeDotGTX(T x, T y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - template T normalizeDotGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - template T normalizeDotGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - template T normalizeDotGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - - template T fastNormalizeDotGTX(T x, T y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - template T fastNormalizeDotGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - template T fastNormalizeDotGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - template T fastNormalizeDotGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - - namespace gtx - { - //! GLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root. - namespace normalize_dot - { - template T normalizeDot(T x, T y){normalizeDotGTX(x, y);} //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - template T fastNormalizeDot(T x, T y){fastNormalizeDotGTX(x, y);} //!< \brief Normalize parameters and returns the dot product of x and y, faster that dot(normalize(x), normalize(y)) (From GLM_GTX_normalize_dot extension) - } - } -} - -#define GLM_GTX_normalize_dot namespace gtx::normalize_dot - -#include "normalize_dot.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_normalize_dot;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_normalize_dot__ diff --git a/experimental/sse/glm/ext/gtx/normalize_dot.inl b/experimental/sse/glm/ext/gtx/normalize_dot.inl deleted file mode 100644 index 0c8f5c74..00000000 --- a/experimental/sse/glm/ext/gtx/normalize_dot.inl +++ /dev/null @@ -1,54 +0,0 @@ -////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-09-28 -// Updated : 2007-09-28 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/normalize_dot.inl -////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template T normalizeDotGTX(T x, T y) - { - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); - } - - template T normalizeDotGTX(const detail::_xvec2& x, const detail::_xvec2& y) - { - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); - } - - template T normalizeDotGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); - } - - template T normalizeDotGTX(const detail::_xvec4& x, const detail::_xvec4& y) - { - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); - } - - template T fastNormalizeDotGTX(T x, T y) - { - return glm::dot(x, y) * glm::fastInverseSqrtGTX(glm::dot(x, x) * glm::dot(y, y)); - } - - template T fastNormalizeDotGTX(const detail::_xvec2& x, const detail::_xvec2& y) - { - return glm::dot(x, y) * glm::fastInverseSqrtGTX(glm::dot(x, x) * glm::dot(y, y)); - } - - template T fastNormalizeDotGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return glm::dot(x, y) * glm::fastInverseSqrtGTX(glm::dot(x, x) * glm::dot(y, y)); - } - - template T fastNormalizeDotGTX(const detail::_xvec4& x, const detail::_xvec4& y) - { - return glm::dot(x, y) * glm::fastInverseSqrtGTX(glm::dot(x, x) * glm::dot(y, y)); - } -} diff --git a/experimental/sse/glm/ext/gtx/number_precision.h b/experimental/sse/glm/ext/gtx/number_precision.h deleted file mode 100644 index eb8cb3f5..00000000 --- a/experimental/sse/glm/ext/gtx/number_precision.h +++ /dev/null @@ -1,265 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-05-10 -// Updated : 2007-05-10 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/number_precision.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_half -// - GLM_GTX_double -// - GLM_GTX_integer -// - GLM_GTX_unsigned_integer -// - GLM_GTX_quaternion -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_number_precision__ -#define __glm_gtx_number_precision__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/half.h" -#include "../gtx/double.h" -#include "../gtx/integer.h" -#include "../gtx/unsigned_int.h" -#include "../gtx/quaternion.h" - -namespace glm -{ - typedef signed char __int8GTX; //!< 8bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed short __int16GTX; //!< 16bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed int __int32GTX; //!< 32bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed long long __int64GTX; //!< 64bit signed integer. (from GLM_GTX_number_precision extension) - - typedef signed char __i8GTX; //!< 8bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed short __i16GTX; //!< 16bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed int __i32GTX; //!< 32bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed long long __i64GTX; //!< 64bit signed integer. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __i8vec2GTX; //!< 8bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __i8vec3GTX; //!< 8bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __i8vec4GTX; //!< 8bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __i16vec2GTX; //!< 16bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __i16vec3GTX; //!< 16bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __i16vec4GTX; //!< 16bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __i32vec2GTX; //!< 32bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __i32vec3GTX; //!< 32bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __i32vec4GTX; //!< 32bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __i64vec2GTX; //!< 64bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __i64vec3GTX; //!< 64bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __i64vec4GTX; //!< 64bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef unsigned char __uint8GTX; //!< 8bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned short __uint16GTX; //!< 16bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned int __uint32GTX; //!< 32bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned long long __uint64GTX; //!< 64bit unsigned integer. (from GLM_GTX_number_precision extension) - - typedef unsigned char __u8GTX; //!< 8bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned short __u16GTX; //!< 16bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned int __u32GTX; //!< 32bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned long long __u64GTX; //!< 64bit unsigned integer. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __u8vec2GTX; //!< 8bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __u8vec3GTX; //!< 8bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __u8vec4GTX; //!< 8bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __u16vec2GTX; //!< 16bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __u16vec3GTX; //!< 16bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __u16vec4GTX; //!< 16bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __u32vec2GTX; //!< 32bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __u32vec3GTX; //!< 32bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __u32vec4GTX; //!< 32bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __u64vec2GTX; //!< 64bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __u64vec3GTX; //!< 64bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __u64vec4GTX; //!< 64bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef __halfGTX __float16GTX; //!< Half-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef float __float32GTX; //!< Single-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef double __float64GTX; //!< Double-precision floating-point number. (from GLM_GTX_number_precision extension) - - typedef __halfGTX __f16GTX; //!< Half-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef float __f32GTX; //!< Single-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef double __f64GTX; //!< Double-precision floating-point number. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2<__halfGTX> __f16vec2GTX; //!< Half-precision floating-point vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3<__halfGTX> __f16vec3GTX; //!< Half-precision floating-point vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4<__halfGTX> __f16vec4GTX; //!< Half-precision floating-point vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __f32vec2GTX; //!< Single-precision floating-point vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __f32vec3GTX; //!< Single-precision floating-point vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __f32vec4GTX; //!< Single-precision floating-point vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 __f64vec2GTX; //!< Double-precision floating-point vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 __f64vec3GTX; //!< Double-precision floating-point vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 __f64vec4GTX; //!< Double-precision floating-point vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2<__halfGTX> __f16mat2GTX; //!< Half-precision floating-point 2x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3<__halfGTX> __f16mat3GTX; //!< Half-precision floating-point 3x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4<__halfGTX> __f16mat4GTX; //!< Half-precision floating-point 4x4 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2x3<__halfGTX> __f16mat2x3GTX; //!< Half-precision floating-point 2x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat2x4<__halfGTX> __f16mat2x4GTX; //!< Half-precision floating-point 2x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x2<__halfGTX> __f16mat3x2GTX; //!< Half-precision floating-point 3x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x4<__halfGTX> __f16mat3x4GTX; //!< Half-precision floating-point 3x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x2<__halfGTX> __f16mat4x2GTX; //!< Half-precision floating-point 4x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x3<__halfGTX> __f16mat4x3GTX; //!< Half-precision floating-point 4x3 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2 __f32mat2GTX; //!< Single-precision floating-point 2x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3 __f32mat3GTX; //!< Single-precision floating-point 3x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4 __f32mat4GTX; //!< Single-precision floating-point 4x4 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2x3 __f32mat2x3GTX; //!< Single-precision floating-point 2x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat2x4 __f32mat2x4GTX; //!< Single-precision floating-point 2x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x2 __f32mat3x2GTX; //!< Single-precision floating-point 3x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x4 __f32mat3x4GTX; //!< Single-precision floating-point 3x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x2 __f32mat4x2GTX; //!< Single-precision floating-point 4x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x3 __f32mat4x3GTX; //!< Single-precision floating-point 4x3 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2 __f64mat2GTX; //!< Double-precision floating-point 2x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3 __f64mat3GTX; //!< Double-precision floating-point 3x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4 __f64mat4GTX; //!< Double-precision floating-point 4x4 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2x3 __f64mat2x3GTX; //!< Double-precision floating-point 2x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat2x4 __f64mat2x4GTX; //!< Double-precision floating-point 2x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x2 __f64mat3x2GTX; //!< Double-precision floating-point 3x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x4 __f64mat3x4GTX; //!< Double-precision floating-point 3x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x2 __f64mat4x2GTX; //!< Double-precision floating-point 4x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x3 __f64mat4x3GTX; //!< Double-precision floating-point 4x3 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xquat<__halfGTX> __f16quatGTX; //!< Half-precision floating-point quaternion. (from GLM_GTX_number_precision extension) - typedef detail::_xquat __f32quatGTX; //!< Single-precision floating-point quaternion. (from GLM_GTX_number_precision extension) - typedef detail::_xquat __f64quatGTX; //!< Double-precision floating-point quaternion. (from GLM_GTX_number_precision extension) - - namespace gtx - { - //! GLM_GTX_number_precision extension: Defined size types. - namespace number_precision - { - typedef signed char int8; //!< 8bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed short int16; //!< 16bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed int int32; //!< 32bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed long long int64; //!< 64bit signed integer. (from GLM_GTX_number_precision extension) - - typedef signed char i8; //!< 8bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed short i16; //!< 16bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed int i32; //!< 32bit signed integer. (from GLM_GTX_number_precision extension) - typedef signed long long i64; //!< 64bit signed integer. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 i8vec2; //!< 8bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 i8vec3; //!< 8bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 i8vec4; //!< 8bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 i16vec2; //!< 16bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 i16vec3; //!< 16bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 i16vec4; //!< 16bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 i32vec2; //!< 32bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 i32vec3; //!< 32bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 i32vec4; //!< 32bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 i64vec2; //!< 64bit signed integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 i64vec3; //!< 64bit signed integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 i64vec4; //!< 64bit signed integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef unsigned char uint8; //!< 8bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned short uint16; //!< 16bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned int uint32; //!< 32bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned long long uint64; //!< 64bit unsigned integer. (from GLM_GTX_number_precision extension) - - typedef unsigned char u8; //!< 8bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned short u16; //!< 16bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned int u32; //!< 32bit unsigned integer. (from GLM_GTX_number_precision extension) - typedef unsigned long long u64; //!< 64bit unsigned integer. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 u8vec2; //!< 8bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 u8vec3; //!< 8bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 u8vec4; //!< 8bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 u16vec2; //!< 16bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 u16vec3; //!< 16bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 u16vec4; //!< 16bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 u32vec2; //!< 32bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 u32vec3; //!< 32bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 u32vec4; //!< 32bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 u64vec2; //!< 64bit unsigned integer vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 u64vec3; //!< 64bit unsigned integer vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 u64vec4; //!< 64bit unsigned integer vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef __halfGTX float16; //!< Half-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef float float32; //!< Single-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef double float64; //!< Double-precision floating-point number. (from GLM_GTX_number_precision extension) - - typedef __halfGTX f16; //!< Half-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef float f32; //!< Single-precision floating-point number. (from GLM_GTX_number_precision extension) - typedef double f64; //!< Double-precision floating-point number. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2<__halfGTX> f16vec2; //!< Half-precision floating-point vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3<__halfGTX> f16vec3; //!< Half-precision floating-point vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4<__halfGTX> f16vec4; //!< Half-precision floating-point vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 f32vec2; //!< Single-precision floating-point vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 f32vec3; //!< Single-precision floating-point vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 f32vec4; //!< Single-precision floating-point vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xvec2 f64vec2; //!< Double-precision floating-point vector of 2 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec3 f64vec3; //!< Double-precision floating-point vector of 3 components. (from GLM_GTX_number_precision extension) - typedef detail::_xvec4 f64vec4; //!< Double-precision floating-point vector of 4 components. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2<__halfGTX> f16mat2; //!< Half-precision floating-point 2x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3<__halfGTX> f16mat3; //!< Half-precision floating-point 3x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4<__halfGTX> f16mat4; //!< Half-precision floating-point 4x4 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2x3<__halfGTX> f16mat2x3; //!< Half-precision floating-point 2x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat2x4<__halfGTX> f16mat2x4; //!< Half-precision floating-point 2x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x2<__halfGTX> f16mat3x2; //!< Half-precision floating-point 3x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x4<__halfGTX> f16mat3x4; //!< Half-precision floating-point 3x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x2<__halfGTX> f16mat4x2; //!< Half-precision floating-point 4x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x3<__halfGTX> f16mat4x3; //!< Half-precision floating-point 4x3 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2 f32mat2; //!< Single-precision floating-point 2x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3 f32mat3; //!< Single-precision floating-point 3x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4 f32mat4; //!< Single-precision floating-point 4x4 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2x3 f32mat2x3; //!< Single-precision floating-point 2x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat2x4 f32mat2x4; //!< Single-precision floating-point 2x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x2 f32mat3x2; //!< Single-precision floating-point 3x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x4 f32mat3x4; //!< Single-precision floating-point 3x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x2 f32mat4x2; //!< Single-precision floating-point 4x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x3 f32mat4x3; //!< Single-precision floating-point 4x3 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2 f64mat2; //!< Double-precision floating-point 2x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3 f64mat3; //!< Double-precision floating-point 3x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4 f64mat4; //!< Double-precision floating-point 4x4 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xmat2x3 f64mat2x3; //!< Double-precision floating-point 2x3 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat2x4 f64mat2x4; //!< Double-precision floating-point 2x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x2 f64mat3x2; //!< Double-precision floating-point 3x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat3x4 f64mat3x4; //!< Double-precision floating-point 3x4 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x2 f64mat4x2; //!< Double-precision floating-point 4x2 matrix. (from GLM_GTX_number_precision extension) - typedef detail::_xmat4x3 f64mat4x3; //!< Double-precision floating-point 4x3 matrix. (from GLM_GTX_number_precision extension) - - typedef detail::_xquat<__halfGTX> f16quat; //!< Half-precision floating-point quaternion. (from GLM_GTX_number_precision extension) - typedef detail::_xquat f32quat; //!< Single-precision floating-point quaternion. (from GLM_GTX_number_precision extension) - typedef detail::_xquat f64quat; //!< Double-precision floating-point quaternion. (from GLM_GTX_number_precision extension) - } - } -} - -#define GLM_GTX_number_precision namespace gtx::number_precision - -#include "number_precision.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_number_precision;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_number_precision__ diff --git a/experimental/sse/glm/ext/gtx/number_precision.inl b/experimental/sse/glm/ext/gtx/number_precision.inl deleted file mode 100644 index 19e9c8da..00000000 --- a/experimental/sse/glm/ext/gtx/number_precision.inl +++ /dev/null @@ -1,13 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-05-10 -// Updated : 2007-05-10 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/number_precision.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - -} diff --git a/experimental/sse/glm/ext/gtx/optimum_pow.h b/experimental/sse/glm/ext/gtx/optimum_pow.h deleted file mode 100644 index 59b8cf48..00000000 --- a/experimental/sse/glm/ext/gtx/optimum_pow.h +++ /dev/null @@ -1,55 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/optimum_pow.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_optimum_pow__ -#define __glm_gtx_optimum_pow__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template genType pow2GTX(const genType& x); //!< \brief Returns x raised to the power of 2. (From GLM_GTX_optimum_pow extension) - template genType pow3GTX(const genType& x); //!< \brief Returns x raised to the power of 3. (From GLM_GTX_optimum_pow extension) - template genType pow4GTX(const genType& x); //!< \brief Returns x raised to the power of 4. (From GLM_GTX_optimum_pow extension) - - inline bool powOfTwoGTX(int num); //!< \brief Checks if the parameter is a power of 2 number. (From GLM_GTX_optimum_pow extension) - inline detail::_bvec2 powOfTwoGTX(const detail::_xvec2& x); //!< \brief Checks to determine if the parameter component are power of 2 numbers. (From GLM_GTX_optimum_pow extension) - inline detail::_bvec3 powOfTwoGTX(const detail::_xvec3& x); //!< \brief Checks to determine if the parameter component are power of 2 numbers. (From GLM_GTX_optimum_pow extension) - inline detail::_bvec4 powOfTwoGTX(const detail::_xvec4& x); //!< \brief Checks to determine if the parameter component are power of 2 numbers. (From GLM_GTX_optimum_pow extension) - - namespace gtx - { - //! GLM_GTX_optimum_pow extension: Integer exponenciation of power functions. - namespace optimum_pow - { - template inline genType pow2(const genType& x){return pow2GTX(x);} //!< \brief Returns x raised to the power of 2. (From GLM_GTX_optimum_pow extension) - template inline genType pow3(const genType& x){return pow3GTX(x);} //!< \brief Returns x raised to the power of 3. (From GLM_GTX_optimum_pow extension) - template inline genType pow4(const genType& x){return pow4GTX(x);} //!< \brief Returns x raised to the power of 4. (From GLM_GTX_optimum_pow extension) - - inline bool powOfTwo(int num){return powOfTwoGTX(num);} //!< \brief Checks if the parameter is a power of 2 number. (From GLM_GTX_optimum_pow extension) - inline detail::_bvec2 powOfTwo(const detail::_xvec2& x){return powOfTwoGTX(x);} //!< \brief Checks to determine if the parameter component are power of 2 numbers. (From GLM_GTX_optimum_pow extension) - inline detail::_bvec3 powOfTwo(const detail::_xvec3& x){return powOfTwoGTX(x);} //!< \brief Checks to determine if the parameter component are power of 2 numbers. (From GLM_GTX_optimum_pow extension) - inline detail::_bvec4 powOfTwo(const detail::_xvec4& x){return powOfTwoGTX(x);} //!< \brief Checks to determine if the parameter component are power of 2 numbers. (From GLM_GTX_optimum_pow extension) - } - } -} - -#define GLM_GTX_optimum_pow namespace gtx::optimum_pow - -#include "optimum_pow.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_optimum_pow;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_optimum_pow__ diff --git a/experimental/sse/glm/ext/gtx/optimum_pow.inl b/experimental/sse/glm/ext/gtx/optimum_pow.inl deleted file mode 100644 index 379f43b8..00000000 --- a/experimental/sse/glm/ext/gtx/optimum_pow.inl +++ /dev/null @@ -1,58 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-27 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/optimum_pow.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline genType pow2GTX(const genType& x) - { - return x * x; - } - - template - inline genType pow3GTX(const genType& x) - { - return x * x * x; - } - - template - inline genType pow4GTX(const genType& x) - { - return x * x * x * x; - } - - inline bool powOfTwoGTX(int x) - { - return !(x & (x - 1)); - } - - inline detail::_bvec2 powOfTwoGTX(const detail::_xvec2& x) - { - return detail::_bvec2( - powOfTwoGTX(x.x), - powOfTwoGTX(x.y)); - } - - inline detail::_bvec3 powOfTwoGTX(const detail::_xvec3& x) - { - return detail::_bvec3( - powOfTwoGTX(x.x), - powOfTwoGTX(x.y), - powOfTwoGTX(x.z)); - } - - inline detail::_bvec4 powOfTwoGTX(const detail::_xvec4& x) - { - return detail::_bvec4( - powOfTwoGTX(x.x), - powOfTwoGTX(x.y), - powOfTwoGTX(x.z), - powOfTwoGTX(x.w)); - } -} diff --git a/experimental/sse/glm/ext/gtx/orthonormalize.h b/experimental/sse/glm/ext/gtx/orthonormalize.h deleted file mode 100644 index 7238218c..00000000 --- a/experimental/sse/glm/ext/gtx/orthonormalize.h +++ /dev/null @@ -1,43 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/orthonormalize.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_orthonormalize__ -#define __glm_gtx_orthonormalize__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat3 orthonormalizeGTX(const detail::_xmat3& m); //!< \brief Returns the orthonormalized matrix of m (from GLM_GTX_orthonormalize extension) - template detail::_xvec3 orthonormalizeGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< \brief Orthonormalizes x according y (from GLM_GTX_orthonormalize extension) - - namespace gtx - { - //! GLM_GTX_orthonormalize extension: Orthonormalize matrices. - namespace orthonormalize - { - template inline detail::_xmat3 orthonormalize(const detail::_xmat3& m){return orthonormalizeGTX(m);} //!< \brief Returns the orthonormalized matrix of m (from GLM_GTX_orthonormalize extension) - template inline detail::_xvec3 orthonormalize(const detail::_xvec3& x, const detail::_xvec3& y){return orthonormalizeGTX(x, y);} //!< \brief Orthonormalizes x according y (from GLM_GTX_orthonormalize extension) - } - } -} - -#define GLM_GTX_orthonormalize namespace gtx::orthonormalize - -#include "orthonormalize.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_orthonormalize;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_orthonormalize__ diff --git a/experimental/sse/glm/ext/gtx/orthonormalize.inl b/experimental/sse/glm/ext/gtx/orthonormalize.inl deleted file mode 100644 index 6471c86e..00000000 --- a/experimental/sse/glm/ext/gtx/orthonormalize.inl +++ /dev/null @@ -1,36 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/orthonormalize.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat3 orthonormalizeGTX(const detail::_xmat3& m) - { - detail::_xmat3 r = m; - - r[0] = normalize(r[0]); - - float d0 = dot(r[0], r[1]); - r[1] -= r[0] * d0; - r[1] = normalize(r[1]); - - float d1 = dot(r[1], r[2]); - d0 = dot(r[0], r[2]); - r[2] -= r[0] * d0 + r[1] * d1; - r[2] = normalize(r[2]); - - return r; - } - - template - inline detail::_xvec3 orthonormalizeGTX(const detail::_xvec3& x, const detail::_xvec3& y) - { - return normalize(x - y * dot(y, x)); - } -} diff --git a/experimental/sse/glm/ext/gtx/outer_product.h b/experimental/sse/glm/ext/gtx/outer_product.h deleted file mode 100644 index 47b7dd32..00000000 --- a/experimental/sse/glm/ext/gtx/outer_product.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2006 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-03-30 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/outer_product.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_outer_product__ -#define __glm_gtx_outer_product__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat2 outerProductGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< Product of x extended to a matrix with the y extended to a transposed matrix. (from GLM_GTX_outer_product extension) - template detail::_xmat3 outerProductGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< Product of x extended to a matrix with the y extended to a transposed matrix. (from GLM_GTX_outer_product extension) - template detail::_xmat4 outerProductGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< Product of x extended to a matrix with the y extended to a transposed matrix. (from GLM_GTX_outer_product extension) - - namespace gtx - { - //! GLM_GTX_outer_product extension: Product of x extended to a matrix with the y extended to a transposed matrix. (Deprecated: included in GLM core) - namespace outer_product - { - template inline detail::_xmat2 outerProduct(const detail::_xvec2& x, const detail::_xvec2& y){return outerProductGTX(x, y);} //!< Product of x extended to a matrix with the y extended to a transposed matrix. (from GLM_GTX_outer_product extension) - template inline detail::_xmat3 outerProduct(const detail::_xvec3& x, const detail::_xvec3& y){return outerProductGTX(x, y);} //!< Product of x extended to a matrix with the y extended to a transposed matrix. (from GLM_GTX_outer_product extension) - template inline detail::_xmat4 outerProduct(const detail::_xvec4& x, const detail::_xvec4& y){return outerProductGTX(x, y);} //!< Product of x extended to a matrix with the y extended to a transposed matrix. (from GLM_GTX_outer_product extension) - } - } -} - -#define GLM_GTX_outer_product namespace gtx::outer_product - -#include "outer_product.inl" -/* Deprecated -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_outer_product;} -#endif//GLM_GTX_INCLUDED -*/ -#endif//__glm_gtx_outer_product__ diff --git a/experimental/sse/glm/ext/gtx/outer_product.inl b/experimental/sse/glm/ext/gtx/outer_product.inl deleted file mode 100644 index 3039c63a..00000000 --- a/experimental/sse/glm/ext/gtx/outer_product.inl +++ /dev/null @@ -1,64 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-03-30 -// Updated : 2006-03-30 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/outer_product.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat2 outerProductGTX( - const detail::_xvec2& a, - const detail::_xvec2& b) - { - detail::_xmat2 m; - m[0][0] = a.x * b.x; - m[0][1] = a.x * b.y; - m[1][0] = a.y * b.x; - m[1][1] = a.y * b.y; - return m; - } - - template - inline detail::_xmat3 outerProductGTX( - const detail::_xvec3& a, - const detail::_xvec3& b) - { - detail::_xmat3 m; - m[0][0] = a.x * b.x; - m[0][1] = a.x * b.y; - m[0][2] = a.x * b.z; - m[1][0] = a.y * b.x; - m[1][1] = a.y * b.y; - m[1][2] = a.y * b.z; - m[2][0] = a.z * b.x; - m[2][1] = a.z * b.y; - m[2][2] = a.z * b.z; - return m; - } - - template - inline detail::_xmat4 outerProductGTX( - const detail::_xvec4& a, - const detail::_xvec4& b) - { - detail::_xmat4 m; - m[0][0] = a.x * b.x; - m[0][1] = a.x * b.y; - m[0][2] = a.x * b.z; - m[0][3] = T(0); - m[1][0] = a.y * b.x; - m[1][1] = a.y * b.y; - m[1][2] = a.y * b.z; - m[1][3] = T(0); - m[2][0] = a.z * b.x; - m[2][1] = a.z * b.y; - m[2][2] = a.z * b.z; - m[2][3] = T(0); - m[3] = detail::_xvec4(T(0), T(0), T(0), T(1)); - return m; - } -} diff --git a/experimental/sse/glm/ext/gtx/perpendicular.h b/experimental/sse/glm/ext/gtx/perpendicular.h deleted file mode 100644 index 389f5615..00000000 --- a/experimental/sse/glm/ext/gtx/perpendicular.h +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/perpendicular.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_projection -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_perpendicular__ -#define __glm_gtx_perpendicular__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/projection.h" - -namespace glm -{ - template detail::_xvec2 perpGTX(const detail::_xvec2& x, const detail::_xvec2& Normal); //!< \brief Projects x a perpendicular axis of Normal (from GLM_GTX_perpendicular extension) - template detail::_xvec3 perpGTX(const detail::_xvec3& x, const detail::_xvec3& Normal); //!< \brief Projects x a perpendicular axis of Normal (from GLM_GTX_perpendicular extension) - template detail::_xvec4 perpGTX(const detail::_xvec4& x, const detail::_xvec4& Normal); //!< \brief Projects x a perpendicular axis of Normal (from GLM_GTX_perpendicular extension) - - namespace gtx - { - //! GLM_GTX_perpendicular extension: Perpendicular of a vector from other one - namespace perpendicular - { - template inline detail::_xvec2 perp(const detail::_xvec2& x, const detail::_xvec2& Normal){return perpGTX(x, Normal);} //!< \brief Projects x a perpendicular axis of Normal (from GLM_GTX_perpendicular extension) - template inline detail::_xvec3 perp(const detail::_xvec3& x, const detail::_xvec3& Normal){return perpGTX(x, Normal);} //!< \brief Projects x a perpendicular axis of Normal (from GLM_GTX_perpendicular extension) - template inline detail::_xvec4 perp(const detail::_xvec4& x, const detail::_xvec4& Normal){return perpGTX(x, Normal);} //!< \brief Projects x a perpendicular axis of Normal (from GLM_GTX_perpendicular extension) - } - } -} - -#define GLM_GTX_perpendicular namespace gtx::perpendicular - -#include "perpendicular.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_perpendicular;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_perpendicular__ diff --git a/experimental/sse/glm/ext/gtx/perpendicular.inl b/experimental/sse/glm/ext/gtx/perpendicular.inl deleted file mode 100644 index c32c7345..00000000 --- a/experimental/sse/glm/ext/gtx/perpendicular.inl +++ /dev/null @@ -1,29 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/perpendicular.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xvec2 perpGTX(const detail::_xvec2& x, const detail::_xvec2& Normal) - { - return x - projGTX(x, Normal); - } - - template - inline detail::_xvec3 perpGTX(const detail::_xvec3& x, const detail::_xvec3& Normal) - { - return x - projGTX(x, Normal); - } - - template - inline detail::_xvec4 perpGTX(const detail::_xvec4& x, const detail::_xvec4& Normal) - { - return x - projGTX(x, Normal); - } -} diff --git a/experimental/sse/glm/ext/gtx/polar_coordinates.h b/experimental/sse/glm/ext/gtx/polar_coordinates.h deleted file mode 100644 index e8d9f08d..00000000 --- a/experimental/sse/glm/ext/gtx/polar_coordinates.h +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-06 -// Updated : 2007-03-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/polar_coordinates.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_polar_coordinates__ -#define __glm_gtx_polar_coordinates__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - //! Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude (From GLM_GTX_polar_coordinates extension) - template _xvec3 polarGTX(const _xvec3& euclidean); - //! Convert Polar to Euclidean coordinates (From GLM_GTX_polar_coordinates extension) - template _xvec3 euclideanGTX(const _xvec3& polar); - - namespace gtx - { - //! GLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert. - namespace polar_coordinates - { - //! Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude (From GLM_GTX_polar_coordinates extension) - template inline _xvec3 polar(const _xvec3& euclidean){return polarGTX(euclidean);} - //! Convert Polar to Euclidean coordinates (From GLM_GTX_polar_coordinates extension) - template inline _xvec3 euclidean(const _xvec3& polar){return euclideanGTX(polar);} - } - } -} - -#define GLM_GTX_polar_coordinates namespace gtx::polar_coordinates - -#include "polar_coordinates.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_polar_coordinates;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_polar_coordinates__ diff --git a/experimental/sse/glm/ext/gtx/polar_coordinates.inl b/experimental/sse/glm/ext/gtx/polar_coordinates.inl deleted file mode 100644 index 79e24e81..00000000 --- a/experimental/sse/glm/ext/gtx/polar_coordinates.inl +++ /dev/null @@ -1,35 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-06 -// Updated : 2007-03-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/polar_coordinates.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline _xvec3 polarGTX(const _xvec3& euclidean) - { - T length = length(euclidean); - _xvec3 tmp = euclidean / length; - T xz_dist = sqrt(tmp.x * tmp.x + tmp.z * tmp.z); - - return _xvec3( - degrees(atan(xz_dist, tmp.y)), // latitude - degrees(atan(tmp.x, tmp.z)), // longitude - xz_dist); // xz distance - } - - template - inline _xvec3 euclideanGTX(const _xvec3& polar) - { - T latitude = radians(polar.x); - T longitude = radians(polar.y); - return _xvec3( - cos(latitude) * sin(longitude), - sin(latitude), - cos(latitude) * cos(longitude)); - } -} diff --git a/experimental/sse/glm/ext/gtx/projection.h b/experimental/sse/glm/ext/gtx/projection.h deleted file mode 100644 index 7b8f6653..00000000 --- a/experimental/sse/glm/ext/gtx/projection.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/projection.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_projection__ -#define __glm_gtx_projection__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xvec2 projGTX(const detail::_xvec2& x, const detail::_xvec2& Normal); //!< \brief Projects x on Normal (from GLM_GTX_projection extension) - template detail::_xvec3 projGTX(const detail::_xvec3& x, const detail::_xvec3& Normal); //!< \brief Projects x on Normal (from GLM_GTX_projection extension) - template detail::_xvec4 projGTX(const detail::_xvec4& x, const detail::_xvec4& Normal); //!< \brief Projects x on Normal (from GLM_GTX_projection extension) - - namespace gtx - { - //! GLM_GTX_projection extension: Projection of a vector to other one - namespace projection - { - template inline detail::_xvec2 proj(const detail::_xvec2& x, const detail::_xvec2& Normal){return projGTX(x, Normal);} //!< \brief Projects x on Normal (from GLM_GTX_projection extension) - template inline detail::_xvec3 proj(const detail::_xvec3& x, const detail::_xvec3& Normal){return projGTX(x, Normal);} //!< \brief Projects x on Normal (from GLM_GTX_projection extension) - template inline detail::_xvec4 proj(const detail::_xvec4& x, const detail::_xvec4& Normal){return projGTX(x, Normal);} //!< \brief Projects x on Normal (from GLM_GTX_projection extension) - } - } -} - -#define GLM_GTX_projection namespace gtx::projection - -#include "projection.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_projection;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_projection__ diff --git a/experimental/sse/glm/ext/gtx/projection.inl b/experimental/sse/glm/ext/gtx/projection.inl deleted file mode 100644 index c44ae383..00000000 --- a/experimental/sse/glm/ext/gtx/projection.inl +++ /dev/null @@ -1,29 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/projection.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xvec2 projGTX(const detail::_xvec2& x, const detail::_xvec2& Normal) - { - return dot(x, Normal) / dot(Normal, Normal) * Normal; - } - - template - inline detail::_xvec3 projGTX(const detail::_xvec3& x, const detail::_xvec3& Normal) - { - return dot(x, Normal) / dot(Normal, Normal) * Normal; - } - - template - inline detail::_xvec4 projGTX(const detail::_xvec4& x, const detail::_xvec4& Normal) - { - return dot(x, Normal) / dot(Normal, Normal) * Normal; - } -} diff --git a/experimental/sse/glm/ext/gtx/quaternion.h b/experimental/sse/glm/ext/gtx/quaternion.h deleted file mode 100644 index fe491323..00000000 --- a/experimental/sse/glm/ext/gtx/quaternion.h +++ /dev/null @@ -1,175 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/quaternion.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// -// ToDo: -// - Study constructors with angles and axis -// - Study constructors with vec3 that are the imaginary component of quaternion -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_quaternion__ -#define __glm_gtx_quaternion__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - namespace detail - { - //! \brief Template for quaternion. (From GLM_GTX_quaternion extension) - template class _xquat - { - public: - T x, y, z, w; - - // Constructors - _xquat(); - explicit _xquat(const T s, const _xvec3& v); - explicit _xquat(const T w, const T x, const T y, const T z); - - // Convertions - explicit _xquat(const T pitch, const T yaw, const T roll); - explicit _xquat(const _xvec3& eulerAngles); - //explicit _xquat(const _xvec4& x); - explicit _xquat(const _xmat3& m); - explicit _xquat(const _xmat4& m); - //explicit _xquat(float angle, float x, float y, float z); - //explicit _xquat(float angle, const _xvec3& v); - - // Accesses - T& operator[](int i); - T operator[](int i) const; - operator T*(); - operator const T*() const; - - // Operators - _xquat operator+ (const _xquat& q) const; - _xquat& operator+=(const _xquat& q); - _xquat operator- (const _xquat& q) const; - _xquat& operator-=(const _xquat& q); - _xquat operator* (T s) const; - _xquat& operator*=(T s); - _xquat operator* (const _xquat& q) const; - _xquat& operator*=(const _xquat& q); - _xquat operator/ (T s) const; - _xquat& operator/=(T s); - _xquat operator/ (const _xquat& q) const; - _xquat& operator/=(const _xquat& q); - _xquat operator- () const; - - // Transformations - _xvec3 operator* (const _xvec3& v) const; - _xvec4 operator* (const _xvec4& v) const; - }; - - template _xquat operator* (const T s, const _xquat & q) - { - return q * s; - } - } //namespace detail - - template T lengthGTX(const detail::_xquat& q); //!< \brief Returns the length of the quaternion x. (from GLM_GTX_quaternion extension) - template detail::_xquat normalizeGTX(const detail::_xquat& q); //!< \brief Returns the normalized quaternion of from x. (from GLM_GTX_quaternion extension) - template T dotGTX(const detail::_xquat& q1, const detail::_xquat& q2); //!< \brief Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... (from GLM_GTX_quaternion extension) - template detail::_xquat crossGTX(const detail::_xquat& q1, const detail::_xquat& q2); //!< \brief Returns the cross product of q1 and q2. (from GLM_GTX_quaternion extension) - template detail::_xquat mixGTX(const detail::_xquat& x, const detail::_xquat& y, T a); //!< \brief Returns a LERP interpolated quaternion of x and y according a. (from GLM_GTX_quaternion extension) - template detail::_xquat squadGTX(const detail::_xquat& q1, const detail::_xquat& q2, const detail::_xquat& s1, const detail::_xquat& s2, const T h); //!< \brief Compute a point on a path according squad equation. q1 and q2 are control points; s1 and s2 are intermediate control points (from GLM_GTX_transform extension) - template detail::_xquat intermediateGTX(const detail::_xquat& prev, const detail::_xquat& curr, const detail::_xquat& next); //!< \brief Returns an intermediate control point for squad interpolation (from GLM_GTX_quaternion extension) - template detail::_xquat expGTX(const detail::_xquat& q, const T exponent); //!< \brief Returns a exp of a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat logGTX(const detail::_xquat& q); //!< \brief Returns a log of a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat powGTX(const detail::_xquat& x, T y); //!< \brief Returns x raised to the y power. (from GLM_GTX_quaternion extension) - template detail::_xquat sqrtGTX(const detail::_xquat& q); - template detail::_xquat conjugateGTX(const detail::_xquat& q); //!< \brief Returns the q conjugate. (from GLM_GTX_quaternion extension) - template detail::_xquat inverseGTX(const detail::_xquat& q); //!< \brief Returns the q inverse. (from GLM_GTX_quaternion extension) - template detail::_xquat rotateGTX(const detail::_xquat& q, T angle, T x, T y, T z); //!< \brief Rotates a quaternion from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xquat rotateGTX(const detail::_xquat& q, T angle, const detail::_xvec3& v); //!< \brief Rotates a quaternion from an vector of 3 components axis and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xvec3 rotateGTX(const detail::_xquat& q, const detail::_xvec3& v); //!< \brief Rotates a 3 components vector by a quaternion. (from GLM_GTX_transform extension) - template detail::_xvec4 rotateGTX(const detail::_xquat& q, const detail::_xvec4& v); //!< \brief Rotates a 4 components vector by a quaternion. (from GLM_GTX_transform extension) - template T angleGTX(const detail::_xquat& x); //!< \brief Returns the q rotation angle. (from GLM_GTX_quaternion extension) - template detail::_xvec3 axisGTX(const detail::_xquat& x); //!< \brief Returns the q rotation axis. (from GLM_GTX_quaternion extension) - //template detail::_xmat3 mat3GTX(const detail::_xquat& x); //!< \brief Converts a quaternion to a 3 * 3 matrix. (from GLM_GTX_quaternion extension) - //template detail::_xmat4 mat4GTX(const detail::_xquat& x); //!< \brief Converts a quaternion to a 4 * 4 matrix. (from GLM_GTX_quaternion extension) - //template detail::_xquat quatGTX(const detail::_xmat3& x); //!< \brief Converts a 3 * 3 matrix to a quaternion. (from GLM_GTX_quaternion extension) - //template detail::_xquat quatGTX(const detail::_xmat4& x); //!< \brief Converts a 4 * 4 matrix to a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat angleAxisGTX(T angle, T x, T y, T z); //!< \brief Build a quaternion from an angle and an axis. (from GLM_GTX_quaternion extension) - template detail::_xquat angleAxisGTX(T angle, const detail::_xvec3& v); //!< \brief Build a quaternion from an angle and an axis. (from GLM_GTX_quaternion extension) - template T extractRealComponentGTX(const detail::_xquat& q); //!< \brief Extract the real component of a quaternion. (from GLM_GTX_quaternion extension) - template T rollGTX(const detail::_xquat& x); //!< \brief Returns roll value of euler angles. (from GLM_GTX_quaternion extension) - template T pitchGTX(const detail::_xquat& x); //!< \brief Returns pitch value of euler angles. (from GLM_GTX_quaternion extension) - template T yawGTX(const detail::_xquat& x); //!< \brief Returns yaw value of euler angles. (from GLM_GTX_quaternion extension) - template detail::_xvec3 eularAnglesGTX(const detail::_xquat& x); //!< \brief Returns euler angles, yitch as x, yaw as y, roll as z. (from GLM_GTX_quaternion extension) - template detail::_xvec3 crossGTX(const detail::_xquat& q, const detail::_xvec3& v){return rotateGTX(q, v);} //!< \brief Compute a cross product between a quaternion and a vector. (from GLM_GTX_quaternion extension) - template detail::_xvec3 crossGTX(const detail::_xvec3& v, const detail::_xquat& q){return rotateGTX(inverseGTX(q), v);} //!< \brief Compute a cross product between a vector and a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xmat3 toMat3GTX(const detail::_xquat& x); //!< \brief Converts a quaternion to a 3 * 3 matrix. (from GLM_GTX_quaternion extension) - template detail::_xmat4 toMat4GTX(const detail::_xquat& x); //!< \brief Converts a quaternion to a 4 * 4 matrix. (from GLM_GTX_quaternion extension) - template detail::_xquat toQuatGTX(const detail::_xmat3& x); //!< \brief Converts a 3 * 3 matrix to a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat toQuatGTX(const detail::_xmat4& x); //!< \brief Converts a 4 * 4 matrix to a quaternion. (from GLM_GTX_quaternion extension) - - typedef detail::_xquat __quatGTX; //!< \brief Quaternion of floating-point numbers. (from GLM_GTX_quaternion extension) - - namespace gtx - { - //! GLM_GTX_quaternion extension: Quaternion types and functions - namespace quaternion - { - template T length(const detail::_xquat& q){return lengthGTX(q);} //!< \brief Returns the length of the quaternion x. (from GLM_GTX_quaternion extension) - template detail::_xquat normalize(const detail::_xquat& q){return normalizeGTX(q);} //!< \brief Returns the normalized quaternion of from x. (from GLM_GTX_quaternion extension) - template T dot(const detail::_xquat& q1, const detail::_xquat& q2){return dotGTX(q1, q2);} //!< \brief Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... (from GLM_GTX_quaternion extension) - template detail::_xquat cross(const detail::_xquat& q1, const detail::_xquat& q2){return crossGTX(q1, q2);} //!< \brief Returns the cross product of q1 and q2. (from GLM_GTX_quaternion extension) - template detail::_xquat mix(const detail::_xquat& x, const detail::_xquat& y, T a){return mixGTX(x, y, a);} //!< \brief Returns a LERP interpolated quaternion of x and y according a. (from GLM_GTX_quaternion extension) - template detail::_xquat squad(const detail::_xquat& q1, const detail::_xquat& q2, const detail::_xquat& s1, const detail::_xquat& s2, const T h) - {return squadGTX(q1, q2, s1, s2, h);} //!< \brief Compute a point on a path according squad equation. q1 and q2 are control points; s1 and s2 are intermediate control points (from GLM_GTX_transform extension) - template detail::_xquat intermediate(const detail::_xquat& prev, const detail::_xquat& curr, const detail::_xquat& next) - {return intermediateGTX(prev, curr, next);} //!< \brief Returns an intermediate control point for squad interpolation (from GLM_GTX_quaternion extension) - template detail::_xquat exp(const detail::_xquat& q, const T exponent){return expGTX(q, exponent);} //!< \brief Returns a exp of a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat log(const detail::_xquat& q){return logGTX(q);} //!< \brief Returns a log of a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat pow(const detail::_xquat& x, T y){return powGTX(x, y);} //!< \brief Returns x raised to the y power. (from GLM_GTX_quaternion extension) - template detail::_xquat sqrt(const detail::_xquat& q){return sqrtGTX(q);} //!< \brief Returns quarternion square root (from GLM_GTX_quaternion extension) - template detail::_xquat conjugate(const detail::_xquat& q){return conjugateGTX(q);} //!< \brief Returns the q conjugate. (from GLM_GTX_quaternion extension) - template detail::_xquat inverse(const detail::_xquat& q){return inverseGTX(q);} //!< \brief Returns the q inverse. (from GLM_GTX_quaternion extension) - template detail::_xquat rotate(const detail::_xquat& q, T angle, T x, T y, T z){return rotateGTX(q, angle, x, y ,z);} //!< \brief Rotates a quaternion from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xquat rotate(const detail::_xquat& q, T angle, const detail::_xvec3& v){return rotateGTX(q, angle, v);} //!< \brief Rotates a quaternion from an vector of 3 components axis and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xvec3 rotate(const detail::_xquat& q, const detail::_xvec3& v){return rotateGTX(q, v);} //!< \brief Rotates a 3 components vector by a quaternion. (from GLM_GTX_transform extension) - template detail::_xvec4 rotate(const detail::_xquat& q, const detail::_xvec4& v){return rotateGTX(q, v);} //!< \brief Rotates a 4 components vector by a quaternion. (from GLM_GTX_transform extension) - template T angle(const detail::_xquat& x){return angleGTX(x);} //!< \brief Returns the q rotation angle. (from GLM_GTX_quaternion extension) - template detail::_xvec3 axis(const detail::_xquat& x){return axisGTX(x);} //!< \brief Returns the q rotation axis. (from GLM_GTX_quaternion extension) - //template detail::_xmat3 mat3(const detail::_xquat& x); //!< \brief Converts a quaternion to a 3 * 3 matrix. (from GLM_GTX_quaternion extension) - //template detail::_xmat4 mat4(const detail::_xquat& x); //!< \brief Converts a quaternion to a 4 * 4 matrix. (from GLM_GTX_quaternion extension) - //template detail::_xquat quat(const detail::_xmat3& x); //!< \brief Converts a 3 * 3 matrix to a quaternion. (from GLM_GTX_quaternion extension) - //template detail::_xquat quat(const detail::_xmat4& x); //!< \brief Converts a 4 * 4 matrix to a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat angleAxis(T angle, T x, T y, T z){return angleAxisGTX(angle, x, y, z);} //!< \brief Build a quaternion from an angle and an axis. (from GLM_GTX_quaternion extension) - template detail::_xquat angleAxis(T angle, const detail::_xvec3& v){return angleAxisGTX(angle, v);} //!< \brief Build a quaternion from an angle and an axis. (from GLM_GTX_quaternion extension) - template T extractRealComponent(const detail::_xquat& q){return extractRealComponentGTX(q);} //!< \brief Extract the real component of a quaternion. (from GLM_GTX_quaternion extension) - template T roll(const detail::_xquat& x){return rollGTX(x);} //!< \brief Returns roll value of euler angles. (from GLM_GTX_quaternion extension) - template T pitch(const detail::_xquat& x){return pitchGTX(x);} //!< \brief Returns pitch value of euler angles. (from GLM_GTX_quaternion extension) - template T yaw(const detail::_xquat& x){return yawGTX(x);} //!< \brief Returns yaw value of euler angles. (from GLM_GTX_quaternion extension) - template detail::_xvec3 eularAngles(const detail::_xquat& x){return eularAnglesGTX(x);} //!< \brief Returns euler angles, yitch as x, yaw as y, roll as z. (from GLM_GTX_quaternion extension) - template detail::_xvec3 cross(const detail::_xquat& q, const detail::_xvec3& v){return rotateGTX(q, v);} //!< \brief Compute a cross product between a quaternion and a vector. (from GLM_GTX_quaternion extension) - template detail::_xvec3 cross(const detail::_xvec3& v, const detail::_xquat& q){return rotateGTX(inverseGTX(q), v);} //!< \brief Compute a cross product between a vector and a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xmat3 toMat3(const detail::_xquat& x){return toMat3GTX(x);} //!< \brief Converts a quaternion to a 3 * 3 matrix. (from GLM_GTX_quaternion extension) - template detail::_xmat4 toMat4(const detail::_xquat& x){return toMat4GTX(x);} //!< \brief Converts a quaternion to a 4 * 4 matrix. (from GLM_GTX_quaternion extension) - template detail::_xquat toQuat(const detail::_xmat3& x){return toQuatGTX(x);} //!< \brief Converts a 3 * 3 matrix to a quaternion. (from GLM_GTX_quaternion extension) - template detail::_xquat toQuat(const detail::_xmat4& x){return toQuatGTX(x);} //!< \brief Converts a 4 * 4 matrix to a quaternion. (from GLM_GTX_quaternion extension) - - typedef detail::_xquat quat; //!< \brief Quaternion of floating-point numbers. (from GLM_GTX_quaternion extension) - } - } -} //namespace glm - -#define GLM_GTX_quaternion namespace gtx::quaternion - -#include "quaternion.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_quaternion;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_quaternion__ diff --git a/experimental/sse/glm/ext/gtx/quaternion.inl b/experimental/sse/glm/ext/gtx/quaternion.inl deleted file mode 100644 index 0fd08cc5..00000000 --- a/experimental/sse/glm/ext/gtx/quaternion.inl +++ /dev/null @@ -1,847 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// -// Created : 2005-12-21 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/quaternion.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm{ -namespace detail{ - - template - inline _xquat::_xquat() : - x(0), - y(0), - z(0), - w(1) - {} - - template - inline _xquat::_xquat(const T s, const _xvec3& v) : - x(v.x), - y(v.y), - z(v.z), - w(s) - {} - - template - inline _xquat::_xquat(const T w, const T x, const T y, const T z) : - x(x), - y(y), - z(z), - w(w) - {} - - ////////////////////////////////////////////////////////////// - // _xquat conversions - - template - inline _xquat::_xquat(const T pitch, const T yaw, const T roll) - { - _xvec3 eulerAngle(pitch * T(0.5), yaw * T(0.5), roll * T(0.5)); - _xvec3 c = cos(eulerAngle * T(0.5)); - _xvec3 s = sin(eulerAngle * T(0.5)); - - this->w = c.x * c.y * c.z + s.x * s.y * s.z; - this->x = s.x * c.y * c.z - c.x * s.y * s.z; - this->y = c.x * s.y * c.z + s.x * c.y * s.z; - this->z = c.x * c.y * s.z - s.x * s.y * c.z; - } - - template - inline _xquat::_xquat(const _xvec3& eulerAngle) - { - _xvec3 c = cos(eulerAngle * T(0.5)); - _xvec3 s = sin(eulerAngle * T(0.5)); - - this->w = c.x * c.y * c.z + s.x * s.y * s.z; - this->x = s.x * c.y * c.z - c.x * s.y * s.z; - this->y = c.x * s.y * c.z + s.x * c.y * s.z; - this->z = c.x * c.y * s.z - s.x * s.y * c.z; - } - - /* - template - inline _xquat::_xquat(const _xvec4& x) : - w(x.w), - x(x.x), - y(x.y), - z(x.z) - {} - */ - - template - inline _xquat::_xquat(const _xmat3& m) - { - T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; - T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; - T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; - T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; - - int biggestIndex = 0; - T fourBiggestSquaredMinus1 = fourWSquaredMinus1; - if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourXSquaredMinus1; - biggestIndex = 1; - } - if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourYSquaredMinus1; - biggestIndex = 2; - } - if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourZSquaredMinus1; - biggestIndex = 3; - } - - T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5); - T mult = T(0.25) / biggestVal; - - switch(biggestIndex) - { - case 0: - this->x = (m[1][2] - m[2][1]) * mult; - this->y = (m[2][0] - m[0][2]) * mult; - this->z = (m[0][1] - m[1][0]) * mult; - this->w = biggestVal; - break; - case 1: - this->x = biggestVal; - this->y = (m[0][1] + m[1][0]) * mult; - this->z = (m[2][1] + m[1][2]) * mult; - this->w = (m[1][2] - m[2][1]) * mult; - break; - case 2: - this->x = (m[0][1] + m[1][0]) * mult; - this->y = biggestVal; - this->z = (m[1][2] + m[2][1]) * mult; - this->w = (m[2][0] - m[0][2]) * mult; - break; - case 3: - this->x = (m[2][0] + m[0][2]) * mult; - this->y = (m[1][2] + m[2][1]) * mult; - this->z = biggestVal; - this->w = (m[0][1] - m[1][0]) * mult; - break; - } - } - - template - inline _xquat::_xquat(const _xmat4& m) - { - T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; - T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; - T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; - T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; - - int biggestIndex = 0; - T fourBiggestSquaredMinus1 = fourWSquaredMinus1; - if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourXSquaredMinus1; - biggestIndex = 1; - } - if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourYSquaredMinus1; - biggestIndex = 2; - } - if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourZSquaredMinus1; - biggestIndex = 3; - } - - T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0); - T mult = T(0.25) / biggestVal; - - switch(biggestIndex) - { - case 0: - this->x = (m[1][2] - m[2][1]) * mult; - this->y = (m[2][0] - m[0][2]) * mult; - this->z = (m[0][1] - m[1][0]) * mult; - this->w = biggestVal; - break; - case 1: - this->x = biggestVal; - this->y = (m[0][1] + m[1][0]) * mult; - this->z = (m[2][1] + m[1][2]) * mult; - this->w = (m[1][2] - m[2][1]) * mult; - break; - case 2: - this->x = (m[0][1] + m[1][0]) * mult; - this->y = biggestVal; - this->z = (m[1][2] + m[2][1]) * mult; - this->w = (m[2][0] - m[0][2]) * mult; - break; - case 3: - this->x = (m[2][0] + m[0][2]) * mult; - this->y = (m[1][2] + m[2][1]) * mult; - this->z = biggestVal; - this->w = (m[0][1] - m[1][0]) * mult; - break; - } - } - /* - template - inline _xquat::_xquat(float angle, float x, float y, float z) - { - // Axis of rotation must be normalised - float len = length(_xvec3(x, y, z)); - if(abs(len - 1.0f) > 0.001f) - { - float oneOverLen = 1 / len; - x *= oneOverLen; - y *= oneOverLen; - z *= oneOverLen; - } - - angle = radians(angle); - float fSin = sin(angle * 0.5f); - - this->x = x * fSin; - this->y = y * fSin; - this->z = z * fSin; - this->w = cos(angle * 0.5f)); - } - - template - inline _xquat::_xquat(float angle, const _xvec3& v) - { - _xvec3 v_normalized = normalize(v); - - angle = radians(angle); - float fSin = sin(angle * 0.5f); - - this->x = v.x * fSin; - this->y = v.y * fSin; - this->z = v.z * fSin; - this->w = cos(angle * 0.5f)); - } - */ - ////////////////////////////////////////////////////////////// - // __quatGT accesses - - template - inline T& _xquat::operator [] (int i) - { - return (&x)[i]; - } - - template - inline T _xquat::operator [] (int i) const - { - return (&x)[i]; - } - - template - inline _xquat::operator T* () - { - return &x; - } - - template - inline _xquat::operator const T* () const - { - return &x; - } - - ////////////////////////////////////////////////////////////// - // __quatGT Operators - - template - inline _xquat _xquat::operator +(const _xquat& q) const - { - return _xquat( - this->w + q.w, - this->x + q.x, - this->y + q.y, - this->z + q.z); - } - - template - inline _xquat& _xquat::operator +=(const _xquat& q) - { - return *this = *this + q; - } - - template - inline _xquat _xquat::operator -(const _xquat& q) const - { - return _xquat( - this->w - q.w, - this->x - q.x, - this->y - q.y, - this->z - q.z); - } - - template - inline _xquat& _xquat::operator -=(const _xquat& q) - { - return *this = *this - q; - } - - template - inline _xquat _xquat::operator *(T s) const - { - return _xquat( - this->w * s, - this->x * s, - this->y * s, - this->z * s); - } - - template - inline _xquat& _xquat::operator *=(T s) - { - this->w *= s; - this->x *= s; - this->y *= s; - this->z *= s; - return *this; - } - - template - inline _xquat _xquat::operator* (const _xquat& q) const - { - return _xquat(this->w * q.w, this->x * q.x, this->y * q.y, this->z * q.z); - } - - template - inline _xquat& _xquat::operator *=(const _xquat& q) - { - return *this = *this * q; - } - - template - inline _xquat _xquat::operator /(T s) const - { - return _xquat( - this->w / s, - this->x / s, - this->y / s, - this->z / s); - } - - template - inline _xquat& _xquat::operator /=(T s) - { - this->w /= s; - this->x /= s; - this->y /= s; - this->z /= s; - return *this; - } - - template - inline _xquat _xquat::operator /(const _xquat& q) const - { - return *this * inverseGTX(q); - } - - template - inline _xquat& _xquat::operator /=(const _xquat& q) - { - return *this = *this * inverseGTX(q); - } - - template - inline _xquat _xquat::operator- () const - { - return _xquat(-this->w, -this->x, -this->y, -this->z); - } - - // Transformation - template - inline _xvec3 _xquat::operator* (const _xvec3& v) const - { - _xvec3 uv, uuv; - _xvec3 QuatVector(x, y, z); - uv = cross(QuatVector, v); - uuv = cross(QuatVector, uv); - uv *= (T(2) * w); - uuv *= T(2); - - return v + uv + uuv; - } - - template - inline _xvec4 _xquat::operator* (const _xvec4& v) const - { - return _xvec4(*this * _xvec3(v), v.w); - } -}//namespace detail - - //////////////////////////////////////////////////////// - template - inline T lengthGTX(const detail::_xquat & q) - { - return static_cast(sqrt( - q.x * q.x + - q.y * q.y + - q.z * q.z + - q.w * q.w)); - } - - template - inline detail::_xquat normalizeGTX(const detail::_xquat& q) - { - T len = static_cast(length(q)); - if(len <= 0) // Problem - return detail::_xquat(1, 0, 0, 0); - T oneOverLen = 1 / len; - return detail::_xquat(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); - } - - template - inline T dotGTX(const detail::_xquat& q1, const detail::_xquat& q2) - { - return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w; - } - - template - inline detail::_xquat crossGTX(const detail::_xquat& q1, const detail::_xquat& q2) - { - return detail::_xquat( - q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, - q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, - q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, - q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); - } - /* - template - inline detail::_xquat crossGTX(const detail::_xquat & q, const detail::_xvec3 & v) - { - return detail::_xquat( - (q.w * v.x) + (q.y * v.z) - (q.z * v.y), - (q.w * v.y) + (q.z * v.x) - (q.x * v.z), - (q.w * v.z) + (q.x * v.y) - (q.y * v.x), - -(q.x * v.x) - (q.y * v.y) - (q.z * v.z)); - } - */ - /* - template - inline detail::_xquat crossGTX(const detail::_xvec3 & v, const detail::_xquat & q) - { - - } - */ - template - inline detail::_xquat mixGTX(const detail::_xquat& x, const detail::_xquat& y, T a) - { - if(a <= T(0)) return x; - if(a >= T(1)) return y; - - float fCos = dot(x, y); - detail::_xquat y2(y); //BUG!!! _xquat y2; - if(fCos < T(0)) - { - y2 = -y; - fCos = -fCos; - } - - //if(fCos > 1.0f) // problem - float k0, k1; - if(fCos > T(0.9999)) - { - k0 = T(1) - a; - k1 = T(0) + a; //BUG!!! 1.0f + a; - } - else - { - T fSin = sqrt(T(1) - fCos * fCos); - T fAngle = atan(fSin, fCos); - T fOneOverSin = T(1) / fSin; - k0 = sin((T(1) - a) * fAngle) * fOneOverSin; - k1 = sin((T(0) + a) * fAngle) * fOneOverSin; - } - - return detail::_xquat( - k0 * x.w + k1 * y2.w, - k0 * x.x + k1 * y2.x, - k0 * x.y + k1 * y2.y, - k0 * x.z + k1 * y2.z); - } - - template - inline detail::_xquat squadGTX(const detail::_xquat& q1, const detail::_xquat& q2, const detail::_xquat& s1, const detail::_xquat& s2, const T h) - { - return mix(mix(q1, q2, h), mix(s1, s2, h), T(2) * h (T(1) - h)); - } - - template - inline detail::_xquat intermediateGTX(const detail::_xquat& prev, const detail::_xquat& curr, const detail::_xquat& next) - { - detail::_xquat invQuat = inverseGTX(curr); - return extGTX((logGTX(next + invQuat) + logGTX(prev + invQuat)) / T(-4)) * curr; - } - - template - inline detail::_xquat expGTX(const detail::_xquat& q, const T exponent) - { - detail::_xvec3 u(q.x, q.y, q.z); - float a = length(u); - detail::_xvec3 v(u / a); - return detail::_xquat(cos(a), sin(a) * v); - } - - template - inline detail::_xquat logGTX(const detail::_xquat& q) - { - if((q.x == T(0)) && (q.y == T(0)) && (q.z == T(0))) - { - if(q.w > T(0)) - return detail::_xquat(log(q.w), T(0), T(0), T(0)); - else if(q.w < T(0)) - return detail::_xquat(log(-q.w), T(3.1415926535897932384626433832795), T(0),T(0)); - else - return detail::_xquat(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); - } - else - { - T Vec3Len = sqrt(q.x * q.x + q.y * q.y + q.z * q.z); - T QuatLen = sqrt(Vec3Len * Vec3Len + q.w * q.w); - T t = atan(Vec3Len, T(q.w)) / Vec3Len; - return detail::_xquat(t * q.x, t * q.y, t * q.z, log(QuatLen)); - } - } -/* - template - inline detail::_xquat powGTX(const _xquat& q, const T exponent) - { - detail::_xquat Result; - - T alpha = acos(w); - T expAlpha = alpha * exponent; - - Result.w = cos(expAlpha); - - T mult = sin(expAlpha) / sin(alpha); - Result.x = q.x * mult; - Result.y = q.y * mult; - Result.z = q.z * mult; - - return Result; - } -*/ - template - inline detail::_xquat powGTX(const detail::_xquat& x, const T y) - { - if(abs(x.w) > T(0.9999)) - return x; - float Angle = acos(y); - float NewAngle = Angle * y; - float Div = sin(NewAngle) / sin(Angle); - return detail::_xquat( - cos(NewAngle), - x.x * Div, - x.y * Div, - x.z * Div); - } - - template - inline detail::_xquat sqrtGTX(const detail::_xquat& q) - { - T q0 = T(1) - dotGTX(q, q); - return T(2) * (T(1) + q0) * q; - } - - template - inline detail::_xquat conjugateGTX(const detail::_xquat& q) - { - return detail::_xquat(q.w, -q.x, -q.y, -q.z); - } - - template - inline detail::_xquat inverseGTX(const detail::_xquat& q) - { - return conjugateGTX(q) / lengthGTX(q); - } - - template - inline detail::_xquat rotateGTX(const detail::_xquat& q, T angle, T x, T y, T z) - { - // Axis of rotation must be normalised - T len = length(detail::_xvec3(x, y, z)); - if(abs(len - T(1)) > T(0.001)) - { - T oneOverLen = T(1) / len; - x *= oneOverLen; - y *= oneOverLen; - z *= oneOverLen; - } - - angle = radians(angle); - T fSin = sin(angle * T(0.5)); - - return detail::_xquat(cos(angle * T(0.5)), x * fSin, y * fSin, z * fSin); - } - - template - inline detail::_xvec3 rotateGTX(const detail::_xquat& q, const detail::_xvec3& v) - { - detail::_xquat Result = q * v * inverseGTX(q); - return detail::_xvec3(Result.x, Result.y, Result.z); - } - - template - inline detail::_xvec4 rotateGTX(const detail::_xquat& q, const detail::_xvec4& v) - { - detail::_xquat Result = q * v * inverseGTX(q); - return detail::_xvec4(v.w, Result.x, Result.y, Result.z); - } - - template - inline T angleGTX(const detail::_xquat& x) - { - return cos(x.w) * T(2); - } - - template - inline detail::_xvec3 axisGTX(const detail::_xquat& x) - { - T tmp1 = T(1) - x.w * x.w; - if(tmp1 <= T(0)) - return detail::_xvec3(0, 0, 1); - T tmp2 = T(1) / sqrt(tmp1); - return detail::_xvec3(x.x * tmp2, x.y * tmp2, x.z * tmp2); - } - - template - inline detail::_xmat3 toMat3GTX(const detail::_xquat& q) - { - detail::_xmat3 Result(1); - Result[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; - Result[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; - Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; - - Result[1][0] = 2 * q.x * q.y - 2 * q.w * q.z; - Result[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z; - Result[1][2] = 2 * q.y * q.z + 2 * q.w * q.x; - - Result[2][0] = 2 * q.x * q.z + 2 * q.w * q.y; - Result[2][1] = 2 * q.y * q.z - 2 * q.w * q.x; - Result[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y; - return Result; - } - - template - inline detail::_xmat4 toMat4GTX(const detail::_xquat& q) - { - detail::_xmat4 Result = detail::_xmat4(1); - Result[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z; - Result[0][1] = 2 * q.x * q.y + 2 * q.w * q.z; - Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y; - - Result[1][0] = 2 * q.x * q.y - 2 * q.w * q.z; - Result[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z; - Result[1][2] = 2 * q.y * q.z + 2 * q.w * q.x; - - Result[2][0] = 2 * q.x * q.z + 2 * q.w * q.y; - Result[2][1] = 2 * q.y * q.z - 2 * q.w * q.x; - Result[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y; - return Result; - } - - template - inline detail::_xquat toQuatGTX(const detail::_xmat3& m) - { - T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; - T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; - T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; - T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; - - int biggestIndex = 0; - T fourBiggestSquaredMinus1 = fourWSquaredMinus1; - if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourXSquaredMinus1; - biggestIndex = 1; - } - if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourYSquaredMinus1; - biggestIndex = 2; - } - if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourZSquaredMinus1; - biggestIndex = 3; - } - - T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5); - T mult = T(0.25) / biggestVal; - - detail::_xquat Result; - switch(biggestIndex) - { - case 0: - Result.w = biggestVal; - Result.x = (m[1][2] - m[2][1]) * mult; - Result.y = (m[2][0] - m[0][2]) * mult; - Result.z = (m[0][1] - m[1][0]) * mult; - break; - case 1: - Result.w = (m[1][2] - m[2][1]) * mult; - Result.x = biggestVal; - Result.y = (m[0][1] + m[1][0]) * mult; - Result.z = (m[2][1] + m[1][2]) * mult; - break; - case 2: - Result.w = (m[2][0] - m[0][2]) * mult; - Result.x = (m[0][1] + m[1][0]) * mult; - Result.y = biggestVal; - Result.z = (m[1][2] + m[2][1]) * mult; - break; - case 3: - Result.w = (m[0][1] - m[1][0]) * mult; - Result.x = (m[2][0] + m[0][2]) * mult; - Result.y = (m[1][2] + m[2][1]) * mult; - Result.z = biggestVal; - break; - } - return Result; - } - - template - inline detail::_xquat toQuatGTX(const detail::_xmat4& m) - { - T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; - T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; - T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; - T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; - - int biggestIndex = 0; - T fourBiggestSquaredMinus1 = fourWSquaredMinus1; - if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourXSquaredMinus1; - biggestIndex = 1; - } - if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourYSquaredMinus1; - biggestIndex = 2; - } - if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourZSquaredMinus1; - biggestIndex = 3; - } - - T biggestVal = sqrt(fourBiggestSquaredMinus1 + 1) * T(0.5); - T mult = T(0.25) / biggestVal; - - detail::_xquat Result; - switch(biggestIndex) - { - case 0: - Result.w = biggestVal; - Result.x = (m[1][2] - m[2][1]) * mult; - Result.y = (m[2][0] - m[0][2]) * mult; - Result.z = (m[0][1] - m[1][0]) * mult; - break; - case 1: - Result.w = (m[1][2] - m[2][1]) * mult; - Result.x = biggestVal; - Result.y = (m[0][1] + m[1][0]) * mult; - Result.z = (m[2][1] + m[1][2]) * mult; - break; - case 2: - Result.w = (m[2][0] - m[0][2]) * mult; - Result.x = (m[0][1] + m[1][0]) * mult; - Result.y = biggestVal; - Result.z = (m[1][2] + m[2][1]) * mult; - break; - case 3: - Result.w = (m[0][1] - m[1][0]) * mult; - Result.x = (m[2][0] + m[0][2]) * mult; - Result.y = (m[1][2] + m[2][1]) * mult; - Result.z = biggestVal; - break; - } - return Result; - } - - template - inline detail::_xquat angleAxisGTX(T angle, T x, T y, T z) - { - detail::_xquat result; - // Axis of rotation must be normalised - float len = length(detail::_xvec3(x, y, z)); - if(abs(len - T(1)) > T(0.001)) - { - T oneOverLen = T(1) / len; - x *= oneOverLen; - y *= oneOverLen; - z *= oneOverLen; - } - - angle = radians(angle); - T fSin = sin(angle * T(0.5)); - - result.w = cos(angle * T(0.5)); - result.x = x * fSin; - result.y = y * fSin; - result.z = z * fSin; - return result; - } - - template - inline detail::_xquat angleAxisGTX(T angle, const detail::_xvec3& v) - { - detail::_xquat result; - detail::_xvec3 v_normalized = normalize(v); - - angle = radians(angle); - T fSin = sin(angle * T(0.5)); - - result.w = cos(angle * T(0.5)); - result.x = v.x * fSin; - result.y = v.y * fSin; - result.z = v.z * fSin; - return result; - } - - template - inline T extractRealComponentGTX(const detail::_xquat& q) - { - T w = T(1.0) - q.x * q.x - q.y * q.y - q.z * q.z; - if(w < T(0)) - return T(0); - else - return -sqrt(w); - } - - template - inline T rollGTX(const detail::_xquat& q) - { - return tan2(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z); - } - - template - inline T pitchGTX(const detail::_xquat& q) - { - return atan2(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z); - } - - template - inline T yawGTX(const detail::_xquat& q) - { - return asin(T(-2) * (q.x * q.z - q.w * q.y)); - } - - template - inline detail::_xvec3 eularAnglesGTX(const detail::_xquat& x) - { - return detail::_xvec3(pitchGTX(x), yawGTX(x), rollGTX(x)); - } -} diff --git a/experimental/sse/glm/ext/gtx/random.h b/experimental/sse/glm/ext/gtx/random.h deleted file mode 100644 index 207a83a7..00000000 --- a/experimental/sse/glm/ext/gtx/random.h +++ /dev/null @@ -1,157 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-16 -// Updated : 2007-08-30 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/random.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_vecx -// - GLM_GTX_half -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_random__ -#define __glm_gtx_random__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/half.h" -#include "../gtx/vecx.h" - -namespace glm -{ - template T signedRand1GTX(); //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template <> __halfGTX signedRand1GTX(); //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template <> float signedRand1GTX(); //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template <> double signedRand1GTX(); //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec2 signedRand2GTX(); //!< Generate 2 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec3 signedRand3GTX(); //!< Generate 3 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec4 signedRand4GTX(); //!< Generate 4 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvecxGTX signedRandGTX(); //!< Generate N random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - - template detail::_xvec2 normalizedRand2GTX(); //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - //template <> _xvec2<__halfGTX> normalizedRand2GTX(); //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - //template <> _xvec2 normalizedRand2GTX(); //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - //template <> _xvec2 normalizedRand2GTX(); //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - template detail::_xvec2 normalizedRand2GTX(T Min, T Max); //!< Generate a scaled and normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - - template detail::_xvec3 normalizedRand3GTX(); //!< Generate a normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) - //template <> _xvec3<__halfGTX> normalizedRand3GTX(); //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - //template <> _xvec3 normalizedRand3GTX(); //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - //template <> _xvec3 normalizedRand3GTX(); //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - template detail::_xvec3 normalizedRand3GTX(T Min, T Max); //!< Generate a scaled and normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) - - template T compRand1GTX(); //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> __halfGTX compRand1GTX(); //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> float compRand1GTX(); //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> double compRand1GTX(); //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template T compRand1GTX(T Min, T Max); //!< Generate a random number in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec2 compRand2GTX(T Min, T Max); //!< Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec3 compRand3GTX(T Min, T Max); //!< Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec4 compRand4GTX(T Min, T Max); //!< Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvecxGTX compRandGTX(T Min, T Max); //!< Generate N random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec2 compRand2GTX(const detail::_xvec2& Min, const detail::_xvec2& Max); //!< Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec3 compRand3GTX(const detail::_xvec3& Min, const detail::_xvec3& Max); //!< Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvec3 compRand4GTX(const detail::_xvec4& Min, const detail::_xvec4& Max); //!< Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template detail::_xvecxGTX compRandGTX(const detail::_xvecxGTX& Min, const detail::_xvecxGTX& Max); //!< Generate N random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - - template detail::_xvec2 vecRand2GTX(); //!< Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template <> detail::_xvec2<__halfGTX> vecRand2GTX(); //!< Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template <> detail::_xvec2 vecRand2GTX(); //!< Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template <> detail::_xvec2 vecRand2GTX(); //!< Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::_xvec2 vecRand2GTX(T MinRadius, T MaxRadius); //!< Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - - template detail::_xvec3 vecRand3GTX(); //!< Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - //template <> detail::_xvec3<__halfGTX> vecRand3GTX(); //!< Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - //template <> detail::_xvec3 vecRand3GTX(); //!< Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - //template <> detail::_xvec3 vecRand3GTX(); //!< Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::_xvec3 vecRand3GTX(T MinRadius, T MaxRadius); //!< Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - - template detail::_xvec4 vecRand4GTX(); //!< Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template <> detail::_xvec4<__halfGTX> vecRand4GTX(); //!< Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template <> detail::_xvec4 vecRand4GTX(); //!< Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template <> detail::_xvec4 vecRand4GTX(); //!< Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template detail::_xvec4 vecRand4GTX(T MinRadius, T MaxRadius); //!< Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - - template T gaussRand1GTX(T mean, T std_deviation); //!< Gererate a random floating number according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec2 gaussRand2GTX(T mean, T std_deviation); //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec3 gaussRand3GTX(T mean, T std_deviation); //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec4 gaussRand4GTX(T mean, T std_deviation); //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec2 gaussRand2GTX(const detail::_xvec2& mean, T std_deviation); //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec3 gaussRand3GTX(const detail::_xvec3& mean, T std_deviation); //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec4 gaussRand4GTX(const detail::_xvec4& mean, T std_deviation); //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec2 gaussRand2GTX(T mean, const detail::_xvec2& std_deviation); //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec3 gaussRand3GTX(T mean, const detail::_xvec3& std_deviation); //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec4 gaussRand4GTX(T mean, const detail::_xvec4& std_deviation); //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec2 gaussRand2GTX(const detail::_xvec2& mean, const detail::_xvec2& std_deviation); //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec3 gaussRand3GTX(const detail::_xvec3& mean, const detail::_xvec3& std_deviation); //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template detail::_xvec4 gaussRand4GTX(const detail::_xvec4& mean, const detail::_xvec4& std_deviation); //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - - namespace gtx - { - //! GLM_GTX_random extension: Generate random number from varius distribution methods - namespace random - { - template inline T signedRand1(){return signedRand1GTX();} //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template <> inline __halfGTX signedRand1(){return signedRand1GTX<__halfGTX>();} //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template <> inline float signedRand1(){return signedRand1GTX();} //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template <> inline double signedRand1(){return signedRand1GTX();} //!< Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec2 signedRand2(){return signedRand2GTX();} //!< Generate 2 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec3 signedRand3(){return signedRand3GTX();} //!< Generate 3 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec4 signedRand4(){return signedRand4GTX();} //!< Generate 4 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvecxGTX signedRand(){return signedRandGTX();} //!< Generate N random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension) - - template detail::_xvec2 normalizedRand2(){return normalizedRand2GTX();} //!< Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - template detail::_xvec2 normalizedRand2(T Min, T Max){return normalizedRand2GTX(Min, Max);} //!< Generate a scaled and normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension) - template detail::_xvec3 normalizedRand3(){return normalizedRand3GTX();} //!< Generate a normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) - template detail::_xvec3 normalizedRand3(T Min, T Max){return normalizedRand3GTX(Min, Max);} //!< Generate a scaled and normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension) - - template inline T compRand1(){return compRand1GTX();} //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> inline __halfGTX compRand1(){return compRand1GTX<__halfGTX>();} //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> inline float compRand1(){return compRand1GTX();} //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template <> inline double compRand1(){return compRand1GTX();} //!< Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension) - template inline T compRand1(T Min, T Max){return compRand1GTX(Min, Max);} //!< Generate a random number in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec2 compRand2(T Min, T Max){return compRand2GTX(Min, Max);} //!< Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec3 compRand3(T Min, T Max){return compRand3GTX(Min, Max);} //!< Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec4 compRand4(T Min, T Max){return compRand4GTX(Min, Max);} //!< Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvecxGTX compRand(T Min, T Max){return compRand(Min, Max);} //!< Generate N random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec2 compRand2(const detail::_xvec2& Min, const detail::_xvec2& Max){return compRand2GTX(Min, Max);} //!< Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec3 compRand3(const detail::_xvec3& Min, const detail::_xvec3& Max){return compRand3GTX(Min, Max);} //!< Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvec3 compRand4(const detail::_xvec4& Min, const detail::_xvec4& Max){return compRand4GTX(Min, Max);} //!< Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - template inline detail::_xvecxGTX compRand(const detail::_xvecxGTX& Min, const detail::_xvecxGTX& Max){return compRandGTX(Min, Max);} //!< Generate N random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension) - - template inline detail::_xvec2 vecRand2(){return vecRand2GTX();} //!< Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template inline detail::_xvec2 vecRand2(T MinRadius, T MaxRadius){return vecRand2GTX(MinRadius, MaxRadius);} //!< Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template inline detail::_xvec3 vecRand3(){return vecRand3GTX();} //!< Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template inline detail::_xvec3 vecRand3(T MinRadius, T MaxRadius){return vecRand3GTX(MinRadius, MaxRadius);} //!< Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template inline detail::_xvec4 vecRand4(){return vecRand4GTX();} //!< Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - template inline detail::_xvec4 vecRand4(T MinRadius, T MaxRadius){return vecRand4GTX(MinRadius, MaxRadius);} //!< Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension) - - template inline T gaussRand1(T mean, T std_deviation){return gaussRand1GTX(mean, std_deviation);} //!< Gererate a random floating number according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec2 gaussRand2(T mean, T std_deviation){return gaussRand2GTX(mean, std_deviation);} //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec3 gaussRand3(T mean, T std_deviation){return gaussRand3GTX(mean, std_deviation);} //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec4 gaussRand4(T mean, T std_deviation){return gaussRand4GTX(mean, std_deviation);} //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec2 gaussRand2(const detail::_xvec2& mean, T std_deviation){return gaussRand2GTX(mean, std_deviation);} //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec3 gaussRand3(const detail::_xvec3& mean, T std_deviation){return gaussRand3GTX(mean, std_deviation);} //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec4 gaussRand4(const detail::_xvec4& mean, T std_deviation){return gaussRand4GTX(mean, std_deviation);} //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec2 gaussRand2(T mean, const detail::_xvec2& std_deviation){return gaussRand2GTX(mean, std_deviation);} //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec3 gaussRand3(T mean, const detail::_xvec3& std_deviation){return gaussRand3GTX(mean, std_deviation);} //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec4 gaussRand4(T mean, const detail::_xvec4& std_deviation){return gaussRand4GTX(mean, std_deviation);} //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec2 gaussRand2(const detail::_xvec2& mean, const detail::_xvec2& std_deviation){return gaussRand2GTX(mean, std_deviation);} //!< Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec3 gaussRand3(const detail::_xvec3& mean, const detail::_xvec3& std_deviation){return gaussRand3GTX(mean, std_deviation);} //!< Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - template inline detail::_xvec4 gaussRand4(const detail::_xvec4& mean, const detail::_xvec4& std_deviation){return gaussRand4GTX(mean, std_deviation);} //!< Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension) - } - } -} - -#define GLM_GTX_random namespace gtx::random - -#include "random.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_random;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_random__ diff --git a/experimental/sse/glm/ext/gtx/random.inl b/experimental/sse/glm/ext/gtx/random.inl deleted file mode 100644 index e1dc2a09..00000000 --- a/experimental/sse/glm/ext/gtx/random.inl +++ /dev/null @@ -1,627 +0,0 @@ -////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-16 -// Updated : 2006-01-16 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/random.inl -////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm -{ - template <> - inline __halfGTX signedRand1GTX() - { - return __halfGTX(signedRand1GTX()); - } - - template <> - inline float signedRand1GTX() - { - #define GLM_COMPILER GLM_COMPILER_VC80 - #if(GLM_COMPILER == GLM_COMPILER_VC80) - #define RAND_SHIFT_NUM 5 - #else - #define RAND_SHIFT_NUM 0 - #endif - return float((std::rand() - (RAND_MAX >> 1) - 1) << 1) / float(RAND_MAX - RAND_SHIFT_NUM); - } - - template <> - inline double signedRand1GTX() - { - return double(signedRand1GTX()); - } - - template - inline detail::_xvec2 signedRand2GTX() - { - return detail::_xvec2( - signedRand1GTX(), - signedRand1GTX()); - } - - template - inline detail::_xvec3 signedRand3GTX() - { - return detail::_xvec3( - signedRand1GTX(), - signedRand1GTX(), - signedRand1GTX()); - } - - template - inline detail::_xvec4 signedRand4GTX() - { - return detail::_xvec4( - signedRand1GTX(), - signedRand1GTX(), - signedRand1GTX(), - signedRand1GTX()); - } - - template - inline detail::_xvecxGTX signedRandGTX() - { - detail::_xvecxGTX Result; - for(int i = 0; i < N; ++i) - Result[i] = signedRand1GTX(T()); - } - - template - inline detail::_xvec2 normalizedRand2GTX() - { - T a = compRand1GTX(T(0), T(6.283185307179586476925286766559f)); - return detail::_xvec2(cos(a), sin(a)); - } -/* -#ifdef GLM_COMPILER_VC - template <> - inline detail::_xvec2<__halfGTX> normalizedRand2GTX() - { - return detail::_xvec2<__halfGTX>(normalizedRand2GTX()); - } -#endif//GLM_COMPILER_VC - - template <> - inline detail::_xvec2 normalizedRand2GTX() - { - float a = compRand1GTX(float(0), float(6.283185307179586476925286766559f)); - return detail::_xvec2(cos(a), sin(a)); - } - - template <> - inline detail::_xvec2 normalizedRand2GTX() - { - double a = compRand1GTX(double(0), double(6.283185307179586476925286766559)); - return detail::_xvec2(cos(a), sin(a)); - } - - template - inline detail::_xvec2 normalizedRand2GTX(T Min, T Max) - { - return normalizedRand2GTX() * compRand1GTX(Min, Max); - } -*/ - template - inline detail::_xvec3 normalizedRand3GTX() - { - T z = compRand1GTX(T(-1), T(1)); - T a = compRand1GTX(T(0), T(6.283185307179586476925286766559f)); - - T r = sqrt(T(1) - z * z); - - T x = r * cos(a); - T y = r * sin(a); - - return detail::_xvec3(x, y, z); - } - - template - inline detail::_xvec3 normalizedRand3GTX(T Min, T Max) - { - return normalizedRand3GTX() * compRand1GTX(Min, Max); - } - - template <> - inline __halfGTX compRand1GTX() - { - return __halfGTX(float(std::rand()) / float(RAND_MAX)); - } - - template <> - inline float compRand1GTX() - { - return float(std::rand()) / float(RAND_MAX); - } - - template <> - inline double compRand1GTX() - { - return double(std::rand()) / double(RAND_MAX); - } - - template - inline T compRand1GTX(T Min, T Max) - { - return compRand1GTX() * (Max - Min) + Min; - } - - template - inline detail::_xvec2 compRand2GTX(T Min, T Max) - { - return detail::_xvec2( - compRand1GTX(Min, Max), - compRand1GTX(Min, Max)); - } - - template - inline detail::_xvec3 compRand3GTX(T Min, T Max) - { - return detail::_xvec3( - compRand1GTX(Min, Max), - compRand1GTX(Min, Max), - compRand1GTX(Min, Max)); - } - - template - inline detail::_xvec4 compRand4GTX(T Min, T Max) - { - return detail::_xvec4( - compRand1GTX(Min, Max), - compRand1GTX(Min, Max), - compRand1GTX(Min, Max), - compRand1GTX(Min, Max)); - } - - template - inline detail::_xvecxGTX compRandGTX(T Min, T Max) - { - detail::_xvecxGTX result; - for(int i = 0; i < N; ++i) - result[i] = compRand1GTX(Min, Max); - return result; - } - - template - inline detail::_xvec2 compRand2GTX(T Min, const detail::_xvec2& Max) - { - return detail::_xvec2( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y)); - } - - template - inline detail::_xvec3 compRand3GTX(T Min, const detail::_xvec3& Max) - { - return detail::_xvec3( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y), - compRand1GTX(Min.z, Max.z)); - } - - template - inline detail::_xvec4 compRand4GTX(T Min, const detail::_xvec4& Max) - { - return detail::_xvec4( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y), - compRand1GTX(Min.z, Max.z), - compRand1GTX(Min.w, Max.w)); - } - - template - inline detail::_xvecxGTX compRandGTX(T Min, const detail::_xvecxGTX& Max) - { - detail::_xvecxGTX result; - for(int i = 0; i < N; ++i) - result[i] = compRand1GTX(Min[i], Max[i]); - return result; - } - - template - inline detail::_xvec2 compRand2GTX(const detail::_xvec2& Min, T Max) - { - return detail::_xvec2( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y)); - } - - template - inline detail::_xvec3 compRand3GTX(const detail::_xvec3& Min, T Max) - { - return detail::_xvec3( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y), - compRand1GTX(Min.z, Max.z)); - } - - template - inline detail::_xvec4 compRand4GTX(const detail::_xvec4& Min, T Max) - { - return detail::_xvec4( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y), - compRand1GTX(Min.z, Max.z), - compRand1GTX(Min.w, Max.w)); - } - - template - inline detail::_xvecxGTX compRandGTX(const detail::_xvecxGTX& Min, T Max) - { - detail::_xvecxGTX result; - for(int i = 0; i < N; ++i) - result[i] = compRand1GTX(Min[i], Max[i]); - return result; - } - - template - inline detail::_xvec2 compRand2GTX(const detail::_xvec2& Min, const detail::_xvec2& Max) - { - return detail::_xvec2( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y)); - } - - template - inline detail::_xvec3 compRand3GTX(const detail::_xvec3& Min, const detail::_xvec3& Max) - { - return detail::_xvec3( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y), - compRand1GTX(Min.z, Max.z)); - } - - template - inline detail::_xvec4 compRand4GTX(const detail::_xvec4& Min, const detail::_xvec4& Max) - { - return detail::_xvec4( - compRand1GTX(Min.x, Max.x), - compRand1GTX(Min.y, Max.y), - compRand1GTX(Min.z, Max.z), - compRand1GTX(Min.w, Max.w)); - } - - template - inline detail::_xvecxGTX compRandGTX(const detail::_xvecxGTX& Min, const detail::_xvecxGTX& Max) - { - detail::_xvecxGTX result; - for(int i = 0; i < N; ++i) - result[i] = compRand1GTX(Min[i], Max[i]); - return result; - } -/* - template - inline detail::_xvec2 vecRand2GTX() - { - detail::_xvec2 result(0); - do - { - result = compRand2GTX(T(-1), T(1)); - } while (length(result) > T(1)); - - return result; - } -*/ - -#ifdef GLM_COMPILER_VC - template <> - inline detail::_xvec2<__halfGTX> vecRand2GTX() - { - detail::_xvec2 result(float(0)); - do - { - result = compRand2GTX(float(-1), float(1)); - } while (length(result) > float(1)); - - return detail::_xvec2<__halfGTX>(result); - } -#endif//GLM_COMPILER_VC - - template - inline detail::_xvec2 vecRand2GTX() - { - detail::_xvec2 result(float(0)); - do - { - result = compRand2GTX(float(-1), float(1)); - } while (length(result) > float(1)); - - return result; - } - - template - inline detail::_xvec2 vecRand2GTX() - { - detail::_xvec2 result(double(0)); - do - { - result = compRand2GTX(double(-1), double(1)); - } while (length(result) > double(1)); - - return result; - } - - template - inline detail::_xvec2 vecRand2GTX(T MinRadius, T MaxRadius) - { - assert(MinRadius < MaxRadius); - - detail::_xvec2 Result(T(0)); - T LenRadius(0); - - do - { - Result = compRand2GTX(-MaxRadius, MaxRadius); - LenRadius = length(Result); - } - while(LenRadius > MaxRadius || LenRadius < MinRadius); - - return Result; - } - - template - inline detail::_xvec3 vecRand3GTX() - { - detail::_xvec3 Result(T(0)); - do - { - Result = compRand3GTX(T(-1), T(1)); - } - while(length(Result) > T(1)); - - return Result; - } - -/* -#ifdef GLM_COMPILER_VC - template <> - inline detail::_xvec3<__halfGTX> vecRand3GTX<__halfGTX>() - { - detail::_xvec3 result(float(0)); - do - { - result = compRand3GTX(float(-1), float(1)); - } while (length(result) > float(1)); - - return detail::_xvec3<__halfGTX>(result); - } -#endif//GLM_COMPILER_VC - - template - inline detail::_xvec3 vecRand3GTX() - { - detail::_xvec3 result(float(0)); - do - { - result = compRand3GTX(float(-1), float(1)); - } while (length(result) > float(1)); - - return result; - } - - template - inline detail::_xvec3 vecRand3GTX() - { - detail::_xvec3 result(double(0)); - do - { - result = compRand3GTX(double(-1), double(1)); - } while (length(result) > double(1)); - - return result; - } -*/ - template - inline detail::_xvec3 vecRand3GTX(T MinRadius, T MaxRadius) - { - assert(MinRadius < MaxRadius); - - detail::_xvec3 Result(0); - T LenRadius(0); - - do - { - Result = compRand3GTX(-MaxRadius, MaxRadius); - LenRadius = length(Result); - } - while(LenRadius > MaxRadius || LenRadius < MinRadius); - - return Result; - } -/* - template - inline detail::_xvec4 vecRand4GTX() - { - detail::_xvec4 Result(T(0)); - do - { - Result = compRand4GTX(T(-1), T(1)); - } - while(length(Result) > T(1)); - - return Result; - } -*/ -#ifdef GLM_COMPILER_VC - template <> - inline detail::_xvec4<__halfGTX> vecRand4GTX() - { - detail::_xvec4 result(float(0)); - do - { - result = compRand4GTX(float(-1), float(1)); - } while (length(result) > float(1)); - - return detail::_xvec4<__halfGTX>(result); - } -#endif//GLM_COMPILER_VC - - template - inline detail::_xvec4 vecRand4GTX() - { - detail::_xvec4 result(float(0)); - do - { - result = compRand4GTX(float(-1), float(1)); - } while (length(result) > float(1)); - - return result; - } - - template - inline detail::_xvec4 vecRand4GTX() - { - detail::_xvec4 result(double(0)); - do - { - result = compRand4GTX(double(-1), double(1)); - } while (length(result) > double(1)); - - return result; - } - - template - inline detail::_xvec4 vecRand4GTX(T MinRadius, T MaxRadius) - { - assert(MinRadius < MaxRadius); - - detail::_xvec4 Result(T(0)); - T LenRadius(T(0)); - - do - { - Result = compRand4GTX(-MaxRadius, MaxRadius); - LenRadius = length(Result); - } - while(LenRadius > MaxRadius || LenRadius < MinRadius); - - return Result; - } - - template - inline T gaussRand1GTX(T mean, T std_deviation) - { - T w, x1, x2; - - do - { - x1 = rand1GTX(T(-1), T(1)); - x2 = rand1GTX(T(-1), T(1)); - - w = x1 * x1 + x2 * x2; - } while(w > T(1)); - - return x2 * std_deviation * std_deviation * sqrt((T(-2) * ln(w)) / w) + mean; - } - - template - inline detail::_xvec2 gaussRand2GTX(T mean, T std_deviation) - { - return detail::_xvec2( - gaussRand1GTX(mean, std_deviation), - gaussRand1GTX(mean, std_deviation)); - } - - template - inline detail::_xvec3 gaussRand3GTX(T mean, T std_deviation) - { - return detail::_xvec3( - gaussRand1GTX(mean, std_deviation), - gaussRand1GTX(mean, std_deviation), - gaussRand1GTX(mean, std_deviation)); - } - - template - inline detail::_xvec4 gaussRand4GTX(T mean, T std_deviation) - { - return detail::_xvec4( - gaussRand1GTX(mean, std_deviation), - gaussRand1GTX(mean, std_deviation), - gaussRand1GTX(mean, std_deviation), - gaussRand1GTX(mean, std_deviation)); - } - - template - inline detail::_xvec2 gaussRand2GTX(T mean, const detail::_xvec2& std_deviation) - { - return detail::_xvec2( - gaussRand1GTX(mean, std_deviation.x), - gaussRand1GTX(mean, std_deviation.y)); - } - - template - inline detail::_xvec3 gaussRand3GTX(T mean, const detail::_xvec3& std_deviation) - { - return detail::_xvec3( - gaussRand1GTX(mean, std_deviation.x), - gaussRand1GTX(mean, std_deviation.y), - gaussRand1GTX(mean, std_deviation.z)); - } - - template - inline detail::_xvec4 gaussRand4GTX(T mean, const detail::_xvec4& std_deviation) - { - return detail::_xvec4( - gaussRand1GTX(mean, std_deviation.x), - gaussRand1GTX(mean, std_deviation.y), - gaussRand1GTX(mean, std_deviation.z), - gaussRand1GTX(mean, std_deviation.w)); - } - - template - inline detail::_xvec2 gaussRand2GTX(const detail::_xvec2& mean, T std_deviation) - { - return detail::_xvec2( - gaussRand1GTX(mean.x, std_deviation), - gaussRand1GTX(mean.y, std_deviation)); - } - - template - inline detail::_xvec3 gaussRand3GTX(const detail::_xvec3& mean, T std_deviation) - { - return detail::_xvec3( - gaussRand1GTX(mean.x, std_deviation), - gaussRand1GTX(mean.y, std_deviation), - gaussRand1GTX(mean.z, std_deviation)); - } - - template - inline detail::_xvec4 gaussRand4GTX(const detail::_xvec4& mean, T std_deviation) - { - return detail::_xvec4( - gaussRand1GTX(mean.x, std_deviation), - gaussRand1GTX(mean.y, std_deviation), - gaussRand1GTX(mean.z, std_deviation), - gaussRand1GTX(mean.w, std_deviation)); - } - - template - inline detail::_xvec2 gaussRand2GTX(const detail::_xvec2& mean, const detail::_xvec2& std_deviation) - { - return detail::_xvec2( - gaussRand1GTX(mean.x, std_deviation.x), - gaussRand1GTX(mean.y, std_deviation.y)); - } - - template - inline detail::_xvec3 gaussRand3GTX(const detail::_xvec3& mean, const detail::_xvec3& std_deviation) - { - return detail::_xvec3( - gaussRand1GTX(mean.x, std_deviation.x), - gaussRand1GTX(mean.y, std_deviation.y), - gaussRand1GTX(mean.z, std_deviation.z)); - } - - template - inline detail::_xvec4 gaussRand4GTX(const detail::_xvec4& mean, const detail::_xvec4& std_deviation) - { - return detail::_xvec4( - gaussRand1GTX(mean.x, std_deviation.x), - gaussRand1GTX(mean.y, std_deviation.y), - gaussRand1GTX(mean.z, std_deviation.z), - gaussRand1GTX(mean.w, std_deviation.w)); - } -} diff --git a/experimental/sse/glm/ext/gtx/rotate_vector.h b/experimental/sse/glm/ext/gtx/rotate_vector.h deleted file mode 100644 index 19009b77..00000000 --- a/experimental/sse/glm/ext/gtx/rotate_vector.h +++ /dev/null @@ -1,60 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-11-02 -// Updated : 2006-12-15 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/rotate_vector.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_rotate_vector__ -#define __glm_gtx_rotate_vector__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/transform.h" - -namespace glm -{ - template detail::_xvec2 rotateGTX(const detail::_xvec2& v, T angle); //!< \brief Rotate a two dimentionnals vector (from GLM_GTX_rotate_vector extension) - template detail::_xvec3 rotateGTX(const detail::_xvec3& v, T angle, const detail::_xvec3& normal); //!< \brief Rotate a three dimentionnals vector around an axis (from GLM_GTX_rotate_vector extension) - template detail::_xvec4 rotateGTX(const detail::_xvec4& v, T angle, const detail::_xvec3& normal); //!< \brief Rotate a four dimentionnals vector around an axis (from GLM_GTX_rotate_vector extension) - template detail::_xvec3 rotateXGTX(const detail::_xvec3& v, T angle); //!< \brief Rotate a three dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template detail::_xvec3 rotateYGTX(const detail::_xvec3& v, T angle); //!< \brief Rotate a three dimentionnals vector around the Y axis (from GLM_GTX_rotate_vector extension) - template detail::_xvec3 rotateZGTX(const detail::_xvec3& v, T angle); //!< \brief Rotate a three dimentionnals vector around the Z axis (from GLM_GTX_rotate_vector extension) - template detail::_xvec4 rotateXGTX(const detail::_xvec4& v, T angle); //!< \brief Rotate a four dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template detail::_xvec4 rotateYGTX(const detail::_xvec4& v, T angle); //!< \brief Rotate a four dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template detail::_xvec4 rotateZGTX(const detail::_xvec4& v, T angle); //!< \brief Rotate a four dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template detail::_xmat4 orientationGTX(const detail::_xvec3& Normal, const detail::_xvec3& Up); //!< \brief Build a rotation matrix from a normal and a up vector (from GLM_GTX_rotate_vector extension) - - namespace gtx - { - //! GLM_GTX_rotate_vector extension: Function to directly rotate a vector - namespace rotate_vector - { - template inline detail::_xvec2 rotate(const detail::_xvec2& v, T angle){return rotateGTX(v, angle);} //!< \brief Rotate a two dimentionnals vector (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec3 rotate(const detail::_xvec3& v, T angle, const detail::_xvec3& normal){return rotateGTX(v, angle, normal);} //!< \brief Rotate a three dimentionnals vector around an axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec4 rotate(const detail::_xvec4& v, T angle, const detail::_xvec3& normal){return rotateGTX(v, angle, normal);} //!< \brief Rotate a four dimentionnals vector around an axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec3 rotateX(const detail::_xvec3& v, T angle){return rotateXGTX(v, angle);} //!< \brief Rotate a three dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec3 rotateY(const detail::_xvec3& v, T angle){return rotateYGTX(v, angle);} //!< \brief Rotate a three dimentionnals vector around the Y axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec3 rotateZ(const detail::_xvec3& v, T angle){return rotateZGTX(v, angle);} //!< \brief Rotate a three dimentionnals vector around the Z axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec4 rotateX(const detail::_xvec4& v, T angle){return rotateXGTX(v, angle);} //!< \brief Rotate a four dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec4 rotateY(const detail::_xvec4& v, T angle){return rotateYGTX(v, angle);} //!< \brief Rotate a four dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xvec4 rotateZ(const detail::_xvec4& v, T angle){return rotateZGTX(v, angle);} //!< \brief Rotate a four dimentionnals vector around the X axis (from GLM_GTX_rotate_vector extension) - template inline detail::_xmat4 orientation(const detail::_xvec3& Normal, const detail::_xvec3& Up){return orientationGTX(Normal, Up);} //!< \brief Build a rotation matrix from a normal and a up vector (from GLM_GTX_rotate_vector extension) - } - } -} - -#define GLM_GTX_rotate_vector namespace gtx::rotate_vector - -#include "rotate_vector.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_rotate_vector;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_rotate_vector__ diff --git a/experimental/sse/glm/ext/gtx/rotate_vector.inl b/experimental/sse/glm/ext/gtx/rotate_vector.inl deleted file mode 100644 index e788f91a..00000000 --- a/experimental/sse/glm/ext/gtx/rotate_vector.inl +++ /dev/null @@ -1,119 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-11-02 -// Updated : 2006-11-02 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/rotate_vector.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xvec2 rotateGTX(const detail::_xvec2& v, T angle) - { - detail::_xvec2 Result; - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - }; - - template - inline detail::_xvec3 rotateGTX(const detail::_xvec3& v, T angle, const detail::_xvec3& normal) - { - return rotateGTX(angle, normal) * v; - } -/* - template - inline detail::_xvec3 rotateGTX(const detail::_xvec3& x, T angle, const detail::_xvec3& normal) - { - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin; - } -*/ - template - inline detail::_xvec4 rotateGTX(const detail::_xvec4& v, T angle, const detail::_xvec3& normal) - { - return rotateGTX(angle, normal) * v; - } - - template - inline detail::_xvec3 rotateXGTX(const detail::_xvec3& v, T angle) - { - detail::_xvec3 Result = v; - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - Result.y = v.y * Cos - v.z * Sin; - Result.z = v.y * Sin + v.z * Cos; - return Result; - } - - template - inline detail::_xvec3 rotateYGTX(const detail::_xvec3& v, T angle) - { - detail::_xvec3 Result = v; - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - Result.x = v.x * Cos + v.z * Sin; - Result.z = -v.x * Sin + v.z * Cos; - return Result; - } - - template - inline detail::_xvec3 rotateZGTX(const detail::_xvec3& v, T angle) - { - detail::_xvec3 Result = v; - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - }; - - template - inline detail::_xvec4 rotateXGTX(const detail::_xvec4& v, T angle) - { - detail::_xvec4 Result = v; - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - Result.y = v.y * Cos - v.z * Sin; - Result.z = v.y * Sin + v.z * Cos; - return Result; - } - - template - inline detail::_xvec4 rotateYGTX(const detail::_xvec4& v, T angle) - { - detail::_xvec4 Result = v; - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - Result.x = v.x * Cos + v.z * Sin; - Result.z = -v.x * Sin + v.z * Cos; - return Result; - } - - template - inline detail::_xvec4 rotateZGTX(const detail::_xvec4& v, T angle) - { - detail::_xvec4 Result = v; - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - }; - - template - inline detail::_xmat4 orientationGTX(const detail::_xvec3& Normal, const detail::_xvec3& Up) - { - if(all(equal(Normal, Up))) - return detail::_xmat4(T(1)); - - detail::_xvec3 RotationAxis = cross(Up, Normal); - T Angle = degrees(acos(dot(Normal, Up))); - return rotateGTX(Angle, RotationAxis); - } -} diff --git a/experimental/sse/glm/ext/gtx/round.h b/experimental/sse/glm/ext/gtx/round.h deleted file mode 100644 index cf4a47c3..00000000 --- a/experimental/sse/glm/ext/gtx/round.h +++ /dev/null @@ -1,51 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/round.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_half -// - GLM_GTX_double -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_round__ -#define __glm_gtx_round__ - -// Dependency: -#include "../../glm.h" -#include "../../ext/gtx/half.h" -#include "../../ext/gtx/double.h" - -namespace glm -{ - template genType roundGTX(const genType& x); //!< \brief Computes the component-wise round value of x (from GLM_GTX_round extension) - __halfGTX roundGTX(__halfGTX x); //!< \brief Computes the round value of x (from GLM_GTX_round extension) - float roundGTX(float x); //!< \brief Computes the round value of x (from GLM_GTX_round extension) - double roundGTX(double x); //!< \brief Computes the round value of x (from GLM_GTX_round extension) - - namespace gtx - { - //! GLM_GTX_round extension: Computes the round value - namespace round - { - template inline genType round(const genType& x){return roundGTX(x);} //!< \brief Computes the component-wise round value of x (from GLM_GTX_round extension) - inline __halfGTX round(__halfGTX x){return roundGTX(x);} //!< \brief Computes the round value of x (from GLM_GTX_round extension) - inline float round(float x){return roundGTX(x);} //!< \brief Computes the round value of x (from GLM_GTX_round extension) - inline double round(double x){return roundGTX(x);} //!< \brief Computes the round value of x (from GLM_GTX_round extension) - } - } -} - -#define GLM_GTX_round namespace gtx::round - -#include "round.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_round;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_round__ diff --git a/experimental/sse/glm/ext/gtx/round.inl b/experimental/sse/glm/ext/gtx/round.inl deleted file mode 100644 index 2d6b9384..00000000 --- a/experimental/sse/glm/ext/gtx/round.inl +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/round.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GL_GTX_double -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline genType roundGTX(const genType& x) - { - genType result; - int i = x._size(); - while(i--) - result[i] = float(int(x[i] + 0.5f)); - return result; - } - - inline __halfGTX roundGTX(__halfGTX x) - { - return __halfGTX(roundGTX(float(x))); - } - - inline float roundGTX(float x) - { - return float(int(x + 0.5f)); - } - - inline double roundGTX(double x) - { - return double(int(x + 0.5)); - } -} diff --git a/experimental/sse/glm/ext/gtx/spline.h b/experimental/sse/glm/ext/gtx/spline.h deleted file mode 100644 index 4b27ce23..00000000 --- a/experimental/sse/glm/ext/gtx/spline.h +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-25 -// Updated : 2007-03-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/spline.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_spline__ -#define __glm_gtx_spline__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template genType catmullRomGTX(const genType& v1, const genType& v2, const genType& v3, const genType& v4, const GLMvalType& s); //!< Return a point from a catmull rom curve (from GLM_GTX_spline extension) - template genType hermiteGTX(const genType& v1, const genType& t1, const genType& v2, const genType& t2, const GLMvalType& s); //!< Return a point from a hermite curve (from GLM_GTX_spline extension) - template genType cubicGTX(const genType& v1, const genType& v2, const genType& v3, const genType& v4, const GLMvalType& s); //!< Return a point from a cubic curve (from GLM_GTX_spline extension) - - namespace gtx - { - //! GLM_GTX_spline extension: Spline functions - namespace spline - { - template inline genType catmullRom(const genType& v1, const genType& v2, const genType& v3, const genType& v4, const GLMvalType& s){return catmullRomGTX(v1, v2, v3, v4, s);} //!< Return a point from a catmull rom curve (from GLM_GTX_spline extension) - template inline genType hermite(const genType& v1, const genType& t1, const genType& v2, const genType& t2, const GLMvalType& s){return hermiteGTX(v1, t1, v2, t2, s);} //!< Return a point from a hermite curve (from GLM_GTX_spline extension) - template inline genType cubic(const genType& v1, const genType& v2, const genType& v3, const genType& v4, const GLMvalType& s){return cubicGTX(v1, v2, v3, v4, s);} //!< Return a point from a cubic curve (from GLM_GTX_spline extension) - } - } -} - -#define GLM_GTX_spline namespace gtx::spline - -#include "spline.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_spline;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_spline__ - diff --git a/experimental/sse/glm/ext/gtx/spline.inl b/experimental/sse/glm/ext/gtx/spline.inl deleted file mode 100644 index d75858aa..00000000 --- a/experimental/sse/glm/ext/gtx/spline.inl +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-01-25 -// Updated : 2007-03-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/spline.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline genType catmullRomGTX(const genType& v1, const genType& v2, const genType& v3, const genType& v4, const GLMvalType& s) - { - GLMvalType s1 = s; - GLMvalType s2 = pow2GTX(s); - GLMvalType s3 = pow3GTX(s); - - GLMvalType f1 = -s3 + GLMvalType(2) * s2 - s; - GLMvalType f2 = GLMvalType(3) * s3 - GLMvalType(5) * s2 + GLMvalType(2); - GLMvalType f3 = GLMvalType(-3) * s3 + GLMvalType(4) * s2 + s; - GLMvalType f4 = s3 - s2; - - return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / GLMvalType(2); - - } - - template - inline genType hermiteGTX(const genType& v1, const genType& t1, const genType& v2, const genType& t2, const GLMvalType& s) - { - GLMvalType s1 = s; - GLMvalType s2 = pow2GTX(s); - GLMvalType s3 = pow3GTX(s); - - GLMvalType f1 = GLMvalType(2) * s3 - GLMvalType(3) * s2 + GLMvalType(1); - GLMvalType f2 = GLMvalType(-2) * s3 + GLMvalType(3) * s2; - GLMvalType f3 = s3 - GLMvalType(2) * s2 + s; - GLMvalType f4 = s3 - s2; - - return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; - } - - template - inline genType cubicGTX(const genType& v1, const genType& v2, const genType& v3, const genType& v4, const GLMvalType& s) - { - return ((v1 * s + v2) * s + v3) * s + v4; - } -} diff --git a/experimental/sse/glm/ext/gtx/statistics_operation.h b/experimental/sse/glm/ext/gtx/statistics_operation.h deleted file mode 100644 index fa4e8225..00000000 --- a/experimental/sse/glm/ext/gtx/statistics_operation.h +++ /dev/null @@ -1,71 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-11-21 -// Updated : 2007-11-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/statistics_operation.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_statistics_operation__ -#define __glm_gtx_statistics_operation__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template T distanceGTX(const _xvec2& v1, const _xvec2& v2); - template T distanceGTX(const _xvec3& v1, const _xvec3& v2); - template T distanceGTX(const _xvec4& v1, const _xvec4& v2); - - template T distanceGTX(const _xmat2& m1, const _xmat2& m2); - template T distanceGTX(const _xmat3& m1, const _xmat3& m2); - template T distanceGTX(const _xmat4& m1, const _xmat4& m2); - - template T expectedValueGTX(const _xvec2& v1, const _xvec2& v2); - template T expectedValueGTX(const _xvec3& v1, const _xvec3& v2); - template T expectedValueGTX(const _xvec4& v1, const _xvec4& v2); - - template T expectedValueGTX(const _xmat2& m1, const _xmat2& m2); - template T expectedValueGTX(const _xmat3& m1, const _xmat3& m2); - template T expectedValueGTX(const _xmat4& m1, const _xmat4& m2); - - template T varianceGTX(const _xvec2& v1, const _xvec2& v2); - template T varianceGTX(const _xvec3& v1, const _xvec3& v2); - template T varianceGTX(const _xvec4& v1, const _xvec4& v2); - - template T varianceGTX(const _xmat2& m1, const _xmat2& m2); - template T varianceGTX(const _xmat3& m1, const _xmat3& m2); - template T varianceGTX(const _xmat4& m1, const _xmat4& m2); - - template T standardDevitionGTX(const _xvec2& v1, const _xvec2& v2); - template T standardDevitionGTX(const _xvec3& v1, const _xvec3& v2); - template T standardDevitionGTX(const _xvec4& v1, const _xvec4& v2); - - template T standardDevitionGTX(const _xmat2& m1, const _xmat2& m2); - template T standardDevitionGTX(const _xmat3& m1, const _xmat3& m2); - template T standardDevitionGTX(const _xmat4& m1, const _xmat4& m2); - - namespace gtx - { - //! GLM_GTX_statistics_operation extension: - Work in progress - Statistics functions - namespace statistics_operation - { - - } - } -} - -#define GLM_GTX_statistics_operation namespace gtx::statistics_operation - -#include "statistics_operation.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_statistics_operation;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_statistics_operation__ diff --git a/experimental/sse/glm/ext/gtx/statistics_operation.inl b/experimental/sse/glm/ext/gtx/statistics_operation.inl deleted file mode 100644 index 97644a9b..00000000 --- a/experimental/sse/glm/ext/gtx/statistics_operation.inl +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-11-21 -// Updated : 2007-11-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/statistics_operator.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm -{ - //! Compute the sum of square of differences between each matrices paremeters - template - inline T distanceGTX(const _xmat2& m1, const _xmat2& m2) - { - T result = T(0); - for(int j = 0; j < 2; ++j) - for(int i = 0; i < 2; ++i) - { - T diff = m1[j][i] - m2[j][i]; - result += diff * diff; - } - return result; - } - - template - inline T distanceGTX(const _xmat3& m1, const _xmat3& m2) - { - T result = T(0); - for(int j = 0; j < 3; ++j) - for(int i = 0; i < 3; ++i) - { - T diff = m1[j][i] - m2[j][i]; - result += diff * diff; - } - return result; - } - - template - inline T distanceGTX(const _xmat4& m1, const _xmat4& m2) - { - T result = T(0); - for(int j = 0; j < 4; ++j) - for(int i = 0; i < 4; ++i) - { - T diff = m1[j][i] - m2[j][i]; - result += diff * diff; - } - return result; - } - - template - T expectedValueGTX(const _xmat4& m) - { - T result = T(0); - for(int j = 0; j < 4; ++j) - for(int i = 0; i < 4; ++i) - result += m[j][i]; - result *= T(0,0625); - return result; - } - - template - T varianceGTX(const _xmat4& m) - { - T ExpectedValue = expectedValueGTX(m); - T ExpectedValueOfSquaredMatrix = expectedValueGTX(matrixCompMult(m)); - return ExpectedValueOfSquaredMatrix - ExpectedValue * ExpectedValue; - } - - template - T standardDevitionGTX(const _xmat4& m) - { - return sqrt(varianceGTX(m)); - } -} diff --git a/experimental/sse/glm/ext/gtx/transform.h b/experimental/sse/glm/ext/gtx/transform.h deleted file mode 100644 index b7004dde..00000000 --- a/experimental/sse/glm/ext/gtx/transform.h +++ /dev/null @@ -1,107 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/transform.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_transform__ -#define __glm_gtx_transform__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat4 translateGTX(T x, T y, T z); //!< /brief Builds a translation 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template detail::_xmat4 translateGTX(const detail::_xvec3 & v); //!< /brief Builds a translation 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template detail::_xmat4 translateGTX(const detail::_xmat4 & m, T x, T y, T z); //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template detail::_xmat4 translateGTX(const detail::_xmat4 & m, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template detail::_xmat4 rotateGTX(T angle, T x, T y, T z); //!< /brief Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat4 rotateGTX(T angle, const detail::_xvec3 & v); //!< /brief Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat4 rotateGTX(const detail::_xmat4 & m, T angle, T x, T y, T z); //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat4 rotateGTX(const detail::_xmat4 & m, T angle, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat4 scaleGTX(T x, T y, T z); //!< /brief Builds a scale 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template detail::_xmat4 scaleGTX(const detail::_xvec3 & v); //!< /brief Builds a scale 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template detail::_xmat4 scaleGTX(const detail::_xmat4 & m, T x, T y, T z); //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template detail::_xmat4 scaleGTX(const detail::_xmat4 & m, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - - // 3D - template detail::_xmat4 translate3DGTX(const detail::_xmat4 & m, T x, T y, T z); //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template detail::_xmat4 translate3DGTX(const detail::_xmat4 & m, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template detail::_xmat4 rotate3DGTX(const detail::_xmat4 & m, T angle, T x, T y, T z); //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat4 rotate3DGTX(const detail::_xmat4 & m, T angle, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat3 rotate3DGTX(const detail::_xmat3 & m, T angle, T x, T y, T z); //!< /brief Transforms a matrix with a rotation 3 * 3 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat3 rotate3DGTX(const detail::_xmat3 & m, T angle, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a rotation 3 * 3 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat4 scale3DGTX(const detail::_xmat4 & m, T x, T y, T z); //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template detail::_xmat4 scale3DGTX(const detail::_xmat4 & m, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template detail::_xmat3 scale3DGTX(const detail::_xmat3 & m, T x, T y, T z); //!< /brief Transforms a matrix with a scale 3 * 3 matrix created from 3 scalars (from GLM_GTX_transform extension) - template detail::_xmat3 scale3DGTX(const detail::_xmat3 & m, const detail::_xvec3 & v); //!< /brief Transforms a matrix with a scale 3 * 3 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - - // 2D - template detail::_xmat3 translate2DGTX(const detail::_xmat3 & m, T x, T y); //!< /brief Translates a 3 * 3 matrix from 2 scalars (from GLM_GTX_transform extension) - template detail::_xmat3 translate2DGTX(const detail::_xmat3 & m, const detail::_xvec2 & v); //!< /brief Translates a 3 * 3 matrix from a vector of 2 components (from GLM_GTX_transform extension) - template detail::_xmat3 rotate2DGTX(const detail::_xmat3 & m, T angle); //!< /brief Rotates a 3 * 3 matrix from an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat2 rotate2DGTX(const detail::_xmat2 & m, T angle); //!< /brief Rotates a 2 * 2 matrix from an angle expressed in degrees (from GLM_GTX_transform extension) - template detail::_xmat3 scale2DGTX(const detail::_xmat3 & m, T x, T y); //!< /brief Scales a 3 * 3 matrix using 2 scalars (from GLM_GTX_transform extension) - template detail::_xmat3 scale2DGTX(const detail::_xmat3 & m, const detail::_xvec2 & v); //!< /brief Scales a 3 * 3 matrix using a vector of 2 components (from GLM_GTX_transform extension) - template detail::_xmat2 scale2DGTX(const detail::_xmat2 & m, T x, T y); //!< /brief Scales a 2 * 2 matrix using 2 scalars (from GLM_GTX_transform extension) - template detail::_xmat2 scale2DGTX(const detail::_xmat2 & m, const detail::_xvec2 & v); //!< /brief Scales a 2 * 2 matrix using a vector of 2 components (from GLM_GTX_transform extension) - - namespace gtx - { - //! GLM_GTX_transform extension: Add transformation matrices - namespace transform - { - template inline detail::_xmat4 translate(T x, T y, T z){return translateGTX(x, y, z);} //!< /brief Builds a translation 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat4 translate(const detail::_xvec3 & v){return translateGTX(v);} //!< /brief Builds a translation 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template inline detail::_xmat4 translate(const detail::_xmat4 & m, T x, T y, T z){return translateGTX(m, x, y, z);} //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat4 translate(const detail::_xmat4 & m, const detail::_xvec3 & v){return translateGTX(m, v);} //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template inline detail::_xmat4 rotate(T angle, T x, T y, T z){return rotateGTX(angle, x, y, z);} //!< /brief Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat4 rotate(T angle, const detail::_xvec3 & v){return rotateGTX(angle, v);} //!< /brief Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat4 rotate(const detail::_xmat4 & m, T angle, T x, T y, T z){return rotateGTX(m, angle, x, y, z);} //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat4 rotate(const detail::_xmat4 & m, T angle, const detail::_xvec3 & v){return rotateGTX(m, angle, v);} //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat4 scale(T x, T y, T z){return scaleGTX(x, y, z);} //!< /brief Builds a scale 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat4 scale(const detail::_xvec3 & v){return scaleGTX(v);} //!< /brief Builds a scale 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template inline detail::_xmat4 scale(const detail::_xmat4 & m, T x, T y, T z){return scaleGTX(m, x, y, z);} //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat4 scale(const detail::_xmat4 & m, const detail::_xvec3 & v){return scaleGTX(m, v);} //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - - // 3D - template inline detail::_xmat4 translate3D(const detail::_xmat4 & m, T x, T y, T z){return translate3DGTX(m, x, y, z);} //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat4 translate3D(const detail::_xmat4 & m, const detail::_xvec3 & v){return translate3DGTX(m, v);} //!< /brief Transforms a matrix with a translation 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template inline detail::_xmat4 rotate3D(const detail::_xmat4 & m, T angle, T x, T y, T z){return rotate3DGTX(m, angle, x, y, z);} //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat4 rotate3D(const detail::_xmat4 & m, T angle, const detail::_xvec3 & v){return rotate3DGTX(m, angle, v);} //!< /brief Transforms a matrix with a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat3 rotate3D(const detail::_xmat3 & m, T angle, T x, T y, T z){return rotate3DGTX(m, angle, x, y, z);} //!< /brief Transforms a matrix with a rotation 3 * 3 matrix created from an axis of 3 scalars and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat3 rotate3D(const detail::_xmat3 & m, T angle, const detail::_xvec3 & v){return rotate3DGTX(m, angle, v);} //!< /brief Transforms a matrix with a rotation 3 * 3 matrix created from an axis vector and an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat4 scale3D(const detail::_xmat4 & m, T x, T y, T z){return scale3DGTX(m, x, y, z);} //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat4 scale3D(const detail::_xmat4 & m, const detail::_xvec3 & v){return scale3DGTX(m, v);} //!< /brief Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - template inline detail::_xmat3 scale3D(const detail::_xmat3 & m, T x, T y, T z){return scale3DGTX(m, x, y, z);} //!< /brief Transforms a matrix with a scale 3 * 3 matrix created from 3 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat3 scale3D(const detail::_xmat3 & m, const detail::_xvec3 & v){return scale3DGTX(m, v);} //!< /brief Transforms a matrix with a scale 3 * 3 matrix created from a vector of 3 components (from GLM_GTX_transform extension) - - // 2D - template inline detail::_xmat3 translate2D(const detail::_xmat3 & m, T x, T y){return translate2DGTX(m, x, y);} //!< /brief Translates a 3 * 3 matrix from 2 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat3 translate2D(const detail::_xmat3 & m, const detail::_xvec2 & v){return translate2DGTX(m, v);} //!< /brief Translates a 3 * 3 matrix from a vector of 2 components (from GLM_GTX_transform extension) - template inline detail::_xmat3 rotate2D(const detail::_xmat3 & m, T angle){return rotate2DGTX(m, angle);} //!< /brief Rotates a 3 * 3 matrix from an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat2 rotate2D(const detail::_xmat2 & m, T angle){return rotate2DGTX(m, angle);} //!< /brief Rotates a 2 * 2 matrix from an angle expressed in degrees (from GLM_GTX_transform extension) - template inline detail::_xmat3 scale2D(const detail::_xmat3 & m, T x, T y){return scale2DGTX(m, x, y);} //!< /brief Scales a 3 * 3 matrix using 2 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat3 scale2D(const detail::_xmat3 & m, const detail::_xvec2 & v){return scale2DGTX(m, v);} //!< /brief Scales a 3 * 3 matrix using a vector of 2 components (from GLM_GTX_transform extension) - template inline detail::_xmat2 scale2D(const detail::_xmat2 & m, T x, T y){return scale2DGTX(m, x, y);} //!< /brief Scales a 2 * 2 matrix using 2 scalars (from GLM_GTX_transform extension) - template inline detail::_xmat2 scale2D(const detail::_xmat2 & m, const detail::_xvec2 & v){return scale2DGTX(m, v);} //!< /brief Scales a 2 * 2 matrix using a vector of 2 components (from GLM_GTX_transform extension) - } - } -} - -#define GLM_GTX_transform namespace gtx::transform - -#include "transform.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_transform;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_transform__ diff --git a/experimental/sse/glm/ext/gtx/transform.inl b/experimental/sse/glm/ext/gtx/transform.inl deleted file mode 100644 index 84c5b183..00000000 --- a/experimental/sse/glm/ext/gtx/transform.inl +++ /dev/null @@ -1,334 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/transform.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat4 translateGTX(T x, T y, T z) - { - return translateGTX(detail::_xvec3(x, y , z)); - } - - template - inline detail::_xmat4 translateGTX(const detail::_xvec3& v) - { - detail::_xmat4 result(T(1)); - result[3] = detail::_xvec4(v, T(1)); - return result; - } - - template - inline detail::_xmat4 translateGTX(const detail::_xmat4& m, T x, T y, T z) - { - detail::_xmat4 r; - r[0] = m[0]; - r[1] = m[1]; - r[2] = m[2]; - r[3][0] = m[0][0] * x + m[1][0] * y + m[2][0] * z + m[3][0]; - r[3][1] = m[0][1] * x + m[1][1] * y + m[2][1] * z + m[3][1]; - r[3][2] = m[0][2] * x + m[1][2] * y + m[2][2] * z + m[3][2]; - r[3][3] = m[0][3] * x + m[1][3] * y + m[2][3] * z + m[3][3]; - return r; - } - - template - inline detail::_xmat4 translateGTX(const detail::_xmat4& m, const detail::_xvec3& v) - { - return translateGTX(m, v.x, v.y, v.z); - } - - template - inline detail::_xmat4 rotateGTX(T angle, T x, T y, T z) - { - float a = radians(angle); - float c = cos(a); - float s = sin(a); - detail::_xmat4 Result; - - detail::_xvec3 axis = normalize(detail::_xvec3(x, y, z)); - - Result[0][0] = c + (1 - c) * axis.x * axis.x; - Result[0][1] = (1 - c) * axis.x * axis.y + s * axis.z; - Result[0][2] = (1 - c) * axis.x * axis.z - s * axis.y; - Result[0][3] = 0; - - Result[1][0] = (1 - c) * axis.y * axis.x - s * axis.z; - Result[1][1] = c + (1 - c) * axis.y * axis.y; - Result[1][2] = (1 - c) * axis.y * axis.z + s * axis.x; - Result[1][3] = 0; - - Result[2][0] = (1 - c) * axis.x * axis.z + s * axis.y; - Result[2][1] = (1 - c) * axis.y * axis.z - s * axis.x; - Result[2][2] = c + (1 - c) * axis.z * axis.z; - Result[2][3] = 0; - - Result[3] = detail::_xvec4(0, 0, 0, 1); - return Result; - } - - template - inline detail::_xmat4 rotateGTX(T angle, const detail::_xvec3& v) - { - return rotateGTX(angle, v.x, v.y, v.z); - } - - template - inline detail::_xmat4 rotateGTX(const detail::_xmat4& m, T angle, T x, T y, T z) - { - return m * rotateGTX(angle, x, y, z); - } - - template - inline detail::_xmat4 rotateGTX(const detail::_xmat4& m, T angle, const detail::_xvec3& v) - { - return m * rotateGTX(angle, v.x, v.y, v.z); - } - - template - inline detail::_xmat4 scaleGTX(T x, T y, T z) - { - detail::_xmat4 Result(T(1)); - Result[0][0] = x; - Result[1][1] = y; - Result[2][2] = z; - return Result; - } - - template - inline detail::_xmat4 scaleGTX(const detail::_xvec3& v) - { - return scaleGTX(v.x, v.y, v.z); - } - - template - inline detail::_xmat4 scaleGTX(const detail::_xmat4& m, T x, T y, T z) - { - detail::_xmat4 Result; - Result[0] = m[0] * x; - Result[1] = m[1] * y; - Result[2] = m[2] * z; - Result[3] = m[3]; - return Result; - } - - template - inline detail::_xmat4 scaleGTX(const detail::_xmat4& m, const detail::_xvec3& v) - { - return scaleGTX(m, v.x, v.y, v.z); - } - - ///////////////////////////////////////////////// - template - inline detail::_xmat4 translate3DGTX(const detail::_xmat4& m, T x, T y, T z) - { - detail::_xmat4 r; - r[0] = m[0]; - r[1] = m[1]; - r[2] = m[2]; - r[3][0] = m[0][0] * x + m[1][0] * y + m[2][0] * z + m[3][0]; - r[3][1] = m[0][1] * x + m[1][1] * y + m[2][1] * z + m[3][1]; - r[3][2] = m[0][2] * x + m[1][2] * y + m[2][2] * z + m[3][2]; - r[3][3] = m[0][3] * x + m[1][3] * y + m[2][3] * z + m[3][3]; - return r; - } - - template - inline detail::_xmat4 translate3DGTX(const detail::_xmat4& m, const detail::_xvec3& v) - { - return translate3DGTX(m, v.x, v.y, v.z); - } - - template - inline detail::_xmat4 rotate3DGTX(const detail::_xmat4& m, T angle, T x, T y, T z) - { - T a = radians(angle); - T c = cos(a); - T s = sin(a); - detail::_xmat4 Result; - - detail::_xvec3 axis = normalize(detail::_xvec3(x, y, z)); - - Result[0][0] = c + (1 - c) * axis.x * axis.x; - Result[0][1] = (1 - c) * axis.x * axis.y + s * axis.z; - Result[0][2] = (1 - c) * axis.x * axis.z - s * axis.y; - Result[0][3] = 0; - - Result[1][0] = (1 - c) * axis.y * axis.x - s * axis.z; - Result[1][1] = c + (1 - c) * axis.y * axis.y; - Result[1][2] = (1 - c) * axis.y * axis.z + s * axis.x; - Result[1][3] = 0; - - Result[2][0] = (1 - c) * axis.x * axis.z + s * axis.y; - Result[2][1] = (1 - c) * axis.y * axis.z - s * axis.x; - Result[2][2] = c + (1 - c) * axis.z * axis.z; - Result[2][3] = 0; - - Result[3] = detail::_xvec4(0, 0, 0, 1); - - return m * Result; - } - - template - inline detail::_xmat4 rotate3DGTX(const detail::_xmat4& m, T angle, const detail::_xvec3& v) - { - return rotate3DGTX(m, angle, v.x, v.y, v.z); - } - - template - inline detail::_xmat3 rotate3DGTX(const detail::_xmat3& m, T angle, T x, T y, T z) - { - T a = radians(angle); - T c = cos(a); - T s = sin(a); - detail::_xmat3 Result; - - detail::_xvec3 axis = normalize(detail::_xvec3(x, y, z)); - - Result[0][0] = c + (1 - c) * axis.x * axis.x; - Result[0][1] = (1 - c) * axis.x * axis.y + s * axis.z; - Result[0][2] = (1 - c) * axis.x * axis.z - s * axis.y; - - Result[1][0] = (1 - c) * axis.y * axis.x - s * axis.z; - Result[1][1] = c + (1 - c) * axis.y * axis.y; - Result[1][2] = (1 - c) * axis.y * axis.z + s * axis.x; - - Result[2][0] = (1 - c) * axis.x * axis.z + s * axis.y; - Result[2][1] = (1 - c) * axis.y * axis.z - s * axis.x; - Result[2][2] = c + (1 - c) * axis.z * axis.z; - - return m * Result; - } - - template - inline detail::_xmat3 rotate3DGTX(const detail::_xmat3& m, T angle, const detail::_xvec3& v) - { - return rotate3DGTX(m, angle, v.x, v.y, v.z); - } - - template - inline detail::_xmat4 scale3DGTX(const detail::_xmat4& m, T x, T y, T z) - { - detail::_xmat4 r; - r[0] = m[0] * x; - r[1] = m[1] * y; - r[2] = m[2] * z; - r[3] = m[3]; - return r; - } - - template - inline detail::_xmat4 scale3DGTX(const detail::_xmat4& m, const detail::_xvec3& v) - { - return scale3DGTX(m, v.x, v.y, v.z); - } - - template - inline detail::_xmat3 scale3DGTX(const detail::_xmat3& m, T x, T y, T z) - { - detail::_xmat3 r; - r[0] = m[0] * x; - r[1] = m[1] * y; - r[2] = m[2] * z; - return r; - } - - template - inline detail::_xmat3 scale3DGTX(const detail::_xmat3& m, const detail::_xvec3& v) - { - return scale3DGTX(m, v.x, v.y, v.z); - } - - template - inline detail::_xmat3 translate2DGTX(const detail::_xmat3& m, T x, T y) - { - detail::_xmat3 r; - r[0] = m[0]; - r[1] = m[1]; - r[2] = m[2]; - r[2][0] = m[0][0] * x + m[1][0] * y + m[2][0]; - r[2][1] = m[0][1] * x + m[1][1] * y + m[2][1]; - r[2][2] = m[0][2] * x + m[1][2] * y + m[2][2]; - return r; - } - - template - inline detail::_xmat3 translate2DGTX(const detail::_xmat3& m, const detail::_xvec2& v) - { - return translate2DGTX(m, v.x, v.y); - } - - template - inline detail::_xmat3 rotate2DGTX(const detail::_xmat3& m, T angle) - { - T a = radians(angle); - T c = cos(a); - T s = sin(a); - detail::_xmat3 Result; - - Result[0][0] = c; - Result[0][1] = -s; - Result[0][2] = 0; - - Result[1][0] = s; - Result[1][1] = c; - Result[1][2] = 0; - - Result[2] = detail::_xvec3(0, 0, 1); - - return m * Result; - } - - template - inline detail::_xmat2 rotate2DGTX(const detail::_xmat2& m, T angle) - { - T a = radians(angle); - T c = cos(a); - T s = sin(a); - detail::_xmat2 Result; - - Result[0][0] = c; - Result[0][1] = -s; - - Result[1][0] = s; - Result[1][1] = c; - - return m * Result; - } - - template - inline detail::_xmat3 scale2DGTX(const detail::_xmat3& m, T x, T y) - { - detail::_xmat3 r; - r[0] = m[0] * x; - r[1] = m[1] * y; - r[2] = m[2]; - return r; - } - - template - inline detail::_xmat3 scale2DGTX(const detail::_xmat3& m, const detail::_xvec2& v) - { - return scale2DGTX(m, v.x, v.y); - } - - template - inline detail::_xmat2 scale2DGTX(const detail::_xmat2& m, T x, T y) - { - detail::_xmat2 r; - r[0] = m[0] * x; - r[1] = m[1] * y; - return r; - } - - template - inline detail::_xmat2 scale2DGTX(const detail::_xmat2& m, const detail::_xvec2& v) - { - return scale2DGTX(m, v.x, v.y); - } -} diff --git a/experimental/sse/glm/ext/gtx/transform2.h b/experimental/sse/glm/ext/gtx/transform2.h deleted file mode 100644 index 05973f4e..00000000 --- a/experimental/sse/glm/ext/gtx/transform2.h +++ /dev/null @@ -1,69 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/transform2.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_transform2__ -#define __glm_gtx_transform2__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat3 shearX2DGTX(const detail::_xmat3 & m, T y); //!< /brief Transforms a matrix with a shearing on X axis (from GLM_GTX_transform2 extension) - template detail::_xmat3 shearY2DGTX(const detail::_xmat3 & m, T x); //!< /brief Transforms a matrix with a shearing on Y axis (from GLM_GTX_transform2 extension) - template detail::_xmat4 shearX3DGTX(const detail::_xmat4 & m, T y, T z); //!< /brief Transforms a matrix with a shearing on X axis (from GLM_GTX_transform2 extension) - template detail::_xmat4 shearY3DGTX(const detail::_xmat4 & m, T x, T z); //!< /brief Transforms a matrix with a shearing on Y axis (from GLM_GTX_transform2 extension) - template detail::_xmat4 shearZ3DGTX(const detail::_xmat4 & m, T x, T y); //!< /brief Transforms a matrix with a shearing on Z axis (from GLM_GTX_transform2 extension) - //template detail::_xmat4 shearGTX(const detail::_xmat4 & m, shearPlane, planePoint, angle) - // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 - // - dot(PointOnPlane, normal) * OnPlaneVector 1 - - // Reflect functions seem to don't work - template detail::_xmat3 reflect2DGTX(const detail::_xmat3 & m, const detail::_xvec3& normal); - template detail::_xmat4 reflect3DGTX(const detail::_xmat4 & m, const detail::_xvec3& normal); - template detail::_xmat3 proj2DGTX(const detail::_xmat3 & m, const detail::_xvec3& normal); //!< /brief Build planar projection matrix along normal axis (from GLM_GTX_transform2 extension) - template detail::_xmat4 proj3DGTX(const detail::_xmat4 & m, const detail::_xvec3& normal); //!< /brief Build planar projection matrix along normal axis (from GLM_GTX_transform2 extension) - template detail::_xmat4 lookAtGTX(const detail::_xvec3& eye, const detail::_xvec3& center, const detail::_xvec3& up); //!< /brief Build a look at view matrix (from GLM_GTX_transform2 extension) - - namespace gtx - { - //! GLM_GTX_transform2 extension: Add extra transformation matrices - namespace transform2 - { - template inline detail::_xmat3 shearX2D(const detail::_xmat3 & m, T y){return shearX2DGTX(m, y);} //!< /brief Transforms a matrix with a shearing on X axis (from GLM_GTX_transform2 extension) - template inline detail::_xmat3 shearY2D(const detail::_xmat3 & m, T x){return shearY2DGTX(m, x);} //!< /brief Transforms a matrix with a shearing on Y axis (from GLM_GTX_transform2 extension) - template inline detail::_xmat4 shearX3D(const detail::_xmat4 & m, T y, T z){return shearX3DGTX(m, y, z);} //!< /brief Transforms a matrix with a shearing on X axis (from GLM_GTX_transform2 extension) - template inline detail::_xmat4 shearY3D(const detail::_xmat4 & m, T x, T z){return shearY3DGTX(m, x, z);} //!< /brief Transforms a matrix with a shearing on Y axis (from GLM_GTX_transform2 extension) - template inline detail::_xmat4 shearZ3D(const detail::_xmat4 & m, T x, T y){return shearZ3DGTX(m, x, y);} //!< /brief Transforms a matrix with a shearing on Z axis (from GLM_GTX_transform2 extension) - //template inline detail::_xmat4 shear(const detail::_xmat4 & m, shearPlane, planePoint, angle) - // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 - // - dot(PointOnPlane, normal) * OnPlaneVector 1 - - // Reflect functions seem to don't work - template inline detail::_xmat3 reflect2D(const detail::_xmat3 & m, const detail::_xvec3& normal){return reflect2DGTX(m, normal);} - template inline detail::_xmat4 reflect3D(const detail::_xmat4 & m, const detail::_xvec3& normal){return reflect3DGTX(m, normal);} - template inline detail::_xmat3 proj2D(const detail::_xmat3 & m, const detail::_xvec3& normal){return proj2DGTX(m, normal);} //!< /brief Build planar projection matrix along normal axis (from GLM_GTX_transform2 extension) - template inline detail::_xmat4 proj3D(const detail::_xmat4 & m, const detail::_xvec3& normal){return proj3DGTX(m, normal);} //!< /brief Build planar projection matrix along normal axis (from GLM_GTX_transform2 extension) - template inline detail::_xmat4 lookAt(const detail::_xvec3& eye, const detail::_xvec3& center, const detail::_xvec3& up){return lookAtGTX(eye, center, up);} //!< /brief Build a look at view matrix (from GLM_GTX_transform2 extension) - } - } -} - -#define GLM_GTX_transform2 namespace gtx::transform2 - -#include "transform2.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_transform2;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_transform2__ diff --git a/experimental/sse/glm/ext/gtx/transform2.inl b/experimental/sse/glm/ext/gtx/transform2.inl deleted file mode 100644 index 06ee280c..00000000 --- a/experimental/sse/glm/ext/gtx/transform2.inl +++ /dev/null @@ -1,136 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-02-28 -// Updated : 2005-04-23 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/transform2.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat3 shearX2DGTX(const detail::_xmat3& m, T s) - { - detail::_xmat3 r(1); - r[0][1] = s; - return m * r; - } - - template - inline detail::_xmat3 shearY2DGTX(const detail::_xmat3& m, T s) - { - detail::_xmat3 r(1); - r[1][0] = s; - return m * r; - } - - template - inline detail::_xmat4 shearX3DGTX(const detail::_xmat4& m, T s, T t) - { - detail::_xmat4 r(1); - r[1][0] = s; - r[2][0] = t; - return m * r; - } - - template - inline detail::_xmat4 shearY3DGTX(const detail::_xmat4& m, T s, T t) - { - detail::_xmat4 r(1); - r[0][1] = s; - r[2][1] = t; - return m * r; - } - - template - inline detail::_xmat4 shearZ3DGTX(const detail::_xmat4& m, T s, T t) - { - detail::_xmat4 r(1); - r[0][2] = s; - r[1][2] = t; - return m * r; - } - - template - inline detail::_xmat3 reflect2DGTX(const detail::_xmat3& m, const detail::_xvec3& normal) - { - detail::_xmat3 r(1); - r[0][0] = 1 - 2 * normal.x * normal.x; - r[0][1] = -2 * normal.x * normal.y; - r[1][0] = -2 * normal.x * normal.y; - r[1][1] = 1 - 2 * normal.y * normal.y; - return m * r; - } - - template - inline detail::_xmat4 reflect3DGTX(const detail::_xmat4& m, const detail::_xvec3& normal) - { - detail::_xmat4 r(1); - r[0][0] = 1 - 2 * normal.x * normal.x; - r[0][1] = -2 * normal.x * normal.y; - r[0][2] = -2 * normal.x * normal.z; - - r[1][0] = -2 * normal.x * normal.y; - r[1][1] = 1 - 2 * normal.y * normal.y; - r[1][2] = -2 * normal.y * normal.z; - - r[2][0] = -2 * normal.x * normal.z; - r[2][1] = -2 * normal.y * normal.z; - r[2][2] = 1 - 2 * normal.z * normal.z; - return m * r; - } - - template - inline detail::_xmat3 proj2DGTX(const detail::_xmat3& m, const detail::_xvec3& normal) - { - detail::_xmat3 r(1); - r[0][0] = 1 - normal.x * normal.x; - r[0][1] = - normal.x * normal.y; - r[1][0] = - normal.x * normal.y; - r[1][1] = 1 - normal.y * normal.y; - return m * r; - } - - template - inline detail::_xmat4 proj3DGTX(const detail::_xmat4& m, const detail::_xvec3& normal) - { - detail::_xmat4 r(1); - r[0][0] = 1 - normal.x * normal.x; - r[0][1] = - normal.x * normal.y; - r[0][2] = - normal.x * normal.z; - r[1][0] = - normal.x * normal.y; - r[1][1] = 1 - normal.y * normal.y; - r[1][2] = - normal.y * normal.z; - r[2][0] = - normal.x * normal.z; - r[2][1] = - normal.y * normal.z; - r[2][2] = 1 - normal.z * normal.z; - return m * r; - } - - template - inline detail::_xmat4 lookAtGTX(const detail::_xvec3& eye, const detail::_xvec3& center, const detail::_xvec3& up) - { - detail::_xvec3 f = normalize(center - eye); - detail::_xvec3 u = normalize(up); - detail::_xvec3 s = normalize(cross(f, u)); - u = cross(s, f); - - detail::_xmat4 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 translate3DGTX - Result[3][0] =-dot(s, eye); - Result[3][1] =-dot(y, eye); - Result[3][2] = dot(f, eye); - */ - return translate3DGTX(Result, -eye); - } -} diff --git a/experimental/sse/glm/ext/gtx/transpose.h b/experimental/sse/glm/ext/gtx/transpose.h deleted file mode 100644 index a00aab10..00000000 --- a/experimental/sse/glm/ext/gtx/transpose.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/transpose.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_transpose__ -#define __glm_gtx_transpose__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xmat2 transposeGTX(const detail::_xmat2& x); //!< - Deprecated - Returns the transposed 2 * 2 matrix of x (From GLM_GTX_transpose extension) - template detail::_xmat3 transposeGTX(const detail::_xmat3& x); //!< - Deprecated - Returns the transposed 3 * 3 matrix of x (From GLM_GTX_transpose extension) - template detail::_xmat4 transposeGTX(const detail::_xmat4& x); //!< - Deprecated - Returns the transposed 4 * 4 matrix of x (From GLM_GTX_transpose extension) - - namespace gtx - { - //! GLM_GTX_transpose extension: - Deprecated - Use GLM core function instead - namespace transpose - { - template inline detail::_xmat2 transpose(const detail::_xmat2& x){return transposeGTX(x);} //!< - Deprecated - Returns the transposed 2 * 2 matrix of x (From GLM_GTX_transpose extension) - template inline detail::_xmat3 transpose(const detail::_xmat3& x){return transposeGTX(x);} //!< - Deprecated - Returns the transposed 3 * 3 matrix of x (From GLM_GTX_transpose extension) - template inline detail::_xmat4 transpose(const detail::_xmat4& x){return transposeGTX(x);} //!< - Deprecated - Returns the transposed 4 * 4 matrix of x (From GLM_GTX_transpose extension) - } - } -} - -#define GLM_GTX_transpose namespace gtx::transpose - -#include "transpose.inl" -/* Deprecated -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_transpose;} -#endif//GLM_GTX_INCLUDED -*/ -#endif//__glm_gtx_transpose__ diff --git a/experimental/sse/glm/ext/gtx/transpose.inl b/experimental/sse/glm/ext/gtx/transpose.inl deleted file mode 100644 index b7df22a0..00000000 --- a/experimental/sse/glm/ext/gtx/transpose.inl +++ /dev/null @@ -1,66 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/transpose.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xmat2 transposeGTX(const detail::_xmat2& m) - { - detail::_xmat2 Transpose; - Transpose[0][0] = m[0][0]; - Transpose[0][1] = m[1][0]; - Transpose[1][0] = m[0][1]; - Transpose[1][1] = m[1][1]; - return Transpose; - } - - template - inline detail::_xmat3 transposeGTX(const detail::_xmat3& m) - { - detail::_xmat3 Transpose; - Transpose[0][0] = m[0][0]; - Transpose[0][1] = m[1][0]; - Transpose[0][2] = m[2][0]; - - Transpose[1][0] = m[0][1]; - Transpose[1][1] = m[1][1]; - Transpose[1][2] = m[2][1]; - - Transpose[2][0] = m[0][2]; - Transpose[2][1] = m[1][2]; - Transpose[2][2] = m[2][2]; - return Transpose; - } - - template - inline detail::_xmat4 transposeGTX(const detail::_xmat4& m) - { - detail::_xmat4 Transpose; - Transpose[0][0] = m[0][0]; - Transpose[0][1] = m[1][0]; - Transpose[0][2] = m[2][0]; - Transpose[0][3] = m[3][0]; - - Transpose[1][0] = m[0][1]; - Transpose[1][1] = m[1][1]; - Transpose[1][2] = m[2][1]; - Transpose[1][3] = m[3][1]; - - Transpose[2][0] = m[0][2]; - Transpose[2][1] = m[1][2]; - Transpose[2][2] = m[2][2]; - Transpose[2][3] = m[3][2]; - - Transpose[3][0] = m[0][3]; - Transpose[3][1] = m[1][3]; - Transpose[3][2] = m[2][3]; - Transpose[3][3] = m[3][3]; - return Transpose; - } -} diff --git a/experimental/sse/glm/ext/gtx/unsigned_int.h b/experimental/sse/glm/ext/gtx/unsigned_int.h deleted file mode 100644 index ae21d450..00000000 --- a/experimental/sse/glm/ext/gtx/unsigned_int.h +++ /dev/null @@ -1,47 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-24 -// Updated : 2006-11-14 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/unsigned_int.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_unsigned_int -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_unsigned_int__ -#define __glm_gtx_unsigned_int__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/integer.h" - -namespace glm -{ - unsigned int powGTX(unsigned int x, unsigned int y); //!< \brief Returns x raised to the y power. (From GLM_GTX_unsigned_int extensions) - unsigned int sqrtGTX(unsigned int x); //!< \brief Returns the positive square root of x. (From GLM_GTX_unsigned_int extensions) - unsigned int modGTX(unsigned int x, unsigned int y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_unsigned_int extensions) - - namespace gtx - { - //! GLM_GTX_unsigned_int extension: Add support for unsigned integer for core functions - namespace unsigned_int - { - inline unsigned int pow(unsigned int x, unsigned int y){return powGTX(x, y);} //!< \brief Returns x raised to the y power. (From GLM_GTX_unsigned_int extensions) - inline unsigned int sqrt(unsigned int x){return sqrtGTX(x);} //!< \brief Returns the positive square root of x. (From GLM_GTX_unsigned_int extensions) - inline unsigned int mod(unsigned int x, unsigned int y){return modGTX(x, y);} //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_unsigned_int extensions) - } - } -} - -#define GLM_GTX_unsigned_int namespace gtx::unsigned_int; using namespace gtx::integer - -#include "unsigned_int.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_unsigned_int;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_unsigned_int__ diff --git a/experimental/sse/glm/ext/gtx/unsigned_int.inl b/experimental/sse/glm/ext/gtx/unsigned_int.inl deleted file mode 100644 index ae0d8121..00000000 --- a/experimental/sse/glm/ext/gtx/unsigned_int.inl +++ /dev/null @@ -1,40 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-24 -// Updated : 2006-12-06 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/unsigned_int.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - inline unsigned int powGTX(unsigned int x, unsigned int y) - { - unsigned int result = x; - for(unsigned int i = 1; i < y; ++i) - result *= x; - return result; - } - - inline unsigned int sqrtGTX(unsigned int x) - { - if(x <= 1) return x; - - unsigned int NextTrial = x >> 1; - unsigned int CurrentAnswer; - - do - { - CurrentAnswer = NextTrial; - NextTrial = (NextTrial + x / NextTrial) >> 1; - } while(NextTrial < CurrentAnswer); - - return CurrentAnswer; - } - - inline unsigned int modGTX(unsigned int x, unsigned int y) - { - return x - y * (x / y); - } -} diff --git a/experimental/sse/glm/ext/gtx/vector_access.h b/experimental/sse/glm/ext/gtx/vector_access.h deleted file mode 100644 index e30cb2a4..00000000 --- a/experimental/sse/glm/ext/gtx/vector_access.h +++ /dev/null @@ -1,64 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-16 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_access.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_double -// - GLM_GTX_half -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_vector_access__ -#define __glm_gtx_vector_access__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/half.h" -#include "../gtx/double.h" - -namespace glm -{ -/* - void setGTX(float& v, float x); - void setGTX(int& v, int x); - void setGTX(bool& v, bool x); - void setGTX(double& v, double x); - void setGTX(__halfGTX& v, __halfGTX x); -*/ - template void setGTX(detail::_xvec2& v, T x, T y); //!< \brief Sets values to a 2 components vector of floating-point numbers or integers (from GLM_GTX_vector_access extension) - template void setGTX(detail::_xvec3& v, T x, T y, T z); //!< \brief Sets values to a 3 components vector of floating-point numbers or integers (from GLM_GTX_vector_access extension) - template void setGTX(detail::_xvec4& v, T x, T y, T z, T w); //!< \brief Sets values to a 4 components vector of floating-point numbers or integers (from GLM_GTX_vector_access extension) - - void setGTX(detail::_bvec2& v, bool x, bool y); //!< \brief Sets values to a 2 components vector of booleans (from GLM_GTX_vector_access extension) - void setGTX(detail::_bvec3& v, bool x, bool y, bool z); //!< \brief Sets values to a 3 components vector of booleans (from GLM_GTX_vector_access extension) - void setGTX(detail::_bvec4& v, bool x, bool y, bool z, bool w); //!< \brief Sets values to a 4 components vector of booleans (from GLM_GTX_vector_access extension) - - namespace gtx - { - //! GLM_GTX_vector_access extension: Function to set values to vectors - namespace vector_access - { - template void set(detail::_xvec2& v, T x, T y){setGTX(v, x, y);} //!< \brief Sets values to a 2 components vector of floating-point numbers or integers (from GLM_GTX_vector_access extension) - template void set(detail::_xvec3& v, T x, T y, T z){setGTX(v, x, y, z);} //!< \brief Sets values to a 3 components vector of floating-point numbers or integers (from GLM_GTX_vector_access extension) - template void set(detail::_xvec4& v, T x, T y, T z, T w){setGTX(v, x, y, z, w);} //!< \brief Sets values to a 4 components vector of floating-point numbers or integers (from GLM_GTX_vector_access extension) - - inline void set(detail::_bvec2& v, bool x, bool y){setGTX(v, x, y);} //!< \brief Sets values to a 2 components vector of booleans (from GLM_GTX_vector_access extension) - inline void set(detail::_bvec3& v, bool x, bool y, bool z){setGTX(v, x, y, z);} //!< \brief Sets values to a 3 components vector of booleans (from GLM_GTX_vector_access extension) - inline void set(detail::_bvec4& v, bool x, bool y, bool z, bool w){setGTX(v, x, y, z, w);} //!< \brief Sets values to a 4 components vector of booleans (from GLM_GTX_vector_access extension) - } - } -} - -#define GLM_GTX_vector_access namespace gtx::vector_access - -#include "vector_access.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_vector_access;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_vector_access__ diff --git a/experimental/sse/glm/ext/gtx/vector_access.inl b/experimental/sse/glm/ext/gtx/vector_access.inl deleted file mode 100644 index a2ad8ede..00000000 --- a/experimental/sse/glm/ext/gtx/vector_access.inl +++ /dev/null @@ -1,82 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-01-16 -// Updated : 2006-01-16 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_access.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ -/* - inline void setGTX(float& v, float x) - { - v = x; - } - - inline void setGTX(int& v, int x) - { - v = x; - } - - inline void setGTX(bool& v, bool x) - { - v = x; - } - - inline void setGTX(double& v, double x) - { - v = x; - } - - inline void setGTX(__halfGTX& v, __halfGTX x) - { - v = x; - } -*/ - template - inline void setGTX(detail::_xvec2& v, T x, T y) - { - v.x = x; - v.y = y; - } - - template - inline void setGTX(detail::_xvec3& v, T x, T y, T z) - { - v.x = x; - v.y = y; - v.z = z; - } - - template - inline void setGTX(detail::_xvec4& v, T x, T y, T z, T w) - { - v.x = x; - v.y = y; - v.z = z; - v.w = w; - } - - inline void setGTX(detail::_bvec2& v, bool x, bool y) - { - v.x = x; - v.y = y; - } - - inline void setGTX(detail::_bvec3& v, bool x, bool y, bool z) - { - v.x = x; - v.y = y; - v.z = z; - } - - inline void setGTX(detail::_bvec4& v, bool x, bool y, bool z, bool w) - { - v.x = x; - v.y = y; - v.z = z; - v.w = w; - } -} diff --git a/experimental/sse/glm/ext/gtx/vector_angle.h b/experimental/sse/glm/ext/gtx/vector_angle.h deleted file mode 100644 index b4c03df5..00000000 --- a/experimental/sse/glm/ext/gtx/vector_angle.h +++ /dev/null @@ -1,56 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-30 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_angle.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -// - GLM_GTX_quaternion -// - GLM_GTX_epsilon -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_vector_angle__ -#define __glm_gtx_vector_angle__ - -// Dependency: -#include "../../glm.h" -#include "../gtx/quaternion.h" -#include "../gtx/epsilon.h" - -namespace glm -{ - template T angleGTX(const T x, const T y); //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - template T angleGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - template T angleGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - template T angleGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - template T orientedAngleGTX(const detail::_xvec2& x, const detail::_xvec2& y); //!< Returns the oriented angle between x and y (From GLM_GTX_vector_angle extension) - template T orientedAngleGTX(const detail::_xvec3& x, const detail::_xvec3& y); //!< Returns the oriented angle between x and y (From GLM_GTX_vector_angle extension) - template T orientedAngleGTX(const detail::_xvec4& x, const detail::_xvec4& y); //!< Returns the oriented angle between x and y (From GLM_GTX_vector_angle extension) - - namespace gtx - { - //! GLM_GTX_vector_angle extension: Compute angle between vectors - namespace vector_angle - { - template inline T angle(const T x, const T y){return angleGTX(x, y);} //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - template inline T angle(const detail::_xvec2& x, const detail::_xvec2& y){return angleGTX(x, y);} //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - template inline T angle(const detail::_xvec3& x, const detail::_xvec3& y){return angleGTX(x, y);} //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - template inline T angle(const detail::_xvec4& x, const detail::_xvec4& y){return angleGTX(x, y);} //!< Returns the absolute angle between x and y (From GLM_GTX_vector_angle extension) - - template inline GLMvalType orientedAngle(const genType& x, const genType& y){return orientedAngleGTX(x, y);} //!< Returns the oriented angle between x and y (From GLM_GTX_vector_angle extension) - } - } -} - -#define GLM_GTX_vector_angle namespace gtx::vector_angle - -#include "vector_angle.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_vector_angle;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_vector_angle__ diff --git a/experimental/sse/glm/ext/gtx/vector_angle.inl b/experimental/sse/glm/ext/gtx/vector_angle.inl deleted file mode 100644 index 297977a6..00000000 --- a/experimental/sse/glm/ext/gtx/vector_angle.inl +++ /dev/null @@ -1,82 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-30 -// Updated : 2005-12-30 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_angle.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline T angleGTX(const T x, const T y) - { - return degrees(acos(dot(x, y))); - } - - template - inline T angleGTX( - const detail::_xvec2& x, - const detail::_xvec2& y) - { - return degrees(acos(dot(x, y))); - } - - template - inline T angleGTX( - const detail::_xvec3& x, - const detail::_xvec3& y) - { - return degrees(acos(dot(x, y))); - } - - template - inline T angleGTX( - const detail::_xvec4& x, - const detail::_xvec4& y) - { - return degrees(acos(dot(x, y))); - } - - template - inline T orientedAngleGTX( - const detail::_xvec2& x, - const detail::_xvec2& y) - { - T Angle = acos(dot(x, y)); - T c = cos(Angle); - T s = sin(Angle); - detail::_xvec2 TransformedVector = detail::_xvec2(c * y.x - s * y.y, s * y.x + c * y.y); - if(all(equalEpsilonGTX(x, TransformedVector, T(0.01)))) - return -degrees(Angle); - else - return degrees(Angle); - } - - template - inline T orientedAngleGTX( - const detail::_xvec3& x, - const detail::_xvec3& y) - { - T Angle = degrees(acos(dot(x, y))); - detail::_xvec3 TransformedVector = rotateGTX(__quatGTX(), Angle, cross(x, y)) * y; - if(all(equalEpsilonGTX(x, TransformedVector, T(0.01)))) - return -degrees(Angle); - else - return degrees(Angle); - } - - template - inline T orientedAngleGTX( - const detail::_xvec4& x, - const detail::_xvec4& y) - { - T Angle = degrees(acos(dot(x, y))); - detail::_xvec4 TransformedVector = rotateGTX(__quatGTX(), Angle, cross(x, y)) * y; - if(all(equalEpsilonGTX(x, TransformedVector, T(0.01)))) - return -degrees(Angle); - else - return degrees(Angle); - } -} diff --git a/experimental/sse/glm/ext/gtx/vector_comp_mult.h b/experimental/sse/glm/ext/gtx/vector_comp_mult.h deleted file mode 100644 index 47303286..00000000 --- a/experimental/sse/glm/ext/gtx/vector_comp_mult.h +++ /dev/null @@ -1,56 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2006-11-13 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_comp_mult.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Note: -// mat4 m; -// vec4 v; -// ... -// vec4 Result = transposeGTX(m) * v; -// Same result as the following, but it's faster by avoiding the matrix transpose: -// vec4 Result = vectorCompMultGTX(m, v); -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Note: -// - This extension is deprecated, use the operator vec* * mat* instead. -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_vector_comp_mult__ -#define __glm_gtx_vector_comp_mult__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template detail::_xvec2 vectorCompMultGTX(const detail::_xmat2& x, const detail::_xvec2& y); //!< - Deprecated - Returns the result of the product between the transposed 2 * 2 matrix of x and the 2 component vector y. Deprecated, prefer vec2 * mat2 operator (From GLM_GTX_vector_comp_mult extension) - template detail::_xvec3 vectorCompMultGTX(const detail::_xmat3& x, const detail::_xvec3& y); //!< - Deprecated - Returns the result of the product between the transposed 3 * 3 matrix of x and the 3 component vector y. Deprecated, prefer vec3 * mat3 operator (From GLM_GTX_vector_comp_mult extension) - template detail::_xvec4 vectorCompMultGTX(const detail::_xmat4& x, const detail::_xvec4& y); //!< - Deprecated - Returns the result of the product between the transposed 4 * 4 matrix of x and the 4 component vector y. Deprecated, prefer vec4 * mat4 operator (From GLM_GTX_vector_comp_mult extension) - - namespace gtx - { - //! GLM_GTX_vector_comp_mult extension: - Deprecated - Revert matrix and vector product instead with core operators - namespace vector_comp_mult - { - template inline detail::_xvec2 vectorCompMult(const detail::_xmat2& x, const detail::_xvec2& y){return vectorCompMultGTX(x, y);} //!< - Deprecated - Returns the result of the product between the transposed 2 * 2 matrix of x and the 2 component vector y. Deprecated, prefer vec2 * mat2 operator (From GLM_GTX_vector_comp_mult extension) - template inline detail::_xvec3 vectorCompMult(const detail::_xmat3& x, const detail::_xvec3& y){return vectorCompMultGTX(x, y);} //!< - Deprecated - Returns the result of the product between the transposed 3 * 3 matrix of x and the 3 component vector y. Deprecated, prefer vec3 * mat3 operator (From GLM_GTX_vector_comp_mult extension) - template inline detail::_xvec4 vectorCompMult(const detail::_xmat4& x, const detail::_xvec4& y){return vectorCompMultGTX(x, y);} //!< - Deprecated - Returns the result of the product between the transposed 4 * 4 matrix of x and the 4 component vector y. Deprecated, prefer vec4 * mat4 operator (From GLM_GTX_vector_comp_mult extension) - } - } -} - -#define GLM_GTX_vector_comp_mult namespace gtx::vector_comp_mult - -#include "vector_comp_mult.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_vector_comp_mult;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_vector_comp_mult__ diff --git a/experimental/sse/glm/ext/gtx/vector_comp_mult.inl b/experimental/sse/glm/ext/gtx/vector_comp_mult.inl deleted file mode 100644 index 7a5acc57..00000000 --- a/experimental/sse/glm/ext/gtx/vector_comp_mult.inl +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-12-21 -// Updated : 2005-12-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_comp_mult.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline detail::_xvec2 vectorCompMultGTX(const detail::_xmat2& m, const detail::_xvec2& v) - { - return detail::_xvec2( - m[0][0] * v.x + m[0][1] * v.y, - m[1][0] * v.x + m[1][1] * v.y); - } - - template - inline detail::_xvec3 vectorCompMultGTX(const detail::_xmat3& m, const detail::_xvec3& v) - { - return detail::_xvec3( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); - } - - template - inline detail::_xvec4 vectorCompMultGTX(const detail::_xmat4& m, const detail::_xvec4& v) - { - return detail::_xvec4( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w, - m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w); - } -} diff --git a/experimental/sse/glm/ext/gtx/vector_query.h b/experimental/sse/glm/ext/gtx/vector_query.h deleted file mode 100644 index ec4b5bb6..00000000 --- a/experimental/sse/glm/ext/gtx/vector_query.h +++ /dev/null @@ -1,69 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-05 -// Updated : 2007-03-05 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_query.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_vector_query__ -#define __glm_gtx_vector_query__ - -// Dependency: -#include "../../glm.h" -#include - -namespace glm -{ - template bool areCollinearGTX(const detail::_xvec2& v0, const detail::_xvec2& v1, const T epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are collinears (From GLM_GTX_vector_query extensions) - template bool areCollinearGTX(const detail::_xvec3& v0, const detail::_xvec3& v1, const T epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are collinears (From GLM_GTX_vector_query extensions) - template bool areCollinearGTX(const detail::_xvec4& v0, const detail::_xvec4& v1, const T epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are collinears (From GLM_GTX_vector_query extensions) - - template bool areOppositeGTX(const detail::_xvec2& v0, const detail::_xvec2& v1, const T epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are opposite (From GLM_GTX_vector_query extensions) - template bool areOppositeGTX(const detail::_xvec3& v0, const detail::_xvec3& v1, const T epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are opposite (From GLM_GTX_vector_query extensions) - template bool areOppositeGTX(const detail::_xvec4& v0, const detail::_xvec4& v1, const T epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are opposite (From GLM_GTX_vector_query extensions) - - template bool areOrthogonalGTX(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are orthogonal (From GLM_GTX_vector_query extensions) - - template bool isNormalizedGTX(const genType& v, const GLMvalType epsilon = std::numeric_limits::epsilon()); //!< Check if a vector is normalized (From GLM_GTX_vector_query extensions) - - template bool isNullGTX(const genType& v, const GLMvalType epsilon = std::numeric_limits::epsilon()); //!< Check if a vector is null (From GLM_GTX_vector_query extensions) - - template bool isCompNullGTX(const float s, const T epsilon = std::numeric_limits::epsilon()); //!< Check if each vector component is null (From GLM_GTX_vector_query extensions) - template bvec2 isCompNullGTX(const detail::_xvec2& v, const T epsilon = std::numeric_limits::epsilon()); //!< Check if each vector component is null (From GLM_GTX_vector_query extensions) - template bvec3 isCompNullGTX(const detail::_xvec3& v, const T epsilon = std::numeric_limits::epsilon()); //!< Check if each vector component is null (From GLM_GTX_vector_query extensions) - template bvec4 isCompNullGTX(const detail::_xvec4& v, const T epsilon = std::numeric_limits::epsilon()); //!< Check if each vector component is null (From GLM_GTX_vector_query extensions) - - template bool areOrthonormalGTX(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are orthonormal (From GLM_GTX_vector_query extensions) - - template bool areSimilarGTX(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()); //!< Check if two vectors are similar (From GLM_GTX_vector_query extensions) - - namespace gtx - { - //! GLM_GTX_vector_query extension: Query informations of vector types - namespace vector_query - { - template inline bool areCollinear(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()){return areCollinearGTX(v0, v1, epsilon);} //!< Check if two vectors are collinears (From GLM_GTX_vector_query extensions) - template inline bool areOpposite(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()){return areOppositeGTX(v0, v1, epsilon);} //!< Check if two vectors are opposites (From GLM_GTX_vector_query extensions) - template inline bool areOrthogonal(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()){return areOrthogonalGTX(v0, v1, epsilon);} //!< Check if two vectors are orthogonals (From GLM_GTX_vector_query extensions) - template inline bool isNormalized(const genType& v, const GLMvalType epsilon = std::numeric_limits::epsilon()){return isNormalizedGTX(v, epsilon);} //!< Check if a vector is normalized (From GLM_GTX_vector_query extensions) - template inline bool isNull(const genType& v, const GLMvalType epsilon = std::numeric_limits::epsilon()){return isNullGTX(v, epsilon);} //!< Check if a vector is null (From GLM_GTX_vector_query extensions) - template inline bool areOrthonormal(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()){return areOrthonormalGTX(v0, v1, epsilon);} //!< Check if two vectors are orthonormal (From GLM_GTX_vector_query extensions) - template inline bool areSimilar(const genType& v0, const genType& v1, const GLMvalType epsilon = std::numeric_limits::epsilon()){return areSimilarGTX(v0, v1, epsilon);} //!< Check if two vectors are similar (From GLM_GTX_vector_query extensions) - } - } -} - -#define GLM_GTX_vector_query namespace gtx::vector_query - -#include "vector_query.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_vector_query;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_vector_query__ diff --git a/experimental/sse/glm/ext/gtx/vector_query.inl b/experimental/sse/glm/ext/gtx/vector_query.inl deleted file mode 100644 index 4a54e77c..00000000 --- a/experimental/sse/glm/ext/gtx/vector_query.inl +++ /dev/null @@ -1,233 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-03-05 -// Updated : 2007-03-05 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vector_query.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm -{ - template - inline bool areCollinearGTX(const detail::_xvec2& v0, const detail::_xvec2& v1, const T epsilon) - { - return length(cross(detail::_xvec3(v0, T(0)), detail::_xvec3(v1, T(0)))) < epsilon; - } - - template - inline bool areCollinearGTX(const detail::_xvec3& v0, const detail::_xvec3& v1, const T epsilon) - { - return length(cross(v0, v1)) < epsilon; - } - - template - inline bool areCollinearGTX(const detail::_xvec4& v0, const detail::_xvec4& v1, const T epsilon) - { - return length(cross(detail::_xvec3(v0), detail::_xvec3(v1))) < epsilon; - } - - template - inline bool areOppositeGTX(const genType& v0, const genType& v1, const GLMvalType epsilon) - { - assert(isNormalized(v0) && isNormalized(v1)); - return((genType::value_type(1) + dot(v0, v1)) <= epsilon); - } -/* - template - inline bool areOppositeGTX(const _xvec2& v0, const _xvec2& v1, const T epsilon) - { - assert(isNormalized(v0) && isNormalized(v1)); - return((T(1) + dot(v0, v1)) <= epsilon); - } - - template - inline bool areOppositeGTX(const _xvec3& v0, const _xvec3& v1, const T epsilon) - { - assert(isNormalized(v0) && isNormalized(v1)); - return((T(1) + dot(v0, v1)) <= epsilon); - } - - template - inline bool areOppositeGTX(const _xvec4& v0, const _xvec4& v1, const T epsilon) - { - assert(isNormalized(v0) && isNormalized(v1)); - return((T(1) + dot(v0, v1)) <= epsilon); - } -*/ - template - inline bool areOrthogonalGTX(const genType& v0, const genType& v1, const GLMvalType epsilon) - { - return abs(dot(v0, v1)) <= max(GLMvalType(1), length(v0)) * max(GLMvalType(1), length(v1)) * epsilon; - } -/* - template - inline bool areOrthogonalGTX(const _xvec2& v0, const _xvec2& v1, const T epsilon) - { - return abs(dot(v0, v1)) <= max(T(1), length(v0)) * max(T(1), length(v1)) * epsilon; - } - - template - inline bool areOrthogonalGTX(const _xvec3& v0, const _xvec3& v1, const T epsilon) - { - return abs(dot(v0, v1)) <= max(T(1), length(v0)) * max(T(1), length(v1)) * epsilon; - } - - template - inline bool areOrthogonalGTX(const _xvec4& v0, const _xvec4& v1, const T epsilon) - { - return abs(dot(v0, v1)) <= max(T(1), length(v0)) * max(T(1), length(v1)) * epsilon; - } -*/ - - template - inline bool isNormalizedGTX(const genType& v, const GLMvalType epsilon) - { - return abs(length(v) - GLMvalType(1)) <= GLMvalType(2) * epsilon; - } -/* - template - inline bool isNormalizedGTX(const _xvec2& v, const T epsilon) - { - return abs(length(v) - T(1)) <= T(2) * epsilon; - } - - template - inline bool isNormalizedGTX(const _xvec3& v, const T epsilon) - { - return abs(length(v) - T(1)) <= T(2) * epsilon; - } - - template - inline bool isNormalizedGTX(const _xvec4& v, const T epsilon) - { - return abs(length(v) - T(1)) <= T(2) * epsilon; - } -*/ - template - inline bool isNullGTX(const genType& v, const GLMvalType epsilon) - { - return length(v) <= epsilon; - } -/* - template - inline bool isNullGTX(const _xvec2& v, const T epsilon) - { - return length(v) <= epsilon; - } - - template - inline bool isNullGTX(const _xvec3& v, const T epsilon) - { - return length(v) <= epsilon; - } - - template - inline bool isNullGTX(const _xvec4& v, const T epsilon) - { - return length(v) <= epsilon; - } -*/ - - template - inline bool isCompNullGTX(const T s, const T epsilon) - { - return abs(s) < epsilon; - } - - template - inline bvec2 isCompNullGTX(const detail::_xvec2& v, const T epsilon) - { - return bvec2( - (abs(v.x) < epsilon), - (abs(v.y) < epsilon)); - } - - template - inline bvec3 isCompNullGTX(const detail::_xvec3& v, const T epsilon) - { - return bvec3( - abs(v.x) < epsilon, - abs(v.y) < epsilon, - abs(v.z) < epsilon); - } - - template - inline bvec4 isCompNullGTX(const detail::_xvec4& v, const T epsilon) - { - return bvec4( - abs(v.x) < epsilon, - abs(v.y) < epsilon, - abs(v.z) < epsilon, - abs(v.w) < epsilon); - } - - template - inline bool areOrthonormalGTX(const genType& v0, const genType& v1, const GLMvalType epsilon) - { - return isNormalizedGTX(v0) && isNormalizedGTX(v1) && (abs(dot(v0, v1)) <= epsilon); - } - -/* - template - inline bool areOrthonormalGTX(const _xvec2& v0, const _xvec2& v1, const T epsilon) - { - return isNormalizedGTX(v0) && isNormalizedGTX(v1) && (abs(dot(v0, v1)) <= epsilon); - } - - template - inline bool areOrthonormalGTX(const _xvec3& v0, const _xvec3& v1, const T epsilon) - { - return isNormalizedGTX(v0) && isNormalizedGTX(v1) && (abs(dot(v0, v1)) <= epsilon); - } - - template - inline bool areOrthonormalGTX(const _xvec4& v0, const _xvec4& v1, const T epsilon) - { - return isNormalizedGTX(v0) && isNormalizedGTX(v1) && (abs(dot(v0, v1)) <= epsilon); - } -*/ - - template - inline bool areSimilarGTX(const genType& v0, const genType& v1, const GLMvalType epsilon) - { - bool similar = true; - for(typename genType::size_type i = 0; similar && i < genType::value_size; i++) - similar = (abs(v0[i] - v1[i]) <= epsilon); - return similar; - } - -/* - template - inline bool areSimilar(const _xvec2& v0, const _xvec2& v1, const T epsilon) - { - bool similar = true; - for(int i = 0; similar && i < 2; i++) - similar = (abs(v0[i] - v1[i]) <= epsilon); - return similar; - } - - template - inline bool areSimilar(const _xvec3& v0, const _xvec3& v1, const T epsilon) - { - bool similar = true; - for(int i = 0; similar && i < 3; i++) - similar = (abs(v0[i] - v1[i]) <= epsilon); - return similar; - } - - template - inline bool areSimilar(const _xvec4& v0, const _xvec4& v1, const T epsilon) - { - bool similar = true; - for(int i = 0; similar && i < 4; i++) - similar = (abs(v0[i] - v1[i]) <= epsilon); - return similar; - } -*/ -} diff --git a/experimental/sse/glm/ext/gtx/vecx.h b/experimental/sse/glm/ext/gtx/vecx.h deleted file mode 100644 index ec93f08d..00000000 --- a/experimental/sse/glm/ext/gtx/vecx.h +++ /dev/null @@ -1,221 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-02-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vecx.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_vecx__ -#define __glm_gtx_vecx__ - -namespace glm{ -namespace detail{ - - template - class _bvecxGTX - { - private: - bool data[N]; - - public: - typedef bool value_type; - typedef int size_type; - static const size_type value_size; - static const size_type col_size; - static const size_type row_size; - - // Common constructors - _bvecxGTX(); - _bvecxGTX(const _bvecxGTX& v); - - // Accesses - bool& operator[](int i); - const bool operator[](int i) const; - operator bool*(); - operator const bool*() const; - - // Bool constructors - explicit _bvecxGTX(const bool a); - - // Operators - _bvecxGTX& operator=(const _bvecxGTX& v); - _bvecxGTX operator! () const; - }; - - template - class _xvecxGTX - { - private: - T data[N]; - - public: - typedef T value_type; - typedef int size_type; - static const size_type value_size; - - // Common constructors - _xvecxGTX(); - _xvecxGTX(const _xvecxGTX& v); - - // Accesses - T& operator[](int i); - const T operator[](int i) const; - operator T*(); - operator const T*() const; - - // T constructors - explicit _xvecxGTX(const T x); - - // Unary updatable operators - _xvecxGTX& operator= (const _xvecxGTX& v); - _xvecxGTX& operator+=(const T s); - _xvecxGTX& operator+=(const _xvecxGTX& v); - _xvecxGTX& operator-=(const T s); - _xvecxGTX& operator-=(const _xvecxGTX& v); - _xvecxGTX& operator*=(const T s); - _xvecxGTX& operator*=(const _xvecxGTX& v); - _xvecxGTX& operator/=(const T s); - _xvecxGTX& operator/=(const _xvecxGTX& v); - _xvecxGTX& operator++(); - _xvecxGTX& operator--(); - }; - -}//namespace detail - - // Binary operators - template - detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator+ (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - template - detail::_xvecxGTX operator- (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator- (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator- (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - template - detail::_xvecxGTX operator* (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator* (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator* (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - template - detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v, const T s); - - template - detail::_xvecxGTX operator/ (const T s, const detail::_xvecxGTX& v); - - template - detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2); - - // Unary constant operators - template - const detail::_xvecxGTX operator- (const detail::_xvecxGTX& v); - - template - const detail::_xvecxGTX operator-- (const detail::_xvecxGTX& v, int); - - template - const detail::_xvecxGTX operator++ (const detail::_xvecxGTX& v, int); - - // Trigonometric Functions - template const detail::_xvecxGTX radians(const detail::_xvecxGTX& degrees); //!< \brief Converts degrees to radians and returns the result. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX degrees(const detail::_xvecxGTX& radians); //!< \brief Converts radians to degrees and returns the result. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX sin(const detail::_xvecxGTX& angle); //!< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX cos(const detail::_xvecxGTX& angle); //!< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX tan(const detail::_xvecxGTX& angle); //!< \brief The standard trigonometric tangent function. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX asin(const detail::_xvecxGTX& x); //!< \brief Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX acos(const detail::_xvecxGTX& x); //!< \brief Arc cosine. Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX atan(const detail::_xvecxGTX& y, const detail::_xvecxGTX& x); //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX atan(const detail::_xvecxGTX& y_over_x); //!< \brief Arc tangent. Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2]. (From GLM_GTX_vecx extension) - - // Exponential Functions - template const detail::_xvecxGTX pow(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns x raised to the y power. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX exp(const detail::_xvecxGTX& x); //!< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX log(const detail::_xvecxGTX& x); //!< \brief Returns the natural logarithm of x, i.e., returns the value y which satisfies the equation x = e^y. Results are undefined if x <= 0. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX exp2(const detail::_xvecxGTX& x); //!< \brief Returns 2 raised to the x power. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX log2(const detail::_xvecxGTX& x); //!< \brief Returns the base 2 log of x, i.e., returns the value y, which satisfies the equation x = 2 ^ y. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX sqrt(const detail::_xvecxGTX& x); //!< \brief Returns the positive square root of x. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX inversesqrt(const detail::_xvecxGTX& x); //!< \brief Returns the reciprocal of the positive square root of x. (From GLM_GTX_vecx extension) - - // Common Functions - template const detail::_xvecxGTX abs(const detail::_xvecxGTX& x); //!< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX sign(const detail::_xvecxGTX& x); //!< \brief Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX floor(const detail::_xvecxGTX& x); //!< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX ceil(const detail::_xvecxGTX& x); //!< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX fract(const detail::_xvecxGTX& x); //!< \brief Return x - floor(x). (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX mod(const detail::_xvecxGTX& x, T y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX mod(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Modulus. Returns x - y * floor(x / y) for each component in x using the corresponding component of y. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX min(const detail::_xvecxGTX& x, T y); //!< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX min(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns minimum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX max(const detail::_xvecxGTX& x, T y); //!< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX max(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns maximum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX clamp(const detail::_xvecxGTX& x, T minVal, T maxVal); //!< \brief Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal and maxVal. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX clamp(const detail::_xvecxGTX& x, const detail::_xvecxGTX& minVal, const detail::_xvecxGTX& maxVal); //!< \brief Returns the component-wise result of min(max(x, minVal), maxVal). (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX step(T edge, const detail::_xvecxGTX& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX step(const detail::_xvecxGTX& edge, const detail::_xvecxGTX& x); //!< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX smoothstep(T edge0, T edge1, const detail::_xvecxGTX& x); //!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX smoothstep(const detail::_xvecxGTX& edge0, const detail::_xvecxGTX& edge1, const detail::_xvecxGTX& x);//!< \brief Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x, edge1. (From GLM_GTX_vecx extension) - - // Geometric Functions - template const T length(const detail::_xvecxGTX& x); //!< \brief Returns the length of x, i.e., sqrt(x * x). (From GLM_GTX_vecx extension) - template const T distance(const detail::_xvecxGTX& p0, const detail::_xvecxGTX& p1); //!< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLM_GTX_vecx extension) - template const T dot(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns the dot product of x and y, i.e., result = x[0] * y[0] + x[1] * y[1]. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX normalize(const detail::_xvecxGTX& x); //!< \brief Returns a vector in the same direction as x but with length of 1. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX faceforward(const detail::_xvecxGTX& Norm, const detail::_xvecxGTX& I, const detail::_xvecxGTX& Nref); //!< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX reflect(const detail::_xvecxGTX& I, const detail::_xvecxGTX& N); //!< \brief For the incident vector I and surface orientation N, returns the reflection direction : result = I - 2.0 * dot(N, I) * N. (From GLM_GTX_vecx extension) - template const detail::_xvecxGTX refract(const detail::_xvecxGTX& I, const detail::_xvecxGTX& N, T eta); //!< \brief For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. (From GLM_GTX_vecx extension) - - // Vector Relational Functions - template const detail::_bvecxGTX lessThan(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns the component-wise compare of x < y. (From GLM_GTX_vecx extension) - template const detail::_bvecxGTX lessThanEqual(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns the component-wise compare of x <= y. (From GLM_GTX_vecx extension) - template const detail::_bvecxGTX greaterThan(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns the component-wise compare of x > y. (From GLM_GTX_vecx extension) - template const detail::_bvecxGTX greaterThanEqual(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns the component-wise compare of x >= y. (From GLM_GTX_vecx extension) - template const detail::_bvecxGTX equal(const detail::_bvecxGTX& x, const detail::_bvecxGTX& y); //!< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension) - template const detail::_bvecxGTX equal(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension) - template const detail::_bvecxGTX notEqual(const detail::_bvecxGTX& x, const detail::_bvecxGTX& y); //!< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension) - template const detail::_bvecxGTX notEqual(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y); //!< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension) - template const bool any(const detail::_bvecxGTX& x); //!< \brief Returns true if any component of x is true. (From GLM_GTX_vecx extension) - template const bool all(const detail::_bvecxGTX& x); //!< \brief Returns true if all component of x is true. (From GLM_GTX_vecx extension) -#ifdef _MSC_VER // VC compiler doesn't support the C++ key word 'not' - template const detail::_bvecxGTX not(const detail::_bvecxGTX& v); //!< \brief Returns the component-wise logical complement of x. (From GLM_GTX_vecx extension) -#endif -#ifdef __GNUC__ // GCC - template const detail::_bvecxGTX operator not(const detail::_bvecxGTX& v); //!< \brief Returns the component-wise logical complement of x. (From GLM_GTX_vecx extension) -#endif - - namespace gtx - { - //! GLM_GTX_vecx extension: - Work in progress - Add custom size vectors - namespace vecx - { - - } - } -} - -#define GLM_GTX_vecx namespace gtx::vecx - -#include "vecx.inl" - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_vecx;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_vecx__ diff --git a/experimental/sse/glm/ext/gtx/vecx.inl b/experimental/sse/glm/ext/gtx/vecx.inl deleted file mode 100644 index 6f8620c1..00000000 --- a/experimental/sse/glm/ext/gtx/vecx.inl +++ /dev/null @@ -1,866 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-02-21 -// Updated : 2007-02-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/vecx.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm -{ -namespace detail{ - - template const typename _bvecxGTX::size_type _bvecxGTX::value_size = N; - - // Bool constructors - template - inline _bvecxGTX::_bvecxGTX() - { - for(int i = 0; i < N; ++i) - this->data[i] = false; - } - - template - inline _bvecxGTX::_bvecxGTX(const _bvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - } - - template - inline _bvecxGTX::_bvecxGTX(const bool s) - { - for(int i = 0; i < N; ++i) - this->data[i] = s; - } - - // Accesses - template - inline bool& _bvecxGTX::operator[](int i) - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline const bool _bvecxGTX::operator[](int i) const - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline _bvecxGTX::operator bool*() - { - return data; - } - - template - inline _bvecxGTX::operator const bool*() const - { - return data; - } - - // Operators - template - inline _bvecxGTX& _bvecxGTX::operator=(const _bvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - return *this; - } - - template - inline _bvecxGTX _bvecxGTX::operator! () const - { - _bvecxGTX result; - for(int i = 0; i < N; ++i) - result[i] = !this->data[i]; - return result; - } - - template const typename _xvecxGTX::size_type _xvecxGTX::value_size = N; - - // Common constructors - template - inline _xvecxGTX::_xvecxGTX() - { - for(int i = 0; i < N; ++i) - this->data[i] = T(0); - } - - template - inline _xvecxGTX::_xvecxGTX(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - } - - // T constructors - template - inline _xvecxGTX::_xvecxGTX(const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] = s; - } - - // Accesses - template - inline T& _xvecxGTX::operator[](int i) - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline const T _xvecxGTX::operator[](int i) const - { - assert(i >= 0 && i < N); - return this->data[i]; - } - - template - inline _xvecxGTX::operator T*() - { - return data; - } - - template - inline _xvecxGTX::operator const T*() const - { - return data; - } - - template - inline _xvecxGTX& _xvecxGTX::operator=(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] = v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator+= (const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] += s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator+=(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] += v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator-= (const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] -= s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator-=(const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] -= v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator*=(const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] *= s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator*= (const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] *= v[i]; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator/=(const T s) - { - for(int i = 0; i < N; ++i) - this->data[i] /= s; - return *this; - } - - template - inline _xvecxGTX& _xvecxGTX::operator/= (const _xvecxGTX& v) - { - for(int i = 0; i < N; ++i) - this->data[i] /= v[i]; - return *this; - } -}//namespace detail - - // Unary constant operators - template - inline const detail::_xvecxGTX operator- (const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = -v[i]; - return result; - } - - template - inline const detail::_xvecxGTX operator++ (const detail::_xvecxGTX& v, int) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] + T(1); - return result; - } - - template - inline const detail::_xvecxGTX operator-- (const detail::_xvecxGTX& v, int) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] - T(1); - return result; - } - - // Binary operators - template - inline detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] + s; - return result; - } - - template - inline detail::_xvecxGTX operator+ (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] + s; - return result; - } - - template - inline detail::_xvecxGTX operator+ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] + v2[i]; - return result; - } - - template - inline detail::_xvecxGTX operator- (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] - s; - return result; - } - - template - inline detail::_xvecxGTX operator- (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = s - v[i]; - return result; - } - - template - inline detail::_xvecxGTX operator- (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] - v2[i]; - return result; - } - - template - inline detail::_xvecxGTX operator* (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] * s; - return result; - } - - template - inline detail::_xvecxGTX operator* (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = s * v[i]; - return result; - } - - template - inline detail::_xvecxGTX operator* (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] * v2[i]; - return result; - } - - template - inline detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v, const T s) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v[i] / s; - return result; - } - - template - inline detail::_xvecxGTX operator/ (const T s, const detail::_xvecxGTX& v) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = s / v[i]; - return result; - } - - template - inline detail::_xvecxGTX operator/ (const detail::_xvecxGTX& v1, const detail::_xvecxGTX& v2) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = v1[i] / v2[i]; - return result; - } - - // Trigonometric Functions - template - const detail::_xvecxGTX radians(const detail::_xvecxGTX& degrees) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = radians(degrees[i]); - return result; - } - - template - const detail::_xvecxGTX degrees(const detail::_xvecxGTX& radians) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = degrees(radians[i]); - return result; - } - - template - const detail::_xvecxGTX sin(const detail::_xvecxGTX& angle) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = sin(angle[i]); - return result; - } - - template - const detail::_xvecxGTX cos(const detail::_xvecxGTX& angle) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = cos(angle[i]); - return result; - } - - template - const detail::_xvecxGTX tan(const detail::_xvecxGTX& angle) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = tan(angle[i]); - return result; - } - - template - const detail::_xvecxGTX asin(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = asin(x[i]); - return result; - } - - template - const detail::_xvecxGTX acos(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = acos(x[i]); - return result; - } - - template - const detail::_xvecxGTX atan(const detail::_xvecxGTX& y, const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = atan(y[i], x[i]); - return result; - } - - template - const detail::_xvecxGTX atan(const detail::_xvecxGTX& y_over_x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = atan(y_over_x[i]); - return result; - } - - // Exponential Functions - template - const detail::_xvecxGTX pow(const detail::_xvecxGTX& x, const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = pow(x[i], y[i]); - return result; - } - - template - const detail::_xvecxGTX exp(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = exp(x[i]); - return result; - } - - template - const detail::_xvecxGTX log(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = log(x[i]); - return result; - } - - template - const detail::_xvecxGTX exp2(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = exp2(x[i]); - return result; - } - - template - const detail::_xvecxGTX log2(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = log2(x[i]); - return result; - } - - template - const detail::_xvecxGTX sqrt(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = sqrt(x[i]); - return result; - } - - template - const detail::_xvecxGTX inversesqrt(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = inversesqrt(x[i]); - return result; - } - - // Common Functions - template - const detail::_xvecxGTX abs(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = abs(x[i]); - return result; - } - - template - const detail::_xvecxGTX sign(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = sign(x[i]); - return result; - } - - template - const detail::_xvecxGTX floor(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = floor(x[i]); - return result; - } - - template - const detail::_xvecxGTX ceil(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = ceil(x[i]); - return result; - } - - template - const detail::_xvecxGTX fract(const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = fract(x[i]); - return result; - } - - template - const detail::_xvecxGTX mod(const detail::_xvecxGTX& x, T y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = mod(x[i], y); - return result; - } - - template - const detail::_xvecxGTX mod( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = mod(x[i], y[i]); - return result; - } - - template - const detail::_xvecxGTX min( - const detail::_xvecxGTX& x, - T y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = min(x[i], y); - return result; - } - - template - const detail::_xvecxGTX min( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = min(x[i], y[i]); - return result; - } - - template - const detail::_xvecxGTX max( - const detail::_xvecxGTX& x, - T y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = max(x[i], y); - return result; - } - - template - const detail::_xvecxGTX max( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = max(x[i], y[i]); - return result; - } - - template - const detail::_xvecxGTX clamp( - const detail::_xvecxGTX& x, - T minVal, - T maxVal) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = clamp(x[i], minVal, maxVal); - return result; - } - - template - const detail::_xvecxGTX clamp( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& minVal, - const detail::_xvecxGTX& maxVal) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = clamp(x[i], minVal[i], maxVal[i]); - return result; - } - - template - const detail::_xvecxGTX step( - T edge, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge, x[i]); - return result; - } - - template - const detail::_xvecxGTX step( - const detail::_xvecxGTX& edge, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge[i], x[i]); - return result; - } - - template - const detail::_xvecxGTX smoothstep( - T edge0, - T edge1, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge0, edge1, x[i]); - return result; - } - - template - const detail::_xvecxGTX smoothstep( - const detail::_xvecxGTX& edge0, - const detail::_xvecxGTX& edge1, - const detail::_xvecxGTX& x) - { - detail::_xvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = step(edge0[i], edge1[i], x[i]); - return result; - } - - // Geometric Functions - template - const T length( - const detail::_xvecxGTX& x) - { - T sqr = dot(x, x); - return sqrt(sqr); - } - - template - const T distance( - const detail::_xvecxGTX& p0, - const detail::_xvecxGTX& p1) - { - return length(p1 - p0); - } - - template - const T dot( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - T result = T(0); - for(int i = 0; i < N; ++i) - result += x[i] * y[i]; - return result; - } - - template - const detail::_xvecxGTX normalize( - const detail::_xvecxGTX& x) - { - T sqr = dot(x, x); - return x * inversesqrt(sqr); - } - - template - const detail::_xvecxGTX faceforward( - const detail::_xvecxGTX& Normal, - const detail::_xvecxGTX& I, - const detail::_xvecxGTX& Nref) - { - return dot(Nref, I) < T(0) ? Normal : -Normal; - } - - template - const detail::_xvecxGTX reflect( - const detail::_xvecxGTX& I, - const detail::_xvecxGTX& Normal) - { - return I - Normal * dot(Normal, I) * T(2); - } - - template - const detail::_xvecxGTX refract( - const detail::_xvecxGTX& I, - const detail::_xvecxGTX& Normal, - T eta) - { - T dot = dot(Normal, I); - T k = T(1) - eta * eta * (T(1) - dot * dot); - if(k < T(0)) - return detail::_xvecxGTX(T(0)); - else - return eta * I - (eta * dot + sqrt(k)) * Normal; - } - - // Vector Relational Functions - template - const detail::_bvecxGTX lessThan( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = lessThan(x[i], y[i]); - return result; - } - - template - const detail::_bvecxGTX lessThanEqual( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = lessThanEqual(x[i], y[i]); - return result; - } - - template - const detail::_bvecxGTX greaterThan( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = greaterThan(x[i], y[i]); - return result; - } - - template - const detail::_bvecxGTX greaterThanEqual( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = greaterThanEqual(x[i], y[i]); - return result; - } - - template - const detail::_bvecxGTX equal( - const detail::_bvecxGTX& x, - const detail::_bvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = equal(x[i], y[i]); - return result; - } - - template - const detail::_bvecxGTX equal( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = equal(x[i], y[i]); - return result; - } - - template - const detail::_bvecxGTX notEqual( - const detail::_bvecxGTX& x, - const detail::_bvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = equal(x[i], y[i]); - return result; - } - - template - const detail::_bvecxGTX notEqual( - const detail::_xvecxGTX& x, - const detail::_xvecxGTX& y) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = notEqual(x[i], y[i]); - return result; - } - - template - const bool any(const detail::_bvecxGTX& x) - { - for(int i = 0; i< N; ++i) - if(x[i]) return true; - return false; - } - - template - const bool all(const detail::_bvecxGTX& x) - { - for(int i = 0; i< N; ++i) - if(!x[i]) return false; - return true; - } - -#if (defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC) // VC compiler doesn't support the C++ key word 'not' - template - detail::_bvecxGTX not( - const detail::_bvecxGTX& v) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = !v[i]; - return result; - } -#elif (defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC) // GCC - template - detail::_bvecxGTX operator not( - const detail::_bvecxGTX& v) - { - detail::_bvecxGTX result; - for(int i = 0; i< N; ++i) - result[i] = !v[i]; - return result; - } -#endif -} //namespace glm diff --git a/experimental/sse/glm/ext/gtx/verbose_operator.h b/experimental/sse/glm/ext/gtx/verbose_operator.h deleted file mode 100644 index 0b2ad4dd..00000000 --- a/experimental/sse/glm/ext/gtx/verbose_operator.h +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-05-21 -// Updated : 2007-05-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/verbose_operator.h -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_gtx_verbose_operator__ -#define __glm_gtx_verbose_operator__ - -// Dependency: -#include "../../glm.h" - -namespace glm -{ - template genType addGTX(const genType& a, const genType& b); // Addition of two numbers, two vectors or two matrices (from GLM_GTX_verbose_operator extension) - template genType subGTX(const genType& a, const genType& b); // Substration of two numbers, two vectors or two matrices (from GLM_GTX_verbose_operator extension) - template genType divGTX(const genType& a, const genType& b); // Division of two numbers, two vectors or two matrices (from GLM_GTX_verbose_operator extension) - - namespace gtx - { - //! GLM_GTX_verbose_operator extension: Use words to replace operators - namespace verbose_operator - { - template inline genType add(const genType& a, const genType& b){return addGTX(a, b);} // Addition of two numbers, two vectors or two matrices (from GLM_GTX_verbose_operator extension) - template inline genType sub(const genType& a, const genType& b){return subGTX(a, b);} // Substration of two numbers, two vectors or two matrices (from GLM_GTX_verbose_operator extension) - template inline genType div(const genType& a, const genType& b){return divGTX(a, b);} // Division of two numbers, two vectors or two matrices (from GLM_GTX_verbose_operator extension) - } - } -} - -#include "verbose_operator.inl" - -#define GLM_GTX_verbose_operator namespace gtx::verbose_operator - -#ifdef GLM_GTX_INCLUDED -namespace glm{using GLM_GTX_verbose_operator;} -#endif//GLM_GTX_INCLUDED - -#endif//__glm_gtx_verbose_operator__ diff --git a/experimental/sse/glm/ext/gtx/verbose_operator.inl b/experimental/sse/glm/ext/gtx/verbose_operator.inl deleted file mode 100644 index 65983b66..00000000 --- a/experimental/sse/glm/ext/gtx/verbose_operator.inl +++ /dev/null @@ -1,29 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2007-05-21 -// Updated : 2007-05-21 -// Licence : This source is under GNU LGPL licence -// File : glm/gtx/verbose_operator.inl -/////////////////////////////////////////////////////////////////////////////////////////////////// - -namespace glm -{ - template - inline genType addGTX(const genType& a, const genType& b) - { - return a + b; - } - - template - inline genType subGTX(const genType& a, const genType& b) - { - return a - b; - } - - template - inline genType divGTX(const genType& a, const genType& b) - { - return a / b; - } -} diff --git a/experimental/sse/glm/glm.h b/experimental/sse/glm/glm.h deleted file mode 100644 index d5d40b14..00000000 --- a/experimental/sse/glm/glm.h +++ /dev/null @@ -1,180 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-14 -// Updated : 2008-03-22 -// Licence : This source is under GNU LGPL licence -// File : glm/glm.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -/*! \mainpage OpenGL Mathematics - * - * \section introduction 1. Introduction - * - * OpenGL Mathematics (GLM) is a mathematics library for 3D applications based on OpenGL Shading Language(GLSL). The project's goal is to provide to 3D programmer the same tools when he develops under GPU and CPU. This project wasn't limited by GLSL tools, an extension system based on GLSL extensions development conventions allows to extend GLSL capabilities. GLM is release under MIT license and available for all version of GCC from version 3.4 and Visual Studio from version 7.1 (2003). - * - * Any feedback are welcome, please send then to g.truc.creation[NO_SPAM_THANKS]gmail.com. - * - * \section using_glm_installation 2. Installation - * - * \subsection using_glm_installation_compiler 2.1. Compiler setup - * It's not required to build GLM, it's a header library. You use have to indicate where is the "glm" directory to your compiler. The only files present in this directory that matter for your own projects are header files. You can whether copy this directory in your "include" project directory or add this directory to your compiler header directories list (-I with GCC). - * - * \subsection using_glm_installation_core 2.2. Core features - * When you have setup your compiler or project, all core features of GLM (basically, GLSL features) will be available to your project if you include "glm.h": #include - * - * \subsection using_glm_installation_swizzle 2.3. Setup of swizzle operators - * Swizzle operators are disabled by default. It's possible to enable each component types by defining GLM_SWIZZLE to GLM_SWIZZLE_XYZW, GLM_SWIZZLE_RGBA or GLM_SWIZZLE_STQP. To enable all swizzle names, use GLM_SWIZZLE_FULL. - * This setup is done using defines included in "glmsetup.h". You can directly edit this file but you take the risk to replace "glmsetup.h" and lose your settings when you will update GLM. Other way is to include "glmsetup.h" in a third-party file and then add your settings before including "glm.h". GLM will use default settings if "glmsetup.h" isn't included before "glm.h". - * - * \subsection using_glm_installation_ext 2.4. Using extensions features - * To take advantages of all extra features of GLM, you have to use the extensions which are included in "glmext.h": #include . Go to section 3 for more information about extensions - * - * \section extensions 3. GLM Extensions - * - * \subsection extensions_setup 3.1. Setup - * To take advantages of all extra features of GLM, you have to use the extensions which are included in "glmext.h": #include - * - * \subsection extensions_about 3.2. About GLSL extension convensions - * GLSL working group have defined some rules to define GLSL extensions. However, it seams that graphics card companies choose to adapt this rules according there own wishes which actually have some advantages thanks to the possibility to enable or disable GLSL extensions. - * - * \subsection extensions_arb 3.3. ARB convensions - * By default, all extensions are available using the working group rules. To use an extension, you just have to include the according header file. To include the quaternion extension (GLM_GTX_quaternion), just include "glm/gtx/quaternion.h" You can also ask to use every extension by including glmext.h. - * - * \subsection extensions_ihv 3.4. IHV convensions - * To use the vendor way of using extensions, it's still required include header files but you also have to explicitly ask for it. Example to use GLM_GTX_quaternion with IHV convensions: - * - * namespace glm - * { - * using GLM_GTX_quaternion; - * } - * - * It's also possible to automatically setup every extensions defining GLM_GTX_INCLUDED before including "glm.h". - * - * - * \section known_issue 4. Known issues - * - * \subsection known_issue_swizzle 4.1. Swizzle operators - * Enabling swizzle operator can result to name collision with the Win32 API. - * - * \subsection known_issue_not 4.2. "not" function - * The GLSL keyword "not" isn’t well supported under Visual Studio because of Microsoft implementation of the "not" C++ Keyword… it's a #define. - * - * \subsection known_issue_half 4.3. "half" based types - * Half based types can't be used with GCC because of multiple component names implementation based on union. To use half based types, define GLM_SINGLE_COMP_NAME before including GLM headers. This disables color and texcoord component names. - * - */ - -#ifndef __glm_glm__ -#define __glm_glm__ - -#undef max -#undef min - -#ifdef __GNUC__ -#define GLM_SINGLE_COMP_NAME -#endif - -#define GLMvalType typename genType::value_type -#define GLMcolType typename genType::col_type -#define GLMrowType typename genType::row_type - -#define GLMsizeType typename genType::size_type -#define GLMrowSize typename genType::row_size -#define GLMcolSize typename genType::col_size - -#define GLMvalSize typename genType::value_size - -#include "./glmsetup.h" - -#include "./core/_bvec2.inl" -#include "./core/_bvec3.inl" -#include "./core/_bvec4.inl" -#include "./core/_xvec2.inl" -#include "./core/_xvec3.inl" -#include "./core/_xvec4.inl" -#include "./core/_xmat2.inl" -#include "./core/_xmat3.inl" -#include "./core/_xmat4.inl" -#include "./core/_xmat2x3.inl" -#include "./core/_xmat2x4.inl" -#include "./core/_xmat3x2.inl" -#include "./core/_xmat3x4.inl" -#include "./core/_xmat4x2.inl" -#include "./core/_xmat4x3.inl" -#include "./core/_func.inl" -#include "./core/_swizzle.h" -#include "./core/_xref2.inl" -#include "./core/_xref3.inl" -#include "./core/_xref4.inl" - -//! \brief OpenGL Mathematics namespace -namespace glm -{ - //! GLM experimental extensions. The interface could change between releases. - namespace gtx{} - - //! GLM stable extensions. Nothing yet. - namespace gtc{} - - typedef detail::_xvec2 vec2; //!< \brief Vector of 2 floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xvec2 ivec2; //!< \brief Vector of 2 integers. (From GLSL 1.20.6 specification) - typedef detail::_bvec2 bvec2; //!< \brief Vector of 2 booleans. (From GLSL 1.20.6 specification) - typedef detail::_xvec3 vec3; //!< \brief Vector of 3 floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xvec3 ivec3; //!< \brief Vector of 3 integers. (From GLSL 1.20.6 specification) - typedef detail::_bvec3 bvec3; //!< \brief Vector of 3 booleans. (From GLSL 1.20.6 specification) - typedef detail::_xvec4 vec4; //!< \brief Vector of 4 floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xvec4 ivec4; //!< \brief Vector of 4 integers. (From GLSL 1.20.6 specification) - typedef detail::_bvec4 bvec4; //!< \brief Vector of 4 booleans. (From GLSL 1.20.6 specification) - typedef detail::_xmat2 mat2; //!< \brief 2 * 2 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat3 mat3; //!< \brief 3 * 3 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat4 mat4; //!< \brief 4 * 4 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat2 mat2x2; //!< \brief 2 * 2 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat3 mat3x3; //!< \brief 3 * 3 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat4 mat4x4; //!< \brief 4 * 4 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat2x3 mat2x3; //!< \brief 2 * 3 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat3x2 mat3x2; //!< \brief 3 * 2 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat2x4 mat2x4; //!< \brief 2 * 4 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat4x2 mat4x2; //!< \brief 4 * 2 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat3x4 mat3x4; //!< \brief 3 * 4 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - typedef detail::_xmat4x3 mat4x3; //!< \brief 4 * 3 matrix of floating-point numbers. (From GLSL 1.20.6 specification) - - typedef const vec2& param_vec2; - typedef const vec3& param_vec3; - typedef const vec4& param_vec4; - typedef const ivec2& param_ivec2; - typedef const ivec3& param_ivec3; - typedef const ivec4& param_ivec4; - typedef const bvec2& param_bvec2; - typedef const bvec3& param_bvec3; - typedef const bvec4& param_bvec4; - typedef const mat2& param_mat2; - typedef const mat3& param_mat3; - typedef const mat4& param_mat4; - typedef const mat2x3& param_mat2x3; - typedef const mat3x2& param_mat3x2; - typedef const mat2x4& param_mat2x4; - typedef const mat4x2& param_mat4x2; - typedef const mat3x4& param_mat3x4; - typedef const mat4x3& param_mat4x3; -} //namespace glm - -#ifdef GLM_COMPILER_VC -#define GLM_DEPRECATED __declspec(deprecated) -#else -#define GLM_DEPRECATED -#endif//GLM_COMPILER_VC - -#ifdef GLM_COMPILER_VC -#define GLM_RESTRICT __restrict -#else -#define GLM_RESTRICT -#endif//GLM_COMPILER_VC - -#ifdef GLM_COMPILER_VC -#define GLM_ALIGN(x) __declspec(align(x)) -#else -#define GLM_ALIGN(x) -#endif//GLM_COMPILER_VC - -#endif //__glm_glm__ diff --git a/experimental/sse/glm/glmext.h b/experimental/sse/glm/glmext.h deleted file mode 100644 index fa05e945..00000000 --- a/experimental/sse/glm/glmext.h +++ /dev/null @@ -1,20 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-14 -// Updated : 2007-08-03 -// Licence : This source is under GNU LGPL licence -// File : glm/glmext.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_glmext__ -#define __glm_glmext__ - -#include "./glm.h" -//#include "./ext/gtc.h" -#include "./ext/gtx.h" - -//const float goldenRatio = 1.618033988749894848f; -//const float pi = 3.141592653589793238f; - -#endif //__glm_glmext__ diff --git a/experimental/sse/glm/glmsetup.h b/experimental/sse/glm/glmsetup.h deleted file mode 100644 index e85317e8..00000000 --- a/experimental/sse/glm/glmsetup.h +++ /dev/null @@ -1,128 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net) -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2006-11-13 -// Updated : 2007-03-14 -// Licence : This source is under GNU LGPL licence -// File : glm/glmsetup.h -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef __glm_glmsetup__ -#define __glm_glmsetup__ - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Version - -#define GLM_VERSION 70 -#define GLM_REVISION 111 - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Cast - -#define GLM_CAST_NONE 0x00000000 -#define GLM_CAST_DIRECTX_9 0x00000001 -#define GLM_CAST_DIRECTX_10 0x00000002 -#define GLM_CAST_NVSG 0x00000004 -#define GLM_CAST_WILD_MAGIC_3 0x00000008 -#define GLM_CAST_WILD_MAGIC_4 0x00000010 -#define GLM_CAST_PHYSX 0x00000020 -#define GLM_CAST_ODE 0x00000040 - -//! By default: -// #define GLM_CAST GLM_CAST_NONE -// #define GLM_CAST_EXT GLM_CAST_NONE - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Swizzle operators - -#define GLM_SWIZZLE_NONE 0x00000000 -#define GLM_SWIZZLE_XYZW 0x00000001 -#define GLM_SWIZZLE_RGBA 0x00000002 -#define GLM_SWIZZLE_STQP 0x00000004 -#define GLM_SWIZZLE_FULL (GLM_SWIZZLE_XYZW | GLM_SWIZZLE_RGBA | GLM_SWIZZLE_STQP) - -//! By default: -// #define GLM_SWIZZLE GLM_SWIZZLE_NONE - -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Compiler - -#ifdef _MSC_VER -#define GLM_COMPILER_VC 0x01001000 - -#if _MSC_VER == 1000 -#define GLM_COMPILER_VC40 0x01000100 -#endif - -#if _MSC_VER == 1100 -#define GLM_COMPILER_VC50 0x01000200 -#endif - -#if _MSC_VER == 1200 -#define GLM_COMPILER_VC60 0x01000400 -#endif - -#if _MSC_VER == 1300 -#define GLM_COMPILER_VC70 0x01000800 -#endif - -#if _MSC_VER == 1310 -#define GLM_COMPILER_VC71 0x01001000 -#endif - -#if _MSC_VER == 1400 -#define GLM_COMPILER_VC80 0x01002000 -#endif - -#endif - -#ifdef __GNUC__ -#define GLM_COMPILER_GCC 0x02000000 - -#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 8) //!< GCC 2.8x isn't supported -#define GLM_COMPILER_GCC29 0x02000400 -#endif - -#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 9) //!< GCC 2.9x isn't supported -#define GLM_COMPILER_GCC29 0x02000400 -#endif - -#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 0) //!< GCC 3.0 isn't supported yet -#define GLM_COMPILER_GCC30 0x02000800 -#endif - -#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 1) //!< GCC 3.1 isn't supported yet -#define GLM_COMPILER_GCC31 0x02001000 -#endif - -#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) -#define GLM_COMPILER_GCC32 0x02002000 -#endif - -#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 3) -#define GLM_COMPILER_GCC33 0x02004000 -#endif - -#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 4) -#define GLM_COMPILER_GCC34 0x02008000 -#endif - -#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 5) -#define GLM_COMPILER_GCC35 0x02010000 -#endif - -#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 0) -#define GLM_COMPILER_GCC40 0x02020000 -#endif - -#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 1) -#define GLM_COMPILER_GCC41 0x02040000 -#endif - -#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 2) -#define GLM_COMPILER_GCC42 0x02080000 -#endif - -#endif - -#endif//__glm_glmsetup__ diff --git a/experimental/sse/main.cpp b/experimental/sse/main.cpp deleted file mode 100644 index df35be1d..00000000 --- a/experimental/sse/main.cpp +++ /dev/null @@ -1,137 +0,0 @@ -#include "precompiled.h" -#include "sse_vec4.h" -#include "sse_vec4array.h" -#include "sse_mat4.h" -#include "sse_mat4array.h" - -#include - -#define CPUID __asm __emit 0fh __asm __emit 0a2h -#define RDTSC __asm __emit 0fh __asm __emit 031h - -unsigned test_sse() -{ - //test_sse_vec4(); - //test_sse_mat4(); - - glm::sse::vec4 v0 = glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::sse::mat4 m0 = glm::sse::mat4(v0, v0, v0, v0); - glm::sse::mat4 m1 = glm::sse::mat4(v0, v0, v0, v0); - - unsigned cycles; - - __asm - { - pushad - - CPUID - RDTSC - mov cycles, eax - - popad - } - - //glm::sse::transpose(m0); - //m0.transpose(); - m0 * m0; - - __asm - { - pushad - - CPUID - RDTSC - sub eax, cycles - mov cycles, eax - - popad - } - - return cycles; -} - -int main() -{ - test_sse_vec4(); - test_sse_mat4(); - - unsigned int base, base1, base2, base3, base4, base5; - unsigned int clock; - - // Warm up cpuid & rdtsc - - __asm - { - pushad; - - cpuid; - rdtsc; - mov clock, eax; - cpuid; - rdtsc; - sub eax, clock; - mov base1, eax; - - cpuid; - rdtsc; - mov clock, eax; - cpuid; - rdtsc; - sub eax, clock; - mov base2, eax; - - cpuid; - rdtsc; - mov clock, eax; - cpuid; - rdtsc; - sub eax, clock; - mov base3, eax; - - cpuid; - rdtsc; - mov clock, eax; - cpuid; - rdtsc; - sub eax, clock; - mov base4, eax; - - cpuid; - rdtsc; - mov clock, eax; - cpuid; - rdtsc; - sub eax, clock; - mov base5, eax; - - popad; - } - - base = base1; - if (base > base2) - base = base2; - if (base > base3) - base = base3; - if (base > base4) - base = base4; - if (base > base5) - base = base5; - - { - const unsigned size = 16; - unsigned cycles[size]; - for(unsigned i = 0; i < size; ++i) - cycles[i] = test_sse(); - - // By the second or third run, both data and instruction - // cache effects should have been eliminated, and results - // will be consistent. - - printf("SSE\nBase : %d\n", base); - printf("Cycle counts:\n"); - for(unsigned i = 0; i < size; ++i) - printf("%d\n", cycles[i] - base); - } - - system("pause"); -} diff --git a/experimental/sse/precompiled.cpp b/experimental/sse/precompiled.cpp deleted file mode 100644 index c08ca1f1..00000000 --- a/experimental/sse/precompiled.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precompiled.h" \ No newline at end of file diff --git a/experimental/sse/precompiled.h b/experimental/sse/precompiled.h deleted file mode 100644 index cfd780ea..00000000 --- a/experimental/sse/precompiled.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef SSE_PRECOMPILED_H -#define SSE_PRECOMPILED_H - -#include "glm/glm.h" -#include "glm/glmext.h" - -#endif//SSE_PRECOMPILED_H diff --git a/experimental/sse/rdtsc.cpp b/experimental/sse/rdtsc.cpp deleted file mode 100644 index 5f656a45..00000000 --- a/experimental/sse/rdtsc.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precompiled.h" diff --git a/experimental/sse/rdtsc.h b/experimental/sse/rdtsc.h deleted file mode 100644 index e69de29b..00000000 diff --git a/experimental/sse/sse.cpp b/experimental/sse/sse.cpp deleted file mode 100644 index f68aaa32..00000000 --- a/experimental/sse/sse.cpp +++ /dev/null @@ -1,1378 +0,0 @@ -#include "precompiled.h" -#include "sse.h" - -//namespace sse -//{ -// // some defines first -// union ieee754_QNAN -// { -// const float f; -// struct -// { -// const unsigned int mantissa:23, exp:8, sign:1; -// }; -// -// ieee754_QNAN() : f(0.0), mantissa(0x7FFFFF), exp(0xFF), sign(0x0) {} -// }; -// -// namespace detail -// { -// union ieee754 -// { -// ieee754() : -// f(0.0f) -// {} -// -// ieee754(float f) : -// f(f) -// {} -// -// ieee754(unsigned int mantissa, unsigned int exp, unsigned int sign) : -// mantissa(mantissa), exp(exp), sign(sign) -// {} -// -// float f; -// struct -// { -// unsigned int mantissa:23, exp:8, sign:1; -// }; -// }; -// -// _MM_ALIGN16 const ieee754 qnan(0x7FFFFF, 0xFF, 0x0); -// } -// -// float load(unsigned int mantissa, unsigned int exp, unsigned int sign) -// { -// sse::detail::ieee754 value(mantissa, exp, sign); -// return value.f; -// } -// -// _MM_ALIGN16 const sse::detail::ieee754 qnan(0x7FFFFF, 0xFF, 0x0); -// -// _MM_ALIGN16 const ieee754_QNAN absMask; -// //static const __m128 abs4Mask = _mm_load1_ps( &absMask.f); -// static const __m128 abs4Mask = _mm_set_ps1(absMask.f); -// -// __m128 _mm_neg_ps(__m128 v) -// { -// return _mm_sub_ps(_mm_setzero_ps(), v); -// } -// -// __m128 fast_pow(__m128 base, __m128 exponent) -// { -// __m128 denom = _mm_mul_ps( exponent, base); -// denom = _mm_sub_ps( exponent, denom); -// denom = _mm_add_ps( base, denom); -// return _mm_mul_ps( base, _mm_rcp_ps(denom)); -// } -// -// static const __m128 zero = _mm_setzero_ps(); -// static const __m128 one = _mm_set_ps1(1.0f); -// static const __m128 two = _mm_set_ps1(2.0f); -// static const __m128 pi = _mm_set_ps1(3.1415926535897932384626433832795f); -// static const __m128 hundred_eighty = _mm_set_ps1(180.f); -// static const __m128 pi_over_hundred_eighty = _mm_set_ps1(0.017453292519943295769236907684886f); -// static const __m128 hundred_eighty_over_pi = _mm_set_ps1(57.295779513082320876798154814105f); -// -// //vec4 radians(vec4 degrees) -// //{ -// // const float pi = float(3.1415926535897932384626433832795); -// // return degrees * (pi / 180.f); -// //} -// __m128 radians(__m128 degrees) -// { -// return _mm_mul_ps(degrees, pi_over_hundred_eighty); -// } -// -// __m128 _mm_rad_ss(__m128 degrees) -// { -// return _mm_mul_ss(degrees, pi_over_hundred_eighty); -// } -// -// __m128 _mm_rad_ps(__m128 degrees) -// { -// return _mm_mul_ps(degrees, pi_over_hundred_eighty); -// } -// -// //vec4 degrees(vec4 radians) -// //{ -// // const float pi = float(3.1415926535897932384626433832795); -// // return radians * (180.f / pi); -// //} -// __m128 degrees(__m128 radians) -// { -// return _mm_mul_ps(radians, hundred_eighty_over_pi); -// } -// -// __m128 _mm_deg_ss(__m128 radians) -// { -// return _mm_mul_ss(radians, hundred_eighty_over_pi); -// } -// -// __m128 _mm_deg_ps(__m128 radians) -// { -// return _mm_mul_ps(radians, hundred_eighty_over_pi); -// } -// -// //vec4 sqrt(vec4 v) -// //{ -// // return vec4(sqrt(v.x), sqrt(v.y), sqrt(v.z), sqrt(v.w)); -// //} -// __m128 sqrt(__m128 v) -// { -// return _mm_sqrt_ps(v); -// } -// -// //vec4 inversesqrt(vec4 x) -// //{ -// // return vec4(1.0f) / sqrt(x); -// //} -// __m128 inversesqrt(__m128 v) -// { -// return _mm_rsqrt_ps(v); -// } -// -// //vec4 abs(vec4 x) -// //{ -// // return x >= T(0) ? x : -x; -// //} -// __m128 abs(__m128 x) -// { -// return _mm_and_ps(abs4Mask, x); -// } -// -// //__m128 _mm_abs_ss(__m128 x) -// //{ -// // return _mm_and_ss(abs4Mask, x); -// //} -// -// __m128 _mm_abs_ps(__m128 x) -// { -// return _mm_and_ps(abs4Mask, x); -// } -// -// //vec4 sign(vec4 x) -// //{ -// // vec4 result; -// // if(x > vec4(0)) -// // result = vec4(1); -// // else if(x < T(0)) -// // result = vec4(-1); -// // else -// // result = vec4(0); -// // return result; -// //} -// __m128 sign(__m128 x) -// { -// __m128 result; -// __m128 cmp0 = _mm_cmpeq_ps(x, zero); -// if(_mm_movemask_ps(cmp0) == 0) -// result = zero; -// else -// { -// __m128 cmp1 = _mm_cmpge_ps(x, zero); -// //__m128 cmp2 = _mm_cmple_ps(x, zero); -// if(_mm_movemask_ps(cmp1) > 0) -// result = one; -// else //if(_mm_movemask_ps(cmp2) > 0) -// result = minus_one; -// } -// return result; -// } -// -// __m128 _mm_sgn_ss(__m128 x) -// { -// __m128 result; -// __m128 cmp0 = _mm_cmpeq_ss(x, zero); -// if(_mm_movemask_ss(cmp0) == 0) -// result = zero; -// else -// { -// __m128 cmp1 = _mm_cmpge_ss(x, zero); -// //__m128 cmp2 = _mm_cmple_ss(x, zero); -// if(_mm_movemask_ss(cmp1) > 0) -// result = one; -// else //if(_mm_movemask_ss(cmp2) > 0) -// result = minus_one; -// } -// return result; -// } -// -// __m128 _mm_sgn_ps(__m128 x) -// { -// __m128 cmp0 = _mm_cmpeq_ps(x, zero); -// __m128 cmp1 = _mm_cmple_ps(x, zero); -// __m128 cmp2 = _mm_cmpge_ps(x, zero) -// -// __m128 result; -// __m128 cmp0 = _mm_cmpeq_ps(x, zero); -// if(_mm_movemask_ps(cmp0) == 0) -// result = zero; -// else -// { -// __m128 cmp1 = _mm_cmpge_ps(x, zero); -// //__m128 cmp2 = _mm_cmple_ps(x, zero); -// if(_mm_movemask_ps(cmp1) > 0) -// result = one; -// else //if(_mm_movemask_ps(cmp2) > 0) -// result = minus_one; -// } -// return result; -// } -// -// //vec4 floor(vec4 x) -// //{ -// // return ::std::floor(x); -// //} -// -// __m128 floor(__m128 v) -// { -// -// } -// -// __m128 _mm_flr_ss(__m128 v) -// { -// -// } -// -// __m128 _mm_flr_ps(__m128 v) -// { -// -// } -// -// //vec4 ceil(vec4 x) -// //{ -// // return ::std::ceil(vec4); -// //} -// -// -// -// //vec4 fract(vec4 x) -// //{ -// // return x - floor(x); -// //} -// __m128 fract(__m128 x) -// { -// __m128 flr0 = floor(x); -// __m128 sub0 = _mm_sub_ps(x, flr0); -// return sub0; -// } -// -// __m128 _mm_frc_ss(__m128 x) -// { -// __m128 flr0 = _mm_flr_ss(x); -// __m128 sub0 = _mm_sub_ss(x, flr0); -// return sub0; -// } -// -// __m128 _mm_frc_ps(__m128 x) -// { -// __m128 flr0 = _mm_flr_ps(x); -// __m128 sub0 = _mm_sub_ps(x, flr0); -// return sub0; -// } -// -// //vec4 mod(vec4 x, vec4 y) -// //{ -// // return x - y * floor(x / y); -// //} -// __m128 mod(__m128 x, __m128 y) -// { -// __m128 div0 = _mm_div_ps(x, y); -// __m128 flr0 = _mm_flr_ps(div0); -// __m128 mul0 = _mm_mul_ps(y, flr0); -// __m128 sub0 = _mm_sub_ps(x, mul0); -// return sub0; -// } -// -// __m128 _mm_mod_ss(__m128 x, __m128 y) -// { -// __m128 div0 = _mm_div_ss(x, y); -// __m128 flr0 = _mm_flr_ss(div0); -// __m128 mul0 = _mm_mul_ss(y, flr0); -// __m128 sub0 = _mm_sub_ss(x, mul0); -// return sub0; -// } -// -// __m128 _mm_mod_ps(__m128 x, __m128 y) -// { -// __m128 div0 = _mm_div_ps(x, y); -// __m128 flr0 = _mm_flr_ps(div0); -// __m128 mul0 = _mm_mul_ps(y, flr0); -// __m128 sub0 = _mm_sub_ps(x, mul0); -// return sub0; -// } -// -// //vec4 min(vec4 x, vec4 y) -// //{ -// // return x < y ? x : y; -// //} -// __m128 min(__m128 v1, __m128 v2) -// { -// return _mm_min_ps(v1, v2); -// } -// -// //vec4 max(vec4 x, vec4 y) -// //{ -// // return x > y ? x : y; -// //} -// __m128 max(__m128 v1, __m128 v2) -// { -// return _mm_max_ps(v1, v2); -// } -// -// //vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal) -// //{ -// // return max(min(v, maxVal), minVal); -// //} -// __m128 clamp(__m128 v, __m128 minVal, __m128 maxVal) -// { -// return _mm_max_ps(_mm_min_ps(v, maxVal), minVal); -// } -// -// __m128 _mm_clp_ss(__m128 v, __m128 minVal, __m128 maxVal) -// { -// __m128 min0 = _mm_min_ss(v, maxVal); -// __m128 max0 = _mm_max_ss(min0, minVal); -// return max0; -// } -// -// __m128 _mm_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) -// { -// __m128 min0 = _mm_min_ps(v, maxVal); -// __m128 max0 = _mm_max_ps(min0, minVal); -// return max0; -// } -// -// //vec4 mix(vec4 x, vec4 y, vec4 a) -// //{ -// // return x * (vec4(1) - a) + y * a; -// //} -// __m128 mix(__m128 v1, __m128 v2, __m128 a) -// { -// __m128 sub0 = _mm_sub_ps(one, a); -// __m128 mul0 = _mm_mul_ps(v1, sub0); -// __m128 mul1 = _mm_mul_ps(v2, a); -// __m128 add0 = _mm_add_ps(mul0, mul1); -// return add0; -// } -// -// __m128 _mm_lerp_ss(__m128 v1, __m128 v2, __m128 a) -// { -// __m128 sub0 = _mm_sub_ss(one, a); -// __m128 mul0 = _mm_mul_ss(v1, sub0); -// __m128 mul1 = _mm_mul_ss(v2, a); -// __m128 add0 = _mm_add_ss(mul0, mul1); -// return add0; -// } -// -// __m128 _mm_lerp_ps(__m128 v1, __m128 v2, __m128 a) -// { -// __m128 sub0 = _mm_sub_ps(one, a); -// __m128 mul0 = _mm_mul_ps(v1, sub0); -// __m128 mul1 = _mm_mul_ps(v2, a); -// __m128 add0 = _mm_add_ps(mul0, mul1); -// return add0; -// } -// -// //vec4 step(vec4 edge, vec4 x) -// //{ -// // return x <= edge ? vec4(0) : vec4(1); -// //} -// __m128 step(__m128 edge, __m128 x) -// { -// __m128 cmp = _mm_cmple_ps(x, edge); -// if(_mm_movemask_ps(cmp) == 0) -// return one; -// else -// return zero; -// } -// -// __m128 _mm_step_ss(__m128 edge, __m128 x) -// { -// __m128 cmp = _mm_cmple_ss(x, edge); -// if(_mm_movemask_ss(cmp) == 0) -// return one; -// else -// return zero; -// } -// -// __m128 _mm_step_ps(__m128 edge, __m128 x) -// { -// __m128 cmp = _mm_cmple_ps(x, edge); -// if(_mm_movemask_ps(cmp) == 0) -// return one; -// else -// return zero; -// } -// -// //vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x) -// //{ -// // vec4 tmp = clamp((x - edge0) / (edge1 - edge0), vec4(0), vec4(1)); -// // return tmp * tmp * (vec4(3) - vec4(2) * tmp); -// //} -// __m128 smoothstep(__m128 edge0, __m128 edge1, __m128 x) -// { -// __m128 sub0 = _mm_sub_ps(x, edge0); -// __m128 sub1 = _mm_sub_ps(edge1, edge0); -// __m128 div0 = _mm_sub_ps(sub0, sub1); -// __m128 clp0 = _mm_clp_ps(div0, zero, one); -// __m128 mul0 = _mm_mul_ps(two, clp0); -// __m128 sub2 = _mm_sub_ps(three, mul0); -// __m128 mul1 = _mm_mul_ps(clp0, clp0); -// __m128 mul2 = _mm_mul_ps(mul1, sub2); -// return mul2; -// } -// -// __m128 _mm_ssp_ss(__m128 edge0, __m128 edge1, __m128 x) -// { -// __m128 sub0 = _mm_sub_ss(x, edge0); -// __m128 sub1 = _mm_sub_ss(edge1, edge0); -// __m128 div0 = _mm_sub_ss(sub0, sub1); -// __m128 clp0 = _mm_clp_ss(div0, zero, one); -// __m128 mul0 = _mm_mul_ss(two, clp0); -// __m128 sub2 = _mm_sub_ss(three, mul0); -// __m128 mul1 = _mm_mul_ss(clp0, clp0); -// __m128 mul2 = _mm_mul_ss(mul1, sub2); -// return mul2; -// } -// -// __m128 _mm_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) -// { -// __m128 sub0 = _mm_sub_ps(x, edge0); -// __m128 sub1 = _mm_sub_ps(edge1, edge0); -// __m128 div0 = _mm_sub_ps(sub0, sub1); -// __m128 clp0 = _mm_clp_ps(div0, zero, one); -// __m128 mul0 = _mm_mul_ps(two, clp0); -// __m128 sub2 = _mm_sub_ps(three, mul0); -// __m128 mul1 = _mm_mul_ps(clp0, clp0); -// __m128 mul2 = _mm_mul_ps(mul1, sub2); -// return mul2; -// } -// -// //float length(vec4 x) -// //{ -// // float sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; -// // return sqrt(sqr); -// //} -// __m128 length(__m128 x) -// { -// __m128 dot0 = dot(x, x); -// __m128 sqt0 = _mm_sqrt_ps(dot0); -// return sqt0; -// } -// -// __m128 _mm_len_ss(__m128 x) -// { -// __m128 dot0 = _mm_dot_ss(x, x); -// __m128 sqt0 = _mm_sqrt_ss(dot0); -// return sqt0; -// } -// -// __m128 _mm_len_ps(__m128 x) -// { -// __m128 dot0 = _mm_dot_ps(x, x); -// __m128 sqt0 = _mm_sqrt_ps(dot0); -// return sqt0; -// } -// -// //float distance(vec4 p0, vec4 p1) -// //{ -// // return length(p1 - p0); -// //} -// __m128 distance(__m128 p0, __m128 p1) -// { -// __m128 sub0 = _mm_sub_ps(p0, p1); -// __m128 len0 = _mm_len_ps(sub0); -// return len0; -// } -// -// __m128 _mm_dst_ss(__m128 p0, __m128 p1) -// { -// __m128 sub0 = _mm_sub_ps(p0, p1); -// __m128 len0 = _mm_len_ps(sub0); -// return len0; -// } -// -// __m128 _mm_dst_ps(__m128 p0, __m128 p1) -// { -// __m128 sub0 = _mm_sub_ps(p0, p1); -// __m128 len0 = _mm_len_ps(sub0); -// return len0; -// } -// -// //vec4 dot(vec4 x, vec4 y) -// //{ -// // return vec4(x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w); -// //} -// __m128 dot(__m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v1, v2); -// __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); -// __m128 add0 = _mm_add_ps(mul0, swp0); -// __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); -// __m128 add1 = _mm_add_ps(add0, swp1); -// return add1; -// } -// -// __m128 _mm_dot_ss(__m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v1, v2); -// __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); -// __m128 add0 = _mm_add_ps(mul0, swp0); -// __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); -// __m128 add1 = _mm_add_ps(add0, swp1); -// return add1; -// } -// -// __m128 _mm_dot_ps(__m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v1, v2); -// __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); -// __m128 add0 = _mm_add_ps(mul0, swp0); -// __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); -// __m128 add1 = _mm_add_ps(add0, swp1); -// return add1; -// } -// -// //vec3 cross(vec3 x, vec3 y) -// //{ -// // return vec3( -// // x.y * y.z - y.y * x.z, -// // x.z * y.x - y.z * x.x, -// // x.x * y.y - y.x * x.y); -// //} -// __m128 cross(__m128 v1, __m128 v2) -// { -// __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 mul0 = _mm_mul_ps(swp0, swp3); -// __m128 mul1 = _mm_mul_ps(swp1, swp2); -// __m128 sub0 = _mm_sub_ps(mul0, mul1); -// return sub0; -// } -// -// __m128 _mm_xpd_ps(__m128 v1, __m128 v2) -// { -// __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); -// __m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); -// __m128 mul0 = _mm_mul_ps(swp0, swp3); -// __m128 mul1 = _mm_mul_ps(swp1, swp2); -// __m128 sub0 = _mm_sub_ps(mul0, mul1); -// return sub0; -// } -// -// //vec4 normalize(vec4 x) -// //{ -// // float sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; -// // return x * inversesqrt(sqr); -// //} -// __m128 normalize(__m128 v) -// { -// __m128 dot0 = dot(v, v); -// __m128 isr0 = _mm_rsqrt_ps(dot0); -// __m128 mul0 = _mm_mul_ps(v, isr0); -// return mul0; -// } -// -// __m128 _mm_nrm_ps(__m128 v) -// { -// __m128 dot0 = dot(v, v); -// __m128 isr0 = _mm_rsqrt_ps(dot0); -// __m128 mul0 = _mm_mul_ps(v, isr0); -// return mul0; -// } -// -// __m128 rcp(__m128 v) -// { -// return _mm_rcp_ps(v); -// } -// -// //vec4 mad(vec4 v0, vec4 v1, vec4 v2) -// //{ -// // return v0 * v1 + v2; -// //} -// __m128 mad(__m128 v0, __m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v0, v1); -// __m128 add0 = _mm_add_ps(mul0, v2); -// return add0; -// } -// -// __m128 _mm_mad_ss(__m128 v0, __m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ss(v0, v1); -// __m128 add0 = _mm_add_ss(mul0, v2); -// return add0; -// } -// -// __m128 _mm_mad_ps(__m128 v0, __m128 v1, __m128 v2) -// { -// __m128 mul0 = _mm_mul_ps(v0, v1); -// __m128 add0 = _mm_add_ps(mul0, v2); -// return add0; -// } -// -// //vec4 reflect(vec4 I, vec4 N) -// //{ -// // return I - N * dot(N, I) * 2.0f; -// //} -// __m128 reflect(__m128 I, __m128 N) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(N, I); -// __m128 mul1 = _mm_mul_ps(mul0, two); -// __m128 sub0 = _mm_sub_ps(I, mul1); -// return sub0; -// } -// -// __m128 _mm_rfe_ps(__m128 I, __m128 N) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(N, I); -// __m128 mul1 = _mm_mul_ps(mul0, two); -// __m128 sub0 = _mm_sub_ps(I, mul1); -// return sub0; -// } -// -// //vec4 refract(vec4 I, vec4 N, T eta) -// //{ -// // float dotValue = dot(N, I); -// // float k = 1.0f - eta * eta * (1.0f - dotValue * dotValue); -// // if(k < 0.0f) -// // return vec4(0.0f); -// // return eta * I - (eta * dotValue + sqrt(k)) * N; -// //} -// __m128 refract(__m128 I, __m128 N, __m128 eta) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(eta, eta); -// __m128 mul1 = _mm_mul_ps(dot0, dot0); -// __m128 sub0 = _mm_sub_ps(one, mul0); -// __m128 sub1 = _mm_sub_ps(one, mul1); -// __m128 mul2 = _mm_mul_ps(sub0, sub1); -// -// if(_mm_movemask_ps(_mm_cmplt_ss(mul2, zero)) == 0) -// return zero; -// -// __m128 sqt0 = _mm_sqrt_ps(mul2); -// __m128 mul3 = _mm_mul_ps(eta, dot0); -// __m128 add0 = _mm_add_ps(mul3, sqt0); -// __m128 mul4 = _mm_mul_ps(add0, N); -// __m128 mul5 = _mm_mul_ps(eta, I); -// __m128 sub2 = _mm_sub_ps(mul5, mul4); -// -// return sub2; -// } -// -// __m128 _mm_rfa_ps(__m128 I, __m128 N, __m128 eta) -// { -// __m128 dot0 = dot(N, I); -// __m128 mul0 = _mm_mul_ps(eta, eta); -// __m128 mul1 = _mm_mul_ps(dot0, dot0); -// __m128 sub0 = _mm_sub_ps(one, mul0); -// __m128 sub1 = _mm_sub_ps(one, mul1); -// __m128 mul2 = _mm_mul_ps(sub0, sub1); -// -// if(_mm_movemask_ps(_mm_cmplt_ss(mul2, zero)) == 0) -// return zero; -// -// __m128 sqt0 = _mm_sqrt_ps(mul2); -// __m128 mul3 = _mm_mul_ps(eta, dot0); -// __m128 add0 = _mm_add_ps(mul3, sqt0); -// __m128 mul4 = _mm_mul_ps(add0, N); -// __m128 mul5 = _mm_mul_ps(eta, I); -// __m128 sub2 = _mm_sub_ps(mul5, mul4); -// -// return sub2; -// } -// -// -// struct vec4; -// typedef const vec4& vec4_param; -// -// template -// class comp -// { -// public: -// comp(int i) : -// index(i) -// { -// assert(i < N && i >= 0); -// } -// -// operator const int() const{return index;} -// -// private: -// int index; -// }; -// -// typedef comp<4> comp4_t; -// -// struct vec4 -// { -// vec4(); -// vec4(float s); -// vec4(float x, float y, float z, float w); -// vec4(float v[4]); -// -// explicit vec4(__m128 data); -// -// vec4& operator= (vec4_param v); -// vec4& operator+=(float s); -// vec4& operator+=(vec4_param v); -// vec4& operator-=(float s); -// vec4& operator-=(vec4_param v); -// vec4& operator*=(float s); -// vec4& operator*=(vec4_param v); -// vec4& operator/=(float s); -// vec4& operator/=(vec4_param v); -// vec4& operator++(); -// vec4& operator--(); -// -// union -// { -// __m128 data; -// struct{float x, y, z, w;}; -// float array[4]; -// }; -// }; -// -// vec4::vec4() : -// data(_mm_setzero_ps()) -// {} -// -// vec4::vec4(float s) : -// data(_mm_load_ps1(&s)) -//// data(_mm_set_ps1(s)) -// {} -// -// vec4::vec4(float v[4]) : -// data(_mm_load_ps(v)) -// {} -// -// vec4::vec4(float x, float y, float z, float w) : -//// data(_mm_setr_ps(x, y, z, w)) -// data(_mm_set_ps(w, z, y, x)) -// {} -// -// vec4::vec4(__m128 data) : -// data(data) -// {} -// -// vec4& vec4::operator= (vec4_param v) -// { -// this->data = v.data; -// return *this; -// } -// -// vec4& vec4::operator+=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_add_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator+=(vec4_param v) -// { -// this->data = _mm_add_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator-=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_sub_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator-=(vec4_param v) -// { -// this->data = _mm_sub_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator*=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_mul_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator*=(vec4_param v) -// { -// this->data = _mm_mul_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator/=(float s) -// { -// vec4 tmp(s); -// this->data = _mm_div_ps(this->data , tmp.data); -// return *this; -// } -// -// vec4& vec4::operator/=(vec4_param v) -// { -// this->data = _mm_div_ps(this->data , v.data); -// return *this; -// } -// -// vec4& vec4::operator++() -// { -// static __m128 inc = _mm_set_ps1(1.0f); -// this->data = _mm_add_ps(this->data , inc); -// return *this; -// } -// -// vec4& vec4::operator--() -// { -// static __m128 inc = _mm_set_ps1(1.0f); -// this->data = _mm_sub_ps(this->data , inc); -// return *this; -// } -// -// vec4 operator+ (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_add_ps(v1.data , v2.data)); -// } -// -// vec4 operator+ (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_add_ps(v1.data , v2.data)); -// } -// -// vec4 operator+ (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_add_ps(v1.data , v2.data)); -// } -// -// vec4 operator- (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_sub_ps(v1.data , v2.data)); -// } -// -// vec4 operator- (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_sub_ps(v1.data , v2.data)); -// } -// -// vec4 operator- (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_sub_ps(v1.data , v2.data)); -// } -// -// vec4 operator* (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_mul_ps(v1.data , v2.data)); -// } -// -// vec4 operator* (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_mul_ps(v1.data , v2.data)); -// } -// -// vec4 operator* (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_mul_ps(v1.data , v2.data)); -// } -// -// vec4 operator/ (const vec4& v1, const vec4& v2) -// { -// return vec4(_mm_div_ps(v1.data , v2.data)); -// } -// -// vec4 operator/ (const vec4& v1, const float s) -// { -// vec4 v2(s); -// return vec4(_mm_div_ps(v1.data , v2.data)); -// } -// -// vec4 operator/ (const float s, const vec4& v2) -// { -// vec4 v1(s); -// return vec4(_mm_div_ps(v1.data , v2.data)); -// } -// -// vec4 load(const vec4& v, const comp4_t component) -// { -// switch(component) -// { -// default: -// case 3: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0))); -// case 2: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1))); -// case 1: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2))); -// case 0: -// return vec4(_mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3))); -// } -// } -// -// vec4 rcp(vec4_param v) -// { -// return vec4(_mm_rcp_ps(v.data)); -// } -// -// vec4 sqrt(vec4_param v) -// { -// return vec4(_mm_sqrt_ps(v.data)); -// } -// -// vec4 inversesqrt(vec4_param v) -// { -// return vec4(_mm_rsqrt_ps(v.data)); -// } -// -// vec4 min(vec4_param v1, vec4_param v2) -// { -// return vec4(_mm_min_ps(v1.data, v2.data)); -// } -// -// vec4 max(vec4_param v1, vec4_param v2) -// { -// return vec4(_mm_max_ps(v1.data, v2.data)); -// } -// -// vec4 clamp(vec4_param v, float minVal, float maxVal) -// { -// vec4 v1(minVal); -// vec4 v2(maxVal); -// return vec4(_mm_min_ps(_mm_max_ps(v.data, v2.data), v1.data)); -// } -// -// vec4 clamp(vec4_param v, vec4_param minVal, vec4_param maxVal) -// { -// return vec4(_mm_min_ps(_mm_max_ps(v.data, maxVal.data), minVal.data)); -// } -// -// vec4 mix(vec4_param x, vec4_param y, vec4_param a) -// { -// __m128 one = _mm_set_ps1(1.0f); -// __m128 b = _mm_sub_ps(one, a.data); -// __m128 mul1 = _mm_mul_ps(x.data, b); -// __m128 mul2 = _mm_mul_ps(y.data, a.data); -// __m128 addFinal = _mm_add_ps(mul1, mul2); -// return vec4(addFinal); -// -// -//// __m128 b = _mm_sub_ps(_mm_set_ps1(1.0f), a.data); -//// return vec4(_mm_add_ps(_mm_mul_ps(x.data, b), _mm_mul_ps(y.data, a.data))); -// } -// -// float dot(vec4_param x, vec4_param y) -// { -// float result = 0.0f; -// _mm_store_ss(&result, dot(x.data, y.data)); -// return result; -// } -// -// vec4 reflect(vec4_param I, vec4_param N) -// { -// __m128 Normal = N.data; -// __m128 Inc = I.data; -// __m128 Two = _mm_set_ps1(2.0f); -// __m128 Mul = _mm_mul_ps(Normal, dot(Normal, Inc)); -// return vec4(_mm_sub_ps(Inc, _mm_mul_ps(Mul, Two))); -// } -// -// vec4 refract(vec4_param I, vec4_param N, float eta) -// { -// __m128 zero = _mm_set_ps1(0.0f); -// __m128 eta1 = _mm_set_ps1(eta); -// __m128 eta2 = _mm_mul_ps(eta1, eta1); -// __m128 one = _mm_set_ps1(1.0f); -// __m128 dotValue = dot(I.data, N.data); -// __m128 dotValue2 = _mm_mul_ps(dotValue, dotValue); -// __m128 k = _mm_sub_ps(one, _mm_mul_ps(eta2, _mm_sub_ps(one, dotValue2))); -// __m128 isnull = _mm_cmplt_ss(k, zero); -// if(_mm_movemask_ps(isnull) == 0) -// return vec4(zero); -// else -// { -// __m128 temp0 = _mm_add_ps(_mm_mul_ps(eta1, dotValue), sqrt(k)); -// __m128 temp1 = _mm_shuffle_ps(temp0, temp0, _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 temp2 = _mm_mul_ps(temp1, N.data); -// __m128 temp3 = _mm_mul_ps(eta1, I.data); -// return vec4(_mm_sub_ps(temp3, temp2)); -// } -// } -// -// -//}; -// -//namespace glm -//{ -// glm::vec4 rcp(const glm::vec4& v) -// { -// return 1.0f / v; -// } -//} -// -//namespace cpu -//{ -// void sincos(float a, float &s, float &c) -// { -// _asm -// { -// fld a -// fsincos -// mov ecx, c -// mov edx, s -// fstp dword ptr [ecx] -// fstp dword ptr [edx] -// } -// } -// -// void sincos(double a, double& s, double& c) -// { -// _asm -// { -// fld a -// fsincos -// mov ecx, c -// mov edx, s -// fstp qword ptr [ecx] -// fstp qword ptr [edx] -// } -// } -// -// float sin(float s) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s -// fsin -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// -// //float result = 0.0f; -// //_asm -// //{ -// // fld s -// // fsin -// // mov ecx, result -// // fstp dword ptr [ecx] -// //} -// //return result; -// } -// -// float abs(float s) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s -// fabs -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// -// //float result = 0.0f; -// //_asm -// //{ -// // fld s -// // fsin -// // mov ecx, result -// // fstp dword ptr [ecx] -// //} -// //return result; -// } -// -// float add(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fadd -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -// -// float sub(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fsub -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -// -// float mul(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fmul -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -// -// float div(float s1, float s2) -// { -// float result = 0.0f; -// float* p = &result; -// _asm -// { -// fld s1 -// fld s2 -// fdiv -// mov ecx, p -// fstp dword ptr [ecx] -// } -// return result; -// } -//} -// -//void test_asm() -//{ -// float sin0 = cpu::sin(1.0f); -// float sin1 = glm::sin(1.0f); -// float add0 = cpu::add(1.0f, 2.0f); -// float sub0 = cpu::sub(1.0f, 2.0f); -// -// -// float end = 1.0f; -//} -// -//void test_clamp() -//{ -// sse::vec4 v(0.5f, 0.5f, 9.5f, 9.5f); -// sse::vec4 minVal(1.0f, 2.0f, 3.0f, 4.0f); -// sse::vec4 maxVal(5.0f, 6.0f, 7.0f, 8.0f); -// -// __m128 clamp0 = sse::clamp( -// v.data, -// minVal.data, -// maxVal.data); -// -// glm::vec4 clamp1 = glm::clamp( -// glm::vec4(0.5f, 0.5f, 9.5f, 9.5f), -// glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), -// glm::vec4(5.0f, 6.0f, 7.0f, 8.0f)); -// -// __m128 end = _mm_setzero_ps(); -//} -// -//#define DECLARE_EPI32_CONST(name) \ -// extern const _MM_ALIGN16 int _epi32_##name[4]; -//#define IMPLEMENT_EPI32_CONST(name,x) \ -// const _MM_ALIGN16 int _epi32_##name[4]={x,x,x,x}; -//#define IMPLEMENT_EPI32_CONST4(name,x,y,z,w) \ -// const _MM_ALIGN16 int _epi32_##name[4]={w,z,y,x}; -// -//#define DECLARE_PS_CONST(name) \ -// extern const _MM_ALIGN16 float _ps_##name[4]; -//#define IMPLEMENT_PS_CONST(name,x) \ -// const _MM_ALIGN16 float _ps_##name[4]={x,x,x,x}; -//#define IMPLEMENT_PS_CONST4(name,x,y,z,w) \ -// const _MM_ALIGN16 float _ps_##name[4]={w,z,y,x}; -// -////IMPLEMENT_PS_CONST(sincos_p0, 0.15707963267948963959e1f) -////IMPLEMENT_PS_CONST(sincos_p1, -0.64596409750621907082e0f) -////IMPLEMENT_PS_CONST(sincos_p2, 0.7969262624561800806e-1f) -////IMPLEMENT_PS_CONST(sincos_p3, -0.468175413106023168e-2f) -// -//IMPLEMENT_EPI32_CONST(sign_mask,0x80000000) -//IMPLEMENT_EPI32_CONST(inv_sign_mask,0x7FFFFFFF) -//IMPLEMENT_EPI32_CONST(mant_mask,0x7F800000) -//IMPLEMENT_EPI32_CONST(inv_mant_mask,0x807FFFFF) -//IMPLEMENT_EPI32_CONST(min_norm_pos,0x00800000) -//IMPLEMENT_EPI32_CONST(1,1) -//IMPLEMENT_EPI32_CONST(2,2) -//IMPLEMENT_EPI32_CONST(7,7) -//IMPLEMENT_EPI32_CONST(127,127) -//IMPLEMENT_EPI32_CONST(ninf,0xFF800000) -//IMPLEMENT_EPI32_CONST(pinf,0x7F800000) -// -//IMPLEMENT_PS_CONST(1_3,0.33333333333333333333333333333333f) -//IMPLEMENT_PS_CONST(0p5,0.5f) -//IMPLEMENT_PS_CONST(1,1.0f) -//IMPLEMENT_PS_CONST(m1,-1.0f) -//IMPLEMENT_PS_CONST(2,2.0f) -//IMPLEMENT_PS_CONST(3,3.0f) -//IMPLEMENT_PS_CONST(127,127.0f) -//IMPLEMENT_PS_CONST(255,255.0f) -//IMPLEMENT_PS_CONST(2pow23,8388608.0f) -// -//IMPLEMENT_PS_CONST4(1_0_0_0,1.0f,0.0f,0.0f,0.0f) -//IMPLEMENT_PS_CONST4(0_1_0_0,0.0f,1.0f,0.0f,0.0f) -//IMPLEMENT_PS_CONST4(0_0_1_0,0.0f,0.0f,1.0f,0.0f) -//IMPLEMENT_PS_CONST4(0_0_0_1,0.0f,0.0f,0.0f,1.0f) -// -//IMPLEMENT_PS_CONST(pi, 3.1415926535897932384626433832795f) -//IMPLEMENT_PS_CONST(pi2, 6.283185307179586476925286766560f) -//IMPLEMENT_PS_CONST(2_pi, 0.63661977236758134307553505349006f) -//IMPLEMENT_PS_CONST(pi_2, 1.5707963267948966192313216916398f) -//IMPLEMENT_PS_CONST(4_pi, 1.2732395447351626861510701069801f) -//IMPLEMENT_PS_CONST(pi_4, 0.78539816339744830961566084581988f) -// -//IMPLEMENT_PS_CONST(sincos_p0, 0.15707963267948963959e1f) -//IMPLEMENT_PS_CONST(sincos_p1, -0.64596409750621907082e0f) -//IMPLEMENT_PS_CONST(sincos_p2, 0.7969262624561800806e-1f) -//IMPLEMENT_PS_CONST(sincos_p3, -0.468175413106023168e-2f) -//IMPLEMENT_PS_CONST(tan_p0, -1.79565251976484877988e7f) -//IMPLEMENT_PS_CONST(tan_p1, 1.15351664838587416140e6f) -//IMPLEMENT_PS_CONST(tan_p2, -1.30936939181383777646e4f) -//IMPLEMENT_PS_CONST(tan_q0, -5.38695755929454629881e7f) -//IMPLEMENT_PS_CONST(tan_q1, 2.50083801823357915839e7f) -//IMPLEMENT_PS_CONST(tan_q2, -1.32089234440210967447e6f) -//IMPLEMENT_PS_CONST(tan_q3, 1.36812963470692954678e4f) -//IMPLEMENT_PS_CONST(tan_poleval,3.68935e19f) -//IMPLEMENT_PS_CONST(atan_t0, -0.91646118527267623468e-1f) -//IMPLEMENT_PS_CONST(atan_t1, -0.13956945682312098640e1f) -//IMPLEMENT_PS_CONST(atan_t2, -0.94393926122725531747e2f) -//IMPLEMENT_PS_CONST(atan_t3, 0.12888383034157279340e2f) -//IMPLEMENT_PS_CONST(atan_s0, 0.12797564625607904396e1f) -//IMPLEMENT_PS_CONST(atan_s1, 0.21972168858277355914e1f) -//IMPLEMENT_PS_CONST(atan_s2, 0.68193064729268275701e1f) -//IMPLEMENT_PS_CONST(atan_s3, 0.28205206687035841409e2f) -// -//IMPLEMENT_PS_CONST(exp_hi, 88.3762626647949f) -//IMPLEMENT_PS_CONST(exp_lo, -88.3762626647949f) -//IMPLEMENT_PS_CONST(exp_rln2, 1.4426950408889634073599f) -//IMPLEMENT_PS_CONST(exp_p0, 1.26177193074810590878e-4f) -//IMPLEMENT_PS_CONST(exp_p1, 3.02994407707441961300e-2f) -//IMPLEMENT_PS_CONST(exp_q0, 3.00198505138664455042e-6f) -//IMPLEMENT_PS_CONST(exp_q1, 2.52448340349684104192e-3f) -//IMPLEMENT_PS_CONST(exp_q2, 2.27265548208155028766e-1f) -//IMPLEMENT_PS_CONST(exp_q3, 2.00000000000000000009e0f) -//IMPLEMENT_PS_CONST(exp_c1, 6.93145751953125e-1f) -//IMPLEMENT_PS_CONST(exp_c2, 1.42860682030941723212e-6f) -//IMPLEMENT_PS_CONST(exp2_hi, 127.4999961853f) -//IMPLEMENT_PS_CONST(exp2_lo, -127.4999961853f) -//IMPLEMENT_PS_CONST(exp2_p0, 2.30933477057345225087e-2f) -//IMPLEMENT_PS_CONST(exp2_p1, 2.02020656693165307700e1f) -//IMPLEMENT_PS_CONST(exp2_p2, 1.51390680115615096133e3f) -//IMPLEMENT_PS_CONST(exp2_q0, 2.33184211722314911771e2f) -//IMPLEMENT_PS_CONST(exp2_q1, 4.36821166879210612817e3f) -//IMPLEMENT_PS_CONST(log_p0, -7.89580278884799154124e-1f) -//IMPLEMENT_PS_CONST(log_p1, 1.63866645699558079767e1f) -//IMPLEMENT_PS_CONST(log_p2, -6.41409952958715622951e1f) -//IMPLEMENT_PS_CONST(log_q0, -3.56722798256324312549e1f) -//IMPLEMENT_PS_CONST(log_q1, 3.12093766372244180303e2f) -//IMPLEMENT_PS_CONST(log_q2, -7.69691943550460008604e2f) -//IMPLEMENT_PS_CONST(log_c0, 0.693147180559945f) -//IMPLEMENT_PS_CONST(log2_c0, 1.44269504088896340735992f) -// -//#define GLM_NAKED __declspec(naked) __cdecl -// -//__m128 GLM_NAKED _mm_cos_ps(__m128 x) -//{ -// __asm -// { -// andps xmm0, _epi32_inv_sign_mask -// addps xmm0, _ps_pi_2 -// mulps xmm0, _ps_2_pi -// pxor xmm3, xmm3 -// movdqa xmm5, _epi32_1 -// movaps xmm4, _ps_1 -// cvttps2dq xmm2, xmm0 -// pand xmm5, xmm2 -// pcmpeqd xmm5, xmm3 -// cvtdq2ps xmm6, xmm2 -// pand xmm2, _epi32_2 -// pslld xmm2, 30 -// subps xmm0, xmm6 -// minps xmm0, xmm4 -// subps xmm4, xmm0 -// andps xmm0, xmm5 -// andnps xmm5, xmm4 -// orps xmm0, xmm5 -// movaps xmm1, xmm0 -// mulps xmm0, xmm0 -// orps xmm1, xmm2 -// movaps xmm7, xmm0 -// mulps xmm0, _ps_sincos_p3 -// addps xmm0, _ps_sincos_p2 -// mulps xmm0, xmm7 -// addps xmm0, _ps_sincos_p1 -// mulps xmm0, xmm7 -// addps xmm0, _ps_sincos_p0 -// mulps xmm0, xmm1 -// ret -// } -//} -// -//void test_sse() -//{ -// sse::vec4 v1(1.0f, 2.0f, 3.0f, 4.0f); -// sse::vec4 v2(5.0f, 6.0f, 7.0f, 8.0f); -// sse::vec4 v3(9.0f); -// sse::vec4 v4(0.5f, 0.5f, 0.5f, 0.5f); -// __m128 v5 = sse::mix(v1.data, v2.data, v4.data); -// __m128 dot0 = sse::dot(v1.data, v2.data); -// float dot1 = sse::dot(v1, v2); -// __m128 rcp0 = sse::rcp(v1.data); -// glm::vec4 rcp1 = rcp(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f)); -// -// // cross -// { -// sse::vec4 v1(4.0f, 2.0f, 2.0f, 0.0f); -// sse::vec4 v2(1.0f, 2.0f, 3.0f, 0.0f); -// __m128 crs0 = sse::cross(v1.data, v2.data); -// -// glm::vec3 v3(4.0f, 2.0f, 2.0f); -// glm::vec3 v4(1.0f, 2.0f, 3.0f); -// glm::vec3 crs1 = glm::cross(v3, v4); -// -// __m128 end = _mm_set_ps1(1.0f); -// } -// -// // ieee754 -// { -// sse::detail::ieee754 one(1.f); -// float f = sse::load(one.mantissa, one.exp, one.sign); -// -// __m128 end = _mm_set_ps1(1.0f); -// } -// -// test_clamp(); -// test_asm(); -// -// __m128 cos0 = _mm_cos_ps(_mm_set_ps1(1.0f)); -// glm::vec4 cos1 = glm::cos(glm::vec4(1.0f)); -// -// float f = glm::dot(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(5.0f, 6.0f, 7.0f, 8.0f)); -// sse::vec4 end(9.0f); -// -// //sse::vec4 vComp = sse::load(sse::vec4(1.0f, 2.0f, 3.0f, 4.0f), 1); -// //vComp += sse::vec4(1.0f); -// //--vComp; -// //sse::vec4 vMixed = sse::mix(vComp, sse::vec4(-0.5f), sse::vec4(0.5f)); -// //float sDot = sse::dot(sse::vec4(1.0f), sse::vec4(2.0f)); -// //float cDot = glm::dot(glm::vec4(1.0f), glm::vec4(2.0f)); -//} diff --git a/experimental/sse/sse.h b/experimental/sse/sse.h deleted file mode 100644 index 3ba5a7a0..00000000 --- a/experimental/sse/sse.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __GLM_SSE_H__ -#define __GLM_SSE_H__ - -#ifdef _WIN32 -#include -#endif - -#include "glm/glm.h" -#include "glm/glmext.h" - -void test_sse(); - -#endif//__GLM_SSE_H__ diff --git a/experimental/sse/sse.sln b/experimental/sse/sse.sln deleted file mode 100644 index 7f54daaa..00000000 --- a/experimental/sse/sse.sln +++ /dev/null @@ -1,23 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sse", "sse.vcproj", "{55569881-CA84-46D7-A385-C192D498163F}" -EndProject -Global - GlobalSection(DPCodeReviewSolutionGUID) = preSolution - DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {55569881-CA84-46D7-A385-C192D498163F}.Debug|Win32.ActiveCfg = Debug|Win32 - {55569881-CA84-46D7-A385-C192D498163F}.Debug|Win32.Build.0 = Debug|Win32 - {55569881-CA84-46D7-A385-C192D498163F}.Release|Win32.ActiveCfg = Release|Win32 - {55569881-CA84-46D7-A385-C192D498163F}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/experimental/sse/sse.vcproj b/experimental/sse/sse.vcproj deleted file mode 100644 index a968a81a..00000000 --- a/experimental/sse/sse.vcproj +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/experimental/sse/sse_mat4.cpp b/experimental/sse/sse_mat4.cpp deleted file mode 100644 index 34a0c5ad..00000000 --- a/experimental/sse/sse_mat4.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "precompiled.h" -#include "sse_mat4.h" - -void test_sse_mat4() -{ - { - glm::sse::mat4 m( - glm::sse::vec4(0, 1, 2, 3), - glm::sse::vec4(4, 5, 6, 7), - glm::sse::vec4(8, 9, 10, 11), - glm::sse::vec4(12, 13, 14, 15)); - glm::sse::mat4 n = glm::sse::transpose(m); - m.transpose(); - glm::sse::mat4 m_end; - } - - { - glm::sse::mat4 m0; - glm::sse::mat4 m1(3.f); - glm::sse::mat4 m2( - glm::sse::vec4(1), - glm::sse::vec4(2), - glm::sse::vec4(3), - glm::sse::vec4(4)); - glm::sse::mat4 m3 = m1 + 1.0f; - glm::sse::mat4 m4 = 1.0f + m1; - glm::sse::mat4 m5 = m2 * m2; - - glm::sse::vec4 v0 = glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::sse::vec4 v1 = glm::sse::vec4(5.0f, 6.0f, 7.0f, 8.0f); - glm::sse::vec4 v2 = glm::sse::mat4(v0, v1, v0, v1) * glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::sse::vec4 v3 = glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f) * glm::sse::mat4(v0, v1, v0, v1); - glm::sse::vec4 v_end; - } - - { - glm::mat4 m0; - glm::mat4 m1(3.f); - glm::mat4 m2( - glm::vec4(1), - glm::vec4(2), - glm::vec4(3), - glm::vec4(4)); - glm::mat4 m3 = m1 + 1.0f; - glm::mat4 m4 = 1.0f + m1; - glm::mat4 m5 = m2 * m2; - - glm::vec4 v0 = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4 v1 = glm::vec4(5.0f, 6.0f, 7.0f, 8.0f); - glm::vec4 v2 = glm::mat4(v0, v1, v0, v1) * glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4 v3 = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f) * glm::mat4(v0, v1, v0, v1); - glm::vec4 v_end; - } - - { - int a[][4] = {{0, 0, 1, 2}, {0, 0, 1, 2}}; - } - - glm::sse::mat4 m_end; -} diff --git a/experimental/sse/sse_mat4.h b/experimental/sse/sse_mat4.h deleted file mode 100644 index 31257107..00000000 --- a/experimental/sse/sse_mat4.h +++ /dev/null @@ -1,1280 +0,0 @@ -#ifndef GLM_SSE_MAT4_H -#define GLM_SSE_MAT4_H - -#include -#include -#include "sse_vec4.h" - -namespace glm{ -namespace sse{ - -const __m128i maskX = _mm_set_epi32(0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF); -const __m128i maskY = _mm_set_epi32(0x00000000, 0x00000000, 0xFFFFFFFF, 0x00000000); -const __m128i maskZ = _mm_set_epi32(0x00000000, 0xFFFFFFFF, 0x00000000, 0x00000000); -const __m128i maskW = _mm_set_epi32(0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000); - -GLM_ALIGN(16) struct mat4 -{ - enum ENoInit - { - NO_INIT - }; - - union - { - __m128 data[4]; - }; - - mat4(); - mat4(ENoInit NoInit); - mat4(float s); - mat4(const vec4& x, const vec4& y, const vec4& z, const vec4& w); - - mat4& operator+=(const float s); - - mat4& operator+=(const mat4& m); - mat4& operator*=(const mat4& m); - - void mat4::transpose(); -}; - -__forceinline mat4::mat4() -{ - void* address = this; - - __asm - { - mov esi, address - xorps xmm0, xmm0 - movaps [esi+0x00], xmm0 - movaps [esi+0x10], xmm0 - movaps [esi+0x20], xmm0 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4::mat4(ENoInit NoInit) -{} - -__forceinline mat4::mat4(float s) -{ - void* address = this; - - __asm - { - mov esi, address - movss xmm0, s - shufps xmm0, xmm0, 0 - xorps xmm1, xmm1 - movaps [esi+0x00], xmm1 - movaps [esi+0x10], xmm1 - movaps [esi+0x20], xmm1 - movaps [esi+0x30], xmm1 - movss [esi+0x00], xmm0 - movss [esi+0x14], xmm0 - movss [esi+0x28], xmm0 - movss [esi+0x3C], xmm0 - } -} - -__forceinline mat4::mat4(const vec4& x, const vec4& y, const vec4& z, const vec4& w) -{ - void* address = this; - - __asm - { - mov esi, address - - mov edi, x - movaps xmm0, [edi] - movaps [esi+0x00], xmm0 - - mov edi, y - movaps xmm0, [edi] - movaps [esi+0x10], xmm0 - - mov edi, z - movaps xmm0, [edi] - movaps [esi+0x20], xmm0 - - mov edi, w - movaps xmm0, [edi] - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator+(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - addps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - addps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - addps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - addps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator+(float s, const mat4& m) -{ - return m + s; -} - -__forceinline mat4 operator-(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - subps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - subps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - subps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - subps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator-(float s, const mat4& m) -{ - __asm - { - movss xmm2, s - shufps xmm2, xmm2, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x00], xmm1 - - movaps xmm0, [esi+0x10] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x10], xmm1 - - movaps xmm0, [esi+0x20] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x20], xmm1 - - movaps xmm0, [esi+0x30] - movaps xmm1, xmm2 - subps xmm1, xmm0 - movaps [esi+0x30], xmm1 - } -} - -__forceinline mat4 operator*(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - mulps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - mulps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - mulps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - mulps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator*(float s, const mat4& m) -{ - return m * s; -} - -__forceinline mat4 operator/(const mat4& m, float s) -{ - __asm - { - movss xmm1, s - shufps xmm1, xmm1, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - divps xmm0, xmm1 - movaps [esi+0x00], xmm0 - - movaps xmm0, [esi+0x10] - divps xmm0, xmm1 - movaps [esi+0x10], xmm0 - - movaps xmm0, [esi+0x20] - divps xmm0, xmm1 - movaps [esi+0x20], xmm0 - - movaps xmm0, [esi+0x30] - divps xmm0, xmm1 - movaps [esi+0x30], xmm0 - } -} - -__forceinline mat4 operator/(float s, const mat4& m) -{ - __asm - { - movss xmm2, s - shufps xmm2, xmm2, 0 - mov esi, [m] - - movaps xmm0, [esi+0x00] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x00], xmm1 - - movaps xmm0, [esi+0x10] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x10], xmm1 - - movaps xmm0, [esi+0x20] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x20], xmm1 - - movaps xmm0, [esi+0x30] - movaps xmm1, xmm2 - divps xmm1, xmm0 - movaps [esi+0x30], xmm1 - } -} - -__forceinline vec4 operator*(const mat4& m, const vec4& v) -{ - vec4 result(vec4::NO_INIT); - - // SSE2 - __asm - { - mov esi, [m] - mov edi, [v] - movaps xmm4, [edi] - - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result, xmm0 - } - - return result; -} - -__forceinline vec4 operator*(const vec4& v, const mat4& m) -{ - vec4 result(vec4::NO_INIT); - - // SSE1 - __asm - { - mov esi, [m] - mov edi, [v] - movaps xmm4, [edi] // xmm4: v[3], v[2], v[1], v[0] - - movaps xmm0, [esi+0x00] // xmm0: m[0][3], m[0][2], m[0][1], m[0][0] - movaps xmm1, [esi+0x10] // xmm1: m[1][3], m[1][2], m[1][1], m[1][0] - movaps xmm2, [esi+0x20] // xmm2: m[2][3], m[2][2], m[2][1], m[2][0] - movaps xmm3, [esi+0x30] // xmm3: m[3][3], m[3][2], m[3][1], m[3][0] - - mulps xmm0, xmm4 // xmm0: m[0][3]*v[3], m[0][2]*v[2], m[0][1]*v[1], m[0][0]*v[0] - mulps xmm1, xmm4 // xmm1: m[1][3]*v[3], m[1][2]*v[2], m[1][1]*v[1], m[1][0]*v[0] - mulps xmm2, xmm4 // xmm2: m[2][3]*v[3], m[2][2]*v[2], m[2][1]*v[1], m[2][0]*v[0] - mulps xmm3, xmm4 // xmm2: m[3][3]*v[3], m[3][2]*v[2], m[3][1]*v[1], m[3][0]*v[0] - - movaps xmm4, xmm0 // xmm4: m[0][3]*v[3], m[0][2]*v[2], m[0][1]*v[1], m[0][0]*v[0] - movhlps xmm0, xmm1 // xmm0: m[0][3]*v[3], m[0][2]*v[2], m[1][3]*v[3], m[1][2]*v[2] - movlhps xmm1, xmm4 // xmm1: m[0][1]*v[1], m[0][0]*v[0], m[1][1]*v[1], m[1][0]*v[0] - addps xmm0, xmm1 - - movaps xmm5, xmm2 - movhlps xmm2, xmm3 - movlhps xmm3, xmm5 - addps xmm2, xmm3 - - movaps xmm1, xmm0 - shufps xmm0, xmm2, _MM_SHUFFLE(0, 2, 0, 2) //_MM_SHUFFLE(2, 0, 2, 0) - shufps xmm1, xmm2, _MM_SHUFFLE(1, 3, 1, 3) //_MM_SHUFFLE(3, 1, 3, 1) - addps xmm0, xmm1 - - movaps result, xmm0 - } - - return result; -} - -// 289000 -/* -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - next: - movaps xmm7, [edi] - - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm4 - - pshufd xmm4, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm4 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm4 - - pshufd xmm4, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm4 - - addps xmm2, xmm3 - addps xmm0, xmm1 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -// 288000 -/* -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - next: - movaps xmm7, [edi] - - movaps xmm0, [esi+0x00] - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm5 - - movaps xmm1, [esi+0x10] - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - - movaps xmm2, [esi+0x20] - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm5 - - movaps xmm3, [esi+0x30] - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ -/* -// 290000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm4 - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm4 - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 295000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm4 - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm4 - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 290000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm0, xmm4 - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm2, xmm4 - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 288000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov ecx, 0x10 - mov edx, 0x04 - - movaps xmm7, [edi] - - next: - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm4, xmm7, _MM_SHUFFLE(0, 0, 0, 0) - pshufd xmm5, xmm7, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm0, xmm4 - mulps xmm1, xmm5 - addps xmm0, xmm1 - - pshufd xmm4, xmm7, _MM_SHUFFLE(2, 2, 2, 2) - pshufd xmm5, xmm7, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm2, xmm4 - mulps xmm3, xmm5 - addps xmm2, xmm3 - - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, ecx - add eax, ecx - dec edx - jnz next - } - - return result; -} -*/ - -/* -// 298000 -inline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result; - void* adresse = &result; - - const int int0x10 = 0x10; - - // SSE2 - __asm - { - mov esi, m - mov edi, n - mov eax, adresse - mov edx, int0x10 - - // First column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, edx - add eax, edx - - // Second column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, edx - add eax, edx - - // Third column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - - add edi, edx - add eax, edx - - // Forth column - movaps xmm4, [edi] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps [eax], xmm0 - } - - return result; -} -*/ - -// 294000 -__forceinline mat4 operator*(const mat4& m, const mat4& n) -{ - mat4 result(mat4::NO_INIT); - - // SSE2 - __asm - { - mov esi, m - mov edi, n - - // First column - movaps xmm4, [edi+0x00] - - movaps xmm0, [esi+0x00] - movaps xmm1, [esi+0x10] - movaps xmm2, [esi+0x20] - movaps xmm3, [esi+0x30] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - mulps xmm0, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - mulps xmm1, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - mulps xmm2, xmm5 - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x00], xmm0 - - // Second column - movaps xmm4, [edi+0x10] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x10], xmm0 - - // Third column - movaps xmm4, [edi+0x20] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x20], xmm0 - - // Forth column - movaps xmm4, [edi+0x30] - - pshufd xmm5, xmm4, _MM_SHUFFLE(0, 0, 0, 0) - movaps xmm0, [esi+0x00] - mulps xmm0, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(1, 1, 1, 1) - movaps xmm1, [esi+0x10] - mulps xmm1, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(2, 2, 2, 2) - movaps xmm2, [esi+0x20] - mulps xmm2, xmm5 - - pshufd xmm5, xmm4, _MM_SHUFFLE(3, 3, 3, 3) - movaps xmm3, [esi+0x30] - mulps xmm3, xmm5 - - addps xmm0, xmm1 - addps xmm2, xmm3 - addps xmm0, xmm2 - - movaps result[0x30], xmm0 - } - - return result; -} - -const __m128 sign1010 = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); -const __m128 sign0101 = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); -const __m128i mask1010 = _mm_set_epi32(0x00000000, 0x80000000, 0x00000000, 0x80000000); -const __m128i mask0101 = _mm_set_epi32(0x80000000, 0x00000000, 0x80000000, 0x00000000); - -__forceinline mat4 inverse(const mat4& m) -{ - mat4 result(mat4::NO_INIT); - - vec4 m0a; - vec4 m0b; - vec4 m0c; - - vec4 m1a; - vec4 m1b; - vec4 m1c; - - vec4 m2a; - vec4 m2b; - vec4 m2c; - - vec4 m3a; - vec4 m3b; - vec4 m3c; - - __asm - { - mov esi, m - - ////////////////////////////////////////////////////////////////////////////////////////////// - //R00 = +1 * m11*(m22*m33 - m32*m23) -1 * m12*(m23*m31 - m33*m21) +1 * m13*(m21*m32 - m31*m22) - //R01 = -1 * m12*(m23*m30 - m33*m20) +1 * m13*(m20*m32 - m30*m22) -1 * m10*(m22*m33 - m32*m23) - //R02 = +1 * m13*(m20*m31 - m30*m21) -1 * m10*(m21*m33 - m31*m23) +1 * m11*(m23*m30 - m33*m20) - //R03 = -1 * m10*(m21*m32 - m31*m22) +1 * m11*(m22*m30 - m32*m20) -1 * m12*(m20*m31 - m30*m21) - - movaps xmm6, [esi+20] // xmm6: m23, m22, m21, m20 - movaps xmm7, [esi+30] // xmm7: m33, m32, m31, m30 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm0: m21, m20, m23, m22 (movhlps optimization possible) - pshufd xmm1, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm1: m30, m33, m32, m31 - pshufd xmm2, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm2: m20, m23, m22, m21 - pshufd xmm3, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm3: m31, m30, m33, m32 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m21*m30, m20*m33, m23*m32, m22*m31 - mulps xmm3, xmm2 // xmm2: m20*m31, m23*m30, m22*m33, m21*m32 - subps xmm3, xmm0 // xmm2: m20*m31-m21*m30, m23*m30-m20*m33, m22*m33-m23*m32, m21*m32-m22*m31 - movaps xmm4, xmm3 // xmm4: m20*m31-m21*m30, m23*m30-m20*m33, m22*m33-m23*m32, m21*m32-m22*m31 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm0: m22, m21, m20, m23 - // Reuse xmm1: pshufd xmm1, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm1: m30, m33, m32, m31 - // Reuse xmm2: pshufd xmm2, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm2: m20, m23, m22, m21 - pshufd xmm3, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm3: m32, m31, m30, m33 - - mulps xmm1, xmm0 // xmm1: m30*m22, m33*m21, m32*m20, m31*m23 - mulps xmm2, xmm3 // xmm2: m20*m32, m23*m31, m22*m30, m21*m33 - subps xmm1, xmm2 // xmm1: m30*m22-m20*m32, m33*m21-m23*m31, m32*m20-m22*m30, m31*m23-m21*m33 - movaps xmm5, xmm2 // xmm5: m30*m22-m20*m32, m33*m21-m23*m31, m32*m20-m22*m30, m31*m23-m21*m33 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - // Reuse xmm0: pshufd xmm0, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm0: m22, m21, m20, m23 - pshufd xmm1, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm1: m31, m30, m33, m32 (movhlps optimization possible) - pshufd xmm2, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm2: m21, m20, m23, m22 (movhlps optimization possible) - // Reuse xmm3: pshufd xmm3, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm3: m32, m31, m30, m33 - - mulps xmm0, xmm1 // xmm1: m22*m31, m21*m30, m20*m33, m23*m32 - mulps xmm2, xmm3 // xmm2: m21*m32, m20*m31, m23*m30, m22*m33 - subps xmm2, xmm0 // xmm2: m23*m32-m22*m33, m20*m33-m23*m30, m21*m30-m20*m31, m22*m31-m21*m32 - movaps xmm6, xmm0 // xmm6: m23*m32-m22*m33, m20*m33-m23*m30, m21*m30-m20*m31, m22*m31-m21*m32 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - movaps xmm0, [esi+10] // m13, m12, m11, m10 - - pshufd xmm1, xmm0, _MM_SHUFFLE(2, 1, 0, 3) - xorps xmm1, mask1010 //-m12, m11,-m10, m13 - mulaps xmm4, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(1, 0, 3, 2) // (movhlps optimization possible) - xorps xmm1, mask0101 // m11,-m10, m13,-m12 - mulaps xmm5, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(0, 3, 2, 1) - xorps xmm1, mask1010 //-m10, m13,-m12, m10 - mulaps xmm6, xmm1 - - mulaps xmm6, xmm5 - mulaps xmm6, xmm4 - movaps result[0x00], xmm6 - - ////////////////////////////////////////////////////////////////////////////////////////////// - //R10 = -1 * m21*(m32*m03 – m02*m33) +1 * m22*(m33*m01 – m03*m31) –1 * m23*(m31*m02 – m01*m32) - //R11 = +1 * m22*(m33*m00 – m03*m30) –1 * m23*(m30*m02 – m00*m32) +1 * m20*(m32*m03 – m02*m33) - //R12 = -1 * m23*(m30*m01 – m00*m31) +1 * m20*(m31*m03 – m01*m33) -1 * m21*(m33*m00 – m03*m30) - //R13 = +1 * m20*(m31*m02 – m01*m32) -1 * m21*(m32*m00 – m02*m30) +1 * m22*(m30*m01 – m00*m31) - - movaps xmm6, [esi+00] // xmm6: m03, m02, m01, m00 - // Reuse xmm7 movaps xmm7, [esi+30] // xmm7: m33, m32, m31, m30 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm0: m00, m03, m02, m01 - pshufd xmm1, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm1: m31, m30, m33, m32 (movhlps optimization possible) - pshufd xmm2, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm2: m01, m00, m03, m02 (movhlps optimization possible) - pshufd xmm3, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm3: m30, m33, m32, m31 - - mulps xmm0, xmm1 // xmm0: m31*m00, m30*m03, m33*m02, m32*m01 - mulps xmm3, xmm2 // xmm3: m30*m01, m33*m00, m32*m03, m31*m02 - subps xmm3, xmm0 // xmm3: m30*m01-m31*m00, m33*m00-m30*m03, m32*m03-m33*m02, m31*m02-m32*m01 - movaps xmm4, xmm3 // xmm4: m30*m01-m31*m00, m33*m00-m30*m03, m32*m03-m33*m02, m31*m02-m32*m01 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - // Reuse xmm0 pshufd xmm0, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm0: m00, m03, m02, m01 - pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - // Reuse xmm3 pshufd xmm3, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm3: m30, m33, m32, m31 - - mulps xmm0, xmm1 // xmm0: m00*m32, m03*m31, m02*m30, m01*m33 - mulps xmm3, xmm2 // xmm3: m30*m02, m33*m01, m32*m00, m31*m03 - subps xmm0, xmm3 // xmm3: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - movaps xmm5, xmm0 // xmm4: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(3, 0, 3, 2) // xmm0: m01, m00, m03, m02 (movhlps optimization possible) - // Reuse xmm1: pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - // Reuse xmm2: pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - pshufd xmm3, xmm7, _MM_SHUFFLE(3, 0, 3, 2) // xmm3: m31, m30, m33, m32 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m01*m32, m00*m31, m03*m30, m02*m33 - mulps xmm3, xmm2 // xmm3: m02*m31, m01*m30, m00*m33, m03*m32 - subps xmm3, xmm0 // xmm3: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - movaps xmm6, xmm3 // xmm6: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - movaps xmm0, [esi+20] // m23, m22, m21, m20 - - pshufd xmm1, xmm0, _MM_SHUFFLE(2, 1, 0, 3) - xorps xmm1, mask0101 //-m22, m21,-m20, m23 - mulaps xmm4, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(1, 0, 3, 2) // (movhlps optimization possible) - xorps xmm1, mask1010 // m21,-m20, m23,-m22 - mulaps xmm5, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(0, 3, 2, 1) - xorps xmm1, mask0101 //-m20, m23,-m22, m21 - mulaps xmm6, xmm1 - - mulaps xmm6, xmm5 - mulaps xmm6, xmm4 - movaps result[0x10], xmm6 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - //R20 = +1 * m31*(m02*m13 - m12*m03) -1 * m32*(m03*m11 – m13*m01) +1 * m33*(m01*m12 - m11*m02) - //R21 = -1 * m32*(m03*m10 - m13*m00) +1 * m33*(m00*m12 – m10*m02) -1 * m30*(m02*m13 - m12*m03) - //R22 = +1 * m33*(m00*m11 - m10*m01) -1 * m30*(m01*m13 – m11*m03) +1 * m31*(m03*m10 - m13*m00) - //R23 = -1 * m30*(m01*m12 - m11*m02) +1 * m31*(m02*m10 – m12*m00) -1 * m32*(m00*m11 - m10*m01) - - //Reuse xmm6: movaps xmm6, [esi+00] // xmm6: m03, m02, m01, m00 - movaps xmm7, [esi+10] // xmm7: m13, m12, m11, m10 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(1, 0, 3, 2) // xmm0: m11, m10, m13, m12 (movhlps optimization possible) - pshufd xmm1, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm1: m00, m03, m02, m01 - pshufd xmm2, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm2: m10, m13, m12, m11 - pshufd xmm3, xmm7, _MM_SHUFFLE(1, 0, 3, 2) // xmm3: m01, m00, m03, m02 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m11*m00, m10*m03, m13*m02, m12*m01 - mulps xmm3, xmm2 // xmm3: m01*m10, m00*m13, m03*m12, m02*m11 - subps xmm3, xmm0 // xmm3: m11*m00-m01*m10, m10*m03-m00*m13, m13*m02-m03*m12, m12*m01-m02*m11 - movaps xmm4, xmm3 // xmm4: m11*m00-m01*m10, m10*m03-m00*m13, m13*m02-m03*m12, m12*m01-m02*m11 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - - - - - - - // Reuse xmm0 pshufd xmm0, xmm6, _MM_SHUFFLE(0, 3, 2, 1) // xmm0: m00, m03, m02, m01 - pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - // Reuse xmm3 pshufd xmm3, xmm7, _MM_SHUFFLE(0, 3, 2, 1) // xmm3: m30, m33, m32, m31 - - mulps xmm0, xmm1 // xmm0: m00*m32, m03*m31, m02*m30, m01*m33 - mulps xmm3, xmm2 // xmm3: m30*m02, m33*m01, m32*m00, m31*m03 - subps xmm0, xmm3 // xmm3: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - movaps xmm5, xmm0 // xmm4: m00*m32-m30*m02, m03*m31-m33*m01, m02*m30-m32*m00, m01*m33-m31*m03 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - pshufd xmm0, xmm6, _MM_SHUFFLE(3, 0, 3, 2) // xmm0: m01, m00, m03, m02 (movhlps optimization possible) - // Reuse xmm1: pshufd xmm1, xmm7, _MM_SHUFFLE(2, 1, 0, 3) // xmm1: m32, m31, m30, m33 - // Reuse xmm2: pshufd xmm2, xmm6, _MM_SHUFFLE(2, 1, 0, 3) // xmm2: m02, m01, m00, m03 - pshufd xmm3, xmm7, _MM_SHUFFLE(3, 0, 3, 2) // xmm3: m31, m30, m33, m32 (movhlps optimization possible) - - mulps xmm0, xmm1 // xmm0: m01*m32, m00*m31, m03*m30, m02*m33 - mulps xmm3, xmm2 // xmm3: m02*m31, m01*m30, m00*m33, m03*m32 - subps xmm3, xmm0 // xmm3: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - movaps xmm6, xmm3 // xmm6: m02*m31-m01*m32, m01*m30-m00*m31, m00*m33-m03*m30, m03*m32-m02*m33 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - movaps xmm0, [esi+20] // m23, m22, m21, m20 - - pshufd xmm1, xmm0, _MM_SHUFFLE(2, 1, 0, 3) - xorps xmm1, mask0101 //-m22, m21,-m20, m23 - mulaps xmm4, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(1, 0, 3, 2) // (movhlps optimization possible) - xorps xmm1, mask1010 // m21,-m20, m23,-m22 - mulaps xmm5, xmm1 - - pshufd xmm1, xmm0, _MM_SHUFFLE(0, 3, 2, 1) - xorps xmm1, mask0101 //-m20, m23,-m22, m21 - mulaps xmm6, xmm1 - - mulaps xmm6, xmm5 - mulaps xmm6, xmm4 - movaps result[0x10], xmm6 - - ////////////////////////////////////////////////////////////////////////////////////////////// - - - } - - return result; -} - -__forceinline mat4 transpose(const mat4& m) -{ - mat4 result(mat4::NO_INIT); - - __asm - { - mov esi, m - - movaps xmm4, [esi+0x00] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x10] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movaps xmm0, xmm5 - movhlps xmm1, xmm5 - - movaps xmm2, xmm4 - movhlps xmm3, xmm4 - - movaps xmm4, [esi+0x20] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x30] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movlhps xmm0, xmm5 - movlhps xmm2, xmm4 - - movhlps xmm7, xmm5 - movhlps xmm6, xmm4 - - movlhps xmm1, xmm7 - movlhps xmm3, xmm6 - - movaps result[0x00], xmm0 - movaps result[0x10], xmm1 - movaps result[0x20], xmm2 - movaps result[0x30], xmm3 - } - - return result; -} - -__forceinline void mat4::transpose() -{ - void* address = this; - - __asm - { - mov esi, address - - movaps xmm4, [esi+0x00] - movaps xmm6, [esi+0x10] - movaps xmm5, xmm4 - - unpcklps xmm5, xmm6 - movaps xmm0, xmm5 - movhlps xmm1, xmm5 - - unpckhps xmm4, xmm6 - movaps xmm2, xmm4 - movhlps xmm3, xmm4 - - movaps xmm4, [esi+0x20] - movaps xmm6, [esi+0x30] - movaps xmm5, xmm4 - - unpcklps xmm5, xmm6 - movlhps xmm0, xmm5 - movhlps xmm2, xmm5 - movlhps xmm1, xmm5 - - unpckhps xmm4, xmm6 - movlhps xmm2, xmm4 - movhlps xmm4, xmm4 - movlhps xmm3, xmm4 - - movaps [esi+0x00], xmm0 - movaps [esi+0x10], xmm1 - movaps [esi+0x20], xmm2 - movaps [esi+0x30], xmm3 - } -} - - -/* -inline mat4 transpose(const mat4& m) -{ - mat4 result; - - __asm - { - mov esi, m - - movaps xmm4, [esi+0x00] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x10] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movaps xmm0, xmm5 - movhlps xmm1, xmm5 - - movaps xmm2, xmm4 - movhlps xmm3, xmm4 - - movaps xmm4, [esi+0x20] - movaps xmm5, xmm4 - movaps xmm6, [esi+0x30] - - unpcklps xmm5, xmm6 - unpckhps xmm4, xmm6 - - movlhps xmm0, xmm5 - movhlps xmm7, xmm5 - movlhps xmm1, xmm7 - - movlhps xmm2, xmm4 - movhlps xmm6, xmm4 - movlhps xmm3, xmm6 - - movaps result[0x00], xmm0 - movaps result[0x10], xmm1 - movaps result[0x20], xmm2 - movaps result[0x30], xmm3 - } - - return result; -} -*/ -}//namespace sse -}//namespace glm - -void test_sse_mat4(); - -#endif//GLM_SSE_MAT4_H diff --git a/experimental/sse/sse_mat4array.cpp b/experimental/sse/sse_mat4array.cpp deleted file mode 100644 index c08ca1f1..00000000 --- a/experimental/sse/sse_mat4array.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precompiled.h" \ No newline at end of file diff --git a/experimental/sse/sse_mat4array.h b/experimental/sse/sse_mat4array.h deleted file mode 100644 index e69de29b..00000000 diff --git a/experimental/sse/sse_vec4.cpp b/experimental/sse/sse_vec4.cpp deleted file mode 100644 index 93158f23..00000000 --- a/experimental/sse/sse_vec4.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "precompiled.h" -#include "sse_vec4.h" - -void test_shufps(const glm::sse::vec4& v1, const glm::sse::vec4& v2) -{ - glm::sse::vec4 Result0; - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm0, [esi] - movaps xmm1, [edi] - shufps xmm0, xmm1, _MM_SHUFFLE(3, 2, 1, 0) - movaps Result0, xmm0 - } - - glm::sse::vec4 Result1; - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm2, [esi] - movaps xmm3, [edi] - pshufd xmm2, xmm3, _MM_SHUFFLE(3, 2, 1, 0) - movaps Result1, xmm2 - } - - glm::sse::vec4 end; -} - -void test_sse_vec4() -{ - test_shufps( - glm::sse::vec4(1.0f, 2.0f, 3.0f, 4.0f), - glm::sse::vec4(5.0f, 6.0f, 7.0f, 8.0f)); - - glm::sse::vec4 v0; - glm::sse::vec4 v1(76.f); - glm::sse::vec4 v2(5.f, 1.f, 2.f, 3.f); - v2 += v1; - glm::sse::vec4 v3 = v2; - glm::sse::vec4 v4(1.0f); - float dot = glm::sse::dot(v4, v1); - ++v4; - glm::sse::vec4 v5 = -v4; - glm::sse::vec4 v6(2.f); - glm::sse::vec4 v7 = glm::sse::cross(v2, v6); - glm::vec3 v8 = glm::cross(glm::vec3(5.f, 1.f, 2.f), glm::vec3(2.f)); - printf("vec4(%f, %f, %f, %f)\n", v4.x, v4.y, v4.z, v4.w); - glm::sse::vec4 v9 = glm::sse::normalize(glm::sse::vec4(1.0f, 1.0f, 1.0f, 0.0f)); - glm::sse::vec4 vx; -} diff --git a/experimental/sse/sse_vec4.h b/experimental/sse/sse_vec4.h deleted file mode 100644 index a1ac53de..00000000 --- a/experimental/sse/sse_vec4.h +++ /dev/null @@ -1,290 +0,0 @@ -#ifndef GLM_SSE_VEC4_H -#define GLM_SSE_VEC4_H - -#include -#include - -namespace glm{ -namespace sse{ - -#define GLM_SHUFFLE(fp3,fp2,fp1,fp0) (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | ((fp0))) - -const __m128 zero = _mm_setzero_ps(); -const __m128 one = _mm_set_ps1(1.0f); -const __m128 two = _mm_set_ps1(2.0f); -const __m128 three = _mm_set_ps1(3.0f); -const __m128 pouet = _mm_set_ps(2.0f, 4.0f, 6.0f, 8.0f); - -#define GLM_ALIGN(x) __declspec(align(x)) - -GLM_ALIGN(16) struct vec4 -{ - enum ENoInit - { - NO_INIT - }; - - union - { - __m128 data; - struct{float x, y, z, w;}; - float array[4]; - }; - - vec4(); - vec4(ENoInit NoInit); - vec4(float s); - vec4(float x, float y, float z, float w); - vec4(float v[4]); - - vec4& operator+=(const float s); - - vec4& operator+=(const vec4& v); - vec4& operator*=(const vec4& v); - - vec4& operator++(); -}; - -__forceinline vec4::vec4() -{ - void* address = this; - - __asm - { - mov eax, [address] - xorps xmm0, xmm0 - movaps [eax], xmm0 - } -} - -__forceinline vec4::vec4(ENoInit NoInit) -{} - -__forceinline vec4::vec4(float s) -{ - void* address = this; - - __asm - { - mov esi, [address] - movss xmm0, s - shufps xmm0, xmm0, 0 - movaps [esi], xmm0 - } -} - -__forceinline vec4::vec4(float x, float y, float z, float w) -{ - void* address = this; - - __asm - { - mov esi, address - movss xmm0, x - movss xmm1, y - movss xmm2, z - movss xmm3, w - unpcklps xmm0, xmm1 - unpcklps xmm2, xmm3 - movlhps xmm0, xmm2 - movaps [esi], xmm0 - } -} - -__forceinline vec4::vec4(float v[4]) -{ - void* address = this; - - __asm - { - mov eax, [address] - mov ebx, [v] - movups xmm0, [ebx] - movaps [eax], xmm0 - } -} - -__forceinline vec4& vec4::operator+=(const float s) -{ - void* address = this; - - __asm - { - mov eax, [address] - movss xmm1, s - shufps xmm1, xmm1, 0 - movaps xmm0, [eax] - addps xmm0, xmm1 - movaps [eax], xmm0 - } - - return *this; -} - -__forceinline vec4& vec4::operator+=(const vec4& v) -{ - void* address = this; - - __asm - { - mov eax, [address] - mov ebx, [v] - movaps xmm0, [eax] - addps xmm0, [ebx] - movaps [eax], xmm0 - } - - return *this; -} - -__forceinline vec4& vec4::operator*=(const vec4& v) -{ - void* address = this; - - __asm - { - mov esi, address - mov edi, v - movaps xmm0, esi - mulps xmm0, edi - movaps [esi], xmm0 - } - - return *this; -} - -__forceinline vec4& vec4::operator++() -{ - void* address = this; - - __asm - { - mov eax, [address] - movaps xmm0, [eax] - addps xmm0, one - movaps [eax], xmm0 - } - - return *this; -} - -__forceinline const vec4 operator- (const vec4& v) -{ - vec4 result(vec4::NO_INIT); - - __asm - { - mov esi, v - xorps xmm0, xmm0 - subps xmm0, [esi] - movaps result, xmm0 - } - - result; -} - -__forceinline vec4 cross(const vec4& v1, const vec4& v2) -{ - vec4 result(vec4::NO_INIT); - - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm0, [esi] - movaps xmm1, [edi] - shufps xmm0, xmm0, _MM_SHUFFLE(3, 0, 2, 1) - movaps xmm2, xmm0 - shufps xmm0, xmm0, _MM_SHUFFLE(3, 1, 0, 2) - shufps xmm1, xmm1, _MM_SHUFFLE(3, 0, 2, 1) - movaps xmm3, xmm1 - shufps xmm1, xmm1, _MM_SHUFFLE(3, 1, 0, 2) - mulps xmm0, xmm3 - mulps xmm1, xmm2 - subps xmm0, xmm1 - movaps result, xmm0 - } - - return result; -} - -__forceinline float dot(const vec4& v1, const vec4& v2) -{ - float result; - - // All component processed - //__asm - //{ - // mov esi, v1 - // mov edi, v2 - // movaps xmm0, [esi] - // movaps xmm1, [edi] - // mulps xmm0, xmm1 - // movaps xmm1, xmm0 - // shufps xmm0, xmm0, _MM_SHUFFLE(2, 3, 0, 1) - // addps xmm0, xmm1 - // movaps xmm1, xmm0 - // shufps xmm0, xmm0, _MM_SHUFFLE(0, 1, 2, 3) - // addps xmm0, xmm1 - // movss result, xmm0 - //} - - // SSE - __asm - { - mov esi, v1 - mov edi, v2 - movaps xmm0, [esi] // w1, z1, y1, x1 - mulps xmm0, [edi] // w1 * w2, z1 * z2, y1 * y2, x1 * x2 - movhlps xmm1, xmm0 // XX, XX, w1 * w2, z1 * z2 - addps xmm0, xmm1 // XX, XX, y1 * y2 + w1 * w2, x1 * x2 + z1 * z2 - pshufd xmm1, xmm0, 1 // XX, XX, XX, y1 * y2 + w1 * w2 - addss xmm0, xmm1 // y1 * y2 + w1 * w2 + x1 * x2 + z1 * z2 - movss result, xmm0 - } - - // SSE 3 - - // SSE 4.1 - //__asm - //{ - // mov esi, v1 - // mov edi, v2 - // movaps xmm0, [esi] - // dpps xmm0, [edi] - // movss result, xmm0 - //} - - return result; -} - -__forceinline vec4 normalize(const vec4& v) -{ - vec4 result(vec4::NO_INIT); - - __asm - { - mov esi, v - movaps xmm2, [esi] - movaps xmm0, xmm2 - mulps xmm0, xmm0 - movaps xmm1, xmm0 - shufps xmm0, xmm0, _MM_SHUFFLE(2, 3, 0, 1) - addps xmm0, xmm1 - movaps xmm1, xmm0 - shufps xmm0, xmm0, _MM_SHUFFLE(0, 1, 2, 3) - addps xmm0, xmm1 - rsqrtps xmm0, xmm0 - mulps xmm2, xmm0 - movaps result, xmm2 - } - - return result; -} - -}//namespace sse -}//namespace glm - -void test_sse_vec4(); - -#endif//GLM_SSE_VEC4_H diff --git a/experimental/sse/sse_vec4array.cpp b/experimental/sse/sse_vec4array.cpp deleted file mode 100644 index c08ca1f1..00000000 --- a/experimental/sse/sse_vec4array.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "precompiled.h" \ No newline at end of file diff --git a/experimental/sse/sse_vec4array.h b/experimental/sse/sse_vec4array.h deleted file mode 100644 index e69de29b..00000000 diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index c8329f76..00000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -cmake_minimum_required(VERSION 2.6 FATAL_ERROR) -cmake_policy(VERSION 2.6) - -project(glm) - -set(NAME glm-test) - -file(GLOB ROOT_SOURCE *.cpp) -file(GLOB ROOT_INLINE *.inl) -file(GLOB ROOT_HEADER *.hpp) - -file(GLOB_RECURSE CORE_SOURCE ./core/*.cpp) -file(GLOB_RECURSE CORE_INLINE ./core/*.inl) -file(GLOB_RECURSE CORE_HEADER ./core/*.hpp) - -file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) -file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) -file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) - -file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) -file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) -file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) - -file(GLOB_RECURSE IMG_SOURCE ./img/*.cpp) -file(GLOB_RECURSE IMG_INLINE ./img/*.inl) -file(GLOB_RECURSE IMG_HEADER ./img/*.hpp) - -source_group("Core Files" FILES ${CORE_SOURCE}) -source_group("Core Files" FILES ${CORE_INLINE}) -source_group("Core Files" FILES ${CORE_HEADER}) -source_group("GTC Files" FILES ${GTC_SOURCE}) -source_group("GTC Files" FILES ${GTC_INLINE}) -source_group("GTC Files" FILES ${GTC_HEADER}) -source_group("GTX Files" FILES ${GTX_SOURCE}) -source_group("GTX Files" FILES ${GTX_INLINE}) -source_group("GTX Files" FILES ${GTX_HEADER}) -source_group("IMG Files" FILES ${IMG_SOURCE}) -source_group("IMG Files" FILES ${IMG_INLINE}) -source_group("IMG Files" FILES ${IMG_HEADER}) - -include_directories(..) - - - -add_executable(${NAME} - ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} - ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} - ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} - ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} - ${IMG_SOURCE} ${IMG_INLINE} ${IMG_HEADER}) - -add_definitions(-D_CRT_SECURE_NO_WARNINGS) diff --git a/test/bug.cpp b/test/bug.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/test/core.cpp b/test/core.cpp deleted file mode 100644 index c73f5a37..00000000 --- a/test/core.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-11-14 -// Updated : 2009-11-14 -// Licence : This source is under MIT licence -// File : test/bug.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -namespace glm{ -namespace test -{ - bool main_bug() - { - bool Result = true; - - { - - } - - return Result; - } - -}//namespace test -}//namespace glm diff --git a/test/core.hpp b/test/core.hpp deleted file mode 100644 index e69de29b..00000000 diff --git a/test/core/cast/mat.cpp b/test/core/cast/mat.cpp deleted file mode 100644 index 48730343..00000000 --- a/test/core/cast/mat.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-03-14 -// Updated : 2008-03-14 -// Licence : This source is under MIT License -// File : test/core/ctor/mat.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../../precompiled.hpp" -#include - -using namespace glm; - -bool test_core_cast_mat() -{ - { - mat2x3 m01(1.0f); - mat2x4 m02(1.0f); - mat3x2 m03(1.0f); - mat3x4 m04(1.0f); - mat4x2 m05(1.0f); - mat4x3 m06(1.0f); - } - - { - mat2x3 m01(mat2(1.0f)); - mat2x3 m02(mat3(1.0f)); - mat2x3 m03(mat4(1.0f)); - mat2x3 m04(mat2x3(1.0f)); - mat2x3 m05(mat2x4(1.0f)); - mat2x3 m06(mat3x2(1.0f)); - mat2x3 m07(mat3x4(1.0f)); - mat2x3 m08(mat4x2(1.0f)); - mat2x3 m09(mat4x3(1.0f)); - } - - { - mat2x4 m01(mat2(1.0f)); - mat2x4 m02(mat3(1.0f)); - mat2x4 m03(mat4(1.0f)); - mat2x4 m04(mat2x3(1.0f)); - mat2x4 m05(mat2x4(1.0f)); - mat2x4 m06(mat3x2(1.0f)); - mat2x4 m07(mat3x4(1.0f)); - mat2x4 m08(mat4x2(1.0f)); - mat2x4 m09(mat4x3(1.0f)); - } - - { - mat3x2 m01(mat2(1.0f)); - mat3x2 m02(mat3(1.0f)); - mat3x2 m03(mat4(1.0f)); - mat3x2 m04(mat2x3(1.0f)); - mat3x2 m05(mat2x4(1.0f)); - mat3x2 m06(mat3x2(1.0f)); - mat3x2 m07(mat3x4(1.0f)); - mat3x2 m08(mat4x2(1.0f)); - mat3x2 m09(mat4x3(1.0f)); - } - - { - mat3x4 m01(mat2(1.0f)); - mat3x4 m02(mat3(1.0f)); - mat3x4 m03(mat4(1.0f)); - mat3x4 m04(mat2x3(1.0f)); - mat3x4 m05(mat2x4(1.0f)); - mat3x4 m06(mat3x2(1.0f)); - mat3x4 m07(mat3x4(1.0f)); - mat3x4 m08(mat4x2(1.0f)); - mat3x4 m09(mat4x3(1.0f)); - } - - { - mat4x2 m01(mat2(1.0f)); - mat4x2 m02(mat3(1.0f)); - mat4x2 m03(mat4(1.0f)); - mat4x2 m04(mat2x3(1.0f)); - mat4x2 m05(mat2x4(1.0f)); - mat4x2 m06(mat3x2(1.0f)); - mat4x2 m07(mat3x4(1.0f)); - mat4x2 m08(mat4x2(1.0f)); - mat4x2 m09(mat4x3(1.0f)); - } - - { - mat4x3 m01(mat2(1.0f)); - mat4x3 m02(mat3(1.0f)); - mat4x3 m03(mat4(1.0f)); - mat4x3 m04(mat2x3(1.0f)); - mat4x3 m05(mat2x4(1.0f)); - mat4x3 m06(mat3x2(1.0f)); - mat4x3 m07(mat3x4(1.0f)); - mat4x3 m08(mat4x2(1.0f)); - mat4x3 m09(mat4x3(1.0f)); - } - - { - mat2 m01(mat2x3(1.0f)); - mat2 m02(mat2x4(1.0f)); - mat2 m03(mat3x2(1.0f)); - mat2 m04(mat3x4(1.0f)); - mat2 m05(mat4x2(1.0f)); - mat2 m06(mat4x3(1.0f)); - mat2 m07(mat4(1.0f)); - mat2 m08(mat3(1.0f)); - } - { - mat3 m01(mat2x3(1.0f)); - mat3 m02(mat2x4(1.0f)); - mat3 m03(mat3x2(1.0f)); - mat3 m04(mat3x4(1.0f)); - mat3 m05(mat4x2(1.0f)); - mat3 m06(mat4x3(1.0f)); - mat3 m07(mat4(1.0f)); - mat3 m08(mat2(1.0f)); - } - { - mat4 m01(mat2x3(1.0f)); - mat4 m02(mat2x4(1.0f)); - mat4 m03(mat3x2(1.0f)); - mat4 m04(mat3x4(1.0f)); - mat4 m05(mat4x2(1.0f)); - mat4 m06(mat4x3(1.0f)); - mat4 m07(mat2(1.0f)); - mat4 m08(mat3(1.0f)); - } - - return true; -} diff --git a/test/core/cast/mat.h b/test/core/cast/mat.h deleted file mode 100644 index 826bb9ad..00000000 --- a/test/core/cast/mat.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef GLM_TEST_CAST_MAT_H -#define GLM_TEST_CAST_MAT_H - -bool test_core_cast_mat(); - -#endif//GLM_TEST_CAST_MAT_H diff --git a/test/core/ctor/vec2.cpp b/test/core/ctor/vec2.cpp deleted file mode 100644 index 83da1169..00000000 --- a/test/core/ctor/vec2.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-03-14 -// Updated : 2008-03-14 -// Licence : This source is under MIT licence -// File : test/core/ctor/vec2.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../../precompiled.hpp" -#include diff --git a/test/core/ctor/vec2.h b/test/core/ctor/vec2.h deleted file mode 100644 index 77829ac5..00000000 --- a/test/core/ctor/vec2.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef GLM_TEST_CORE_CTOR_VEC2_H -#define GLM_TEST_CORE_CTOR_VEC2_H - - - -#endif//GLM_TEST_CORE_CTOR_VEC2_H diff --git a/test/core/ctor/vec3.cpp b/test/core/ctor/vec3.cpp deleted file mode 100644 index b3e5b28f..00000000 --- a/test/core/ctor/vec3.cpp +++ /dev/null @@ -1,12 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-03-14 -// Updated : 2008-03-14 -// Licence : This source is under MIT licence -// File : test/core/ctor/vec3.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../../precompiled.hpp" -#include - diff --git a/test/core/ctor/vec3.h b/test/core/ctor/vec3.h deleted file mode 100644 index 2403cb8a..00000000 --- a/test/core/ctor/vec3.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef GLM_TEST_CORE_CTOR_VEC3_H -#define GLM_TEST_CORE_CTOR_VEC3_H - - - -#endif//GLM_TEST_CORE_CTOR_VEC3_H diff --git a/test/core/ctor/vec4.cpp b/test/core/ctor/vec4.cpp deleted file mode 100644 index 57b2ecb5..00000000 --- a/test/core/ctor/vec4.cpp +++ /dev/null @@ -1,14 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-03-14 -// Updated : 2008-03-14 -// Licence : This source is under MIT licence -// File : test/core/ctor/vec4.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../../precompiled.hpp" -#include - - - diff --git a/test/core/ctor/vec4.h b/test/core/ctor/vec4.h deleted file mode 100644 index 748dfccf..00000000 --- a/test/core/ctor/vec4.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef GLM_TEST_CORE_CTOR_VEC4_H -#define GLM_TEST_CORE_CTOR_VEC4_H - - - -#endif//GLM_TEST_CORE_CTOR_VEC4_H diff --git a/test/core/func_common.cpp b/test/core/func_common.cpp deleted file mode 100644 index d4efffd0..00000000 --- a/test/core/func_common.cpp +++ /dev/null @@ -1,882 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/func_common.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -static const float epsilon = 0.00001f; - -bool test_abs_type1() -{ - float absolute1 = glm::abs(( 76.f)); - float absolute2 = glm::abs((-76.f)); - - if(absolute1 != (76.f) || - absolute2 != (76.f)) - return false; - return true; -} - -bool test_abs_type2() -{ - glm::vec2 absolute1 = glm::abs(glm::vec2( 76.f, 76.f)); - glm::vec2 absolute2 = glm::abs(glm::vec2(-76.f,-76.f)); - - if(absolute1.x != 76.f || absolute1.y != 76.f || - absolute2.x != 76.f || absolute2.y != 76.f) - return false; - return true; -} - -bool test_abs_type3() -{ - glm::vec3 absolute1 = glm::abs(glm::vec3( 76.f, 76.f, 76.f)); - glm::vec3 absolute2 = glm::abs(glm::vec3(-76.f,-76.f,-76.f)); - - if(absolute1.x != 76.f || absolute1.y != 76.f || absolute1.z != 76.f || - absolute2.x != 76.f || absolute2.y != 76.f || absolute2.z != 76.f) - return false; - return true; -} - -bool test_abs_type4() -{ - glm::vec4 absolute1 = glm::abs(glm::vec4( 76.f, 76.f, 76.f, 76.f)); - glm::vec4 absolute2 = glm::abs(glm::vec4(-76.f,-76.f,-76.f,-76.f)); - - if(absolute1.x != 76.f || absolute1.y != 76.f || absolute1.z != 76.f || absolute1.w != 76.f || - absolute2.x != 76.f || absolute2.y != 76.f || absolute2.z != 76.f || absolute2.w != 76.f) - return false; - return true; -} - -bool test_sign_type1() -{ - float vec_sign1 = sign( 76.f); - float vec_sign2 = sign( 0.f); - float vec_sign3 = sign(-76.f); - - if(vec_sign1 != 1.0f || - vec_sign2 != 0.0f || - vec_sign3 != -1.0f) - return false; - return true; -} - -bool test_sign_type2() -{ - vec2 vec_sign1 = sign(vec2( 76.f, 76.f)); - vec2 vec_sign2 = sign(vec2( 0.f, 0.f)); - vec2 vec_sign3 = sign(vec2(-76.f,-76.f)); - - if(vec_sign1.x != 1.0f || - vec_sign1.y != 1.0f) - return false; - if(vec_sign2.x != 0.0f || - vec_sign2.y != 0.0f) - return false; - if(vec_sign3.x != -1.0f || - vec_sign3.y != -1.0f) - return false; - return true; -} - -bool test_sign_type3() -{ - vec3 vec_sign1 = sign(vec3( 76.f, 76.f, 76.f)); - vec3 vec_sign2 = sign(vec3( 0.f, 0.f, 0.f)); - vec3 vec_sign3 = sign(vec3(-76.f,-76.f,-76.f)); - - if(vec_sign1.x != 1.0f || - vec_sign1.y != 1.0f || - vec_sign1.z != 1.0f) - return false; - if(vec_sign2.x != 0.0f || - vec_sign2.y != 0.0f || - vec_sign2.z != 0.0f) - return false; - if(vec_sign3.x != -1.0f || - vec_sign3.y != -1.0f || - vec_sign3.z != -1.0f) - return false; - return true; -} - -bool test_sign_type4() -{ - vec4 vec_sign1 = sign(vec4( 76.f, 76.f, 76.f, 76.f)); - vec4 vec_sign2 = sign(vec4( 0.f, 0.f, 0.f, 0.f)); - vec4 vec_sign3 = sign(vec4(-76.f,-76.f,-76.f,-76.f)); - - if(vec_sign1.x != 1.0f || - vec_sign1.y != 1.0f || - vec_sign1.z != 1.0f || - vec_sign1.w != 1.0f) - return false; - if(vec_sign2.x != 0.0f || - vec_sign2.y != 0.0f || - vec_sign2.z != 0.0f || - vec_sign2.w != 0.0f) - return false; - if(vec_sign3.x != -1.0f || - vec_sign3.y != -1.0f || - vec_sign3.z != -1.0f || - vec_sign3.w != -1.0f) - return false; - return true; -} - -bool test_floor_type1() -{ - float val_floor = glm::floor(float(0.5f)); - - if(val_floor != 0) - return false; - return true; -} - -bool test_floor_type2() -{ - glm::vec2 vec_floor = glm::floor(glm::vec2(0.5f, 0.5f)); - - if(vec_floor.x != 0 || - vec_floor.y != 0) - return false; - return true; -} - -bool test_floor_type3() -{ - glm::vec3 vec_floor = glm::floor(glm::vec3(0.5f, 0.5f, 0.5f)); - - if(vec_floor.x != 0 || - vec_floor.y != 0 || - vec_floor.z != 0) - return false; - return true; -} - -bool test_floor_type4() -{ - glm::vec4 vec_floor = glm::floor(glm::vec4(0.5f, 0.5f, 0.5f, 0.5f)); - - if(vec_floor.x != 0 || - vec_floor.y != 0 || - vec_floor.z != 0 || - vec_floor.w != 0) - return false; - return true; -} - -bool test_trunc_type1() -{ - return true; -} - -bool test_trunc_type2() -{ - return true; -} - -bool test_trunc_type3() -{ - return true; -} - -bool test_trunc_type4() -{ - return true; -} - -bool test_round_type1() -{ - return true; -} - -bool test_round_type2() -{ - return true; -} - -bool test_round_type3() -{ - return true; -} - -bool test_round_type4() -{ - return true; -} - -bool test_roundEven_type1() -{ - float a = glm::roundEven(3.5f); - float b = glm::roundEven(4.5f); - float c = glm::roundEven(5.5f); - - float d = glm::roundEven(3.4f); - float e = glm::roundEven(4.4f); - float f = glm::roundEven(5.4f); - - float g = glm::roundEven(3.6f); - float h = glm::roundEven(4.6f); - float i = glm::roundEven(5.6f); - - float end = 0.0f; - - return true; -} - -bool test_roundEven_type2() -{ - return true; -} - -bool test_roundEven_type3() -{ - return true; -} - -bool test_roundEven_type4() -{ - return true; -} - -bool test_ceil_1() -{ - float val_ceil = glm::ceil(float(0.5f)); - - if(val_ceil != 1) - return false; - return true; -} - -bool test_ceil_2() -{ - glm::vec2 vec_ceil = glm::ceil(glm::vec2(0.5f, 0.5f)); - - if(vec_ceil.x != 1 || - vec_ceil.y != 1) - return false; - return true; -} - -bool test_ceil_3() -{ - glm::vec3 vec_ceil = glm::ceil(glm::vec3(0.5f, 0.5f, 0.5f)); - - if(vec_ceil.x != 1 || - vec_ceil.y != 1 || - vec_ceil.z != 1) - return false; - return true; -} - -bool test_ceil_4() -{ - glm::vec4 vec_ceil = glm::ceil(glm::vec4(0.5f, 0.5f, 0.5f, 0.5f)); - - if(vec_ceil.x != 1 || - vec_ceil.y != 1 || - vec_ceil.z != 1 || - vec_ceil.w != 1) - return false; - return true; -} - -bool test_fract_1() -{ - float val_fract = fract(float(0.5f)); - - if(val_fract != 0.5f) - return false; - return true; -} - -bool test_fract_2() -{ - vec2 vec_fract = fract(vec2(0.5f, 0.5f)); - - if(vec_fract.x != 0.5f || - vec_fract.y != 0.5f) - return false; - return true; -} - -bool test_fract_3() -{ - vec3 vec_fract = fract(vec3(0.5f, 0.5f, 0.5f)); - - if(vec_fract.x != 0.5f || - vec_fract.y != 0.5f || - vec_fract.z != 0.5f) - return false; - return true; -} - -bool test_fract_4() -{ - vec4 vec_fract = fract(vec4(0.5f, 0.5f, 0.5f, 0.5f)); - - if(vec_fract.x != 0.5f || - vec_fract.y != 0.5f || - vec_fract.z != 0.5f || - vec_fract.w != 0.5f) - return false; - return true; -} - -bool test_mod_1() -{ - float val_mod = glm::mod(float(4.0f), float(2.0f)); - - if(val_mod != 0.0f) - return false; - return true; -} - -bool test_mod_2() -{ - glm::vec2 vec_mod1 = glm::mod(glm::vec2(4.0f, 4.0f), glm::vec2(2.0f, 2.0f)); - glm::vec2 vec_mod2 = glm::mod(glm::vec2(4.0f, 4.0f), float(2.0f)); - - if(vec_mod1.x != 0.0f || - vec_mod1.y != 0.0f) - return false; - if(vec_mod2.x != 0.0f || - vec_mod2.y != 0.0f) - return false; - return true; -} - -bool test_mod_3() -{ - glm::vec3 vec_mod1 = glm::mod(glm::vec3(4.0f, 4.0f, 4.0f), glm::vec3(2.0f, 2.0f, 2.0f)); - glm::vec3 vec_mod2 = glm::mod(glm::vec3(4.0f, 4.0f, 4.0f), float(2.0f)); - - if(vec_mod1.x != 0.0f || - vec_mod1.y != 0.0f || - vec_mod1.z != 0.0f) - return false; - if(vec_mod2.x != 0.0f || - vec_mod2.y != 0.0f || - vec_mod2.z != 0.0f) - return false; - return true; -} - -bool test_mod_4() -{ - glm::vec4 vec_mod1 = glm::mod(glm::vec4(4.0f, 4.0f, 4.0f, 4.0f), glm::vec4(2.0f, 2.0f, 2.0f, 2.0f)); - glm::vec4 vec_mod2 = glm::mod(glm::vec4(4.0f, 4.0f, 4.0f, 4.0f), float(2.0f)); - - if(vec_mod1.x != 0.0f || - vec_mod1.y != 0.0f || - vec_mod1.z != 0.0f || - vec_mod1.w != 0.0f) - return false; - if(vec_mod2.x != 0.0f || - vec_mod2.y != 0.0f || - vec_mod2.z != 0.0f || - vec_mod2.w != 0.0f) - return false; - return true; -} - -bool test_modf() -{ - return true; -} - -bool test_min_1() -{ - float val_min = glm::min(float(0.0f), float(1.0f)); - - if(val_min > 0.0f) - return false; - return true; -} - -bool test_min_2() -{ - glm::vec2 val_min1 = glm::min(glm::vec2(0.0f, 0.0f), glm::vec2(1.0f, 1.0f)); - glm::vec2 val_min2 = glm::min(glm::vec2(0.0f, 0.0f), float(1.0f)); - - if(val_min1.x > 0.0f || - val_min1.y > 0.0f) - return false; - if(val_min2.x > 0.0f || - val_min2.y > 0.0f) - return false; - return true; -} - -bool test_min_3() -{ - glm::vec3 val_min1 = glm::min(glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(1.0f, 1.0f, 1.0f)); - glm::vec3 val_min2 = glm::min(glm::vec3(0.0f, 0.0f, 0.0f), float(1.0f)); - - if(val_min1.x > 0.0f || - val_min1.y > 0.0f || - val_min1.z > 0.0f) - return false; - if(val_min2.x > 0.0f || - val_min2.y > 0.0f || - val_min2.z > 0.0f) - return false; - return true; -} - -bool test_min_4() -{ - glm::vec4 val_min1 = glm::min(glm::vec4(0.0f, 0.0f, 0.0f, 0.0f), glm::vec4(1.0f, 1.0f, 1.0f, 1.0f)); - glm::vec4 val_min2 = glm::min(glm::vec4(0.0f, 0.0f, 0.0f, 0.0f), float(1.0f)); - - if(val_min1.x > 0.0f || - val_min1.y > 0.0f || - val_min1.z > 0.0f || - val_min1.w > 0.0f) - return false; - if(val_min2.x > 0.0f || - val_min2.y > 0.0f || - val_min2.z > 0.0f || - val_min2.w > 0.0f) - return false; - return true; -} - -bool test_max_1() -{ - float val_max = glm::max(float(0.0f), float(1.0f)); - - if(val_max < 1.0f) - return false; - return true; -} - -bool test_max_2() -{ - glm::vec2 val_max1 = glm::max(glm::vec2(0.0f, 0.0f), glm::vec2(1.0f, 1.0f)); - glm::vec2 val_max2 = glm::max(glm::vec2(0.0f, 0.0f), float(1.0f)); - - if(val_max1.x < 1.0f || - val_max1.y < 1.0f) - return false; - if(val_max2.x < 1.0f || - val_max2.y < 1.0f) - return false; - return true; -} - -bool test_max_3() -{ - glm::vec3 val_max1 = glm::max(glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(1.0f, 1.0f, 1.0f)); - glm::vec3 val_max2 = glm::max(glm::vec3(0.0f, 0.0f, 0.0f), float(1.0f)); - - if(val_max1.x < 1.0f || - val_max1.y < 1.0f || - val_max1.z < 1.0f) - return false; - if(val_max2.x < 1.0f || - val_max2.y < 1.0f || - val_max2.z < 1.0f) - return false; - return true; -} - -bool test_max_4() -{ - glm::vec4 val_max1 = glm::max(glm::vec4(0.0f, 0.0f, 0.0f, 0.0f), glm::vec4(1.0f, 1.0f, 1.0f, 1.0f)); - glm::vec4 val_max2 = glm::max(glm::vec4(0.0f, 0.0f, 0.0f, 0.0f), float(1.0f)); - - if(val_max1.x < 1.0f || - val_max1.y < 1.0f || - val_max1.z < 1.0f || - val_max1.w < 1.0f) - return false; - if(val_max2.x < 1.0f || - val_max2.y < 1.0f || - val_max2.z < 1.0f || - val_max2.w < 1.0f) - return false; - return true; -} - -bool test_clamp_1() -{ - float clamp1 = glm::clamp(float( 4.0f), float(0.0f), float(1.0f)); - float clamp2 = glm::clamp(float(-4.0f), float(0.0f), float(1.0f)); - - if(clamp1 != 1.0f || - clamp2 != 0.0f) - return false; - return true; -} - -bool test_clamp_2() -{ - glm::vec2 clamp1 = glm::clamp( - glm::vec2( 4.0f, 4.0f), - glm::vec2( 0.0f, 0.0f), - glm::vec2( 1.0f, 1.0f)); - glm::vec2 clamp2 = glm::clamp( - glm::vec2(-4.0f,-4.0f), - glm::vec2( 0.0f, 0.0f), - glm::vec2( 1.0f, 1.0f)); - glm::vec2 clamp3 = glm::clamp( - glm::vec2( 4.0f, 4.0f), - float(0.0f), float(1.0f)); - glm::vec2 clamp4 = glm::clamp( - glm::vec2(-4.0f,-4.0f), - float(0.0f), float(1.0f)); - - if(clamp1.x != 1.0f || - clamp1.y != 1.0f) - return false; - if(clamp2.x != 0.0f || - clamp2.y != 0.0f) - return false; - if(clamp3.x != 1.0f || - clamp3.y != 1.0f) - return false; - if(clamp4.x != 0.0f || - clamp4.y != 0.0f) - return false; - return true; -} - -bool test_clamp_3() -{ - glm::vec3 clamp1 = glm::clamp( - glm::vec3( 4.0f, 4.0f, 4.0f), - glm::vec3( 0.0f, 0.0f, 0.0f), - glm::vec3( 1.0f, 1.0f, 1.0f)); - glm::vec3 clamp2 = glm::clamp( - glm::vec3(-4.0f,-4.0f,-4.0f), - glm::vec3( 0.0f, 0.0f, 0.0f), - glm::vec3( 1.0f, 1.0f, 1.0f)); - glm::vec3 clamp3 = glm::clamp( - glm::vec3( 4.0f, 4.0f, 4.0f), - float(0.0f), float(1.0f)); - glm::vec3 clamp4 = glm::clamp( - glm::vec3(-4.0f,-4.0f,-4.0f), - float(0.0f), float(1.0f)); - - if(clamp1.x != 1.0f || - clamp1.y != 1.0f || - clamp1.z != 1.0f) - return false; - if(clamp2.x != 0.0f || - clamp2.y != 0.0f || - clamp2.z != 0.0f) - return false; - if(clamp3.x != 1.0f || - clamp3.y != 1.0f || - clamp3.z != 1.0f) - return false; - if(clamp4.x != 0.0f || - clamp4.y != 0.0f || - clamp4.z != 0.0f) - return false; - return true; -} - -bool test_clamp_4() -{ - glm::vec4 clamp1 = glm::clamp( - glm::vec4( 4.0f, 4.0f, 4.0f, 4.0f), - glm::vec4( 0.0f, 0.0f, 0.0f, 0.0f), - glm::vec4( 1.0f, 1.0f, 1.0f, 1.0f)); - glm::vec4 clamp2 = glm::clamp( - glm::vec4(-4.0f,-4.0f,-4.0f,-4.0f), - glm::vec4( 0.0f, 0.0f, 0.0f, 0.0f), - glm::vec4( 1.0f, 1.0f, 1.0f, 1.0f)); - glm::vec4 clamp3 = glm::clamp( - glm::vec4( 4.0f, 4.0f, 4.0f, 4.0f), - float(0.0f), float(1.0f)); - glm::vec4 clamp4 = glm::clamp( - glm::vec4(-4.0f,-4.0f,-4.0f,-4.0f), - float(0.0f), float(1.0f)); - - if(clamp1.x != 1.0f || - clamp1.y != 1.0f || - clamp1.z != 1.0f || - clamp1.w != 1.0f) - return false; - if(clamp2.x != 0.0f || - clamp2.y != 0.0f || - clamp2.z != 0.0f || - clamp2.w != 0.0f) - return false; - if(clamp3.x != 1.0f || - clamp3.y != 1.0f || - clamp3.z != 1.0f || - clamp3.w != 1.0f) - return false; - if(clamp4.x != 0.0f || - clamp4.y != 0.0f || - clamp4.z != 0.0f || - clamp4.w != 0.0f) - return false; - return true; -} - -bool test_mix_1() -{ - float val_mix = glm::mix(float(1.0f), float(1.0f), float(1.0f)); - - if(val_mix != 1.0f) - return false; - return true; -} - -bool test_mix_2() -{ - glm::vec2 val_mix1 = glm::mix(glm::vec2(1.0f, 1.0f), glm::vec2(1.0f, 1.0f), glm::vec2(1.0f, 1.0f)); - glm::vec2 val_mix2 = glm::mix(glm::vec2(1.0f, 1.0f), glm::vec2(1.0f, 1.0f), float(1.0f)); - - if(val_mix1.x != 1.0f || val_mix1.y != 1.0f || - val_mix2.x != 1.0f || val_mix2.y != 1.0f) - return false; - return true; -} - -bool test_mix_3() -{ - glm::vec3 val_mix1 = glm::mix(glm::vec3(1.0f, 1.0f, 1.0f), glm::vec3(1.0f, 1.0f, 1.0f), glm::vec3(1.0f, 1.0f, 1.0f)); - glm::vec3 val_mix2 = glm::mix(glm::vec3(1.0f, 1.0f, 1.0f), glm::vec3(1.0f, 1.0f, 1.0f), float(1.0f)); - - if(val_mix1.x != 1.0f || val_mix1.y != 1.0f || val_mix1.z != 1.0f || - val_mix2.x != 1.0f || val_mix2.y != 1.0f || val_mix2.z != 1.0f) - return false; - return true; -} - -bool test_mix_4() -{ - glm::vec4 val_mix1 = glm::mix(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f), glm::vec4(1.0f, 1.0f, 1.0f, 1.0f), glm::vec4(1.0f, 1.0f, 1.0f, 1.0f)); - glm::vec4 val_mix2 = glm::mix(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f), glm::vec4(1.0f, 1.0f, 1.0f, 1.0f), float(1.0f)); - - if(val_mix1.x != 1.0f || val_mix1.y != 1.0f || val_mix1.z != 1.0f || val_mix1.w != 1.0f || - val_mix2.x != 1.0f || val_mix2.y != 1.0f || val_mix2.z != 1.0f || val_mix2.w != 1.0f) - return false; - return true; -} - -bool test_step_1() -{ - float vec_step1 = step(1.f, 76.f); - - if(vec_step1 != 1.0f) - return false; - return true; -} - -bool test_step_2() -{ - vec2 vec_step1 = step(1.f, vec2(76.f, 1.f)); - vec2 vec_step2 = step(vec2(1.f, 1.f), vec2(76.f, 1.f)); - - if(vec_step1.x != 1.0f || vec_step1.y != 0.0f || - vec_step2.x != 1.0f || vec_step2.y != 0.0f) - return false; - return true; -} - -bool test_step_3() -{ - vec3 vec_step1 = step(1.f, vec3(76.f, 1.f, 0.f)); - vec3 vec_step2 = step(vec3(1.f, 1.f, 1.f), vec3(76.f, 1.f, 0.f)); - - if(vec_step1.x != 1.0f || vec_step1.y != 0.0f || vec_step1.z != 0.0f || - vec_step2.x != 1.0f || vec_step2.y != 0.0f || vec_step2.z != 0.0f) - return false; - return true; -} - -bool test_step_4() -{ - vec4 vec_step1 = step(1.f, vec4(76.f, 1.f, 0.f, 0.f)); - vec4 vec_step2 = step(vec4(1.f, 1.f, 1.f, 1.f), vec4(76.f, 1.f, 0.f, 0.f)); - - if(vec_step1.x != 1.0f || vec_step1.y != 0.0f || vec_step1.z != 0.0f || vec_step1.w != 0.0f || - vec_step2.x != 1.0f || vec_step2.y != 0.0f || vec_step2.z != 0.0f || vec_step2.w != 0.0f) - return false; - return true; -} - -bool test_smoothstep_1() -{ - float vec_smoothstep1 = smoothstep(0.f, 100.f, 50.f); - - bool Result = (vec_smoothstep1 < 0.5f - epsilon || vec_smoothstep1 > 0.5f + epsilon); - assert(!Result); - - float A = smoothstep(0.2f, 0.8f, 0.5f); - float B = smoothstep(0.2f, 0.8f, 0.7f); - float C = smoothstep(0.2f, 0.8f, 0.3f); - float D = smoothstep(0.2f, 0.8f, 1.2f); - float E = smoothstep(0.2f, 0.8f,-0.2f); - - if(Result) - return false; - return true; -} - -bool test_smoothstep_2() -{ - vec2 vec_smoothstep1 = smoothstep(0.f, 100.f, vec2(50.f, 100.f)); - vec2 vec_smoothstep2 = smoothstep(vec2(0.f, 0.f), vec2(100.f, 100.f), vec2(50.f, 100.f)); - - if(vec_smoothstep1.x < 0.50f - epsilon || vec_smoothstep1.x > 0.50f + epsilon || - vec_smoothstep1.y < 1.00f - epsilon || vec_smoothstep1.y > 1.00f + epsilon) - return false; - if(vec_smoothstep2.x < 0.50f - epsilon || vec_smoothstep2.x > 0.50f + epsilon || - vec_smoothstep2.y < 1.00f - epsilon || vec_smoothstep2.y > 1.00f + epsilon) - return false; - return true; -} - -bool test_smoothstep_3() -{ - vec3 vec_smoothstep1 = smoothstep(0.f, 100.f, vec3(50.f, 100.f, 0.f)); - vec3 vec_smoothstep2 = smoothstep(vec3(0.f, 0.f, 0.f), vec3(100.f, 100.f, 100.f), vec3(50.f, 100.f, 0.f)); - - if(vec_smoothstep1.x < 0.50f - epsilon || vec_smoothstep1.x > 0.50f + epsilon || - vec_smoothstep1.y < 1.00f - epsilon || vec_smoothstep1.y > 1.00f + epsilon || - vec_smoothstep1.z < 0.00f - epsilon || vec_smoothstep1.z > 0.00f + epsilon) - return false; - if(vec_smoothstep2.x < 0.50f - epsilon || vec_smoothstep2.x > 0.50f + epsilon || - vec_smoothstep2.y < 1.00f - epsilon || vec_smoothstep2.y > 1.00f + epsilon || - vec_smoothstep2.z < 0.00f - epsilon || vec_smoothstep2.z > 0.00f + epsilon) - return false; - return true; -} - -bool test_smoothstep_4() -{ - vec4 vec_smoothstep1 = smoothstep(0.f, 100.f, vec4(50.f, 100.f, 0.f, 0.f)); - vec4 vec_smoothstep2 = smoothstep(vec4(0.f, 0.f, 0.f, 0.f), vec4(100.f, 100.f, 100.f, 100.f), vec4(50.f, 100.f, 0.f, 0.f)); - - if(vec_smoothstep1.x < 0.50f - epsilon || vec_smoothstep1.x > 0.50f + epsilon || - vec_smoothstep1.y < 1.00f - epsilon || vec_smoothstep1.y > 1.00f + epsilon || - vec_smoothstep1.z < 0.00f - epsilon || vec_smoothstep1.z > 0.00f + epsilon || - vec_smoothstep1.w < 0.00f - epsilon || vec_smoothstep1.w > 0.00f + epsilon) - return false; - if(vec_smoothstep2.x < 0.50f - epsilon || vec_smoothstep2.x > 0.50f + epsilon || - vec_smoothstep2.y < 1.00f - epsilon || vec_smoothstep2.y > 1.00f + epsilon || - vec_smoothstep2.z < 0.00f - epsilon || vec_smoothstep2.z > 0.00f + epsilon || - vec_smoothstep2.w < 0.00f - epsilon || vec_smoothstep2.w > 0.00f + epsilon) - return false; - return true; -} - -bool test_isnan() -{ - return true; -} - -bool test_isinf() -{ - return true; -} - -void main_core_func_common() -{ - assert(test_abs_type1()); - assert(test_abs_type2()); - assert(test_abs_type3()); - assert(test_abs_type4()); - - assert(test_sign_type1()); - assert(test_sign_type2()); - assert(test_sign_type3()); - assert(test_sign_type4()); - - assert(test_floor_type1()); - assert(test_floor_type2()); - assert(test_floor_type3()); - assert(test_floor_type4()); - - assert(test_trunc_type1()); - assert(test_trunc_type2()); - assert(test_trunc_type3()); - assert(test_trunc_type4()); - - assert(test_round_type1()); - assert(test_round_type2()); - assert(test_round_type3()); - assert(test_round_type4()); - - assert(test_roundEven_type1()); - assert(test_roundEven_type2()); - assert(test_roundEven_type3()); - assert(test_roundEven_type4()); - - assert(test_ceil_1()); - assert(test_ceil_2()); - assert(test_ceil_3()); - assert(test_ceil_4()); - - assert(test_fract_1()); - assert(test_fract_2()); - assert(test_fract_3()); - assert(test_fract_4()); - - assert(test_mod_1()); - assert(test_mod_2()); - assert(test_mod_3()); - assert(test_mod_4()); - - assert(test_mod_1()); - assert(test_mod_2()); - assert(test_mod_3()); - assert(test_mod_4()); - - assert(test_modf()); - - assert(test_min_1()); - assert(test_min_2()); - assert(test_min_3()); - assert(test_min_4()); - - assert(test_max_1()); - assert(test_max_2()); - assert(test_max_3()); - assert(test_max_4()); - - assert(test_clamp_1()); - assert(test_clamp_2()); - assert(test_clamp_3()); - assert(test_clamp_4()); - - assert(test_mix_1()); - assert(test_mix_2()); - assert(test_mix_3()); - assert(test_mix_4()); - - assert(test_step_1()); - assert(test_step_2()); - assert(test_step_3()); - assert(test_step_4()); - - assert(test_smoothstep_1()); - assert(test_smoothstep_2()); - assert(test_smoothstep_3()); - assert(test_smoothstep_4()); - - assert(test_isnan()); - assert(test_isinf()); -} - -}//namespace test -}//namespace glm diff --git a/test/core/func_exponential.cpp b/test/core/func_exponential.cpp deleted file mode 100644 index e834ef87..00000000 --- a/test/core/func_exponential.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/func_exponential.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -static const float epsilon = 0.00001f; - -bool test_pow_1() -{ - float power = glm::pow(2.f, 2.f); - - if(power <= 4.f + epsilon && power >= 4.f - epsilon) - return true; - return false; -} - -bool test_pow_2() -{ - glm::vec2 power = glm::pow(glm::vec2(2.f, 2.f), glm::vec2(2.f, 2.f)); - - if(power.x <= 4.f + epsilon && power.x >= 4.f - epsilon && - power.y <= 4.f + epsilon && power.y >= 4.f - epsilon) - return true; - return false; -} - -bool test_pow_3() -{ - glm::vec3 power = glm::pow(glm::vec3(2.f, 2.f, 2.f), glm::vec3(2.f, 2.f, 2.f)); - - if(power.x <= 4.f + epsilon && power.x >= 4.f - epsilon && - power.y <= 4.f + epsilon && power.y >= 4.f - epsilon && - power.z <= 4.f + epsilon && power.z >= 4.f - epsilon) - return true; - return false; -} - -bool test_pow_4() -{ - glm::vec4 power = glm::pow(glm::vec4(2.f, 2.f, 2.f, 2.f), glm::vec4(2.f, 2.f, 2.f, 2.f)); - - if(power.x <= 4.f + epsilon && power.x >= 4.f - epsilon && - power.y <= 4.f + epsilon && power.y >= 4.f - epsilon && - power.z <= 4.f + epsilon && power.z >= 4.f - epsilon && - power.w <= 4.f + epsilon && power.w >= 4.f - epsilon) - return true; - return false; -} - -bool test_exp_1() -{ - float result = glm::exp(0.f); - - if(result > 1.f + epsilon || result < 1.f - epsilon) - return false; - return true; -} - -bool test_exp_2() -{ - glm::vec2 result = glm::exp(glm::vec2(0.f, 0.f)); - - if(result.x > 1.f + epsilon || result.x < 1.f - epsilon || - result.y > 1.f + epsilon || result.y < 1.f - epsilon) - return false; - return true; -} - -bool test_exp_3() -{ - glm::vec3 result = glm::exp(glm::vec3(0.f, 0.f, 0.f)); - - if(result.x > 1.f + epsilon || result.x < 1.f - epsilon || - result.y > 1.f + epsilon || result.y < 1.f - epsilon || - result.z > 1.f + epsilon || result.z < 1.f - epsilon) - return false; - return true; -} - -bool test_exp_4() -{ - glm::vec4 result = glm::exp(glm::vec4(0.f, 0.f, 0.f, 0.f)); - - if(result.x > 1.f + epsilon || result.x < 1.f - epsilon || - result.y > 1.f + epsilon || result.y < 1.f - epsilon || - result.z > 1.f + epsilon || result.z < 1.f - epsilon || - result.w > 1.f + epsilon || result.w < 1.f - epsilon) - return false; - return true; -} - -bool test_log_1() -{ - float result = glm::log(1.f); - - if(result > epsilon || result < -epsilon) - return false; - return true; -} - -bool test_log_2() -{ - glm::vec2 result = glm::log(glm::vec2(1.f, 1.f)); - - if(result.x > epsilon || result.x < -epsilon || - result.y > epsilon || result.y < -epsilon) - return false; - return true; -} - -bool test_log_3() -{ - glm::vec3 result = glm::log(glm::vec3(1.f, 1.f, 1.f)); - - if(result.x > epsilon || result.x < -epsilon || - result.y > epsilon || result.y < -epsilon || - result.z > epsilon || result.z < -epsilon) - return false; - return true; -} - -bool test_log_4() -{ - glm::vec4 result = glm::log(glm::vec4(1.f, 1.f, 1.f, 1.f)); - - if(result.x > epsilon || result.x < -epsilon || - result.y > epsilon || result.y < -epsilon || - result.z > epsilon || result.z < -epsilon || - result.w > epsilon || result.w < -epsilon) - return false; - return true; -} - -bool test_exp2_1() -{ - float result = glm::exp2(2.f); - - if(result > 4.f + epsilon || result < 4.f - epsilon) - return false; - return true; -} - -bool test_exp2_2() -{ - glm::vec2 result = glm::exp2(glm::vec2(2.f, 2.f)); - - if(result.x > 4.f + epsilon || result.x < 4.f - epsilon || - result.y > 4.f + epsilon || result.y < 4.f - epsilon) - return false; - return true; -} - -bool test_exp2_3() -{ - glm::vec3 result = glm::exp2(glm::vec3(2.f, 2.f, 2.f)); - - if(result.x > 4.f + epsilon || result.x < 4.f - epsilon || - result.y > 4.f + epsilon || result.y < 4.f - epsilon || - result.z > 4.f + epsilon || result.z < 4.f - epsilon) - return false; - return true; -} - -bool test_exp2_4() -{ - glm::vec4 result = glm::exp2(glm::vec4(2.f, 2.f, 2.f, 2.f)); - - if(result.x > 4.f + epsilon || result.x < 4.f - epsilon || - result.y > 4.f + epsilon || result.y < 4.f - epsilon || - result.z > 4.f + epsilon || result.z < 4.f - epsilon || - result.w > 4.f + epsilon || result.w < 4.f - epsilon) - return false; - return true; -} - -bool test_log2_1() -{ - float result = glm::log2(2.f); - - if(result > 1.f + epsilon || result < 1.f - epsilon) - return false; - return true; -} - -bool test_log2_2() -{ - glm::vec2 result = glm::log2(glm::vec2(2.f, 4.f)); - - if(result.x > 1.f + epsilon || result.x < 1.f - epsilon || - result.y > 2.f + epsilon || result.y < 2.f - epsilon) - return false; - return true; -} - -bool test_log2_3() -{ - glm::vec3 result = glm::log2(glm::vec3(2.f, 4.f, 8.f)); - - if(result.x > 1.f + epsilon || result.x < 1.f - epsilon || - result.y > 2.f + epsilon || result.y < 2.f - epsilon || - result.z > 3.f + epsilon || result.z < 3.f - epsilon) - return false; - return true; -} - -bool test_log2_4() -{ - glm::vec4 result = glm::log2(glm::vec4(2.f, 4.f, 8.f, 16.f)); - - if(result.x > 1.f + epsilon || result.x < 1.f - epsilon || - result.y > 2.f + epsilon || result.y < 2.f - epsilon || - result.z > 3.f + epsilon || result.z < 3.f - epsilon || - result.w > 4.f + epsilon || result.w < 4.f - epsilon) - return false; - return true; -} - -bool test_sqrt_1() -{ - float result = glm::sqrt(4.f); - - if(result < 2.f - epsilon && result > 2.f + epsilon) - return false; - return true; -} - -bool test_sqrt_2() -{ - glm::vec2 result = glm::sqrt(glm::vec2(4.f, 4.f)); - - if(result.x < 2.f - epsilon && result.x > 2.f + epsilon && - result.y < 2.f - epsilon && result.y > 2.f + epsilon) - return false; - return true; -} - -bool test_sqrt_3() -{ - glm::vec3 result = glm::sqrt(glm::vec3(4.f, 4.f, 4.f)); - - if(result.x < 2.f - epsilon && result.x > 2.f + epsilon && - result.y < 2.f - epsilon && result.y > 2.f + epsilon && - result.z < 2.f - epsilon && result.z > 2.f + epsilon) - return false; - return true; -} - -bool test_sqrt_4() -{ - glm::vec4 result = glm::sqrt(glm::vec4(4.f, 4.f, 4.f, 4.f)); - - if(result.x < 2.f - epsilon && result.x > 2.f + epsilon && - result.y < 2.f - epsilon && result.y > 2.f + epsilon && - result.z < 2.f - epsilon && result.z > 2.f + epsilon && - result.w < 2.f - epsilon && result.w > 2.f + epsilon) - return false; - return true; -} - -bool test_inversesqrt_1() -{ - float result = glm::inversesqrt(4.f); - - if(result < 0.5f - epsilon && result > 0.5f + epsilon) - return false; - return true; -} - -bool test_inversesqrt_2() -{ - glm::vec2 result = glm::inversesqrt(glm::vec2(4.f, 4.f)); - - if(result.x < 0.5f - epsilon && result.x > 0.5f + epsilon && - result.y < 0.5f - epsilon && result.y > 0.5f + epsilon) - return false; - return true; -} - -bool test_inversesqrt_3() -{ - glm::vec3 result = glm::inversesqrt(glm::vec3(4.f, 4.f, 4.f)); - - if(result.x < 0.5f - epsilon && result.x > 0.5f + epsilon && - result.y < 0.5f - epsilon && result.y > 0.5f + epsilon && - result.z < 0.5f - epsilon && result.z > 0.5f + epsilon) - return false; - return true; -} - -bool test_inversesqrt_4() -{ - glm::vec4 result = glm::inversesqrt(glm::vec4(4.f, 4.f, 4.f, 4.f)); - - if(result.x < 0.5f - epsilon && result.x > 0.5f + epsilon && - result.y < 0.5f - epsilon && result.y > 0.5f + epsilon && - result.z < 0.5f - epsilon && result.z > 0.5f + epsilon && - result.w < 0.5f - epsilon && result.w > 0.5f + epsilon) - return false; - return true; -} - -void main_core_func_exponential() -{ - assert(test_pow_1()); - assert(test_pow_2()); - assert(test_pow_3()); - assert(test_pow_4()); - - assert(test_exp_1()); - assert(test_exp_2()); - assert(test_exp_3()); - assert(test_exp_4()); - - assert(test_log_1()); - assert(test_log_2()); - assert(test_log_3()); - assert(test_log_4()); - - assert(test_exp2_1()); - assert(test_exp2_2()); - assert(test_exp2_3()); - assert(test_exp2_4()); - - assert(test_log2_1()); - assert(test_log2_2()); - assert(test_log2_3()); - assert(test_log2_4()); - - assert(test_sqrt_1()); - assert(test_sqrt_2()); - assert(test_sqrt_3()); - assert(test_sqrt_4()); - - assert(test_inversesqrt_1()); - assert(test_inversesqrt_2()); - assert(test_inversesqrt_3()); - assert(test_inversesqrt_4()); -} - -}//namespace test -}//namespace glm diff --git a/test/core/func_geometric.cpp b/test/core/func_geometric.cpp deleted file mode 100644 index 271751c7..00000000 --- a/test/core/func_geometric.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/func_geometric.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -bool test_length_1() -{ - float f1 = 0.0f; - float len1 = length(f1); - float f2 = 1.0f; - float len2 = length(f2); - - if (len1 == 0.0f && len2 == 1.0f) - return true; - return false; -} - -bool test_length_2() -{ - vec2 v1 = vec2(0, 0); - float len1 = length(v1); - vec2 v2 = vec2 (1, 1); - float len2 = length(v2); - - if (len1 == 0.0f && len2 > 1.41f && len2 < 1.42f) - return true; - return false; -} - -bool test_length_3() -{ - vec3 v1 = vec3(0, 0, 0); - float len1 = length(v1); - vec3 v2 = vec3 (1, 1, 1); - float len2 = length(v2); - - if (len1 == 0.0f && len2 > 1.73f && len2 < 1.74f) - return true; - return false; -} - -bool test_length_4() -{ - vec4 v1 = vec4(0, 0, 0, 0); - float len1 = length(v1); - vec4 v2 = vec4(1, 1, 1, 1); - float len2 = length(v2); - - if (len1 == 0.0f && len2 == 2.f) - return true; - return false; -} - -bool test_distance_1() -{ - float p0 = 2.f; - float p1 = -2.f; - float dist = distance(p0, p1); - - if (dist == 4.0f) - return true; - return false; -} - -bool test_distance_2() -{ - vec2 p0 = vec2(0.f, 2.f); - vec2 p1 = vec2(0.f,-2.f); - float dist = distance(p0, p1); - - if (dist == 4.0f) - return true; - return false; -} - -bool test_distance_3() -{ - vec3 p0 = vec3(0.f, 0.f, 2.f); - vec3 p1 = vec3(0.f, 0.f,-2.f); - float dist = distance(p0, p1); - - if (dist == 4.0f) - return true; - return false; -} - -bool test_distance_4() -{ - vec4 p0 = vec4(0.f, 0.f, 2.f, 0.f); - vec4 p1 = vec4(0.f, 0.f,-2.f, 0.f); - float dist = distance(p0, p1); - - if (dist == 4.0f) - return true; - return false; -} - -bool test_dot_1() -{ - float v1 = 1.0f; - float v2 = 0.0f; - float dot1 = dot (v1, v1); - float dot2 = dot (v1, v2); - - if (dot1 == 1.0f && dot2 == 0.0f) - return true; - return false; -} - -bool test_dot_2() -{ - vec2 v1 = vec2 (1, 0); - vec2 v2 = vec2 (0, 1); - float dot1 = dot (v1, v1); - float dot2 = dot (v1, v2); - - if (dot1 == 1.0f && dot2 == 0.0f) - return true; - return false; -} - -bool test_dot_3() -{ - vec3 v1 = vec3 (1, 0, 0); - vec3 v2 = vec3 (0, 1, 0); - float dot1 = dot (v1, v1); - float dot2 = dot (v1, v2); - - if (dot1 == 1.0f && dot2 == 0.0f) - return true; - return false; -} - -bool test_dot_4() -{ - vec4 v1 = vec4 (1, 0, 0, 0); - vec4 v2 = vec4 (0, 1, 0, 0); - float dot1 = dot (v1, v1); - float dot2 = dot (v1, v2); - - if (dot1 == 1.0f && dot2 == 0.0f) - return true; - return false; -} - -bool test_cross_vec3 () -{ - vec3 v1 = vec3(1.0f, 0.0f, 0.0f); - vec3 v2 = vec3(0.0f, 1.0f, 0.0f); - vec3 v3 = cross(v1, v2); - vec3 v4 = vec3(0.0f, 0.0f, 1.0f); - - if (v3.x == v4.x && v3.y == v4.y && v3.z == v4.z) - return true; - return false; -} - -bool test_normalize_1() -{ - float f1 = 0.0f; - f1 = normalize(f1); - float f2 = 1.0f; - f2 = normalize(f2); - - if (f1 == 1.0f && f2 == 1.0f) - return true; - return false; -} - -bool test_normalize_2() -{ - vec2 v1 = vec2(0, 0); - v1 = normalize(v1); - vec2 v2 = vec2 (1, 1); - v2 = normalize(v2); - - if (length (v2) > 0.99f && length (v2) < 1.01f) - return true; - return false; -} - -bool test_normalize_3() -{ - vec3 v1 = vec3(0, 0, 0); - v1 = normalize(v1); - vec3 v2 = vec3(1, 1, 1); - v2 = normalize(v2); - - if (length (v2) > 0.99f && length (v2) < 1.01f) - return true; - return false; -} - -bool test_normalize_4() -{ - vec4 v1 = vec4(0, 0, 0, 0); - v1 = normalize(v1); - vec4 v2 = vec4(1, 1, 1, 1); - v2 = normalize(v2); - - if (length (v2) > 0.99f && length (v2) < 1.01f) - return true; - return false; -} - -bool test_faceforward_1() -{ - float N = 1.0f; - float I = 1.0f; - float Nref = 1.0f; - N = faceforward(N, I, Nref); - - if (N == -1) - return true; - return false; -} - -bool test_faceforward_2() -{ - vec2 N = vec2(1, 1); - vec2 I = vec2(1, 0); - vec2 Nref = vec2(0, 0); - N = faceforward(N, I, Nref); - - if (N.x == -1 && N.y == -1) - return true; - return false; -} - -bool test_faceforward_3() -{ - vec3 N = vec3(1, 1, 1); - vec3 I = vec3(1, 0, 0); - vec3 Nref = vec3(0, 0, 0); - N = faceforward(N, I, Nref); - - if (N.x == -1 && N.y == -1 && N.z == -1) - return true; - return false; -} - -bool test_faceforward_4() -{ - vec4 N = vec4(1, 1, 1, 1); - vec4 I = vec4(1, 0, 0, 0); - vec4 Nref = vec4(0, 0, 0, 0); - N = faceforward(N, I, Nref); - - if (N.x == -1 && N.y == -1 && N.z == -1 && N.w == -1) - return true; - return false; -} - -bool test_reflect_2() -{ - vec2 N = vec2( 1, 0); - vec2 I = vec2(-1, 0); - vec2 result = reflect(I, N); - - if (result.x != 1.0f || result.y != 0.f) - return false; - return true; -} - -bool test_reflect_3() -{ - vec3 N = vec3( 1, 0, 0); - vec3 I = vec3(-1, 0, 0); - vec3 result = reflect(I, N); - - if (result.x != 1.0f || result.y != 0.f || result.z != 0.f) - return false; - return true; -} - -bool test_reflect_4() -{ - vec4 N = vec4( 1, 0, 0, 0); - vec4 I = vec4(-1, 0, 0, 0); - vec4 result = reflect(I, N); - - if (result.x != 1.0f || result.y != 0.f || result.z != 0.f || result.w != 0.f) - return false; - return true; -} - -bool test_refract_2() -{ - glm::vec2 N = glm::vec2( 1, 0); - glm::vec2 I = glm::vec2(-1, 0); - glm::vec2 result = glm::refract(I, N, 1.0f); - - if (result.x != -1.f || result.y != 0.f) - return false; - return true; -} - -bool test_refract_3() -{ - glm::vec3 N = glm::vec3( 1, 0, 0); - glm::vec3 I = glm::vec3(-1, 0, 0); - glm::vec3 result = glm::refract(I, N, 1.0f); - - if (result.x != -1.f || result.y != 0.f || result.z != 0.f) - return false; - return true; -} - -bool test_refract_4() -{ - glm::vec4 N = glm::vec4( 1, 0, 0, 0); - glm::vec4 I = glm::vec4(-1, 0, 0, 0); - glm::vec4 result = glm::refract(I, N, 1.0f); - - if (result.x != -1.f || result.y != 0.f || result.z != 0.f || result.w != 0.f) - return false; - return true; -} - - -void main_core_func_geometric() -{ - assert(test_length_1()); - assert(test_length_2()); - assert(test_length_3()); - assert(test_length_4()); - - assert(test_distance_1()); - assert(test_distance_2()); - assert(test_distance_3()); - assert(test_distance_4()); - - assert(test_dot_1()); - assert(test_dot_2()); - assert(test_dot_3()); - assert(test_dot_4()); - - assert(test_cross_vec3()); - - assert(test_normalize_1()); - assert(test_normalize_2()); - assert(test_normalize_3()); - assert(test_normalize_4()); - - assert(test_faceforward_1()); - assert(test_faceforward_2()); - assert(test_faceforward_3()); - assert(test_faceforward_4()); - - assert(test_reflect_2()); - assert(test_reflect_3()); - assert(test_reflect_4()); - - assert(test_refract_2()); - assert(test_refract_3()); - assert(test_refract_4()); -} - -}//namespace test -}//namespace glm diff --git a/test/core/func_matrix.cpp b/test/core/func_matrix.cpp deleted file mode 100644 index 0ae3a106..00000000 --- a/test/core/func_matrix.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/func_matrix.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -bool test_matrixcompmult_2x2() -{ - mat2 x = mat2(vec2(0, 1), vec2(2, 3)); - mat2 result = matrixCompMult(x, x); - - if(result[0][0] != 0 || result[0][1] != 1 || - result[1][0] != 4 || result[1][1] != 9) - return false; - return true; -} - -bool test_matrixcompmult_3x3() -{ - mat3 x = mat3(vec3(0, 0, 0), - vec3(1, 1, 1), - vec3(2, 2, 2)); - mat3 result = matrixCompMult(x, x); - - if(result[0][0] != 0 || result[0][1] != 0 || result[0][2] != 0 || - result[1][0] != 1 || result[1][1] != 1 || result[1][2] != 1 || - result[2][0] != 4 || result[2][1] != 4 || result[2][2] != 4) - return false; - return true; -} - -bool test_matrixcompmult_4x4() -{ - mat4 x = mat4(vec4(0, 0, 0, 0), - vec4(1, 1, 1, 1), - vec4(2, 2, 2, 2), - vec4(3, 3, 3, 3)); - mat4 result = matrixCompMult(x, x); - - if(result[0][0] != 0 || result[0][1] != 0 || result[0][2] != 0 || result[0][3] != 0 || - result[1][0] != 1 || result[1][1] != 1 || result[1][2] != 1 || result[1][3] != 1 || - result[2][0] != 4 || result[2][1] != 4 || result[2][2] != 4 || result[2][3] != 4 || - result[3][0] != 9 || result[3][1] != 9 || result[3][2] != 9 || result[3][3] != 9) - return false; - return true; -} - -bool test_outerProduct() -{ - mat2x2 m0 = glm::outerProduct(vec2(1.f), vec2(1.f)); - - return true; -} - -bool test_transpose() -{ - return true; -} - -void main_core_func_matrix() -{ - assert(test_matrixcompmult_2x2()); - assert(test_matrixcompmult_3x3()); - assert(test_matrixcompmult_4x4()); - - assert(test_outerProduct()); - - assert(test_transpose()); -} - -}//namespace test -}//namespace glm diff --git a/test/core/func_noise.cpp b/test/core/func_noise.cpp deleted file mode 100644 index c9c6e4c0..00000000 --- a/test/core/func_noise.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/func_noise.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -bool test_noise() -{ - return true; -} - -void main_core_func_noise() -{ - assert(test_noise()); -} - -}//namespace test -}//namespace glm diff --git a/test/core/func_trigonometric.cpp b/test/core/func_trigonometric.cpp deleted file mode 100644 index f14a9cd9..00000000 --- a/test/core/func_trigonometric.cpp +++ /dev/null @@ -1,400 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/func_trigonometric.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -static const float epsilon = 0.00001f; -static const float pi = 3.14159265358979323846f; - -bool test_radians_1() -{ - float angle = radians(360.f); - - if(angle < 2.0f * pi + epsilon && angle > 2.0f * pi - epsilon) - return true; - return false; -} - -bool test_radians_2() -{ - vec2 angle = radians(vec2(360.f, 180.f)); - - if(angle.x < 2.0f * pi + epsilon && angle.x > 2.0f * pi - epsilon && - angle.y < pi + epsilon && angle.y > pi - epsilon) - return true; - return false; -} - -bool test_radians_3() -{ - vec3 angle = radians(vec3(360.f, 180.f, 0.f)); - - if(angle.x < 2.0f * pi + epsilon && angle.x > 2.0f * pi - epsilon && - angle.y < pi + epsilon && angle.y > pi - epsilon && - angle.z == 0.f) - return true; - return false; -} - -bool test_radians_4() -{ - vec4 angle = radians(vec4 (360.f, 180.f, 0.f, -180.f)); - - if(angle.x < 2.0f * pi + epsilon && angle.x > 2.0f * pi - epsilon && - angle.y < pi + epsilon && angle.y > pi - epsilon && - angle.z == 0.f && - angle.w > -(pi + epsilon) && angle.w < -(pi - epsilon)) - return true; - return false; -} - -bool test_degrees_1() -{ - float angle1 = degrees(pi * 2.f); - float angle2 = degrees(0.f); - - if(angle1 < 360.1f && angle1 > 359.9f && angle2 == 0.0f) - return true; - return false; -} - -bool test_degrees_2() -{ - vec2 angle = degrees(vec2 (pi * 2.f, pi)); - - if(angle.x < 360.1f && angle.x > 359.9f && - angle.y < 180.1f && angle.y > 179.9f) - return true; - return false; -} - -bool test_degrees_3() -{ - vec3 angle = degrees(vec3 (pi * 2.f, pi, 0.f)); - - if(angle.x < 360.1f && angle.x > 359.9f && - angle.y < 180.1f && angle.y > 179.9f && - angle.z == 0.f) - return true; - return false; -} - -bool test_degrees_4() -{ - vec4 angle = degrees(vec4 (pi * 2.f, pi, 0.f, -pi)); - - if(angle.x < 360.1f && angle.x > 359.9f && - angle.y < 180.1f && angle.y > 179.9f && - angle.z == 0.f && - angle.w > -180.1f && angle.w < -179.9f) - return true; - return false; -} - -bool test_sin_1() -{ - float sinus = glm::sin(0.f); - - if(sinus <= epsilon && sinus >= -epsilon) - return true; - return false; -} - -bool test_sin_2() -{ - glm::vec2 sinus = glm::sin(glm::vec2(0.f, 0.f)); - - if(sinus.x <= epsilon && sinus.x >= -epsilon && - sinus.y <= epsilon && sinus.y >= -epsilon) - return true; - return false; -} - -bool test_sin_3() -{ - glm::vec3 sinus = glm::sin(glm::vec3(0.f, 0.f, 0.f)); - - if(sinus.x <= epsilon && sinus.x >= -epsilon && - sinus.y <= epsilon && sinus.y >= -epsilon && - sinus.z <= epsilon && sinus.z >= -epsilon) - return true; - return false; -} - -bool test_sin_4() -{ - glm::vec4 sinus = glm::sin(glm::vec4(0.f, 0.f, 0.f, 0.f)); - - if(sinus.x <= epsilon && sinus.x >= -epsilon && - sinus.y <= epsilon && sinus.y >= -epsilon && - sinus.z <= epsilon && sinus.z >= -epsilon && - sinus.w <= epsilon && sinus.w >= -epsilon) - return true; - return false; -} - -bool test_cos_1() -{ - float cosinus = glm::cos(0.f); - - if(cosinus <= 1.0f + epsilon && cosinus >= 1.0f - epsilon) - return true; - return false; -} - -bool test_cos_2() -{ - glm::vec2 cosinus = glm::cos(glm::vec2(0.f, 0.f)); - - if(cosinus.x <= 1.0f + epsilon && cosinus.x >= 1.0f - epsilon && - cosinus.y <= 1.0f + epsilon && cosinus.y >= 1.0f - epsilon) - return true; - return false; -} - -bool test_cos_3() -{ - glm::vec3 cosinus = glm::cos(glm::vec3(0.f, 0.f, 0.f)); - - if(cosinus.x <= 1.0f + epsilon && cosinus.x >= 1.0f - epsilon && - cosinus.y <= 1.0f + epsilon && cosinus.y >= 1.0f - epsilon && - cosinus.z <= 1.0f + epsilon && cosinus.z >= 1.0f - epsilon) - return true; - return false; -} - -bool test_cos_4() -{ - glm::vec4 cosinus = glm::cos(glm::vec4(0.f, 0.f, 0.f, 0.f)); - - if(cosinus.x <= 1.0f + epsilon && cosinus.x >= 1.0f - epsilon && - cosinus.y <= 1.0f + epsilon && cosinus.y >= 1.0f - epsilon && - cosinus.z <= 1.0f + epsilon && cosinus.z >= 1.0f - epsilon && - cosinus.w <= 1.0f + epsilon && cosinus.w >= 1.0f - epsilon) - return true; - return false; -} - -bool test_tan_1() -{ - float tangent = glm::tan(0.f); - - if(tangent <= epsilon && tangent >= -epsilon) - return true; - return false; -} - -bool test_tan_2() -{ - glm::vec2 tangent = glm::tan(glm::vec2(0.f, 0.f)); - - if(tangent.x <= epsilon && tangent.x >= -epsilon && - tangent.y <= epsilon && tangent.y >= -epsilon) - return true; - return false; -} - -bool test_tan_3() -{ - glm::vec3 tangent = glm::tan(glm::vec3(0.f, 0.f, 0.f)); - - if(tangent.x <= epsilon && tangent.x >= -epsilon && - tangent.y <= epsilon && tangent.y >= -epsilon && - tangent.z <= epsilon && tangent.z >= -epsilon) - return true; - return false; -} - -bool test_tan_4() -{ - glm::vec4 tangent = glm::tan(glm::vec4(0.f, 0.f, 0.f, 0.f)); - - if(tangent.x <= epsilon && tangent.x >= -epsilon && - tangent.y <= epsilon && tangent.y >= -epsilon && - tangent.z <= epsilon && tangent.z >= -epsilon && - tangent.w <= epsilon && tangent.w >= -epsilon) - return true; - return false; -} - -bool test_asin_1() -{ - float arc_sinus = glm::asin(0.f); - - if(arc_sinus <= epsilon && arc_sinus >= -epsilon) - return true; - return false; -} - -bool test_asin_2() -{ - glm::vec2 arc_sinus = glm::asin(glm::vec2(0.f, 0.f)); - - if(arc_sinus.x <= epsilon && arc_sinus.x >= -epsilon && - arc_sinus.y <= epsilon && arc_sinus.y >= -epsilon) - return true; - return false; -} - -bool test_asin_3() -{ - glm::vec3 arc_sinus = glm::asin(glm::vec3(0.f, 0.f, 0.f)); - - if(arc_sinus.x <= epsilon && arc_sinus.x >= -epsilon && - arc_sinus.y <= epsilon && arc_sinus.y >= -epsilon && - arc_sinus.z <= epsilon && arc_sinus.z >= -epsilon) - return true; - return false; -} - -bool test_asin_4() -{ - glm::vec4 arc_sinus = glm::sin(glm::vec4(0.f, 0.f, 0.f, 0.f)); - - if(arc_sinus.x <= epsilon && arc_sinus.x >= -epsilon && - arc_sinus.y <= epsilon && arc_sinus.y >= -epsilon && - arc_sinus.z <= epsilon && arc_sinus.z >= -epsilon && - arc_sinus.w <= epsilon && arc_sinus.w >= -epsilon) - return true; - return false; -} - -bool test_acos_1() -{ - float arc_cosinus = glm::acos(1.f); - - if(arc_cosinus <= epsilon && arc_cosinus >= -epsilon) - return true; - return false; -} - -bool test_acos_2() -{ - glm::vec2 arc_cosinus = glm::acos(glm::vec2(1.f, 1.f)); - - if(arc_cosinus.x <= epsilon && arc_cosinus.x >= -epsilon && - arc_cosinus.y <= epsilon && arc_cosinus.y >= -epsilon) - return true; - return false; -} - -bool test_acos_3() -{ - glm::vec3 arc_cosinus = glm::acos(glm::vec3(1.f, 1.f, 1.f)); - - if(arc_cosinus.x <= epsilon && arc_cosinus.x >= -epsilon && - arc_cosinus.y <= epsilon && arc_cosinus.y >= -epsilon && - arc_cosinus.z <= epsilon && arc_cosinus.z >= -epsilon) - return true; - return false; -} - -bool test_acos_4() -{ - glm::vec4 arc_cosinus = glm::acos(glm::vec4(1.f, 1.f, 1.f, 1.f)); - - if(arc_cosinus.x <= epsilon && arc_cosinus.x >= -epsilon && - arc_cosinus.y <= epsilon && arc_cosinus.y >= -epsilon && - arc_cosinus.z <= epsilon && arc_cosinus.z >= -epsilon && - arc_cosinus.w <= epsilon && arc_cosinus.w >= -epsilon) - return true; - return false; -} - -bool test_atan_1() -{ - float tangent = glm::atan(0.f); - - if(tangent <= epsilon && tangent >= -epsilon) - return true; - return false; -} - -bool test_atan_2() -{ - glm::vec2 tangent = glm::atan(glm::vec2(0.f, 0.f)); - - if(tangent.x <= epsilon && tangent.x >= -epsilon && - tangent.y <= epsilon && tangent.y >= -epsilon) - return true; - return false; -} - -bool test_atan_3() -{ - glm::vec3 tangent = glm::atan(glm::vec3(0.f, 0.f, 0.f)); - - if(tangent.x <= epsilon && tangent.x >= -epsilon && - tangent.y <= epsilon && tangent.y >= -epsilon && - tangent.z <= epsilon && tangent.z >= -epsilon) - return true; - return false; -} - -bool test_atan_4() -{ - glm::vec4 tangent = glm::atan(glm::vec4(0.f, 0.f, 0.f, 0.f)); - - if(tangent.x <= epsilon && tangent.x >= -epsilon && - tangent.y <= epsilon && tangent.y >= -epsilon && - tangent.z <= epsilon && tangent.z >= -epsilon && - tangent.w <= epsilon && tangent.w >= -epsilon) - return true; - return false; -} - -void main_core_func_trigonometric() -{ - assert(test_radians_1()); - assert(test_radians_2()); - assert(test_radians_3()); - assert(test_radians_4()); - - assert(test_degrees_1()); - assert(test_degrees_2()); - assert(test_degrees_3()); - assert(test_degrees_4()); - - assert(test_sin_1()); - assert(test_sin_2()); - assert(test_sin_3()); - assert(test_sin_4()); - - assert(test_cos_1()); - assert(test_cos_2()); - assert(test_cos_3()); - assert(test_cos_4()); - - assert(test_tan_1()); - assert(test_tan_2()); - assert(test_tan_3()); - assert(test_tan_4()); - - assert(test_asin_1()); - assert(test_asin_2()); - assert(test_asin_3()); - assert(test_asin_4()); - - assert(test_acos_1()); - assert(test_acos_2()); - assert(test_acos_3()); - assert(test_acos_4()); - - assert(test_atan_1()); - assert(test_atan_2()); - assert(test_atan_3()); - assert(test_atan_4()); -} - -}//namespace test -}//namespace glm diff --git a/test/core/func_vector_relational.cpp b/test/core/func_vector_relational.cpp deleted file mode 100644 index 3bf0612c..00000000 --- a/test/core/func_vector_relational.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/func_vector_relational.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -bool test_lessthan_2() -{ - bvec2 lessThan1 = lessThan(vec2(0.f, 1.f), vec2(1.f, 0.f)); - bvec2 lessThan2 = lessThan(ivec2(0, 1), ivec2(1, 0)); - - if(!lessThan1.x || lessThan1.y) - return false; - if(!lessThan2.x || lessThan2.y) - return false; - return true; -} - -bool test_lessthan_3() -{ - bvec3 lessThan1 = lessThan(vec3(0.f, 1.f, 1.f), vec3(1.f, 0.f, 1.f)); - bvec3 lessThan2 = lessThan(ivec3(0, 1, 1), ivec3(1, 0, 1)); - - if(!lessThan1.x || lessThan1.y || lessThan1.z) - return false; - if(!lessThan2.x || lessThan2.y || lessThan2.z) - return false; - return true; -} - -bool test_lessthan_4() -{ - bvec4 lessThan1 = lessThan(vec4(0.f, 1.f, 1.f, 0.f), vec4(1.f, 0.f, 1.f, 0.f)); - bvec4 lessThan2 = lessThan(ivec4(0, 1, 1, 0), ivec4(1, 0, 1, 0)); - - if(!lessThan1.x || lessThan1.y || lessThan1.z || lessThan1.w) - return false; - if(!lessThan2.x || lessThan2.y || lessThan2.z || lessThan2.w) - return false; - return true; -} - -bool test_lessthanequal_2() -{ - bvec2 result1 = lessThanEqual(vec2(0.f, 1.f), vec2(1.f, 0.f)); - bvec2 result2 = lessThanEqual(ivec2(0, 1), ivec2(1, 0)); - - if(!result1.x || result1.y) - return false; - if(!result2.x || result2.y) - return false; - return true; -} - -bool test_lessthanequal_3() -{ - bvec3 result1 = lessThanEqual(vec3(0.f, 1.f, 1.f), vec3(1.f, 0.f, 1.f)); - bvec3 result2 = lessThanEqual(ivec3(0, 1, 1), ivec3(1, 0, 1)); - - if(!result1.x || result1.y || !result1.z) - return false; - if(!result2.x || result2.y || !result2.z) - return false; - return true; -} - -bool test_lessthanequal_4() -{ - bvec4 result1 = lessThanEqual(vec4(0.f, 1.f, 1.f, 0.f), vec4(1.f, 0.f, 1.f, 0.f)); - bvec4 result2 = lessThanEqual(ivec4(0, 1, 1, 0), ivec4(1, 0, 1, 0)); - - if(!result1.x || result1.y || !result1.z || !result1.w) - return false; - if(!result2.x || result2.y || !result2.z || !result2.w) - return false; - return true; -} - -bool test_all_2() -{ - bool result1 = all(bvec2(true, true)); - bool result2 = all(bvec2(true, false)); - bool result3 = all(bvec2(false, false)); - - if(!result1 || result2 || result3) - return false; - return true; -} - -bool test_all_3() -{ - bool result1 = all(bvec3(true, true, true)); - bool result2 = all(bvec3(true, false, true)); - bool result3 = all(bvec3(false, false, false)); - - if(!result1 || result2 || result3) - return false; - return true; -} - -bool test_all_4() -{ - bool result1 = all(bvec4(true, true, true, true)); - bool result2 = all(bvec4(true, false, true, false)); - bool result3 = all(bvec4(false, false, false, false)); - - if(!result1 || result2 || result3) - return false; - return true; -} - -bool test_greaterthan_2() -{ - bvec2 result1 = greaterThan(vec2(0.f, 1.f), vec2(1.f, 0.f)); - bvec2 result2 = greaterThan(ivec2(0, 1), ivec2(1, 0)); - - if(result1.x || !result1.y) - return false; - if(result2.x || !result2.y) - return false; - return true; -} - -bool test_greaterthan_3() -{ - bvec3 result1 = greaterThan(vec3(0.f, 1.f, 1.f), vec3(1.f, 0.f, 1.f)); - bvec3 result2 = greaterThan(ivec3(0, 1, 1), ivec3(1, 0, 1)); - - if(result1.x || !result1.y || result1.z) - return false; - if(result2.x || !result2.y || result2.z) - return false; - return true; -} - -bool test_greaterthan_4() -{ - bvec4 result1 = greaterThan(vec4(0.f, 1.f, 1.f, 0.f), vec4(1.f, 0.f, 1.f, 0.f)); - bvec4 result2 = greaterThan(ivec4(0, 1, 1, 0), ivec4(1, 0, 1, 0)); - - if(result1.x || !result1.y || result1.z || result1.w) - return false; - if(result2.x || !result2.y || result2.z || result2.w) - return false; - return true; -} - -bool test_greaterthanequal_2() -{ - bvec2 result1 = greaterThanEqual(vec2(0.f, 1.f), vec2(1.f, 0.f)); - bvec2 result2 = greaterThanEqual(ivec2(0, 1), ivec2(1, 0)); - - if(result1.x || !result1.y) - return false; - if(result2.x || !result2.y) - return false; - return true; -} - -bool test_greaterthanequal_3() -{ - bvec3 result1 = greaterThanEqual(vec3(0.f, 1.f, 1.f), vec3(1.f, 0.f, 1.f)); - bvec3 result2 = greaterThanEqual(ivec3(0, 1, 1), ivec3(1, 0, 1)); - - if(result1.x || !result1.y || !result1.z) - return false; - if(result2.x || !result2.y || !result2.z) - return false; - return true; -} - -bool test_greaterthanequal_4() -{ - bvec4 result1 = greaterThanEqual(vec4(0.f, 1.f, 1.f, 0.f), vec4(1.f, 0.f, 1.f, 0.f)); - bvec4 result2 = greaterThanEqual(ivec4(0, 1, 1, 0), ivec4(1, 0, 1, 0)); - - if(result1.x || !result1.y || !result1.z || !result1.w) - return false; - if(result2.x || !result2.y || !result2.z || !result2.w) - return false; - return true; -} - -bool test_equal_2() -{ - bvec2 result1 = equal(vec2(76.f, 0.f), vec2(76.f, 76.f)); - bvec2 result2 = equal(ivec2(76, 0), ivec2(76, 76)); - bvec2 result3 = equal(bvec2(true, false), bvec2(true, true)); - - if(!result1.x || result1.y) - return false; - if(!result2.x || result2.y) - return false; - if(!result3.x || result3.y) - return false; - return true; -} - -bool test_equal_3() -{ - bvec3 result1 = equal(vec3(76.f, 0.f, 76.f), vec3(76.f, 76.f, 76.f)); - bvec3 result2 = equal(ivec3(76, 0, 76), ivec3(76, 76, 76)); - bvec3 result3 = equal(bvec3(true, false, true), bvec3(true, true, true)); - - if(!result1.x || result1.y || !result1.z) - return false; - if(!result2.x || result2.y || !result2.z) - return false; - if(!result3.x || result3.y || !result3.z) - return false; - return true; -} - -bool test_equal_4() -{ - bvec4 result1 = equal(vec4(76.f, 0.f, 76.f, 0.f), vec4(76.f, 76.f, 76.f, 76.f)); - bvec4 result2 = equal(ivec4(76, 0, 76, 0), ivec4(76, 76, 76, 76)); - bvec4 result3 = equal(bvec4(true, false, true, false), bvec4(true, true, true, true)); - - if(!result1.x || result1.y || !result1.z || result1.w) - return false; - if(!result2.x || result2.y || !result2.z || result2.w) - return false; - if(!result3.x || result3.y || !result3.z || result3.w) - return false; - return true; -} - -bool test_notequal_2() -{ - bvec2 result1 = notEqual(vec2(76.f, 0.f), vec2(76.f, 76.f)); - bvec2 result2 = notEqual(ivec2(76, 0), ivec2(76, 76)); - bvec2 result3 = notEqual(bvec2(true, false), bvec2(true, true)); - - if(result1.x || !result1.y) - return false; - if(result2.x || !result2.y) - return false; - if(result3.x || !result3.y) - return false; - return true; -} - -bool test_notequal_3() -{ - bvec3 result1 = notEqual(vec3(76.f, 0.f, 76.f), vec3(76.f, 76.f, 76.f)); - bvec3 result2 = notEqual(ivec3(76, 0, 76), ivec3(76, 76, 76)); - bvec3 result3 = notEqual(bvec3(true, false, true), bvec3(true, true, true)); - - if(result1.x || !result1.y || result1.z) - return false; - if(result2.x || !result2.y || result2.z) - return false; - if(result3.x || !result3.y || result3.z) - return false; - return true; -} - -bool test_notequal_4() -{ - bvec4 result1 = notEqual(vec4(76.f, 0.f, 76.f, 0.f), vec4(76.f, 76.f, 76.f, 76.f)); - bvec4 result2 = notEqual(ivec4(76, 0, 76, 0), ivec4(76, 76, 76, 76)); - bvec4 result3 = notEqual(bvec4(true, false, true, false), bvec4(true, true, true, true)); - - if(result1.x || !result1.y || result1.z || !result1.w) - return false; - if(result2.x || !result2.y || result2.z || !result2.w) - return false; - if(result3.x || !result3.y || result3.z || !result3.w) - return false; - return true; -} - -bool test_any_2() -{ - bool result1 = any(bvec2(true, true)); - bool result2 = any(bvec2(true, false)); - bool result3 = any(bvec2(false, false)); - - if(!result1 || !result2 || result3) - return false; - return true; -} - -bool test_any_3() -{ - bool result1 = any(bvec3(true, true, true)); - bool result2 = any(bvec3(true, false, true)); - bool result3 = any(bvec3(false, false, false)); - - if(!result1 || !result2 || result3) - return false; - return true; -} - -bool test_any_4() -{ - bool result1 = any(bvec4(true, true, true, true)); - bool result2 = any(bvec4(true, false, true, false)); - bool result3 = any(bvec4(false, false, false, false)); - - if(!result1 || !result2 || result3) - return false; - return true; -} - -bool test_not_2() -{ - bvec2 result = not_(bvec2(true, false)); - - if(result.x || !result.y) - return false; - return true; -} - -bool test_not_3() -{ - bvec3 result = not_(bvec3(true, false, true)); - - if(result.x || !result.y || result.z) - return false; - return true; -} - -bool test_not_4() -{ - bvec4 result = not_(bvec4(true, false, true, false)); - - if(result.x || !result.y || result.z || !result.w) - return false; - return true; -} - -void main_core_func_vector_relational() -{ - assert(test_lessthan_2()); - assert(test_lessthan_3()); - assert(test_lessthan_4()); - - assert(test_lessthanequal_2()); - assert(test_lessthanequal_3()); - assert(test_lessthanequal_4()); - - assert(test_greaterthan_2()); - assert(test_greaterthan_3()); - assert(test_greaterthan_4()); - - assert(test_greaterthanequal_2()); - assert(test_greaterthanequal_3()); - assert(test_greaterthanequal_4()); - - assert(test_greaterthanequal_2()); - assert(test_greaterthanequal_3()); - assert(test_greaterthanequal_4()); - - assert(test_equal_2()); - assert(test_equal_3()); - assert(test_equal_4()); - - assert(test_notequal_2()); - assert(test_notequal_3()); - assert(test_notequal_4()); - - assert(test_any_2()); - assert(test_any_3()); - assert(test_any_4()); - - assert(test_all_2()); - assert(test_all_3()); - assert(test_all_4()); -} - -}//namespace test -}//namespace glm diff --git a/test/core/type.cpp b/test/core/type.cpp deleted file mode 100644 index f3d50ebd..00000000 --- a/test/core/type.cpp +++ /dev/null @@ -1,10 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" diff --git a/test/core/type_float.cpp b/test/core/type_float.cpp deleted file mode 100644 index 69f383f4..00000000 --- a/test/core/type_float.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_float.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_float() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_half.cpp b/test/core/type_half.cpp deleted file mode 100644 index 77d0a281..00000000 --- a/test/core/type_half.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT licence -// File : test/core/type_half.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test -{ - typedef detail::thalf thalf; - - bool main_type_half() - { - bool Result = true; - - { - thalf A(1.0f); - thalf B(2.0f); - thalf C = A + B; - thalf D(C); - float E = D; - int F = C; - thalf G = B * C; - thalf H = G / C; - H += thalf(1.0f); - double J = H; - int I = H; - - Result = Result && J == 3.0; - } - - return Result; - } - -}//namespace test -}//namespace glm diff --git a/test/core/type_int.cpp b/test/core/type_int.cpp deleted file mode 100644 index d41e4f63..00000000 --- a/test/core/type_int.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_int.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_int() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat2x2.cpp b/test/core/type_mat2x2.cpp deleted file mode 100644 index 4ad2a82f..00000000 --- a/test/core/type_mat2x2.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat2x2.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat2x2() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat2x3.cpp b/test/core/type_mat2x3.cpp deleted file mode 100644 index b4d0db37..00000000 --- a/test/core/type_mat2x3.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat2x3.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat2x3() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat2x4.cpp b/test/core/type_mat2x4.cpp deleted file mode 100644 index 549eb507..00000000 --- a/test/core/type_mat2x4.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat2x4.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat2x4() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat3x2.cpp b/test/core/type_mat3x2.cpp deleted file mode 100644 index 4d229b00..00000000 --- a/test/core/type_mat3x2.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat3x2.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat3x2() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat3x3.cpp b/test/core/type_mat3x3.cpp deleted file mode 100644 index 9d099a16..00000000 --- a/test/core/type_mat3x3.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat3x3.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat3x3() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat3x4.cpp b/test/core/type_mat3x4.cpp deleted file mode 100644 index 8489d517..00000000 --- a/test/core/type_mat3x4.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat3x4.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat3x4() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat4x2.cpp b/test/core/type_mat4x2.cpp deleted file mode 100644 index bdb61886..00000000 --- a/test/core/type_mat4x2.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat4x2.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat4x2() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat4x3.cpp b/test/core/type_mat4x3.cpp deleted file mode 100644 index bd0c720c..00000000 --- a/test/core/type_mat4x3.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat4x3.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_mat4x3() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_mat4x4.cpp b/test/core/type_mat4x4.cpp deleted file mode 100644 index dc8845ba..00000000 --- a/test/core/type_mat4x4.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_mat4x4.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include "glm/core/type_mat4x4.hpp" - -namespace glm{ -namespace test{ - -void main_mat4x4() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_vec1.cpp b/test/core/type_vec1.cpp deleted file mode 100644 index 44f711c1..00000000 --- a/test/core/type_vec1.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_vec1.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_vec1() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_vec2.cpp b/test/core/type_vec2.cpp deleted file mode 100644 index 859f7620..00000000 --- a/test/core/type_vec2.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_vec2.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_vec2() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_vec3.cpp b/test/core/type_vec3.cpp deleted file mode 100644 index 38467c2c..00000000 --- a/test/core/type_vec3.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_vec3.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_vec3() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/core/type_vec4.cpp b/test/core/type_vec4.cpp deleted file mode 100644 index 55d6fdf7..00000000 --- a/test/core/type_vec4.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2008-08-31 -// Updated : 2008-08-31 -// Licence : This source is under MIT License -// File : test/core/type_vec4.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../precompiled.hpp" -#include - -namespace glm{ -namespace test{ - -void main_vec4() -{ - -} - -}//namespace test -}//namespace glm diff --git a/test/gtc.cpp b/test/gtc.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/test/gtc.hpp b/test/gtc.hpp deleted file mode 100644 index e69de29b..00000000 diff --git a/test/gtc/double_float.cpp b/test/gtc/double_float.cpp deleted file mode 100644 index 0ca43e65..00000000 --- a/test/gtc/double_float.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_double_float() - { - return false; - } - -}//namespace test -}//namespace glm diff --git a/test/gtc/half_float.cpp b/test/gtc/half_float.cpp deleted file mode 100644 index deb09dc5..00000000 --- a/test/gtc/half_float.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_half_float() - { - bool Result = true; - - { - glm::hvec2 A(1.0f, 3.0f); - glm::half B(2.0f); - glm::hvec2 C = A * B; - glm::hvec2 D = C - glm::hvec2(2.0f); - - Result = Result && glm::all(glm::equal(C, glm::hvec2(0.0f, 4.0f))); - } - - return Result; - } - -}//namespace test -}//namespace glm diff --git a/test/gtc/matrix_access.cpp b/test/gtc/matrix_access.cpp deleted file mode 100644 index adbfd430..00000000 --- a/test/gtc/matrix_access.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_matrix_access() - { - return false; - } - -}//namespace test -}//namespace glm diff --git a/test/gtc/matrix_operation.cpp b/test/gtc/matrix_operation.cpp deleted file mode 100644 index 41346539..00000000 --- a/test/gtc/matrix_operation.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_matrix_operation() - { - return false; - } - -}//namespace test -}//namespace glm diff --git a/test/gtc/matrix_projection.cpp b/test/gtc/matrix_projection.cpp deleted file mode 100644 index b67325ac..00000000 --- a/test/gtc/matrix_projection.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_matrix_projection() - { - return false; - } - -}//namespace test -}//namespace glm diff --git a/test/gtc/matrix_transform.cpp b/test/gtc/matrix_transform.cpp deleted file mode 100644 index c833e8aa..00000000 --- a/test/gtc/matrix_transform.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_matrix_transform() - { - return false; - } - -}//namespace test -}//namespace glm diff --git a/test/gtc/quaternion.cpp b/test/gtc/quaternion.cpp deleted file mode 100644 index cfc89e24..00000000 --- a/test/gtc/quaternion.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_quaternion() - { - return false; - } - -}//namespace test -}//namespace glm diff --git a/test/gtc/type_precision.cpp b/test/gtc/type_precision.cpp deleted file mode 100644 index 02ac245e..00000000 --- a/test/gtc/type_precision.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_gtc_type_precision() - { - return false; - } - -}//namespace test -}//namespace glm diff --git a/test/gtx.hpp b/test/gtx.hpp deleted file mode 100644 index e69de29b..00000000 diff --git a/test/gtx/associated_min_max.cpp b/test/gtx/associated_min_max.cpp deleted file mode 100644 index 2a440512..00000000 --- a/test/gtx/associated_min_max.cpp +++ /dev/null @@ -1,222 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -using namespace glm; - -bool test_associated_min_max() -{ - //{ - // int ResultA = associatedMinGTX( - // 0.0f, 2, - // 1.0f, 4); - - // int ResultB = associatedMaxGTX( - // 0.0f, 2, - // 1.0f, 4); - - // int ResultC = associatedMinGTX( - // 0.0f, 2, - // 1.0f, 4, - // 2.0f, 8); - - // int ResultD = associatedMaxGTX( - // 0.0f, 2, - // 1.0f, 4, - // 2.0f, 8); - - // int ResultE = associatedMinGTX( - // 0.0f, 2, - // 1.0f, 4, - // 2.0f, 8, - // 3.0f, 6); - - // int ResultF = associatedMaxGTX( - // 0.0f, 2, - // 1.0f, 4, - // 2.0f, 8, - // 3.0f, 6); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMinGTX( - // glm::vec2(0), glm::ivec2(2), - // glm::vec2(1), glm::ivec2(4)); - - // glm::ivec3 ResultB = associatedMinGTX( - // glm::vec3(0), glm::ivec3(2), - // glm::vec3(1), glm::ivec3(4)); - - // glm::ivec4 ResultC = associatedMinGTX( - // glm::vec4(0), glm::ivec4(2), - // glm::vec4(1), glm::ivec4(4)); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMaxGTX( - // glm::vec2(0), glm::ivec2(2), - // glm::vec2(1), glm::ivec2(4)); - - // glm::ivec3 ResultB = associatedMaxGTX( - // glm::vec3(0), glm::ivec3(2), - // glm::vec3(1), glm::ivec3(4)); - - // glm::ivec4 ResultC = associatedMaxGTX( - // glm::vec4(0), glm::ivec4(2), - // glm::vec4(1), glm::ivec4(4)); - - // int End = 0; - //} - - //{ - // glm::vec2 ResultA = associatedMinGTX( - // glm::vec2(0.f), 2.f, - // glm::vec2(1.f), 4.f); - - // glm::ivec3 ResultB = associatedMinGTX( - // glm::vec3(0.f), 2, - // glm::vec3(1.f), 4); - - // glm::ivec4 ResultC = associatedMinGTX( - // glm::vec4(0.f), 2, - // glm::vec4(1.f), 4); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMaxGTX( - // glm::vec2(0), 2, - // glm::vec2(1), 4); - - // glm::ivec3 ResultB = associatedMaxGTX( - // glm::vec3(0), 2, - // glm::vec3(1), 4); - - // glm::ivec4 ResultC = associatedMaxGTX( - // glm::vec4(0), 2, - // glm::vec4(1), 4); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMinGTX( - // 0.0f, glm::ivec2(2), - // 1.0f, glm::ivec2(4)); - - // glm::ivec3 ResultB = associatedMinGTX( - // 0.0f, glm::ivec3(2), - // 1.0f, glm::ivec3(4)); - - // glm::ivec4 ResultC = associatedMinGTX( - // 0.0f, glm::ivec4(2), - // 1.0f, glm::ivec4(4)); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMaxGTX( - // 0.0f, glm::ivec2(2), - // 1.0f, glm::ivec2(4)); - - // glm::ivec3 ResultB = associatedMaxGTX( - // 0.0f, glm::ivec3(2), - // 1.0f, glm::ivec3(4)); - - // glm::ivec4 ResultC = associatedMaxGTX( - // 0.0f, glm::ivec4(2), - // 1.0f, glm::ivec4(4)); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMinGTX( - // glm::vec2(0), glm::ivec2(2), - // glm::vec2(1), glm::ivec2(4), - // glm::vec2(2), glm::ivec2(8)); - - // glm::ivec3 ResultB = associatedMinGTX( - // glm::vec3(0), glm::ivec3(2), - // glm::vec3(1), glm::ivec3(4), - // glm::vec3(2), glm::ivec3(8)); - - // glm::ivec4 ResultC = associatedMinGTX( - // glm::vec4(0), glm::ivec4(2), - // glm::vec4(1), glm::ivec4(4), - // glm::vec4(2), glm::ivec4(8)); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMaxGTX( - // glm::vec2(0), glm::ivec2(2), - // glm::vec2(1), glm::ivec2(4), - // glm::vec2(2), glm::ivec2(8)); - - // glm::ivec3 ResultB = associatedMaxGTX( - // glm::vec3(0), glm::ivec3(2), - // glm::vec3(1), glm::ivec3(4), - // glm::vec3(2), glm::ivec3(8)); - - // glm::ivec4 ResultC = associatedMaxGTX( - // glm::vec4(0), glm::ivec4(2), - // glm::vec4(1), glm::ivec4(4), - // glm::vec4(2), glm::ivec4(8)); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMinGTX( - // glm::vec2(0), glm::ivec2(2), - // glm::vec2(1), glm::ivec2(4), - // glm::vec2(2), glm::ivec2(8), - // glm::vec2(3), glm::ivec2(6)); - - // glm::ivec3 ResultB = associatedMinGTX( - // glm::vec3(0), glm::ivec3(2), - // glm::vec3(1), glm::ivec3(4), - // glm::vec3(2), glm::ivec3(8), - // glm::vec3(3), glm::ivec3(6)); - - // glm::ivec4 ResultC = associatedMinGTX( - // glm::vec4(0), glm::ivec4(2), - // glm::vec4(1), glm::ivec4(4), - // glm::vec4(2), glm::ivec4(8), - // glm::vec4(3), glm::ivec4(6)); - - // int End = 0; - //} - - //{ - // glm::ivec2 ResultA = associatedMaxGTX( - // glm::vec2(0), glm::ivec2(2), - // glm::vec2(1), glm::ivec2(4), - // glm::vec2(2), glm::ivec2(8), - // glm::vec2(3), glm::ivec2(6)); - - // glm::ivec3 ResultB = associatedMaxGTX( - // glm::vec3(0), glm::ivec3(2), - // glm::vec3(1), glm::ivec3(4), - // glm::vec3(2), glm::ivec3(8), - // glm::vec3(3), glm::ivec3(6)); - - // glm::ivec4 ResultC = associatedMaxGTX( - // glm::vec4(0), glm::ivec4(2), - // glm::vec4(1), glm::ivec4(4), - // glm::vec4(2), glm::ivec4(8), - // glm::vec4(3), glm::ivec4(6)); - - // int End = 0; - //} - - return true; -} diff --git a/test/gtx/bit.cpp b/test/gtx/bit.cpp deleted file mode 100644 index 30893d05..00000000 --- a/test/gtx/bit.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/closest_point.cpp b/test/gtx/closest_point.cpp deleted file mode 100644 index 7245a91b..00000000 --- a/test/gtx/closest_point.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/color_cast.cpp b/test/gtx/color_cast.cpp deleted file mode 100644 index a30afb74..00000000 --- a/test/gtx/color_cast.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/color_space.cpp b/test/gtx/color_space.cpp deleted file mode 100644 index f9a3d355..00000000 --- a/test/gtx/color_space.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/comparison.cpp b/test/gtx/comparison.cpp deleted file mode 100644 index 870b7b30..00000000 --- a/test/gtx/comparison.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/compatibility.cpp b/test/gtx/compatibility.cpp deleted file mode 100644 index 8517853c..00000000 --- a/test/gtx/compatibility.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/component_wise.cpp b/test/gtx/component_wise.cpp deleted file mode 100644 index f3a2c8c1..00000000 --- a/test/gtx/component_wise.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/epsilon.cpp b/test/gtx/epsilon.cpp deleted file mode 100644 index 32b386f0..00000000 --- a/test/gtx/epsilon.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/euler_angles.cpp b/test/gtx/euler_angles.cpp deleted file mode 100644 index 090e8795..00000000 --- a/test/gtx/euler_angles.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/extend.cpp b/test/gtx/extend.cpp deleted file mode 100644 index e863a5a4..00000000 --- a/test/gtx/extend.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/extented_min_max.cpp b/test/gtx/extented_min_max.cpp deleted file mode 100644 index 21ade74b..00000000 --- a/test/gtx/extented_min_max.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/fast_exponential.cpp b/test/gtx/fast_exponential.cpp deleted file mode 100644 index 82cdc43d..00000000 --- a/test/gtx/fast_exponential.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/fast_square_root.cpp b/test/gtx/fast_square_root.cpp deleted file mode 100644 index ebb7443c..00000000 --- a/test/gtx/fast_square_root.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/fast_trigonometry.cpp b/test/gtx/fast_trigonometry.cpp deleted file mode 100644 index c86e085f..00000000 --- a/test/gtx/fast_trigonometry.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/handed_coordinate_space.cpp b/test/gtx/handed_coordinate_space.cpp deleted file mode 100644 index dd5a3833..00000000 --- a/test/gtx/handed_coordinate_space.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/inertia.cpp b/test/gtx/inertia.cpp deleted file mode 100644 index b3da6a07..00000000 --- a/test/gtx/inertia.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/integer.cpp b/test/gtx/integer.cpp deleted file mode 100644 index c94e3e35..00000000 --- a/test/gtx/integer.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/intersect.cpp b/test/gtx/intersect.cpp deleted file mode 100644 index 4514e8bf..00000000 --- a/test/gtx/intersect.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - void main_gtx_intesect() - { - glm::vec3 Origin = glm::vec3(0.25f, 0.33f, 10.f); - glm::vec3 Direction = glm::vec3(0.0f, 0.0f, -1.f); - - glm::vec3 Vect0 = glm::vec3(0.0f, 0.0f, 0.f); - glm::vec3 Vect1 = glm::vec3(1.0f, 0.0f, 0.f); - glm::vec3 Vect2 = glm::vec3(0.0f, 1.0f, 0.f); - glm::vec3 Position(0.0f); - - bool Result = intersectRayTriangle( - Origin, Direction, - Vect0, Vect1, Vect2, - Position); - - bool End = true; - } - -}//namespace test -}//namespace glm diff --git a/test/gtx/inverse.cpp b/test/gtx/inverse.cpp deleted file mode 100644 index 78b43d6a..00000000 --- a/test/gtx/inverse.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/inverse_transpose.cpp b/test/gtx/inverse_transpose.cpp deleted file mode 100644 index 9fc5f4c8..00000000 --- a/test/gtx/inverse_transpose.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/matrix_access.cpp b/test/gtx/matrix_access.cpp deleted file mode 100644 index 4842e8a8..00000000 --- a/test/gtx/matrix_access.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/matrix_cross_product.cpp b/test/gtx/matrix_cross_product.cpp deleted file mode 100644 index 98c3a6c7..00000000 --- a/test/gtx/matrix_cross_product.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/matrix_major_storage.cpp b/test/gtx/matrix_major_storage.cpp deleted file mode 100644 index 82b6ddb0..00000000 --- a/test/gtx/matrix_major_storage.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/matrix_projection.cpp b/test/gtx/matrix_projection.cpp deleted file mode 100644 index 5dd3958c..00000000 --- a/test/gtx/matrix_projection.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/matrix_query.cpp b/test/gtx/matrix_query.cpp deleted file mode 100644 index 1c665ab9..00000000 --- a/test/gtx/matrix_query.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/matrix_selection.cpp b/test/gtx/matrix_selection.cpp deleted file mode 100644 index e756af3e..00000000 --- a/test/gtx/matrix_selection.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/matx.cpp b/test/gtx/matx.cpp deleted file mode 100644 index adeabdb0..00000000 --- a/test/gtx/matx.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/mixed_product.cpp b/test/gtx/mixed_product.cpp deleted file mode 100644 index 4c9ecb4e..00000000 --- a/test/gtx/mixed_product.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/norm.cpp b/test/gtx/norm.cpp deleted file mode 100644 index 07d99886..00000000 --- a/test/gtx/norm.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/normal.cpp b/test/gtx/normal.cpp deleted file mode 100644 index b97b9eaf..00000000 --- a/test/gtx/normal.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/normalize_dot.cpp b/test/gtx/normalize_dot.cpp deleted file mode 100644 index 5706ceee..00000000 --- a/test/gtx/normalize_dot.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/number_precision.cpp b/test/gtx/number_precision.cpp deleted file mode 100644 index 7017831f..00000000 --- a/test/gtx/number_precision.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/optimum_pow.cpp b/test/gtx/optimum_pow.cpp deleted file mode 100644 index cf51c2bf..00000000 --- a/test/gtx/optimum_pow.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/orthonormalize.cpp b/test/gtx/orthonormalize.cpp deleted file mode 100644 index f284a03e..00000000 --- a/test/gtx/orthonormalize.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/perpendicular.cpp b/test/gtx/perpendicular.cpp deleted file mode 100644 index f5e5d392..00000000 --- a/test/gtx/perpendicular.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/polar_coordinates.cpp b/test/gtx/polar_coordinates.cpp deleted file mode 100644 index 98bec2b1..00000000 --- a/test/gtx/polar_coordinates.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/projection.cpp b/test/gtx/projection.cpp deleted file mode 100644 index 48a5c952..00000000 --- a/test/gtx/projection.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/quaternion.cpp b/test/gtx/quaternion.cpp deleted file mode 100644 index 8a79430a..00000000 --- a/test/gtx/quaternion.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/random.cpp b/test/gtx/random.cpp deleted file mode 100644 index a6140e87..00000000 --- a/test/gtx/random.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/rotate_vector.cpp b/test/gtx/rotate_vector.cpp deleted file mode 100644 index 503b93fa..00000000 --- a/test/gtx/rotate_vector.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/safe_limits.cpp b/test/gtx/safe_limits.cpp deleted file mode 100644 index f56df64f..00000000 --- a/test/gtx/safe_limits.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "../precompiled.hpp" -#include -//#include - -namespace glm -{ - namespace test - { - - } -} - diff --git a/test/gtx/spline.cpp b/test/gtx/spline.cpp deleted file mode 100644 index 90ae2eab..00000000 --- a/test/gtx/spline.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/statistics_operation.cpp b/test/gtx/statistics_operation.cpp deleted file mode 100644 index 56c3e744..00000000 --- a/test/gtx/statistics_operation.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/std_based_type.cpp b/test/gtx/std_based_type.cpp deleted file mode 100644 index 651997ce..00000000 --- a/test/gtx/std_based_type.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/string_cast.cpp b/test/gtx/string_cast.cpp deleted file mode 100644 index f7a6f645..00000000 --- a/test/gtx/string_cast.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/transform.cpp b/test/gtx/transform.cpp deleted file mode 100644 index 5af0d87f..00000000 --- a/test/gtx/transform.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/transform2.cpp b/test/gtx/transform2.cpp deleted file mode 100644 index ffb9550c..00000000 --- a/test/gtx/transform2.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/transpose.cpp b/test/gtx/transpose.cpp deleted file mode 100644 index 93e08a0b..00000000 --- a/test/gtx/transpose.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "../precompiled.hpp" -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/unsigned_int.cpp b/test/gtx/unsigned_int.cpp deleted file mode 100644 index f35bf67c..00000000 --- a/test/gtx/unsigned_int.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/vector_access.cpp b/test/gtx/vector_access.cpp deleted file mode 100644 index 7a7a4270..00000000 --- a/test/gtx/vector_access.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/vector_angle.cpp b/test/gtx/vector_angle.cpp deleted file mode 100644 index babfcd10..00000000 --- a/test/gtx/vector_angle.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/vector_query.cpp b/test/gtx/vector_query.cpp deleted file mode 100644 index 711d8d33..00000000 --- a/test/gtx/vector_query.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/vecx.cpp b/test/gtx/vecx.cpp deleted file mode 100644 index 35b8d13f..00000000 --- a/test/gtx/vecx.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -//#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/gtx/verbose_operator.cpp b/test/gtx/verbose_operator.cpp deleted file mode 100644 index e23b8129..00000000 --- a/test/gtx/verbose_operator.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm -{ - namespace test - { - - } -} diff --git a/test/header.cpp b/test/header.cpp deleted file mode 100644 index c59d2fc3..00000000 --- a/test/header.cpp +++ /dev/null @@ -1,128 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -//#include -//#include -//#include - -//#ifdef GCC - -//template -//< -// std::size_t N, -// typename T, -// template -// < -// std::size_t, -// typename -// > class C -//> -//struct trait -//{ -// typedef T value_type; -// typedef std::size_t size_type; -// static size_type const value_size; -//}; -// -//template -//< -// std::size_t N, -// typename T, -// template -// < -// std::size_t N2, -// typename T2 -// > class C -//> -//typename trait::size_type const trait::value_size = N; -// -//template -//struct base : public trait -//{ -// typename trait::value_type Data[trait::value_size]; -//}; -// -//template -//struct base<4, T> : public trait<4, T, base> -//{ -// value_type Data[value_size]; -//}; - -template -struct test -{ - struct mem - { - T data; - }; -}; - -#if(defined(GLM_COMPILER) && !(GLM_COMPILER & GLM_COMPILER_VC)) -int main() -{ - glm::quat q1 = glm::angleAxis(45.f, glm::vec3(0, 0, 1)); -} -#endif//(GLM_COMPILER == GLM_COMPILER_VC) -//#endif//GCC \ No newline at end of file diff --git a/test/img.cpp b/test/img.cpp deleted file mode 100644 index a3195fb4..00000000 --- a/test/img.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-10-27 -// Updated : 2009-10-27 -// Licence : This source is under MIT License -// File : test/glm/img.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "img.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_img() - { - bool Success = true; - - Success = Success && main_img_multiple(); - assert(Success); - - Success = Success && main_img_wrap(); - assert(Success); - - return Success; - } - -}//namespace test -}//namespace glm diff --git a/test/img.hpp b/test/img.hpp deleted file mode 100644 index 0b18a205..00000000 --- a/test/img.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2009-10-27 -// Updated : 2009-10-27 -// Licence : This source is under MIT License -// File : test/glm/img.hpp -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Dependency: -// - GLM core -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifndef glm_test_img -#define glm_test_img - -namespace glm{ -namespace test -{ - bool main_img(); - -}//namespace test -}//namespace glm - -#endif//glm_test_img diff --git a/test/img/multiple.cpp b/test/img/multiple.cpp deleted file mode 100644 index fb456698..00000000 --- a/test/img/multiple.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "../precompiled.hpp" -#include -#include - -namespace glm{ -namespace test -{ - bool main_img_multiple() - { - bool Success = true; - - { - glm::detail::thalf Source(24.f); - glm::detail::thalf Multiple(16.f); - - glm::detail::thalf Value = glm::higherMultiple(Source, Multiple); - float ExpectedResult(32.f); - float ValueFloat = Value; - - Success = Success && ExpectedResult == ValueFloat; - assert(Success); - } - - { - float Source(24.f); - float Multiple(16.f); - - float Value = glm::higherMultiple(Source, Multiple); - float ExpectedResult(32.f); - - Success = Success && ExpectedResult == Value; - assert(Success); - } - - { - glm::ivec4 Source(16, 24, 47, 65); - glm::ivec4 Multiple(16); - - glm::ivec4 Value = glm::higherMultiple(Source, Multiple); - glm::ivec4 ExpectedResult(16, 32, 48, 80); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - { - glm::vec2 Source(16, 24); - glm::vec2 Multiple(16); - - glm::vec2 Value = glm::higherMultiple(Source, Multiple); - glm::vec2 ExpectedResult(16, 32); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - { - glm::vec3 Source(16, 24, 47); - glm::vec3 Multiple(16); - - glm::vec3 Value = glm::higherMultiple(Source, Multiple); - glm::vec3 ExpectedResult(16, 32, 48); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - { - glm::vec4 Source(16, 24, 47, 65); - glm::vec4 Multiple(16); - - glm::vec4 Value = glm::higherMultiple(Source, Multiple); - glm::vec4 ExpectedResult(16, 32, 48, 80); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - { - glm::ivec4 Source(16, 24, 47, 65); - glm::ivec4 Multiple(16); - - glm::ivec4 Value = glm::lowerMultiple(Source, Multiple); - glm::ivec4 ExpectedResult(16, 16, 32, 64); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - { - glm::vec2 Source(16, 24); - glm::vec2 Multiple(16); - - glm::vec2 Value = glm::lowerMultiple(Source, Multiple); - glm::vec2 ExpectedResult(16, 16); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - { - glm::vec3 Source(16, 24, 47); - glm::vec3 Multiple(16); - - glm::vec3 Value = glm::lowerMultiple(Source, Multiple); - glm::vec3 ExpectedResult(16, 16, 32); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - { - glm::vec4 Source(16, 24, 47, 65); - glm::vec4 Multiple(16); - - glm::vec4 Value = glm::lowerMultiple(Source, Multiple); - glm::vec4 ExpectedResult(16, 16, 32, 64); - - Success = Success && glm::all(glm::equal(ExpectedResult, Value)); - assert(Success); - } - - return Success; - } - -}//namespace test -}//namespace glm diff --git a/test/img/wrap.cpp b/test/img/wrap.cpp deleted file mode 100644 index ce7caadb..00000000 --- a/test/img/wrap.cpp +++ /dev/null @@ -1,141 +0,0 @@ -//#include "../precompiled.hpp" -#include "../../glm/glm.hpp" -#include "../../glm/gtc/half_float.hpp" -#include "../../glm/gtc/double_float.hpp" -#include "../../glm/img/wrap.hpp" - -namespace glm{ -namespace test -{ - static float const epsilon = 0.001f; - - bool main_img_wrap() - { - bool Success = true; - - // mirrorRepeat - { - float A = mirrorRepeat(0.0f); // 0.0f - Success = Success && (A - 0.0f) < epsilon; - assert(Success); - - float B = mirrorRepeat(0.2f); // 0.2f - Success = Success && (B - 0.2f) < epsilon; - assert(Success); - - float C = mirrorRepeat(0.5f); // 0.5f - Success = Success && (C - 0.5f) < epsilon; - assert(Success); - - float D = mirrorRepeat(1.0f); // 1.0f - Success = Success && (D - 1.0f) < epsilon; - assert(Success); - - float E = mirrorRepeat(1.2f); // 0.8f - Success = Success && (E - 0.8f) < epsilon; - assert(Success); - - float F = mirrorRepeat(1.5f); // 0.5f - Success = Success && (F - 0.5f) < epsilon; - assert(Success); - - float G = mirrorRepeat(1.6f); // 0.4f - Success = Success && (G - 0.4f) < epsilon; - assert(Success); - - float H = mirrorRepeat(2.0f); // 0.0f - Success = Success && (H - 0.0f) < epsilon; - assert(Success); - - float I = mirrorRepeat(2.1f); // 0.1f - Success = Success && (I - 0.1f) < epsilon; - assert(Success); - - float J = mirrorRepeat(3.0f); // 1.0f - Success = Success && (J - 1.0f) < epsilon; - assert(Success); - - float K = mirrorRepeat(3.9f); // 0.1f - Success = Success && (K - 0.1f) < epsilon; - assert(Success); - - float L = mirrorRepeat(4.2f); // 0.2f - Success = Success && (L - 0.2f) < epsilon; - assert(Success); - - float M = mirrorRepeat(3.9f); // 0.1f - Success = Success && (M - 0.1f) < epsilon; - assert(Success); - - float N = mirrorRepeat(4.2f); // 0.2f - Success = Success && (N - 0.2f) < epsilon; - assert(Success); - - float O = mirrorRepeat(5.2f); // 0.8f - Success = Success && (O - 0.8f) < epsilon; - assert(Success); - - float P = mirrorRepeat(5.8f); // 0.2f - Success = Success && (P - 0.2f) < epsilon; - assert(Success); - - float Q = mirrorRepeat(6.2f); // 0.2f - Success = Success && (Q - 0.2f) < epsilon; - assert(Success); - - float R = mirrorRepeat(6.8f); // 0.8f - Success = Success && (R - 0.8f) < epsilon; - assert(Success); - - float S = mirrorRepeat(7.0f); // 1.0f - Success = Success && (S - 1.0f) < epsilon; - assert(Success); - } - - { - glm::vec2 A = mirrorRepeat(glm::vec2(0.0f)); // 0.0f - Success = Success && glm::all(glm::lessThan((A - 0.0f), glm::vec2(epsilon))); - assert(Success); - - glm::vec3 B = mirrorRepeat(glm::vec3(0.2f)); // 0.2f - Success = Success && glm::all(glm::lessThan((B - 0.2f), glm::vec3(epsilon))); - assert(Success); - - glm::vec4 C = mirrorRepeat(glm::vec4(1.2f)); // 0.8f - Success = Success && glm::all(glm::lessThan((C - 0.8f), glm::vec4(epsilon))); - assert(Success); - } - - { - glm::hvec2 A = mirrorRepeat(glm::hvec2(0.0f)); // 0.0f - Success = Success && glm::all(glm::lessThan((A - glm::half(0.0f)), glm::hvec2(epsilon))); - assert(Success); - - glm::hvec3 B = mirrorRepeat(glm::hvec3(0.2f)); // 0.2f - Success = Success && glm::all(glm::lessThan((B - glm::half(0.2f)), glm::hvec3(epsilon))); - assert(Success); - - glm::hvec4 C = mirrorRepeat(glm::hvec4(1.2f)); // 0.8f - Success = Success && glm::all(glm::lessThan((C - glm::half(0.8f)), glm::hvec4(epsilon))); - assert(Success); - } - - { - glm::dvec2 A = mirrorRepeat(glm::dvec2(0.0f)); // 0.0f - Success = Success && glm::all(glm::lessThan((A - double(0.0f)), glm::dvec2(epsilon))); - assert(Success); - - glm::dvec3 B = mirrorRepeat(glm::dvec3(0.2f)); // 0.2f - Success = Success && glm::all(glm::lessThan((B - double(0.2f)), glm::dvec3(epsilon))); - assert(Success); - - glm::dvec4 C = mirrorRepeat(glm::dvec4(1.2f)); // 0.8f - Success = Success && glm::all(glm::lessThan((C - double(0.8f)), glm::dvec4(epsilon))); - assert(Success); - } - - return Success; - } - -}//namespace test -}//namespace glm diff --git a/test/main.cpp b/test/main.cpp deleted file mode 100644 index c0ba48ff..00000000 --- a/test/main.cpp +++ /dev/null @@ -1,2313 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2010 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2005-01-12 -// Updated : 2006-12-03 -// Licence : This source is under MIT License -// File : main.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "precompiled.hpp" - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "core.hpp" -#include "img.hpp" -#include "gtc.hpp" -#include "gtx.hpp" - -#include - -//namespace glm -//{ - // using GLM_GTX_double_float; - // using GLM_GTX_inverse; - // using GLM_GTX_integer; - // using GLM_GTX_unsigned_int; - //using GLM_GTX_bit; -// using GLM_GTX_fast_square_root; -// using GLM_GTX_number_precision; -// using GLM_GTX_color_cast; -// using GLM_GTX_quaternion; -// using GLM_GTX_inverse_transpose; -// using GLM_GTX_transform; -// using GLM_GTX_transform2; -// using GLM_GTX_intersect; -// using GLM_GTX_random; -// using GLM_GTX_gradient_paint; -// using GLM_GTX_perpendicular; - //using GLM_GTX_compatibility; - //using GLM_GTX_quaternion; - //using GLM_GTX_string_cast; - //using GLM_GTX_fast_square_root; - //using GLM_GTX_half_float; - //using GLM_GTX_vector_angle; - //using GLM_GTX_matrix_projection; -//} - -unsigned int GetCpuCycle() -{ - unsigned int LowWord = 0; - unsigned int HighWord = 0; -// _asm -// { -// cpuid -// // Insert Real Time Stamp Counter opcodes -// _emit 0x0F -// _emit 0x31 -// mov HighWord, edx -// mov LowWord, eax -// } -// return ((__int64)(HighWord) << 32) + LowWord; - return 0; -} - - -//namespace wip -//{ -// inline glm::detail::fvec4SIMD rcp(glm::detail::fvec4SIMD const & v) -// { -// return glm::detail::fvec4SIMD(_mm_rcp_ps(v.Data)); -// } -// -// inline glm::detail::fvec4SIMD sqrt(glm::detail::fvec4SIMD const & v) -// { -// return glm::detail::fvec4SIMD(_mm_sqrt_ps(v.Data)); -// } -// -// inline glm::detail::fvec4SIMD inversesqrt(glm::detail::fvec4SIMD const & v) -// { -// return glm::detail::fvec4SIMD(_mm_rsqrt_ps(v.Data)); -// } -// -// inline glm::detail::fvec4SIMD min(glm::detail::fvec4SIMD const & v1, glm::detail::fvec4SIMD const & v2) -// { -// return glm::detail::fvec4SIMD(_mm_min_ps(v1.Data, v2.Data)); -// } -// -// inline glm::detail::fvec4SIMD max(glm::detail::fvec4SIMD const & v1, glm::detail::fvec4SIMD const & v2) -// { -// return glm::detail::fvec4SIMD(_mm_max_ps(v1.Data, v2.Data)); -// } -//}//namespace wip - -void test_simd() -{ - glm::detail::fvec4SIMD v1(1.0f, 2.0f, 3.0f, 4.0f); - glm::detail::fvec4SIMD v2(5.0f, 6.0f, 7.0f, 8.0f); - - bool end = true; -} - -namespace a -{ - namespace b{} -} - -namespace c = a::b; - -//#include - -#include -#include -#include -//#include - -//#include - -#ifdef min -#undef min -#endif - -#ifdef max -#undef max -#endif - -//#include "test/sse_vec4.h" -//#include "test/sse_mat4.h" - -/* -inline float fastExp0(float x) -{ - return 1.0f + x + (x * x * 0.5f) + (x * x * x * 0.1666666667f) + (x * x * x * x * 0.041666667f) + (x * x * x * x * x * 0.008333333333f) + (x * x * x * x * x * x * 0.00138888888888f) + (x * x * x * x * x * x * x * 0.000198412698f) + (x * x * x * x * x * x * x * x * 0.0000248015873f); -} - -inline float fastExp1(float x) -{ - float x2 = x * x; - float x3 = x2 * x; - float x4 = x3 * x; - float x5 = x4 * x; - float x6 = x5 * x; - float x7 = x6 * x; - float x8 = x7 * x; - return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f) + (x6 * 0.00138888888888f) + (x7 * 0.000198412698f) + (x8 * 0.0000248015873f); -} - -inline float fastExp2(float x) -{ - float x2 = x * x; - float x3 = x2 * x; - float x4 = x3 * x; - float x5 = x4 * x; - return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f); -} - -inline float fastExp3(float x) -{ - return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); -} - -inline float fastExp4(float x) -{ - if(x >= 0.0f && x <= 1.0f) - { - float x2 = x * x; - float x3 = x2 * x; - float x4 = x3 * x; - float x5 = x4 * x; - return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f); - } - else - { - float e = 2.718281828f; - float IntegerPart = glm::floor(x); - float FloatPart = x - IntegerPart; - float z = e; - - for(int i = 1; i < int(IntegerPart); ++i) - z *= e; - - float x2 = FloatPart * FloatPart; - float x3 = x2 * FloatPart; - float x4 = x3 * FloatPart; - float x5 = x4 * FloatPart; - return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); - } -} - -__forceinline float fastExp5(float x) -{ - const float e = 2.718281828f; - const float IntegerPart = glm::floor(x); - const float FloatPart = x - IntegerPart; - float z = 1.f; - - //for(int i = 0; i < int(IntegerPart); ++i) - // z *= e; - - const float x2 = FloatPart * FloatPart; - const float x3 = x2 * FloatPart; - const float x4 = x3 * FloatPart; - const float x5 = x4 * FloatPart; - return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); -} - -inline float fastLn0(float x) -{ - float y1 = (x - 1.0f) / (x + 1.0f); - float y2 = y1 * y1; - float y4 = y2 * y2; - float y6 = y4 * y2; - float y8 = y4 * y4; - return 2.0f * y1 * (1.0f + y2 * 0.3333333333f + y4 * 0.2f + y6 * 0.1428571429f);// + y8 * 0.1111111111f); -} - -inline float fastLn1(float x) -{ - float y1 = (x - 1.0f) / (x + 1.0f); - float y2 = y1 * y1; - return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f))); -} -*/ - -using namespace std; -using namespace glm; - -void subtitiution() -{ - //-------------------------------------------------------------------- - //AX=B - mat4 L(0.f); - mat4 U(0.f); - mat4 A = mat4( - vec4(4.f), - vec4(4.f), - vec4(4.f), - vec4(4.f)); - - for(int i=0;i < 4;i++) - for(int j=0;j < 4;j++) - { - if(i>j) - U[i][j]=0; - else if(i==j) - L[i][j]=1; - else - L[i][j]=0; - } - - printf("A:\n"); - for(int j = 0; j < 4; ++j) - { - printf("("); - for(int i = 0; i < 4; ++i) - printf("%f ", A[j][i]); - printf(")\n"); - } - printf("\n"); - - //Decomposition of A into L and U - for(int i = 0; i < 4; ++i) - for(int j = 0; j < 4; ++j) - { - float Sum = 0.f; - if(i <= j) - { - for(int k = 0; k < 4; ++k) - if(k != i) - Sum += L[i][k] * U[k][j]; - U[i][j] = (A[i][j] - Sum);// / U[j][j]; - } - else - { - for(int k = 0; k < 4; k++) - if(k != j) - Sum += L[i][k] * U[k][j]; - L[i][j] = (A[i][j] - Sum) / U[j][j]; - } - } - - printf("L:\n"); - for(int j = 0; j < 4; ++j) - { - printf("("); - for(int i = 0; i < 4; ++i) - printf("%f ", L[j][i]); - printf(")\n"); - } - printf("\n"); - - printf("U:\n"); - for(int j = 0; j < 4; ++j) - { - printf("("); - for(int i = 0; i < 4; ++i) - printf("%f ", U[j][i]); - printf(")\n"); - } - printf("\n"); - - system("pause"); -} - -void LUDecompsition( - const detail::tmat4x4& m, - detail::tmat4x4& l, - detail::tmat4x4& u) -{ - for(int i = 0; i < 4; ++i) - l[i][i] = 1.f; - - for(int j = 0; j < 4; ++j) - { - //for(int i = 0; i <= j; ++i) - for(int i = 0; i < j; ++i) - { - u[j][i] = m[j][i]; - for(int k = 0; k < i - 1; ++k) - //for(int k = 0; k < i; ++k) - u[j][i] -= l[k][i] * u[j][k]; - } - //for(int i = j + 1; i < 4; ++i) - for(int i = j; i < 4; ++i) - { - l[j][i] = m[j][i]; - for(int k = 0; k < j - 1; ++k) - //for(int k = 0; k < j; ++k) - l[j][i] -= l[k][i] * u[j][k]; - } - } -} - -/* -ivec3& operator+=(const ivec3& v, const int s) -{ - ivec3 Result = v; - Result.x &= s; - Result.y &= s; - Result.z &= s; - return Result; -} -*/ - -void g() -{ - mat4 m = glm::inverse(mat4(4.0f)); -} - -void test_gtx_bit() -{ - int Number1 = 76; - int NumberA = glm::highestBit(Number1); - int NumberB = glm::highestBitValue(Number1); - bool NumberC = glm::isPowerOfTwo(Number1); - int NumberD = glm::powerOfTwoAbove(Number1); - int NumberE = glm::powerOfTwoBelow(Number1); - int NumberF = glm::powerOfTwoNearest(Number1); - - int Number2 = 256; - int NumberG = glm::highestBit(Number2); - int NumberH = glm::highestBitValue(Number2); - bool NumberI = glm::isPowerOfTwo(Number2); - int NumberJ = glm::powerOfTwoAbove(Number2); - int NumberK = glm::powerOfTwoBelow(Number2); - int NumberL = glm::powerOfTwoNearest(Number2); - - int NumberZ = 0; -} -/* -struct gni -{ - void constructor(short i) - { - data = i; - } - - gni& assignement(const gni& i) - { - data = i.data; - return *this; - } - - short data; -} - -union pouet -{ - pouet(detail::thalf x, detail::thalf y, detail::thalf z) : - x(x), y(y), z(z) - {} - - struct{detail::thalf x, y, z;}; - struct{detail::thalf r, g, b;}; - struct{detail::thalf s, t, q;}; -}; -*/ - -//#include GLM_EXTENSION(GLM_GTX_compatibility, glm::required); - -vec4 mix_fpu(const vec4& x, const vec4& y, const vec4& a) -{ - return x * (vec4(1) - a) + y * a; -} - -/* -namespace glm -{ - template - struct traits - { - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef std::size_t size_type; - static const size_type value_size; - }; - - template - static const traits::size_type traits::value_size = N; - - template - struct traits - { - typedef Type value_type; - typedef Type* pointer; - typedef Type& reference; - }; - - template - struct traits - { - typedef Type value_type; - typedef const Type* pointer; - typedef const Type& reference; - }; -} -*/ - -vec2 reference_swizzle(const vec3& a, const vec3& b) -{ - return vec2(0.0f); -} - -//void test_random() -//{ -// float Value = gaussRand1GTX(1.0f, 2.0f); -// detail::_xvecxGTX<8, float> vecN; -// vecN = compRandGTX(vecN, vecN); -//} - -void test_matrix() -{ -// glm::mat4 Transform = glm::translateGTX( -// glm::rotateGTX(45.f, glm::core::func_geometric::normalize(glm::vec3(1))), glm::vec3(1, 2, 3)); - glm::vec3 Normalized = glm::normalize(glm::vec3(1)); - - glm::mat4 Transform = glm::gtc::matrix_transform::translate( - glm::gtc::matrix_transform::rotate(glm::mat4(1.0f), 45.f, Normalized), - glm::vec3(1, 2, 3)); - glm::mat4 TransformA = glm::inverse(Transform); - glm::mat4 TransformB = glm::affineInverse(Transform); - glm::mat4 End; -} - -void test_vec4() -{ - { - glm::vec4 v(1.0); - glm::vec4 const* const pv = &v; - glm::vec4 const& rv = v; - - //float const* pointer1 = &v; - //float const* pointer2 = v; - //float const* pointer3 = pv; - //float const* pointer4 = &rv; - //glm::vec4* p = &v; - //glm::vec4 v6 = v + long(3); - - float const* pointer1 = &v[0]; - } - //{ - // glm::mat4 m; - // glm::mat4 const* const pm = &m; - // glm::mat4 const& rm = m; - - // float const* pointer1 = &m; - // float const* pointer2 = m; - // float const* pointer3 = pm; - // float const* pointer4 = &rm; - //} -} - -void test_mat4(const glm::mat4& m) -{ - //glm::mat4 copy = m; - //glLoadMatrix(GL_MODELVIEW, copy); -} - -void test_string_cast() -{ - printf("Test string cast: %s\n", glm::string(glm::vec4(1, 2, 3, 4)).c_str()); -} - -void test_isPowerOfTwo() -{ - bool resultA = glm::isPowerOfTwo(unsigned(512)); - bool resultB = glm::isPowerOfTwo(unsigned(513)); - bool end = true; -} - -//#include -// -//void test_opengl_wrapper() -//{ -// glVertex(glm::vec3(1.0f)); -//} - -void fast_inverse() -{ - float one = fastInverseSqrt(1.0f); - float two = fastInverseSqrt(2.0f); - float result = 1.0f; -} - -//void test_desk() -//{ -// typedef glm::detail::desc::value_type vec4_type; -// vec4_type Test(1.0f); -// -// glm::detail::desc::size_type Size = glm::detail::desc::value_size(); -// -// int end = 0; -//} - -//template -//genType TemplateFuncMin(const genType& Type1, const genType& Type2) -//{ -// genType Result; -// for -// ( -// glm::detail::desc::size_type i = glm::detail::desc::size_type(0); -// i < glm::detail::desc::value_size; -// ++i -// ) -// { -// Result[i] = Type1[i] < Type2[i] ? Type1[i] : Type2[i]; -// } -// -// return Result; -//} -// -//void test_genType() -//{ -// glm::vec1 Result1 = TemplateFuncMin(glm::vec1(1), glm::vec1(2)); -//// float ResultF = TemplateFuncMin(1.f, 2.f); -// vec4 Result4 = TemplateFuncMin(glm::vec4(1), glm::vec4(2)); -// -// bool end = true; -//} - -namespace test_ac -{ - struct C1 - { - C1() : - data(76) - {} - - int data; - }; - - struct C2 - { - C2(){} - C2(const C1& c1) : - data(c1.data) - {} - - int data; - }; - - C2 operator+ (const C2& a, const C2& b) - { - C2 result; - result.data = a.data + b.data; - return result; - } - -} - -void test_auto_cast() -{ - test_ac::C1 c1; - test_ac::C2 c2 = c1; - test_ac::C2 c3 = c2 + c1; - -// -// glm::vec3 Data = glm::vec2(1.f)._yxy(); -} - -template -genType abs(const genType& v) -{ - genType Result; - for(typename genType::size_type i = 0; i < genType::size_value; ++i) - Result[i] = Result[i] < typename genType::value_type(0) ? -Result[i] : Result[i]; - return Result; -} - -void test_quaternion() -{ - glm::vec3 tan(1.0f); - glm::quat q; - tan = glm::cross(q, tan); -} - -void test_swizzle() -{ - glm::vec2 a(1, 2); - glm::vec4 b = a.swizzle(X, Y, X, Y); - glm::vec4 c(0); - c.swizzle(X, Y, Z, W) = b.swizzle(X, Y, Z, W); - - //a.xyz = b.xyz; - - bool end = true; -} - -void test_angle() -{ - //float angle1 = glm::angle(0.1f, 0.2f); - float angle2 = glm::angle(glm::vec2(0.1f), glm::vec2(0.2f)); - - return; -} - -void test_half() -{ - hmat2 hmatrix1(half(1.f)); - hmat2 hmatrix2(half(2.f)); - hmat2 hmatrix3 = hmatrix1 + hmatrix2; - half hscalar = hmatrix3[0].x; - double fscalar = hscalar; - - hvec2::size_type Size = hvec2::value_size(); - - return; -} - -template -valType func_profile(glm::detail::tvec3 const & x, valType y) -{ - return glm::dot(x, glm::detail::tvec3(y)); -} - -template <> -float func_profile(glm::vec3 const & x, float y) -{ - return glm::dot(x, glm::vec3(y)); -} - -void test_profile() -{ - - -} - -//template -//class TestType -//{ -//public: -// TestType(valType const & x); -//}; -// -//template -//TestType::TestType(valType const & x) -//{} -// -//template -//class TestType -//{ -//public: -// TestType(valType const & x); -//}; -// -//template -//TestType::TestType(valType const & x) -//{} -// -//typedef TestType _vec4; -// -//void test_type() -//{ -// _vec4 v(1.0); -//} - -void test_fast_inverse() -{ - printf("fastInvSqrt(1.0f) : %f\n", fastInverseSqrt(1.0f)); - printf("fastInvSqrt(1.0f) : %f\n", inversesqrt(1.0f)); - printf("fastInvSqrt(76.0f) : %f\n", fastInverseSqrt(76.f)); - printf("fastInvSqrt(76.0f) : %f\n", inversesqrt(76.f)); - printf("fastInvSqrt(0.01f) : %f\n", fastInverseSqrt(0.01f)); - printf("fastInvSqrt(0.01f) : %f\n", inversesqrt(0.01f)); -} - -namespace ns_hint -{ - struct hint - {}; - - struct see : public hint - {}; - - struct see2 : public see - {}; - - template - vecType func(vecType const & v, hint) - { - return v * v; - } - - template - vecType func(vecType const & v, see2) - { - return v * v; - } - - template - struct vec4 - { - vec4() - { - int i = 0; - } - - valType data; - }; - - template - struct vec4 - { - vec4() - { - int i = 0; - } - - valType data; - }; - - //enum hint - //{ - // fast, - // nice, - // see, - // see2, - // see3, - // see4 - //}; - - //template - //vecType func(vecType const & v); - - //template - //struct functor - //{ - // template - // vecType operator() (vecType const & v) const - // { - // return v * v; - // } - //}; -} - -void test_hint() -{ - glm::vec3 v1 = glm::vec3(2.0f); - glm::vec3 v2 = ns_hint::func(v1, ns_hint::see()); -// ns_hint::vec4 v3; -// ns_hint::vec4 v4; - //glm::vec3 v2 = ns_hint::functor()(v1); - //glm::vec3 v2 = hint::func(v1); -} - -void test_const_call -( - glm::mat4 const & m, - glm::vec4 const & v -) -{ - float const & Value = m[0][0]; - glm::vec4 const & Vector = m[0]; - float const & VecRef = v[0]; - - float const * const ValuePtr = &m[0][0]; - glm::vec4 const * const VectorPtr = &m[0]; - float const * VecPtr = &v[0]; -} - -void test_const() -{ - test_const_call( - glm::mat4(1.0), - glm::vec4(1.0)); -} - -void test_transform() -{ - glm::vec2 QMin(-1024,+1024); - //glm::vec2 QMax(+1024,-1024); - glm::vec2 QMax(-1024 + 640, 1024); - - std::size_t const ValueSize = 6; - glm::vec3 ValueOut[ValueSize]; - glm::vec3 ValueData[ValueSize]; - ValueData[0] = glm::vec3(QMin.x, QMin.y, 1);//(0, 0) - ValueData[1] = glm::vec3(QMax.x, QMin.y, 1);//(1, 0) - ValueData[2] = glm::vec3(QMax.x, QMax.y, 1);//(1, 1) - ValueData[3] = glm::vec3(QMin.x, QMax.y, 1);//(0, 1) - ValueData[4] = glm::vec3(QMin.x, QMax.y / 4.f, 1);//(0, 0.25f) - ValueData[5] = glm::vec3(QMin.x / 4.f, QMax.y, 1);//(0.25f, 0.25f) - - glm::mat3 Q2Norm(1.0f); - Q2Norm[0] = glm::vec3( - 1.0f / (QMax.x - QMin.x), - 0.0f, - 0.0f); - Q2Norm[1] = glm::vec3( - 0.0f, - 1.0f / (QMax.y - QMin.y), - 0.0f); - Q2Norm[2] = glm::vec3( - - QMin.x / (QMax.x - QMin.x), - - QMin.y / (QMax.y - QMin.y), - 1.0f); - - glm::vec2 FBMin(0, 0); - glm::vec2 FBMax(640, 480); - glm::mat3 Norm2FB(1.0f); - Norm2FB[0] = glm::vec3(FBMax.x - FBMin.x, 0, 0); - Norm2FB[1] = glm::vec3(0, FBMax.y - FBMin.y, 0); - Norm2FB[2] = glm::vec3(0, 0, 1); - - for(std::size_t i = 0; i < ValueSize; ++i) - ValueOut[i] = Norm2FB * Q2Norm * ValueData[i]; - - bool End = true; -} - -//namespace -//{ -// template -// valType radialGradient( -// glm::detail::tvec2 const & Center, -// valType const & Radius, -// glm::detail::tvec2 const & Focal, -// glm::detail::tvec2 const & Position) -// { -// glm::detail::tvec2 F = Focal - Center; -// glm::detail::tvec2 D = Position - Focal; -// -// valType Numerator = (D.x * F.x + D.y * F.y) + glm::sqrt((Radius * Radius) * (D.x * D.x + D.y * D.y) - (D.x * F.y - D.y * F.x) * (D.x * F.y - D.y * F.x)); -// valType Denominator = (Radius * Radius) - (F.x * F.x + F.y * F.y); -// return Numerator / Denominator; -// } -//} - -void test_radial() -{ - glm::vec2 Center(0); - float Radius = 1.0f; - glm::vec2 Focal(0); - glm::vec2 PositionA(0); - glm::vec2 PositionB(0, 1); - glm::vec2 PositionC(1, 0); - glm::vec2 PositionD(0.5f, 0.0f); - - float GradA = glm::radialGradient(Center, Radius, Focal, PositionA); - float GradB = glm::radialGradient(Center, Radius, Focal, PositionB); - float GradC = glm::radialGradient(Center, Radius, Focal, PositionC); - float GradD = glm::radialGradient(Center, Radius, Focal, PositionD); - - bool End = true; -} - -void test_quat() -{ - glm::quat q1(1.0f, glm::vec3(0)); - float Roll = glm::roll(q1); -} -// -//void _mm_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]) -//{ -// { -// out[0] = _mm_add_ps(in1[0], in2[0]); -// out[1] = _mm_add_ps(in1[1], in2[1]); -// out[2] = _mm_add_ps(in1[2], in2[2]); -// out[3] = _mm_add_ps(in1[3], in2[3]); -// } -//} -// -//void _mm_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]) -//{ -// { -// out[0] = _mm_sub_ps(in1[0], in2[0]); -// out[1] = _mm_sub_ps(in1[1], in2[1]); -// out[2] = _mm_sub_ps(in1[2], in2[2]); -// out[3] = _mm_sub_ps(in1[3], in2[3]); -// } -//} -// -//inline __m128 _mm_mul_ps(__m128 m[4], __m128 v) -//{ -// __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 v2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 v3 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 m0 = _mm_mul_ps(m[0], v0); -// __m128 m1 = _mm_mul_ps(m[1], v1); -// __m128 m2 = _mm_mul_ps(m[2], v2); -// __m128 m3 = _mm_mul_ps(m[3], v3); -// -// __m128 a0 = _mm_add_ps(m0, m1); -// __m128 a1 = _mm_add_ps(m2, m3); -// __m128 a2 = _mm_add_ps(a0, a1); -// -// return a2; -//} -// -//inline __m128 _mm_mul_ps(__m128 v, __m128 m[4]) -//{ -// __m128 i0 = m[0]; -// __m128 i1 = m[1]; -// __m128 i2 = m[2]; -// __m128 i3 = m[3]; -// -// __m128 m0 = _mm_mul_ps(v, i0); -// __m128 m1 = _mm_mul_ps(v, i1); -// __m128 m2 = _mm_mul_ps(v, i2); -// __m128 m3 = _mm_mul_ps(v, i3); -// -// __m128 u0 = _mm_unpacklo_ps(m0, m1); -// __m128 u1 = _mm_unpackhi_ps(m0, m1); -// __m128 a0 = _mm_add_ps(u0, u1); -// -// __m128 u2 = _mm_unpacklo_ps(m2, m3); -// __m128 u3 = _mm_unpackhi_ps(m2, m3); -// __m128 a1 = _mm_add_ps(u2, u3); -// -// __m128 f0 = _mm_movelh_ps(a0, a1); -// __m128 f1 = _mm_movehl_ps(a1, a0); -// __m128 f2 = _mm_add_ps(f0, f1); -// -// return f2; -//} -// -//inline void _mm_mul_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]) -//{ -// glm::uint64 TimeStart = GetCpuCycle(); -// -// { -// __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 e1 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 e2 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 e3 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 m0 = _mm_mul_ps(in1[0], e0); -// __m128 m1 = _mm_mul_ps(in1[1], e1); -// __m128 m2 = _mm_mul_ps(in1[2], e2); -// __m128 m3 = _mm_mul_ps(in1[3], e3); -// -// __m128 a0 = _mm_add_ps(m0, m1); -// __m128 a1 = _mm_add_ps(m2, m3); -// __m128 a2 = _mm_add_ps(a0, a1); -// -// out[0] = a2; -// } -// -// { -// __m128 e0 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 e1 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 e2 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 e3 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 m0 = _mm_mul_ps(in1[0], e0); -// __m128 m1 = _mm_mul_ps(in1[1], e1); -// __m128 m2 = _mm_mul_ps(in1[2], e2); -// __m128 m3 = _mm_mul_ps(in1[3], e3); -// -// __m128 a0 = _mm_add_ps(m0, m1); -// __m128 a1 = _mm_add_ps(m2, m3); -// __m128 a2 = _mm_add_ps(a0, a1); -// -// out[1] = a2; -// } -// -// { -// __m128 e0 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 e1 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 e2 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 e3 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 m0 = _mm_mul_ps(in1[0], e0); -// __m128 m1 = _mm_mul_ps(in1[1], e1); -// __m128 m2 = _mm_mul_ps(in1[2], e2); -// __m128 m3 = _mm_mul_ps(in1[3], e3); -// -// __m128 a0 = _mm_add_ps(m0, m1); -// __m128 a1 = _mm_add_ps(m2, m3); -// __m128 a2 = _mm_add_ps(a0, a1); -// -// out[2] = a2; -// } -// -// { -// //(__m128&)_mm_shuffle_epi32(__m128i&)in2[0], _MM_SHUFFLE(3, 3, 3, 3)) -// __m128 e0 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 e1 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 e2 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 e3 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 m0 = _mm_mul_ps(in1[0], e0); -// __m128 m1 = _mm_mul_ps(in1[1], e1); -// __m128 m2 = _mm_mul_ps(in1[2], e2); -// __m128 m3 = _mm_mul_ps(in1[3], e3); -// -// __m128 a0 = _mm_add_ps(m0, m1); -// __m128 a1 = _mm_add_ps(m2, m3); -// __m128 a2 = _mm_add_ps(a0, a1); -// -// out[3] = a2; -// } -// -// glm::uint64 TimeEnd = GetCpuCycle(); -// -// printf("Ticks mul: %d\n", TimeEnd - TimeStart); -//} -// -//inline void _mm_transpose_ps(__m128 const in[4], __m128 out[4]) -//{ -// __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); -// __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); -// __m128 tmp1 = _mm_shuffle_ps(in[2], in[3], 0x44); -// __m128 tmp3 = _mm_shuffle_ps(in[2], in[3], 0xEE); -// -// out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88); -// out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD); -// out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88); -// out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); -//} - -//void _mm_inverse_ps(__m128 const in[4], __m128 out[4]) -//{ -// // Swp00 = _mm_shuffle_ps(in[1], in[2], _MM_SHUFFLE(2, 2, 2, 2)); -// // SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; -// // SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; -// // SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; -// // SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; -// // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), -// // - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02), -// // + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08), -// // - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15), -// -// __m128 Sfc00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 Sfc0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 2, 3, 2)); -// __m128 Sfc01 = _mm_shuffle_ps(Sfc0a, Sfc0a, _MM_SHUFFLE(2, 3, 1, 1)); -// __m128 Sfc02 = _mm_shuffle_ps(Sfc0a, Sfc0a, _MM_SHUFFLE(3, 2, 0, 0)); -// __m128 Sfc03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 SfcM0 = _mm_mul_ps(Sfc00, Sfc01); -// __m128 SfcM1 = _mm_mul_ps(Sfc02, Sfc03); -// __m128 SfcM2 = _mm_sub_ps(SfcM0, SfcM1); -// // SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; -// // SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; -// // SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; -// // SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; -// // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), -// // - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02), -// // + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08), -// // - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15), -// -// __m128 Swp00 = _mm_shuffle_ps(in[2], in[2], _MM_SHUFFLE(3, 0, 1, 2)); -// __m128 Swp01 = _mm_shuffle_ps(in[3], in[3], _MM_SHUFFLE(3, 3, 3, 3)); -// __m128 Swp02 = _mm_shuffle_ps(in[3], in[3], _MM_SHUFFLE(3, 0, 1, 2)); -// __m128 Swp03 = _mm_shuffle_ps(in[2], in[2], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 Swp04 = _mm_shuffle_ps(in[2], in[2], _MM_SHUFFLE(3, 0, 0, 1)); -// __m128 Swp05 = _mm_shuffle_ps(in[3], in[3], _MM_SHUFFLE(3, 1, 2, 2)); -// __m128 Swp06 = _mm_shuffle_ps(in[3], in[3], _MM_SHUFFLE(3, 0, 0, 1)); -// __m128 Swp07 = _mm_shuffle_ps(in[2], in[2], _MM_SHUFFLE(3, 1, 2, 2)); -// -// __m128 Swp08 = _mm_shuffle_ps(in[1], in[1], _MM_SHUFFLE(3, 0, 1, 2)); -// __m128 Swp09 = _mm_shuffle_ps(in[1], in[1], _MM_SHUFFLE(3, 3, 3, 3)); -// __m128 Swp10 = _mm_shuffle_ps(in[1], in[1], _MM_SHUFFLE(3, 0, 0, 1)); -// __m128 Swp11 = _mm_shuffle_ps(in[1], in[1], _MM_SHUFFLE(3, 1, 2, 2)); -// -// __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); -// __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); -// __m128 Fac00 = _mm_sub_ps(Mul00, Mul01); -// -// //valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; -// //valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; -// //valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; -// -// __m128 Mul02 = _mm_mul_ps(Swp04, Swp05); -// __m128 Mul03 = _mm_mul_ps(Swp06, Swp07); -// __m128 Fac01 = _mm_sub_ps(Mul02, Mul03); -// -// //valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; -// //valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; -// //valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; -// -// __m128 Mul04 = _mm_mul_ps(Swp08, Swp01); -// __m128 Mul05 = _mm_mul_ps(Swp02, Swp09); -// __m128 Fac02 = _mm_sub_ps(Mul04, Mul05); -// -// //valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; -// //valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; -// //valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; -// -// __m128 Mul06 = _mm_mul_ps(Swp10, Swp05); -// __m128 Mul07 = _mm_mul_ps(Swp06, Swp11); -// __m128 Fac03 = _mm_sub_ps(Mul06, Mul07); -// -// //valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; -// //valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; -// //valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; -// -// __m128 Mul08 = _mm_mul_ps(Swp08, Swp03); -// __m128 Mul09 = _mm_mul_ps(Swp00, Swp09); -// __m128 Fac04 = _mm_sub_ps(Mul08, Mul09); -// -// //valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; -// //valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; -// //valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; -// -// __m128 Mul10 = _mm_mul_ps(Swp10, Swp07); -// __m128 Mul11 = _mm_mul_ps(Swp04, Swp11); -// __m128 Fac05 = _mm_sub_ps(Mul10, Mul11); -// -// //valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; -// //valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; -// //valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; -// -// bool end = true; -//} - -//template -//inline detail::tmat4x4 inverse -//( -// detail::tmat4x4 const & m -//) -//{ - -//inline __m128 _mm_dot_ps(__m128 v1, __m128 v2) -//{ -// __m128 mul0 = _mm_mul_ps(v1, v2); -// __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); -// __m128 add0 = _mm_add_ps(mul0, swp0); -// __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); -// __m128 add1 = _mm_add_ps(add0, swp1); -// return add1; -//} -// -//inline void _mm_inverse_ps(__m128 const in[4], __m128 out[4]) -//{ -// glm::uint64 TimeStart = GetCpuCycle(); -// -// __m128 Fac0; -// { -// // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; -// // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; -// // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; -// // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; -// -// __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); -// __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); -// -// __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); -// __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); -// Fac0 = _mm_sub_ps(Mul00, Mul01); -// -// bool stop = true; -// } -// -// __m128 Fac1; -// { -// // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; -// // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; -// // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; -// // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; -// -// __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); -// __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); -// -// __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); -// __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); -// Fac1 = _mm_sub_ps(Mul00, Mul01); -// -// bool stop = true; -// } -// -// -// __m128 Fac2; -// { -// // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; -// // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; -// // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; -// // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; -// -// __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); -// -// __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); -// -// __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); -// __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); -// Fac2 = _mm_sub_ps(Mul00, Mul01); -// -// bool stop = true; -// } -// -// __m128 Fac3; -// { -// // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; -// // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; -// // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; -// // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; -// -// __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); -// __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); -// -// __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); -// -// __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); -// __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); -// Fac3 = _mm_sub_ps(Mul00, Mul01); -// -// bool stop = true; -// } -// -// __m128 Fac4; -// { -// // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; -// // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; -// // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; -// // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; -// -// __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); -// -// __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); -// -// __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); -// __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); -// Fac4 = _mm_sub_ps(Mul00, Mul01); -// -// bool stop = true; -// } -// -// __m128 Fac5; -// { -// // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; -// // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; -// // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; -// // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; -// -// __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); -// -// __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); -// __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); -// -// __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); -// __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); -// Fac5 = _mm_sub_ps(Mul00, Mul01); -// -// bool stop = true; -// } -// -// __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); -// __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); -// -// // m[1][0] -// // m[0][0] -// // m[0][0] -// // m[0][0] -// __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); -// -// // m[1][1] -// // m[0][1] -// // m[0][1] -// // m[0][1] -// __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); -// __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); -// -// // m[1][2] -// // m[0][2] -// // m[0][2] -// // m[0][2] -// __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); -// __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); -// -// // m[1][3] -// // m[0][3] -// // m[0][3] -// // m[0][3] -// __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); -// __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); -// -// // col0 -// // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), -// // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), -// // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), -// // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), -// __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); -// __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); -// __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); -// __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); -// __m128 Add00 = _mm_add_ps(Sub00, Mul02); -// __m128 Inv0 = _mm_mul_ps(SignB, Add00); -// -// // col1 -// // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), -// // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), -// // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), -// // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), -// __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); -// __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); -// __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); -// __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); -// __m128 Add01 = _mm_add_ps(Sub01, Mul05); -// __m128 Inv1 = _mm_mul_ps(SignA, Add01); -// -// // col2 -// // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), -// // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), -// // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), -// // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), -// __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); -// __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); -// __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); -// __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); -// __m128 Add02 = _mm_add_ps(Sub02, Mul08); -// __m128 Inv2 = _mm_mul_ps(SignB, Add02); -// -// // col3 -// // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), -// // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), -// // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), -// // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); -// __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); -// __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); -// __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); -// __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); -// __m128 Add03 = _mm_add_ps(Sub03, Mul11); -// __m128 Inv3 = _mm_mul_ps(SignA, Add03); -// -// __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); -// __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); -// -// // valType Determinant = m[0][0] * Inverse[0][0] -// // + m[0][1] * Inverse[1][0] -// // + m[0][2] * Inverse[2][0] -// // + m[0][3] * Inverse[3][0]; -// __m128 Det0 = _mm_dot_ps(in[0], Row2); -// -// // Inverse /= Determinant; -// out[0] = _mm_div_ps(Inv0, Det0); -// out[1] = _mm_div_ps(Inv1, Det0); -// out[2] = _mm_div_ps(Inv2, Det0); -// out[3] = _mm_div_ps(Inv3, Det0); -// -// glm::uint64 TimeEnd = GetCpuCycle(); -// -// printf("Ticks inv: %d\n", TimeEnd - TimeStart); -// -// bool stop = true; -//} - -//#include - -void test_mat4_mul() -{ -/* - { - __m128 v1 = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - __m128 m0[4]; - m0[0] = _mm_set_ps(3.0f, 2.0f, 1.0f, 0.0f); - m0[1] = _mm_set_ps(4.0f, 5.0f, 6.0f, 7.0f); - m0[2] = _mm_set_ps(0.3f, 0.2f, 0.1f, 0.0f); - m0[3] = _mm_set_ps(0.4f, 0.5f, 0.6f, 0.7f); - - __m128 v2 = _mm_mul_ps(v1, m0); - - bool stop = true; - } - { - glm::vec4 v1(0.0f, 1.0f, 2.0f, 3.0f); - - glm::mat4 m0; - m0[0] = glm::vec4(0.0f, 1.0f, 2.0f, 3.0f); - m0[1] = glm::vec4(7.0f, 6.0f, 5.0f, 4.0f); - m0[2] = glm::vec4(0.0f, 0.1f, 0.2f, 0.3f); - m0[3] = glm::vec4(0.7f, 0.6f, 0.5f, 0.4f); - glm::vec4 v2 = v1 * m0; - - bool stop = true; - } -*/ - { - __m128 a = _mm_setr_ps(0.0f, 1.0f, 2.0f, 3.0f); - __m128 b = _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 1, 0)); - - bool stop = true; - } - - { - __m128 v1 = _mm_setr_ps(0.3f, 0.2f, 0.1f, 1.0f); - __m128 m0[4]; - m0[0] = _mm_setr_ps(2.0f, 0.2f, 0.1f,-1.4f); - m0[1] = _mm_setr_ps(0.5f, 2.0f, 0.3f,-1.2f); - m0[2] = _mm_setr_ps(0.6f, 0.4f, 2.0f,-1.1f); - m0[3] = _mm_setr_ps(1.4f, 1.2f, 1.1f, 1.0f); - - __m128 v2 = _mm_mul_ps(v1, m0); - - bool stop = true; - } - - { - glm::vec4 v1(0.3f, 0.2f, 0.1f, 1.0f); - - glm::mat4 m0; - m0[0] = glm::vec4(2.0f, 0.2f, 0.1f,-1.4f); - m0[1] = glm::vec4(0.5f, 2.0f, 0.3f,-1.2f); - m0[2] = glm::vec4(0.6f, 0.4f, 2.0f,-1.1f); - m0[3] = glm::vec4(1.4f, 1.2f, 1.1f, 1.0f); - glm::vec4 v2 = v1 * m0; - - bool stop = true; - } - - { - glm::vec4 v1(1.0f, 0.5f,-0.5f,-1.0f); - - glm::mat4 m0; - m0[0] = glm::vec4(2.0f,-1.0f,-1.0f, 4.0f); - m0[1] = glm::vec4(2.0f, 1.0f, 4.0f, 1.0f); - m0[2] = glm::vec4(2.0f, 4.0f, 1.0f, 1.0f); - m0[3] = glm::vec4(4.0f, 1.0f, 1.0f, 1.0f); - m0 = glm::transpose(m0); - glm::vec4 v2 = m0 * v1; - - bool stop = true; - } - - { - glm::mat4 MatA; - MatA[0] = glm::vec4(0.2f, 0.1f, 0.3f, 0.4f); - MatA[1] = glm::vec4(1.0f, 0.3f, 0.2f, 0.3f); - MatA[2] = glm::vec4(3.0f, 2.0f, 0.4f, 0.2f); - MatA[3] = glm::vec4(4.0f, 3.0f, 2.0f, 1.0f); - - glm::mat4 InvA = glm::inverse(MatA); - glm::mat4 IndA = MatA * InvA; -// glm::mat4 InvB = glm::inverseOgre(MatA); -// glm::mat4 IndB = MatA * InvB; -// glm::mat4 InvD = glm::inverseSIMD(MatA); -// glm::mat4 IndD = MatA * InvD; -// glm::mat4 InvE = glm::inverseDev(MatA); -// glm::mat4 IndE = MatA * InvE; - - __m128 MatC[4]; - MatC[0] = _mm_setr_ps(0.2f, 0.1f, 0.3f, 0.4f); - MatC[1] = _mm_setr_ps(1.0f, 0.3f, 0.2f, 0.3f); - MatC[2] = _mm_setr_ps(3.0f, 2.0f, 0.4f, 0.2f); - MatC[3] = _mm_setr_ps(4.0f, 3.0f, 2.0f, 1.0f); - __m128 InvC[4]; - _mm_inverse_ps(MatC, InvC); - - __m128 IndC[4]; - _mm_mul_ps(MatC, InvC, IndC); - - __m128 Mul2[4]; - _mm_mul_ps(MatC, MatC, Mul2); - - bool stop = true; - } - - { - glm::dmat4 Mat; - Mat[0] = glm::dvec4(0.0f, 1.0f, 2.0f, 3.0f); - Mat[1] = glm::dvec4(0.1f, 1.1f, 2.1f, 3.1f); - Mat[2] = glm::dvec4(0.2f, 1.2f, 2.2f, 3.2f); - Mat[3] = glm::dvec4(0.3f, 1.3f, 2.3f, 3.3f); - glm::dmat4 Inv = glm::inverse(Mat); - glm::dmat4 Ind = Mat * Inv; - - glm::dmat4 MatB; - MatB[0] = glm::dvec4(0.0f, 1.0f, 2.0f, 3.0f); - MatB[1] = glm::dvec4(0.1f, 1.1f, 2.1f, 3.1f); - MatB[2] = glm::dvec4(0.2f, 1.2f, 2.2f, 3.2f); - MatB[3] = glm::dvec4(0.3f, 1.3f, 2.3f, 3.3f); -// glm::dmat4 InvB = glm::inverseOgre(MatB); -// glm::dmat4 IndB = MatB * InvB; - - bool stop = true; - } - - { - glm::mat3 Mat; - Mat[0] = glm::vec3(0.0f, 1.0f, 2.0f); - Mat[1] = glm::vec3(0.1f, 1.1f, 2.1f); - Mat[2] = glm::vec3(0.2f, 1.2f, 2.2f); - glm::mat3 Inv = glm::inverse(Mat); - glm::mat3 Ind = Mat * Inv; - - bool stop = true; - } - - bool stop = true; -} - -void test_vec4_mul() -{ - glm::vec4 v1(1.0f, 2.0f, 3.0f, 4.0f); - glm::mat4 m1; - m1[0] = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f) * 0.1f; - m1[1] = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f) * 0.2f; - m1[2] = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f) * 0.3f; - m1[3] = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f) * 0.4f; - glm::vec4 vA = m1 * v1; - glm::vec4 vC = v1 * m1; - - __m128 v2 = _mm_setr_ps(1.0f, 2.0f, 3.0f, 4.0f); - __m128 m2[4]; - m2[0] = _mm_mul_ps(_mm_setr_ps(1.0f, 2.0f, 3.0f, 4.0f), _mm_set_ps1(0.1f)); - m2[1] = _mm_mul_ps(_mm_setr_ps(1.0f, 2.0f, 3.0f, 4.0f), _mm_set_ps1(0.2f)); - m2[2] = _mm_mul_ps(_mm_setr_ps(1.0f, 2.0f, 3.0f, 4.0f), _mm_set_ps1(0.3f)); - m2[3] = _mm_mul_ps(_mm_setr_ps(1.0f, 2.0f, 3.0f, 4.0f), _mm_set_ps1(0.4f)); - __m128 vB = _mm_mul_ps(m2, v2); - __m128 vD = _mm_mul_ps(v2, m2); - - bool stop = true; -} - -void test_mat4_tick() -{ - __m128 MatC[4]; - MatC[0] = _mm_setr_ps(0.2f, 0.1f, 0.3f, 0.4f); - MatC[1] = _mm_setr_ps(1.0f, 0.3f, 0.2f, 0.3f); - MatC[2] = _mm_setr_ps(3.0f, 2.0f, 0.4f, 0.2f); - MatC[3] = _mm_setr_ps(4.0f, 3.0f, 2.0f, 1.0f); - - int CPUInfo[4]; - int InfoType; - - for(std::size_t i = 0; i < 10; ++i) - { - __m128 InvC[4]; - __m128 IndC[4]; - - { -// __cpuid(CPUInfo, InfoType); -// __rdtsc(); -// __cpuid(CPUInfo, InfoType); -// __rdtsc(); -// __cpuid(CPUInfo, InfoType); - - //glm::uint64 ClockStart = GetCpuCycle(); - _mm_inverse_ps(MatC, InvC); - //glm::uint64 ClockEnd = GetCpuCycle(); - //printf("inv: %d\n", ClockEnd - ClockStart); - } - - { -// __cpuid(CPUInfo, InfoType); -// __rdtsc(); -// __cpuid(CPUInfo, InfoType); -// __rdtsc(); -// __cpuid(CPUInfo, InfoType); - - //glm::uint64 ClockStart = GetCpuCycle(); - _mm_mul_ps(MatC, InvC, IndC); - //glm::uint64 ClockEnd = GetCpuCycle(); - //printf("mul: %d\n", ClockEnd - ClockStart); - } - } -} - -int firstBit(int Binary) -{ - for(std::size_t i = 0; i < 32; ++i) - if(Binary & (1 << i)) - return i; - assert(0); - return 0; -} - -void test_exp_golomb() -{ - //0 => 1 => 1 - //1 => 10 => 010 - //2 => 11 => 011 - //3 => 100 => 00100 - //4 => 101 => 00101 - //5 => 110 => 00110 - //6 => 111 => 00111 - //7 => 1000 => 0001000 - //8 => 1001 => 0001001 - - // - Take the number in binary except for the last k digits - // and add 1 to it (arithmetically). Write this down. - // - Count the bits written, subtract one, - // - Write that number of starting zero bits preceding the previous bit string. - // - Write the last k bits in binary. - - std::size_t Bit00 = glm::highestBit(0); - std::size_t Bit01 = glm::highestBit(1); - std::size_t Bit02 = glm::highestBit(2); - std::size_t Bit04 = glm::highestBit(4); - std::size_t Bit08 = glm::highestBit(8); - std::size_t Bit16 = glm::highestBit(16); - std::size_t Bit32 = glm::highestBit(32); - - std::vector Size(256); - std::vector Data(256); - std::vector Conv(256); - - for(std::size_t i = 0; i < 256; ++i) - { - glm::uint32 Binary = i + 1; - glm::uint32 HighestBit = glm::highestBit(Binary); - glm::uint32 CodeSize = (HighestBit << 1) + 1; - glm::uint32 Swift = 32 - CodeSize; - glm::uint32 Temp = glm::bitRevert(Binary << Swift); - //glm::uint32 Temp = Binary << Swift; - - Data[i] = Temp; - Size[i] = HighestBit * 2 + 1; - - printf("Binary(%d, %d): ", Swift, CodeSize); - for(std::size_t k = 0; k < 32; ++k) - printf("%d", glm::uint32((Binary & (1 << k)) != 0)); - printf(" (%d)\n", Binary); - - printf("Temp(%d, %d) : ", Swift, CodeSize); - for(std::size_t k = 0; k < 32; ++k) - printf("%d", glm::uint32((Temp & (1 << k)) != 0)); - printf(" (%d)\n", Temp); - - printf("Value(%d): ", i); - for(std::size_t k = 0; k < 8; ++k) - printf("%d", glm::uint32((i & (1 << k)) != 0)); - printf("; "); - - printf("Code: "); - for(std::size_t k = 0; k < Size[i]; ++k) - printf("%d", glm::uint32((Data[i] & (1 << k)) != 0)); - printf("\n"); - - { - glm::uint32 Temp = Data[i]; - glm::uint32 CodeSize2 = (firstBit(Temp) << 1) + 1; - glm::uint32 Swift2 = 32 - CodeSize2; - glm::uint32 Binary = glm::bitRevert(Temp) >> Swift2; - Conv[i] = Binary - 1; - } - - printf("Conv (%d, %d): ", Swift, CodeSize); - for(std::size_t k = 0; k < 32; ++k) - printf("%d", glm::uint32((Conv[i] & (1 << k)) != 0)); - printf(" (%d)\n\n", Conv[i]); - - bool stop = true; - } - - bool stop = true; -} -/* -int main(int argc, char* argv[]) -{ - test_mat4_mul(); - test_exp_golomb(); - //test_mat4_tick(); - test_quat(); - test_simd(); - test_transform(); - test_const(); - test_radial(); - test_vec4_mul(); - - glm::uint LowestBit = glm::lowestBit(8); - - glm::test::main_core_func_common(); - glm::test::main_core_func_exponential(); - glm::test::main_core_func_geometric(); - glm::test::main_core_func_matrix(); - glm::test::main_core_func_noise(); - glm::test::main_core_func_trigonometric(); - glm::test::main_core_func_vector_relational(); - glm::test::main_gtx_intesect(); - - { - glm::vec3 Normal(1, 0, 0); - - glm::vec3 x = glm::rotate(glm::vec3(1,0,0),180.f,Normal); - glm::vec3 y = glm::rotate(glm::vec3(1,1,0),180.f,Normal); - - bool Stop = true; - } - - glm::mat4 m1 = glm::inverseTranspose( - glm::gtc::matrix_transform::translate( - glm::gtc::matrix_transform::rotate( - glm::mat4(1.0f), - 90.f, - glm::normalize(glm::vec3(1.0f, 0.5f, 0.2f))), - glm::vec3(1.f, 2.f, 3.f))); - - glm::mat4 m2 = glm::transpose( - glm::inverse( - glm::gtc::matrix_transform::translate( - glm::gtc::matrix_transform::rotate( - glm::mat4(1.0f), - 90.f, - glm::normalize(glm::vec3(1.0f, 0.5f, 0.2f))), - glm::vec3(1.f, 2.f, 3.f)))); - - test_hint(); - test_fast_inverse(); - //test_type(); - test_profile(); -// glm::greaterThan(); - test_angle(); - - test_half(); - test_swizzle(); - - test::main_vec2(); - - test_quaternion(); - test_auto_cast(); - - //detail::test_half_type(); - - glm::vec2 Result = glm::perp(glm::vec2(1.0, 0.0), glm::vec2(0.0, 1.0)); - -// test_genType(); -// test_desk(); - //radians(1); - - glm::mat4 LookAt = glm::lookAt(glm::vec3(1), glm::vec3(1), glm::vec3(1)); - - fast_inverse(); - test_string_cast(); - test_isPowerOfTwo(); - - { - float fast0 = glm::fastLength(glm::vec3(1.0f)); - float fast1 = 0.0f; - } - - vec4 v76 = 1.f * vec4(1.0f); - - test_matrix(); - //test_random(); - //test_sse_vec4(); - //test_sse_mat4(); - - { - float f1 = glm::mix(100.f, 1000.f, 0.5f); - vec3 f2 = glm::mix(vec3(100.f), vec3(1000.f), 0.5f); - ivec3 f3 = glm::mix(ivec3(100), ivec3(1000), 0.5f); - ivec3 f4 = glm::mix(ivec3(100), ivec3(1000), vec3(0.5f)); - } - - { - mat4 Projection = glm::frustum(-1.0f, 1.0f, -1.0f, 1.0f, 0.1f, 1.0f); - - //glm_traits::value_type vec(1.0f); - } - - { - glm::vec2 v1(1.0f); - glm::vec2 v2(2.0f); - glm::vec2 v3(3.0f); - -// v1.xy += v2 + v3.xy; - } - - { - bool b = true; - glm::vec4 v4(b); - } - - { - glm::quat q1; - q1 = glm::inverse(q1); - } - - //test_cast(); - //test_half_full(); - - //test_sse(); - //__hvec2GTX Pouet; - //pouet Pouet(1, 2, 3); - glm::dmat4 dm = glm::dmat4(1.0); - glm::mat4 fm1 = glm::mat4(dm); - glm::mat4 fm2(dm); - //glm::hmat4 hm = glm::hmat4(1.0); - //glm::mat4 fm3(hm); - //glm::dmat4 dm2(hm); - - { - glm::quat q1; - glm::vec4 v1; - glm::vec4 r1; - r1 = q1 * v1; - - r1++; - //q1 = glm::absGTX(q1); - } - - { - glm::vec3 v1(1.0f); - ++v1; - v1++; - } - - { - glm::vec4 v1(1.0f); - --v1; - v1--; - } - - { - glm::vec4 v1(1.0f); - ++v1; - v1++; - } - - { - ivec3 testVec = ivec3(3,35,4); - const ivec3 testVec2 = ivec3(13,15,14); - //testVec = testVec2.zyx; - //testVec = testVec2.xyy; - //testVec = testVec2.rrr; - //ivec4 textVec4 = testVec2.zzxx; - //ivec2 textVec2 = testVec2.gr; - - //half h1 = half(1.0f); - //hvec2 hv2 = hvec2(h1); - //hvec3 hv3 = hvec3(h1); - //hvec4 hv4 = hvec4(h1); - } - - vec2 Stuff = glm::mix(vec2(1), vec2(0), 0.5f); - - test_gtx_bit(); - - vec2 Max = glm::max(vec2(0.f), vec2(1.f)); - vec2 Truc = radians(vec2(1)); -// ivec3 v(1); -// v = operator &=((1 << 0)); - - ivec3 v(1); - v &= (1 << 0); - - - vec4 Color = glm::f32_rgba_cast(glm::uint32(0)); - - vec3 Normal = glm::normalizedRand3(); - //__hvec3GTX hCos = cos(__hvec3GTX(1.0f)); - //__hvec3GTX hNormal = normalizedRand3(); - - //quat Quat; - //Quat = sqrt(Quat); - -#if(defined(GLM_SWIZZLE) && GLM_SWIZZLE & GLM_SWIZZLE_FUNC) - vec4 ColorRGBA = vec4(1.0, 0.5, 0.0, 1.0)._xyzw(); -#endif//GLM_SWIZZLE - - hvec2 v1(1.0f, 2.0f); - hvec2 v2(3.0f, 4.0f); - v2 = v1; - v2 += half(1.0f); - v2 += detail::thalf(1.0f); - v2 = v1 - v2; - half hcos1 = glm::cos(half(1.0)); - hvec2 hcos2 = glm::cos(hvec2(1.0)); - - //test_associated_min_max(); - - system("pause"); - return 0; -} -*/ - -#define CPUID __asm __emit 0fh __asm __emit 0a2h -#define RDTSC __asm __emit 0fh __asm __emit 031h - -unsigned test_sse() -{ - glm::mat4 MatA; - MatA[0] = glm::vec4(0.2f, 0.1f, 0.3f, 0.4f); - MatA[1] = glm::vec4(1.0f, 0.3f, 0.2f, 0.3f); - MatA[2] = glm::vec4(3.0f, 2.0f, 0.4f, 0.2f); - MatA[3] = glm::vec4(4.0f, 3.0f, 2.0f, 1.0f); - glm::mat4 MulA; - glm::mat4 InvA; - unsigned cycles; - - __m128 MatC[4]; - MatC[0] = _mm_setr_ps(0.2f, 0.1f, 0.3f, 0.4f); - MatC[1] = _mm_setr_ps(1.0f, 0.3f, 0.2f, 0.3f); - MatC[2] = _mm_setr_ps(3.0f, 2.0f, 0.4f, 0.2f); - MatC[3] = _mm_setr_ps(4.0f, 3.0f, 2.0f, 1.0f); - __m128 MatR[4]; -/* - __asm - { - pushad - - CPUID - RDTSC - mov cycles, eax - - popad - } -*/ - //MulA = MatA * MatA; - //_mm_mul_ps(MatC, MatC, MatR); - //InvA = glm::inverse(MatA); - //_mm_inverse_ps(MatC, MatR); - _mm_inverse_fast_ps(MatC, MatR); - //glm::mat4 IndA = MatA * InvA; - //glm::mat4 InvB = glm::inverseOgre(MatA); - //glm::mat4 IndB = MatA * InvB; -// glm::mat4 InvD = glm::inverseSIMD(MatA); -// glm::mat4 IndD = MatA * InvD; -// glm::mat4 InvE = glm::inverseDev(MatA); -// glm::mat4 IndE = MatA * InvE; - - //__m128 MatC[4]; - //MatC[0] = _mm_setr_ps(0.2f, 0.1f, 0.3f, 0.4f); - //MatC[1] = _mm_setr_ps(1.0f, 0.3f, 0.2f, 0.3f); - //MatC[2] = _mm_setr_ps(3.0f, 2.0f, 0.4f, 0.2f); - //MatC[3] = _mm_setr_ps(4.0f, 3.0f, 2.0f, 1.0f); - //__m128 InvC[4]; - //_mm_inverse_ps(MatC, InvC); - - //__m128 IndC[4]; - //_mm_mul_ps(MatC, InvC, IndC); - - //__m128 Mul2[4]; - //_mm_mul_ps(MatC, MatC, Mul2); -/* - __asm - { - pushad - - CPUID - RDTSC - sub eax, cycles - mov cycles, eax - - popad - } -*/ - return cycles; -} - -unsigned test_mat4_translate() -{ - glm::mat4 MatA; - MatA[0] = glm::vec4(0.2f, 0.1f, 0.3f, 0.4f); - MatA[1] = glm::vec4(1.0f, 0.3f, 0.2f, 0.3f); - MatA[2] = glm::vec4(3.0f, 2.0f, 0.4f, 0.2f); - MatA[3] = glm::vec4(4.0f, 3.0f, 2.0f, 1.0f); - glm::mat4 Transform; - - __m128 MatC[4]; - MatC[0] = _mm_setr_ps(0.2f, 0.1f, 0.3f, 0.4f); - MatC[1] = _mm_setr_ps(1.0f, 0.3f, 0.2f, 0.3f); - MatC[2] = _mm_setr_ps(3.0f, 2.0f, 0.4f, 0.2f); - MatC[3] = _mm_setr_ps(4.0f, 3.0f, 2.0f, 1.0f); - __m128 MatR[4]; - float v[] = {1, 2, 3}; - - unsigned cycles; -/* - __asm - { - pushad - - CPUID - RDTSC - mov cycles, eax - - popad - } -*/ - _mm_rotate_ps(MatC, 45.f, v, MatR); - //Transform = glm::rotate(MatA, 45.f, glm::vec3(1, 2, 3)); -/* - __asm - { - pushad - - CPUID - RDTSC - sub eax, cycles - mov cycles, eax - - popad - } -*/ - return cycles; -} - -void test_vec4_simd() -{ - glm::vec4SIMD v1(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4SIMD v2(5.0f, 6.0f, 7.0f, 8.0f); - glm::vec4SIMD v3 = v1 + v2; - - bool end = true; -} - -bool main_test() -{ - bool Result = true; - - Result = Result && glm::test::main_bug(); - assert(Result); - Result = Result && glm::test::main_type_half(); - assert(Result); - Result = Result && glm::test::main_img(); - assert(Result); - - return true; -} -/* -template