WIP
authorslack <slack@codemaniacs.com>
Sun, 10 Jan 2010 20:30:36 +0000 (21:30 +0100)
committerslack <slack@codemaniacs.com>
Sun, 10 Jan 2010 20:30:36 +0000 (21:30 +0100)
302 files changed:
default.frag [new file with mode: 0644]
default.vert [new file with mode: 0644]
glm/GLM_GTX_associated_min_max.h [new file with mode: 0644]
glm/GLM_GTX_bit.h [new file with mode: 0644]
glm/GLM_GTX_closest_point.h [new file with mode: 0644]
glm/GLM_GTX_color_cast.h [new file with mode: 0644]
glm/GLM_GTX_color_space.h [new file with mode: 0644]
glm/GLM_GTX_color_space_YCoCg.h [new file with mode: 0644]
glm/GLM_GTX_comparison.h [new file with mode: 0644]
glm/GLM_GTX_compatibility.h [new file with mode: 0644]
glm/GLM_GTX_component_wise.h [new file with mode: 0644]
glm/GLM_GTX_determinant.h [new file with mode: 0644]
glm/GLM_GTX_double_float.h [new file with mode: 0644]
glm/GLM_GTX_epsilon.h [new file with mode: 0644]
glm/GLM_GTX_euler_angles.h [new file with mode: 0644]
glm/GLM_GTX_extend.h [new file with mode: 0644]
glm/GLM_GTX_extented_min_max.h [new file with mode: 0644]
glm/GLM_GTX_fast_exponential.h [new file with mode: 0644]
glm/GLM_GTX_fast_square_root.h [new file with mode: 0644]
glm/GLM_GTX_fast_trigonometry.h [new file with mode: 0644]
glm/GLM_GTX_gradient_paint.h [new file with mode: 0644]
glm/GLM_GTX_half_float.h [new file with mode: 0644]
glm/GLM_GTX_handed_coordinate_space.h [new file with mode: 0644]
glm/GLM_GTX_inertia.h [new file with mode: 0644]
glm/GLM_GTX_integer.h [new file with mode: 0644]
glm/GLM_GTX_intersect.h [new file with mode: 0644]
glm/GLM_GTX_inverse.h [new file with mode: 0644]
glm/GLM_GTX_inverse_transpose.h [new file with mode: 0644]
glm/GLM_GTX_log_base.h [new file with mode: 0644]
glm/GLM_GTX_matrix_access.h [new file with mode: 0644]
glm/GLM_GTX_matrix_cross_product.h [new file with mode: 0644]
glm/GLM_GTX_matrix_major_storage.h [new file with mode: 0644]
glm/GLM_GTX_matrix_projection.h [new file with mode: 0644]
glm/GLM_GTX_matrix_query.h [new file with mode: 0644]
glm/GLM_GTX_matrix_selection.h [new file with mode: 0644]
glm/GLM_GTX_mixed_product.h [new file with mode: 0644]
glm/GLM_GTX_norm.h [new file with mode: 0644]
glm/GLM_GTX_normal.h [new file with mode: 0644]
glm/GLM_GTX_normalize_dot.h [new file with mode: 0644]
glm/GLM_GTX_number_precision.h [new file with mode: 0644]
glm/GLM_GTX_optimum_pow.h [new file with mode: 0644]
glm/GLM_GTX_orthonormalize.h [new file with mode: 0644]
glm/GLM_GTX_perpendicular.h [new file with mode: 0644]
glm/GLM_GTX_polar_coordinates.h [new file with mode: 0644]
glm/GLM_GTX_projection.h [new file with mode: 0644]
glm/GLM_GTX_quaternion.h [new file with mode: 0644]
glm/GLM_GTX_random.h [new file with mode: 0644]
glm/GLM_GTX_raw_data.h [new file with mode: 0644]
glm/GLM_GTX_reciprocal.h [new file with mode: 0644]
glm/GLM_GTX_rotate_vector.h [new file with mode: 0644]
glm/GLM_GTX_spline.h [new file with mode: 0644]
glm/GLM_GTX_std_based_type.h [new file with mode: 0644]
glm/GLM_GTX_string_cast.h [new file with mode: 0644]
glm/GLM_GTX_transform.h [new file with mode: 0644]
glm/GLM_GTX_transform2.h [new file with mode: 0644]
glm/GLM_GTX_unsigned_int.h [new file with mode: 0644]
glm/GLM_GTX_vector_access.h [new file with mode: 0644]
glm/GLM_GTX_vector_angle.h [new file with mode: 0644]
glm/GLM_GTX_vector_query.h [new file with mode: 0644]
glm/GLM_GTX_verbose_operator.h [new file with mode: 0644]
glm/GLM_VIRTREV_address.h [new file with mode: 0644]
glm/GLM_VIRTREV_equal_operator.h [new file with mode: 0644]
glm/GLM_VIRTREV_gl.h [new file with mode: 0644]
glm/GLM_VIRTREV_xstream.h [new file with mode: 0644]
glm/core/_detail.hpp [new file with mode: 0644]
glm/core/_swizzle.hpp [new file with mode: 0644]
glm/core/_swizzle.inl [new file with mode: 0644]
glm/core/func_common.hpp [new file with mode: 0644]
glm/core/func_common.inl [new file with mode: 0644]
glm/core/func_exponential.hpp [new file with mode: 0644]
glm/core/func_exponential.inl [new file with mode: 0644]
glm/core/func_geometric.hpp [new file with mode: 0644]
glm/core/func_geometric.inl [new file with mode: 0644]
glm/core/func_matrix.hpp [new file with mode: 0644]
glm/core/func_matrix.inl [new file with mode: 0644]
glm/core/func_noise.hpp [new file with mode: 0644]
glm/core/func_noise.inl [new file with mode: 0644]
glm/core/func_trigonometric.hpp [new file with mode: 0644]
glm/core/func_trigonometric.inl [new file with mode: 0644]
glm/core/func_vector_relational.hpp [new file with mode: 0644]
glm/core/func_vector_relational.inl [new file with mode: 0644]
glm/core/hint.hpp [new file with mode: 0644]
glm/core/intrinsic_common.hpp [new file with mode: 0644]
glm/core/intrinsic_common.inl [new file with mode: 0644]
glm/core/intrinsic_exponential.hpp [new file with mode: 0644]
glm/core/intrinsic_exponential.inl [new file with mode: 0644]
glm/core/intrinsic_geometric.hpp [new file with mode: 0644]
glm/core/intrinsic_geometric.inl [new file with mode: 0644]
glm/core/intrinsic_matrix.hpp [new file with mode: 0644]
glm/core/intrinsic_matrix.inl [new file with mode: 0644]
glm/core/intrinsic_trigonometric.hpp [new file with mode: 0644]
glm/core/intrinsic_trigonometric.inl [new file with mode: 0644]
glm/core/intrinsic_vector_relational.hpp [new file with mode: 0644]
glm/core/intrinsic_vector_relational.inl [new file with mode: 0644]
glm/core/type.hpp [new file with mode: 0644]
glm/core/type_float.hpp [new file with mode: 0644]
glm/core/type_gentype.hpp [new file with mode: 0644]
glm/core/type_gentype.inl [new file with mode: 0644]
glm/core/type_half.hpp [new file with mode: 0644]
glm/core/type_half.inl [new file with mode: 0644]
glm/core/type_int.hpp [new file with mode: 0644]
glm/core/type_mat2x2.hpp [new file with mode: 0644]
glm/core/type_mat2x2.inl [new file with mode: 0644]
glm/core/type_mat2x3.hpp [new file with mode: 0644]
glm/core/type_mat2x3.inl [new file with mode: 0644]
glm/core/type_mat2x4.hpp [new file with mode: 0644]
glm/core/type_mat2x4.inl [new file with mode: 0644]
glm/core/type_mat3x2.hpp [new file with mode: 0644]
glm/core/type_mat3x2.inl [new file with mode: 0644]
glm/core/type_mat3x3.hpp [new file with mode: 0644]
glm/core/type_mat3x3.inl [new file with mode: 0644]
glm/core/type_mat3x4.hpp [new file with mode: 0644]
glm/core/type_mat3x4.inl [new file with mode: 0644]
glm/core/type_mat4x2.hpp [new file with mode: 0644]
glm/core/type_mat4x2.inl [new file with mode: 0644]
glm/core/type_mat4x3.hpp [new file with mode: 0644]
glm/core/type_mat4x3.inl [new file with mode: 0644]
glm/core/type_mat4x4.hpp [new file with mode: 0644]
glm/core/type_mat4x4.inl [new file with mode: 0644]
glm/core/type_size.hpp [new file with mode: 0644]
glm/core/type_vec1.hpp [new file with mode: 0644]
glm/core/type_vec1.inl [new file with mode: 0644]
glm/core/type_vec2.hpp [new file with mode: 0644]
glm/core/type_vec2.inl [new file with mode: 0644]
glm/core/type_vec3.hpp [new file with mode: 0644]
glm/core/type_vec3.inl [new file with mode: 0644]
glm/core/type_vec4.hpp [new file with mode: 0644]
glm/core/type_vec4.inl [new file with mode: 0644]
glm/ext.hpp [new file with mode: 0644]
glm/glm.h [new file with mode: 0644]
glm/glm.hpp [new file with mode: 0644]
glm/glmext.h [new file with mode: 0644]
glm/glmsetup.h [new file with mode: 0644]
glm/gtc.hpp [new file with mode: 0644]
glm/gtc/double_float.hpp [new file with mode: 0644]
glm/gtc/double_float.inl [new file with mode: 0644]
glm/gtc/half_float.hpp [new file with mode: 0644]
glm/gtc/half_float.inl [new file with mode: 0644]
glm/gtc/matrix_access.hpp [new file with mode: 0644]
glm/gtc/matrix_access.inl [new file with mode: 0644]
glm/gtc/matrix_operation.hpp [new file with mode: 0644]
glm/gtc/matrix_operation.inl [new file with mode: 0644]
glm/gtc/matrix_projection.hpp [new file with mode: 0644]
glm/gtc/matrix_projection.inl [new file with mode: 0644]
glm/gtc/matrix_transform.hpp [new file with mode: 0644]
glm/gtc/matrix_transform.inl [new file with mode: 0644]
glm/gtc/quaternion.hpp [new file with mode: 0644]
glm/gtc/quaternion.inl [new file with mode: 0644]
glm/gtc/type_precision.hpp [new file with mode: 0644]
glm/gtc/type_precision.inl [new file with mode: 0644]
glm/gtx.hpp [new file with mode: 0644]
glm/gtx/associated_min_max.hpp [new file with mode: 0644]
glm/gtx/associated_min_max.inl [new file with mode: 0644]
glm/gtx/bit.hpp [new file with mode: 0644]
glm/gtx/bit.inl [new file with mode: 0644]
glm/gtx/closest_point.hpp [new file with mode: 0644]
glm/gtx/closest_point.inl [new file with mode: 0644]
glm/gtx/color_cast.hpp [new file with mode: 0644]
glm/gtx/color_cast.inl [new file with mode: 0644]
glm/gtx/color_space.hpp [new file with mode: 0644]
glm/gtx/color_space.inl [new file with mode: 0644]
glm/gtx/color_space_YCoCg.hpp [new file with mode: 0644]
glm/gtx/color_space_YCoCg.inl [new file with mode: 0644]
glm/gtx/comparison.hpp [new file with mode: 0644]
glm/gtx/comparison.inl [new file with mode: 0644]
glm/gtx/compatibility.hpp [new file with mode: 0644]
glm/gtx/compatibility.inl [new file with mode: 0644]
glm/gtx/component_wise.hpp [new file with mode: 0644]
glm/gtx/component_wise.inl [new file with mode: 0644]
glm/gtx/determinant.hpp [new file with mode: 0644]
glm/gtx/determinant.inl [new file with mode: 0644]
glm/gtx/double_float.hpp [new file with mode: 0644]
glm/gtx/double_float.inl [new file with mode: 0644]
glm/gtx/epsilon.hpp [new file with mode: 0644]
glm/gtx/epsilon.inl [new file with mode: 0644]
glm/gtx/euler_angles.hpp [new file with mode: 0644]
glm/gtx/euler_angles.inl [new file with mode: 0644]
glm/gtx/extend.hpp [new file with mode: 0644]
glm/gtx/extend.inl [new file with mode: 0644]
glm/gtx/extented_min_max.hpp [new file with mode: 0644]
glm/gtx/extented_min_max.inl [new file with mode: 0644]
glm/gtx/fast_exponential.hpp [new file with mode: 0644]
glm/gtx/fast_exponential.inl [new file with mode: 0644]
glm/gtx/fast_square_root.hpp [new file with mode: 0644]
glm/gtx/fast_square_root.inl [new file with mode: 0644]
glm/gtx/fast_trigonometry.hpp [new file with mode: 0644]
glm/gtx/fast_trigonometry.inl [new file with mode: 0644]
glm/gtx/flexible_mix.inl [new file with mode: 0644]
glm/gtx/gradient_paint.hpp [new file with mode: 0644]
glm/gtx/gradient_paint.inl [new file with mode: 0644]
glm/gtx/half_float.hpp [new file with mode: 0644]
glm/gtx/half_float.inl [new file with mode: 0644]
glm/gtx/handed_coordinate_space.hpp [new file with mode: 0644]
glm/gtx/handed_coordinate_space.inl [new file with mode: 0644]
glm/gtx/inertia.hpp [new file with mode: 0644]
glm/gtx/inertia.inl [new file with mode: 0644]
glm/gtx/integer.hpp [new file with mode: 0644]
glm/gtx/integer.inl [new file with mode: 0644]
glm/gtx/intersect.hpp [new file with mode: 0644]
glm/gtx/intersect.inl [new file with mode: 0644]
glm/gtx/inverse.hpp [new file with mode: 0644]
glm/gtx/inverse.inl [new file with mode: 0644]
glm/gtx/inverse_transpose.hpp [new file with mode: 0644]
glm/gtx/inverse_transpose.inl [new file with mode: 0644]
glm/gtx/log_base.hpp [new file with mode: 0644]
glm/gtx/log_base.inl [new file with mode: 0644]
glm/gtx/mat4x3.inl [new file with mode: 0644]
glm/gtx/matrix_access.hpp [new file with mode: 0644]
glm/gtx/matrix_access.inl [new file with mode: 0644]
glm/gtx/matrix_cross_product.hpp [new file with mode: 0644]
glm/gtx/matrix_cross_product.inl [new file with mode: 0644]
glm/gtx/matrix_major_storage.hpp [new file with mode: 0644]
glm/gtx/matrix_major_storage.inl [new file with mode: 0644]
glm/gtx/matrix_operation.hpp [new file with mode: 0644]
glm/gtx/matrix_operation.inl [new file with mode: 0644]
glm/gtx/matrix_projection.hpp [new file with mode: 0644]
glm/gtx/matrix_projection.inl [new file with mode: 0644]
glm/gtx/matrix_query.hpp [new file with mode: 0644]
glm/gtx/matrix_query.inl [new file with mode: 0644]
glm/gtx/matrix_selection.hpp [new file with mode: 0644]
glm/gtx/matrix_selection.inl [new file with mode: 0644]
glm/gtx/matx.hpp [new file with mode: 0644]
glm/gtx/matx.inl [new file with mode: 0644]
glm/gtx/mixed_product.hpp [new file with mode: 0644]
glm/gtx/mixed_product.inl [new file with mode: 0644]
glm/gtx/norm.hpp [new file with mode: 0644]
glm/gtx/norm.inl [new file with mode: 0644]
glm/gtx/normal.hpp [new file with mode: 0644]
glm/gtx/normal.inl [new file with mode: 0644]
glm/gtx/normalize_dot.hpp [new file with mode: 0644]
glm/gtx/normalize_dot.inl [new file with mode: 0644]
glm/gtx/number_precision.hpp [new file with mode: 0644]
glm/gtx/number_precision.inl [new file with mode: 0644]
glm/gtx/ocl_type.hpp [new file with mode: 0644]
glm/gtx/ocl_type.inl [new file with mode: 0644]
glm/gtx/optimum_pow.hpp [new file with mode: 0644]
glm/gtx/optimum_pow.inl [new file with mode: 0644]
glm/gtx/orthonormalize.hpp [new file with mode: 0644]
glm/gtx/orthonormalize.inl [new file with mode: 0644]
glm/gtx/perpendicular.hpp [new file with mode: 0644]
glm/gtx/perpendicular.inl [new file with mode: 0644]
glm/gtx/polar_coordinates.hpp [new file with mode: 0644]
glm/gtx/polar_coordinates.inl [new file with mode: 0644]
glm/gtx/projection.hpp [new file with mode: 0644]
glm/gtx/projection.inl [new file with mode: 0644]
glm/gtx/quaternion.hpp [new file with mode: 0644]
glm/gtx/quaternion.inl [new file with mode: 0644]
glm/gtx/random.hpp [new file with mode: 0644]
glm/gtx/random.inl [new file with mode: 0644]
glm/gtx/raw_data.hpp [new file with mode: 0644]
glm/gtx/raw_data.inl [new file with mode: 0644]
glm/gtx/reciprocal.hpp [new file with mode: 0644]
glm/gtx/reciprocal.inl [new file with mode: 0644]
glm/gtx/rotate_vector.hpp [new file with mode: 0644]
glm/gtx/rotate_vector.inl [new file with mode: 0644]
glm/gtx/simd_common.hpp [new file with mode: 0644]
glm/gtx/simd_common.inl [new file with mode: 0644]
glm/gtx/simd_geometric.hpp [new file with mode: 0644]
glm/gtx/simd_geometric.inl [new file with mode: 0644]
glm/gtx/simd_mat4.hpp [new file with mode: 0644]
glm/gtx/simd_mat4.inl [new file with mode: 0644]
glm/gtx/simd_vec4.hpp [new file with mode: 0644]
glm/gtx/simd_vec4.inl [new file with mode: 0644]
glm/gtx/spline.hpp [new file with mode: 0644]
glm/gtx/spline.inl [new file with mode: 0644]
glm/gtx/statistics_operation.hpp [new file with mode: 0644]
glm/gtx/statistics_operation.inl [new file with mode: 0644]
glm/gtx/std_based_type.hpp [new file with mode: 0644]
glm/gtx/std_based_type.inl [new file with mode: 0644]
glm/gtx/string_cast.hpp [new file with mode: 0644]
glm/gtx/string_cast.inl [new file with mode: 0644]
glm/gtx/transform.hpp [new file with mode: 0644]
glm/gtx/transform.inl [new file with mode: 0644]
glm/gtx/transform2.hpp [new file with mode: 0644]
glm/gtx/transform2.inl [new file with mode: 0644]
glm/gtx/type_ptr.hpp [new file with mode: 0644]
glm/gtx/type_ptr.inl [new file with mode: 0644]
glm/gtx/unsigned_int.hpp [new file with mode: 0644]
glm/gtx/unsigned_int.inl [new file with mode: 0644]
glm/gtx/vector_access.hpp [new file with mode: 0644]
glm/gtx/vector_access.inl [new file with mode: 0644]
glm/gtx/vector_angle.hpp [new file with mode: 0644]
glm/gtx/vector_angle.inl [new file with mode: 0644]
glm/gtx/vector_query.hpp [new file with mode: 0644]
glm/gtx/vector_query.inl [new file with mode: 0644]
glm/gtx/vecx.hpp [new file with mode: 0644]
glm/gtx/vecx.inl [new file with mode: 0644]
glm/gtx/verbose_operator.hpp [new file with mode: 0644]
glm/gtx/verbose_operator.inl [new file with mode: 0644]
glm/img.hpp [new file with mode: 0644]
glm/img/multiple.hpp [new file with mode: 0644]
glm/img/multiple.inl [new file with mode: 0644]
glm/setup.hpp [new file with mode: 0644]
glm/virtrev.hpp [new file with mode: 0644]
glm/virtrev/address.hpp [new file with mode: 0644]
glm/virtrev/equal_operator.hpp [new file with mode: 0644]
glm/virtrev/gl.hpp [new file with mode: 0644]
glm/virtrev/xstream.hpp [new file with mode: 0644]
md5view.pro
meshes/imp.md5mesh [new file with mode: 0644]
viewerwidget.cpp
viewerwidget.h

diff --git a/default.frag b/default.frag
new file mode 100644 (file)
index 0000000..4fa2df6
--- /dev/null
@@ -0,0 +1,10 @@
+#version 120
+// It was expressed that some drivers required this next line to function properly
+in  vec4 ex_Color;
+//out vec4 gl_FragColor;
+
+void main(void) {
+    // Pass through our original color with full opacity.
+    gl_FragColor = ex_Color;
+}
+
diff --git a/default.vert b/default.vert
new file mode 100644 (file)
index 0000000..7d8fa6a
--- /dev/null
@@ -0,0 +1,20 @@
+#version 120
+
+// in_Position was bound to attribute index 0 and in_Color was bound to attribute index 1
+in  vec3 in_Position;
+
+// We output the ex_Color variable to the next shader in the chain
+out vec4 ex_Color;
+void main(void) {
+    // Since we are using flat lines, our input only had two points: x and y.
+    // Set the Z coordinate to 0 and W coordinate to 1
+
+    gl_Position = vec4(in_Position, 1.0);
+
+    // GLSL allows shorthand use of vectors too, the following is also valid:
+    // gl_Position = vec4(in_Position, 0.0, 1.0);
+    // We're simply passing the color through unmodified
+
+    ex_Color = vec4(1.0,0.0,0.0,1.0);
+}
+
diff --git a/glm/GLM_GTX_associated_min_max.h b/glm/GLM_GTX_associated_min_max.h
new file mode 100644 (file)
index 0000000..fd11457
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_associated_min_max_api\r
+#define glm_gtx_associated_min_max_api\r
+\r
+#include "gtx/associated_min_max.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_associated_min_max;\r
+}\r
+\r
+#endif//glm_gtx_associated_min_max_api\r
diff --git a/glm/GLM_GTX_bit.h b/glm/GLM_GTX_bit.h
new file mode 100644 (file)
index 0000000..c74283b
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_bit_api\r
+#define glm_gtx_bit_api\r
+\r
+#include "gtx/bit.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_bit;\r
+}\r
+\r
+#endif//glm_gtx_bit_api\r
diff --git a/glm/GLM_GTX_closest_point.h b/glm/GLM_GTX_closest_point.h
new file mode 100644 (file)
index 0000000..4340bf4
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_closest_point_api\r
+#define glm_gtx_closest_point_api\r
+\r
+#include "gtx/closest_point.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_closest_point;\r
+}\r
+\r
+#endif//glm_gtx_closest_point_api\r
diff --git a/glm/GLM_GTX_color_cast.h b/glm/GLM_GTX_color_cast.h
new file mode 100644 (file)
index 0000000..c03a8ce
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_color_cast_api\r
+#define glm_gtx_color_cast_api\r
+\r
+#include "gtx/color_cast.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_color_cast;\r
+}\r
+\r
+#endif//glm_gtx_color_cast_api\r
diff --git a/glm/GLM_GTX_color_space.h b/glm/GLM_GTX_color_space.h
new file mode 100644 (file)
index 0000000..1126890
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_color_space_api\r
+#define glm_gtx_color_space_api\r
+\r
+#include "gtx/color_space.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_color_space;\r
+}\r
+\r
+#endif//glm_gtx_color_space_api\r
diff --git a/glm/GLM_GTX_color_space_YCoCg.h b/glm/GLM_GTX_color_space_YCoCg.h
new file mode 100644 (file)
index 0000000..f0cb8ca
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-11-28\r
+// Updated : 2008-11-28\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_color_space_YCoCg_api\r
+#define glm_gtx_color_space_YCoCg_api\r
+\r
+#include "gtx/color_space_YCoCg.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_color_space_YCoCg;\r
+}\r
+\r
+#endif//glm_gtx_color_space_YCoCg_api\r
diff --git a/glm/GLM_GTX_comparison.h b/glm/GLM_GTX_comparison.h
new file mode 100644 (file)
index 0000000..35201b5
--- /dev/null
@@ -0,0 +1,16 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_comparison_api\r
+#define glm_gtx_comparison_api\r
+\r
+#include "gtx/comparison.hpp"\r
+\r
+using GLM_GTX_comparison;\r
+\r
+#endif//glm_gtx_comparison_api\r
diff --git a/glm/GLM_GTX_compatibility.h b/glm/GLM_GTX_compatibility.h
new file mode 100644 (file)
index 0000000..420ad2d
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_compatibility_api\r
+#define glm_gtx_compatibility_api\r
+\r
+#include "gtx/compatibility.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_compatibility;\r
+}\r
+\r
+#endif//glm_gtx_compatibility_api\r
diff --git a/glm/GLM_GTX_component_wise.h b/glm/GLM_GTX_component_wise.h
new file mode 100644 (file)
index 0000000..14a37f9
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_component_wise_api\r
+#define glm_gtx_component_wise_api\r
+\r
+#include "gtx/component_wise.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_component_wise;\r
+}\r
+\r
+#endif//glm_gtx_component_wise_api\r
diff --git a/glm/GLM_GTX_determinant.h b/glm/GLM_GTX_determinant.h
new file mode 100644 (file)
index 0000000..5e907ed
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_determinant_api\r
+#define glm_gtx_determinant_api\r
+\r
+#include "gtx/determinant.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_determinant;\r
+}\r
+\r
+#endif//glm_gtx_determinant_api\r
diff --git a/glm/GLM_GTX_double_float.h b/glm/GLM_GTX_double_float.h
new file mode 100644 (file)
index 0000000..b1ebaea
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_double_float_api\r
+#define glm_gtx_double_float_api\r
+\r
+#include "gtx/double_float.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_double_float;\r
+}\r
+\r
+#endif//glm_gtx_double_float_api\r
diff --git a/glm/GLM_GTX_epsilon.h b/glm/GLM_GTX_epsilon.h
new file mode 100644 (file)
index 0000000..04f18cc
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_epsilon_api\r
+#define glm_gtx_epsilon_api\r
+\r
+#include "gtx/epsilon.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_epsilon;\r
+}\r
+\r
+#endif//glm_gtx_epsilon_api\r
diff --git a/glm/GLM_GTX_euler_angles.h b/glm/GLM_GTX_euler_angles.h
new file mode 100644 (file)
index 0000000..f46d6b0
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_euler_angles_api\r
+#define glm_gtx_euler_angles_api\r
+\r
+#include "gtx/euler_angles.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_euler_angles;\r
+}\r
+\r
+#endif//glm_gtx_euler_angles_api\r
diff --git a/glm/GLM_GTX_extend.h b/glm/GLM_GTX_extend.h
new file mode 100644 (file)
index 0000000..0733632
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_extend_api\r
+#define glm_gtx_extend_api\r
+\r
+#include "gtx/extend.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_extend;\r
+}\r
+\r
+#endif//glm_gtx_extend_api\r
diff --git a/glm/GLM_GTX_extented_min_max.h b/glm/GLM_GTX_extented_min_max.h
new file mode 100644 (file)
index 0000000..79d42a7
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_extented_min_max_api\r
+#define glm_gtx_extented_min_max_api\r
+\r
+#include "gtx/extented_min_max.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_extented_min_max;\r
+}\r
+\r
+#endif//glm_gtx_extented_min_max_api\r
diff --git a/glm/GLM_GTX_fast_exponential.h b/glm/GLM_GTX_fast_exponential.h
new file mode 100644 (file)
index 0000000..61cf3ff
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_fast_exponential_api\r
+#define glm_gtx_fast_exponential_api\r
+\r
+#include "gtx/fast_exponential.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_fast_exponential;\r
+}\r
+\r
+#endif//glm_gtx_fast_exponential_api\r
diff --git a/glm/GLM_GTX_fast_square_root.h b/glm/GLM_GTX_fast_square_root.h
new file mode 100644 (file)
index 0000000..7204e3c
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_fast_square_root_api\r
+#define glm_gtx_fast_square_root_api\r
+\r
+#include "gtx/fast_square_root.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_fast_square_root;\r
+}\r
+\r
+#endif//glm_gtx_fast_square_root_api\r
diff --git a/glm/GLM_GTX_fast_trigonometry.h b/glm/GLM_GTX_fast_trigonometry.h
new file mode 100644 (file)
index 0000000..eeca38c
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_fast_trigonometry_api\r
+#define glm_gtx_fast_trigonometry_api\r
+\r
+#include "gtx/fast_trigonometry.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_fast_trigonometry;\r
+}\r
+\r
+#endif//glm_gtx_fast_trigonometry_api\r
diff --git a/glm/GLM_GTX_gradient_paint.h b/glm/GLM_GTX_gradient_paint.h
new file mode 100644 (file)
index 0000000..ba4d051
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-03-06\r
+// Updated : 2009-03-09\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_gradient_paint_api\r
+#define glm_gtx_gradient_paint_api\r
+\r
+#include "gtx/gradient_paint.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_gradient_paint;\r
+}\r
+\r
+#endif//glm_gtx_gradient_paint_api\r
diff --git a/glm/GLM_GTX_half_float.h b/glm/GLM_GTX_half_float.h
new file mode 100644 (file)
index 0000000..1485c1e
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_half_float_api\r
+#define glm_gtx_half_float_api\r
+\r
+#include "gtx/half_float.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_half_float;\r
+}\r
+\r
+#endif//glm_gtx_half_float_api\r
diff --git a/glm/GLM_GTX_handed_coordinate_space.h b/glm/GLM_GTX_handed_coordinate_space.h
new file mode 100644 (file)
index 0000000..9959c2a
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_handed_coordinate_space_api\r
+#define glm_gtx_handed_coordinate_space_api\r
+\r
+#include "gtx/handed_coordinate_space.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_handed_coordinate_space;\r
+}\r
+\r
+#endif//glm_gtx_handed_coordinate_space_api\r
diff --git a/glm/GLM_GTX_inertia.h b/glm/GLM_GTX_inertia.h
new file mode 100644 (file)
index 0000000..0f4a641
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_inertia_api\r
+#define glm_gtx_inertia_api\r
+\r
+#include "gtx/inertia.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_inertia;\r
+}\r
+\r
+#endif//glm_gtx_inertia_api\r
diff --git a/glm/GLM_GTX_integer.h b/glm/GLM_GTX_integer.h
new file mode 100644 (file)
index 0000000..1fca9e6
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_integer_api\r
+#define glm_gtx_integer_api\r
+\r
+#include "gtx/integer.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_integer;\r
+}\r
+\r
+#endif//glm_gtx_integer_api\r
diff --git a/glm/GLM_GTX_intersect.h b/glm/GLM_GTX_intersect.h
new file mode 100644 (file)
index 0000000..0ebff41
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_intersect_api\r
+#define glm_gtx_intersect_api\r
+\r
+#include "gtx/intersect.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_intersect;\r
+}\r
+\r
+#endif//glm_gtx_intersect_api\r
diff --git a/glm/GLM_GTX_inverse.h b/glm/GLM_GTX_inverse.h
new file mode 100644 (file)
index 0000000..4557727
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_inverse_api\r
+#define glm_gtx_inverse_api\r
+\r
+#include "gtx/inverse.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_inverse;\r
+}\r
+\r
+#endif//glm_gtx_inverse_api\r
diff --git a/glm/GLM_GTX_inverse_transpose.h b/glm/GLM_GTX_inverse_transpose.h
new file mode 100644 (file)
index 0000000..230d952
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_inverse_transpose_api\r
+#define glm_gtx_inverse_transpose_api\r
+\r
+#include "gtx/inverse_transpose.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_inverse_transpose;\r
+}\r
+\r
+#endif//glm_gtx_inverse_transpose_api\r
diff --git a/glm/GLM_GTX_log_base.h b/glm/GLM_GTX_log_base.h
new file mode 100644 (file)
index 0000000..f2af52a
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-27\r
+// Updated : 2008-10-27\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_log_base_api\r
+#define glm_gtx_log_base_api\r
+\r
+#include "gtx/log_base.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_log_base;\r
+}\r
+\r
+#endif//glm_gtx_log_base_api\r
diff --git a/glm/GLM_GTX_matrix_access.h b/glm/GLM_GTX_matrix_access.h
new file mode 100644 (file)
index 0000000..07141e3
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_access_api\r
+#define glm_gtx_matrix_access_api\r
+\r
+#include "gtx/matrix_access.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_matrix_access;\r
+}\r
+\r
+#endif//glm_gtx_matrix_access_api\r
diff --git a/glm/GLM_GTX_matrix_cross_product.h b/glm/GLM_GTX_matrix_cross_product.h
new file mode 100644 (file)
index 0000000..9a0fefd
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_cross_product_api\r
+#define glm_gtx_matrix_cross_product_api\r
+\r
+#include "gtx/matrix_cross_product.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_matrix_cross_product;\r
+}\r
+\r
+#endif//glm_gtx_matrix_cross_product_api\r
diff --git a/glm/GLM_GTX_matrix_major_storage.h b/glm/GLM_GTX_matrix_major_storage.h
new file mode 100644 (file)
index 0000000..3dcb1ed
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_major_storage_api\r
+#define glm_gtx_matrix_major_storage_api\r
+\r
+#include "gtx/matrix_major_storage.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_matrix_major_storage;\r
+}\r
+\r
+#endif//glm_gtx_matrix_major_storage_api\r
diff --git a/glm/GLM_GTX_matrix_projection.h b/glm/GLM_GTX_matrix_projection.h
new file mode 100644 (file)
index 0000000..11b365d
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_projection_api\r
+#define glm_gtx_matrix_projection_api\r
+\r
+#include "gtx/matrix_projection.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_matrix_projection;\r
+}\r
+\r
+#endif//glm_gtx_matrix_projection_api\r
diff --git a/glm/GLM_GTX_matrix_query.h b/glm/GLM_GTX_matrix_query.h
new file mode 100644 (file)
index 0000000..e6266eb
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_query_api\r
+#define glm_gtx_matrix_query_api\r
+\r
+#include "gtx/matrix_query.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_matrix_query;\r
+}\r
+\r
+#endif//glm_gtx_matrix_query_api\r
diff --git a/glm/GLM_GTX_matrix_selection.h b/glm/GLM_GTX_matrix_selection.h
new file mode 100644 (file)
index 0000000..9f8cf28
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_selection_api\r
+#define glm_gtx_matrix_selection_api\r
+\r
+#include "gtx/matrix_selection.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_matrix_selection;\r
+}\r
+\r
+#endif//glm_gtx_matrix_selection_api\r
diff --git a/glm/GLM_GTX_mixed_product.h b/glm/GLM_GTX_mixed_product.h
new file mode 100644 (file)
index 0000000..115a7ee
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_mixed_product_api\r
+#define glm_gtx_mixed_product_api\r
+\r
+#include "gtx/mixed_product.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_mixed_product;\r
+}\r
+\r
+#endif//glm_gtx_mixed_product_api\r
diff --git a/glm/GLM_GTX_norm.h b/glm/GLM_GTX_norm.h
new file mode 100644 (file)
index 0000000..457dce1
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2009-01-16\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_norm_api\r
+#define glm_gtx_norm_api\r
+\r
+#include "gtx/norm.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_norm;\r
+}\r
+\r
+#endif//glm_gtx_norm_api\r
diff --git a/glm/GLM_GTX_normal.h b/glm/GLM_GTX_normal.h
new file mode 100644 (file)
index 0000000..2f2a633
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_normal_api\r
+#define glm_gtx_normal_api\r
+\r
+#include "gtx/normal.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_normal;\r
+}\r
+\r
+#endif//glm_gtx_normal_api\r
diff --git a/glm/GLM_GTX_normalize_dot.h b/glm/GLM_GTX_normalize_dot.h
new file mode 100644 (file)
index 0000000..9303833
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_normalize_dot_api\r
+#define glm_gtx_normalize_dot_api\r
+\r
+#include "gtx/normalize_dot.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_normalize_dot;\r
+}\r
+\r
+#endif//glm_gtx_normalize_dot_api\r
diff --git a/glm/GLM_GTX_number_precision.h b/glm/GLM_GTX_number_precision.h
new file mode 100644 (file)
index 0000000..606fbfc
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_number_precision_api\r
+#define glm_gtx_number_precision_api\r
+\r
+#include "gtx/number_precision.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_number_precision;\r
+}\r
+\r
+#endif//glm_gtx_number_precision_api\r
diff --git a/glm/GLM_GTX_optimum_pow.h b/glm/GLM_GTX_optimum_pow.h
new file mode 100644 (file)
index 0000000..1c27ca1
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_optimum_pow_api\r
+#define glm_gtx_optimum_pow_api\r
+\r
+#include "gtx/optimum_pow.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_optimum_pow;\r
+}\r
+\r
+#endif//glm_gtx_optimum_pow_api\r
diff --git a/glm/GLM_GTX_orthonormalize.h b/glm/GLM_GTX_orthonormalize.h
new file mode 100644 (file)
index 0000000..b9ee4b9
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_orthonormalize_api\r
+#define glm_gtx_orthonormalize_api\r
+\r
+#include "gtx/orthonormalize.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_orthonormalize;\r
+}\r
+\r
+#endif//glm_gtx_orthonormalize_api\r
diff --git a/glm/GLM_GTX_perpendicular.h b/glm/GLM_GTX_perpendicular.h
new file mode 100644 (file)
index 0000000..241f624
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_perpendicular_api\r
+#define glm_gtx_perpendicular_api\r
+\r
+#include "gtx/perpendicular.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_perpendicular;\r
+}\r
+\r
+#endif//glm_gtx_perpendicular_api\r
diff --git a/glm/GLM_GTX_polar_coordinates.h b/glm/GLM_GTX_polar_coordinates.h
new file mode 100644 (file)
index 0000000..f7113e1
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_polar_coordinates_api\r
+#define glm_gtx_polar_coordinates_api\r
+\r
+#include "gtx/polar_coordinates.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_polar_coordinates;\r
+}\r
+\r
+#endif//glm_gtx_polar_coordinates_api\r
diff --git a/glm/GLM_GTX_projection.h b/glm/GLM_GTX_projection.h
new file mode 100644 (file)
index 0000000..35090b4
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_projection_api\r
+#define glm_gtx_projection_api\r
+\r
+#include "gtx/projection.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_projection;\r
+}\r
+\r
+#endif//glm_gtx_projection_api\r
diff --git a/glm/GLM_GTX_quaternion.h b/glm/GLM_GTX_quaternion.h
new file mode 100644 (file)
index 0000000..8bdd7a2
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_quaternion_api\r
+#define glm_gtx_quaternion_api\r
+\r
+#include "gtx/quaternion.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_quaternion;\r
+}\r
+\r
+#endif//glm_gtx_quaternion_api\r
diff --git a/glm/GLM_GTX_random.h b/glm/GLM_GTX_random.h
new file mode 100644 (file)
index 0000000..d95218f
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_random_api\r
+#define glm_gtx_random_api\r
+\r
+#include "gtx/random.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_random;\r
+}\r
+\r
+#endif//glm_gtx_random_api\r
diff --git a/glm/GLM_GTX_raw_data.h b/glm/GLM_GTX_raw_data.h
new file mode 100644 (file)
index 0000000..9a5c1e1
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-11-19\r
+// Updated : 2008-11-19\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_raw_data_api\r
+#define glm_gtx_raw_data_api\r
+\r
+#include "gtx/raw_data.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_raw_data;\r
+}\r
+\r
+#endif//glm_gtx_raw_data_api\r
diff --git a/glm/GLM_GTX_reciprocal.h b/glm/GLM_GTX_reciprocal.h
new file mode 100644 (file)
index 0000000..cc34a59
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_reciprocal_api\r
+#define glm_gtx_reciprocal_api\r
+\r
+#include "gtx/reciprocal.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_reciprocal;\r
+}\r
+\r
+#endif//glm_gtx_reciprocal_api\r
diff --git a/glm/GLM_GTX_rotate_vector.h b/glm/GLM_GTX_rotate_vector.h
new file mode 100644 (file)
index 0000000..194f1ee
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_rotate_vector_api\r
+#define glm_gtx_rotate_vector_api\r
+\r
+#include "gtx/rotate_vector.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_rotate_vector;\r
+}\r
+\r
+#endif//glm_gtx_rotate_vector_api\r
diff --git a/glm/GLM_GTX_spline.h b/glm/GLM_GTX_spline.h
new file mode 100644 (file)
index 0000000..164f58b
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_spline_api\r
+#define glm_gtx_spline_api\r
+\r
+#include "gtx/spline.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_spline;\r
+}\r
+\r
+#endif//glm_gtx_spline_api\r
diff --git a/glm/GLM_GTX_std_based_type.h b/glm/GLM_GTX_std_based_type.h
new file mode 100644 (file)
index 0000000..51f3472
--- /dev/null
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_std_based_type_api\r
+#define glm_gtx_std_based_type_api\r
+\r
+#include "gtx/std_based_type.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_std_based_type;\r
+}\r
+\r
+#endif//glm_gtx_std_based_type_api\r
diff --git a/glm/GLM_GTX_string_cast.h b/glm/GLM_GTX_string_cast.h
new file mode 100644 (file)
index 0000000..5460e17
--- /dev/null
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_double_float\r
+// - GLM_GTX_half_float\r
+// - GLM_GTX_quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_string_cast_api\r
+#define glm_gtx_string_cast_api\r
+\r
+#include "gtx/string_cast.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_string_cast;\r
+}\r
+\r
+#endif//glm_gtx_string_cast_api\r
diff --git a/glm/GLM_GTX_transform.h b/glm/GLM_GTX_transform.h
new file mode 100644 (file)
index 0000000..86ff64e
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_transform_api\r
+#define glm_gtx_transform_api\r
+\r
+#include "gtx/transform.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_transform;\r
+}\r
+\r
+#endif//glm_gtx_transform_api\r
diff --git a/glm/GLM_GTX_transform2.h b/glm/GLM_GTX_transform2.h
new file mode 100644 (file)
index 0000000..e41d769
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_transform2_api\r
+#define glm_gtx_transform2_api\r
+\r
+#include "gtx/transform2.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_transform2;\r
+}\r
+\r
+#endif//glm_gtx_transform2_api\r
diff --git a/glm/GLM_GTX_unsigned_int.h b/glm/GLM_GTX_unsigned_int.h
new file mode 100644 (file)
index 0000000..ef15384
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_unsigned_int_api\r
+#define glm_gtx_unsigned_int_api\r
+\r
+#include "gtx/unsigned_int.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_unsigned_int;\r
+}\r
+\r
+#endif//glm_gtx_unsigned_int_api\r
diff --git a/glm/GLM_GTX_vector_access.h b/glm/GLM_GTX_vector_access.h
new file mode 100644 (file)
index 0000000..772d817
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_vector_access_api\r
+#define glm_gtx_vector_access_api\r
+\r
+#include "gtx/vector_access.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_vector_access;\r
+}\r
+\r
+#endif//glm_gtx_vector_access_api\r
diff --git a/glm/GLM_GTX_vector_angle.h b/glm/GLM_GTX_vector_angle.h
new file mode 100644 (file)
index 0000000..817b17a
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_vector_angle_api\r
+#define glm_gtx_vector_angle_api\r
+\r
+#include "gtx/vector_angle.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_vector_angle;\r
+}\r
+\r
+#endif//glm_gtx_vector_angle_api\r
diff --git a/glm/GLM_GTX_vector_query.h b/glm/GLM_GTX_vector_query.h
new file mode 100644 (file)
index 0000000..ceec1a2
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_vector_query_api\r
+#define glm_gtx_vector_query_api\r
+\r
+#include "gtx/vector_query.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_vector_query;\r
+}\r
+\r
+#endif//glm_gtx_vector_query_api\r
diff --git a/glm/GLM_GTX_verbose_operator.h b/glm/GLM_GTX_verbose_operator.h
new file mode 100644 (file)
index 0000000..94f2e26
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_verbose_operator_api\r
+#define glm_gtx_verbose_operator_api\r
+\r
+#include "gtx/verbose_operator.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_GTX_verbose_operator;\r
+}\r
+\r
+#endif//glm_gtx_verbose_operator_api\r
diff --git a/glm/GLM_VIRTREV_address.h b/glm/GLM_VIRTREV_address.h
new file mode 100644 (file)
index 0000000..ee3a3a5
--- /dev/null
@@ -0,0 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_virtrev_address_api\r
+#define glm_virtrev_address_api\r
+\r
+#include "virtrev/address.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_VIRTREV_address;\r
+}\r
+\r
+#endif//glm_virtrev_address_api\r
+\r
diff --git a/glm/GLM_VIRTREV_equal_operator.h b/glm/GLM_VIRTREV_equal_operator.h
new file mode 100644 (file)
index 0000000..d2ad8bf
--- /dev/null
@@ -0,0 +1,16 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_virtrev_equal_operator_api\r
+#define glm_virtrev_equal_operator_api\r
+\r
+#include "virtrev/gl.hpp"\r
+\r
+using namespace glm::virtrev_glmext::equal_operator;\r
+\r
+#endif//glm_virtrev_equal_operator_api\r
diff --git a/glm/GLM_VIRTREV_gl.h b/glm/GLM_VIRTREV_gl.h
new file mode 100644 (file)
index 0000000..1d0c3d0
--- /dev/null
@@ -0,0 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_virtrev_gl_api\r
+#define glm_virtrev_gl_api\r
+\r
+#include "virtrev/gl.hpp"\r
+\r
+namespace glm\r
+{\r
+       using namespace virtrev_glmext::gl;\r
+}\r
+\r
+#endif//glm_virtrev_gl_api\r
+\r
diff --git a/glm/GLM_VIRTREV_xstream.h b/glm/GLM_VIRTREV_xstream.h
new file mode 100644 (file)
index 0000000..91e0da0
--- /dev/null
@@ -0,0 +1,19 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-22\r
+// Updated : 2008-10-22\r
+// Licence : This source is under MIT License\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_virtrev_xstream_api\r
+#define glm_virtrev_xstream_api\r
+\r
+#include "virtrev/xstream.hpp"\r
+\r
+namespace glm\r
+{\r
+       using GLM_VIRTREV_xstream;\r
+}\r
+\r
+#endif//glm_virtrev_xstream_api\r
diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp
new file mode 100644 (file)
index 0000000..7e6adec
--- /dev/null
@@ -0,0 +1,327 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-07-24\r
+// Updated : 2008-08-31\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/_detail.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_detail\r
+#define glm_core_detail\r
+\r
+#include "../setup.hpp"\r
+#include <cassert>\r
+\r
+//#define valType                      typename genType::value_type\r
+//#define valType_cref typename genType::value_type const &\r
+//#define genType_cref typename genType const &\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       class thalf;\r
+\r
+#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))\r
+       typedef signed __int64                                          sint64;\r
+       typedef unsigned __int64                                        uint64;\r
+#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC))\r
+       __extension__ typedef signed long long          sint64;\r
+       __extension__ typedef unsigned long long        uint64;\r
+#else//unknown compiler\r
+       typedef signed long                                                     sint64;\r
+       typedef unsigned long                                           uint64;\r
+#endif//GLM_COMPILER\r
+\r
+       template<bool C>\r
+       struct If\r
+       {\r
+               template<typename F, typename T>\r
+               static inline T apply(F functor, const T& val)\r
+               {\r
+                       return functor(val);\r
+               }\r
+       };\r
+\r
+       template<>\r
+       struct If<false>\r
+       {\r
+               template<typename F, typename T>\r
+               static inline T apply(F, const T& val)\r
+               {\r
+                       return val;\r
+               }\r
+       };\r
+\r
+       //template <typename T>\r
+       //struct traits\r
+       //{\r
+       //      static const bool is_signed = false;\r
+       //      static const bool is_float = false;\r
+       //      static const bool is_vector = false;\r
+       //      static const bool is_matrix = false;\r
+       //      static const bool is_genType = false;\r
+       //      static const bool is_genIType = false;\r
+       //      static const bool is_genUType = false;\r
+       //};\r
+\r
+       //template <>\r
+       //struct traits<half>\r
+       //{\r
+       //      static const bool is_float = true;\r
+       //      static const bool is_genType = true;\r
+       //};\r
+\r
+       //template <>\r
+       //struct traits<float>\r
+       //{\r
+       //      static const bool is_float = true;\r
+       //      static const bool is_genType = true;\r
+       //};\r
+\r
+       //template <>\r
+       //struct traits<double>\r
+       //{\r
+       //      static const bool is_float = true;\r
+       //      static const bool is_genType = true;\r
+       //};\r
+\r
+       //template <typename genType>\r
+       //struct desc\r
+       //{\r
+       //      typedef genType                                                 type;\r
+       //      typedef genType *                                               pointer;\r
+       //      typedef genType const*                                  const_pointer;\r
+       //      typedef genType const *const                    const_pointer_const;\r
+       //      typedef genType *const                                  pointer_const;\r
+       //      typedef genType &                                               reference;\r
+       //      typedef genType const&                                  const_reference;\r
+       //      typedef genType const&                                  param_type;\r
+\r
+       //      typedef typename genType::value_type    value_type;\r
+       //      typedef typename genType::size_type             size_type;\r
+       //      static const typename size_type                 value_size;\r
+       //};\r
+\r
+       //template <typename genType>\r
+       //const typename desc<genType>::size_type desc<genType>::value_size = genType::value_size();\r
+\r
+       union uif32\r
+       {\r
+               uif32() :\r
+                       i(0)\r
+               {}\r
+\r
+               uif32(float f) :\r
+                       f(f)\r
+               {}\r
+\r
+               uif32(unsigned int i) :\r
+                       i(i)\r
+               {}\r
+\r
+               float f;\r
+               unsigned int i;\r
+       };\r
+\r
+       union uif64\r
+       {\r
+               uif64() :\r
+                       i(0)\r
+               {}\r
+\r
+               uif64(double f) :\r
+                       f(f)\r
+               {}\r
+\r
+               uif64(uint64 i) :\r
+                       i(i)\r
+               {}\r
+\r
+               double f;\r
+               uint64 i;\r
+       };\r
+\r
+       typedef uif32 uif;\r
+\r
+       //////////////////\r
+       // int\r
+\r
+       template <typename T>\r
+       struct is_int\r
+       {\r
+               enum is_int_enum\r
+               {\r
+                       YES = 0,\r
+                       NO = 1\r
+               };\r
+       };\r
+\r
+#define GLM_DETAIL_IS_INT(T)   \\r
+       template <>                                     \\r
+       struct is_int<T>                        \\r
+       {                                                       \\r
+               enum is_int_enum                \\r
+               {                                               \\r
+                       YES = 1,                        \\r
+                       NO = 0                          \\r
+               };                                              \\r
+       }\r
+\r
+       //////////////////\r
+       // uint\r
+\r
+       template <typename T>\r
+       struct is_uint\r
+       {\r
+               enum is_uint_enum\r
+               {\r
+                       YES = 0,\r
+                       NO = 1\r
+               };\r
+       };\r
+\r
+#define GLM_DETAIL_IS_UINT(T)  \\r
+       template <>                                     \\r
+       struct is_uint<T>                       \\r
+       {                                                       \\r
+               enum is_uint_enum               \\r
+               {                                               \\r
+                       YES = 1,                        \\r
+                       NO = 0                          \\r
+               };                                              \\r
+       }\r
+\r
+       //GLM_DETAIL_IS_UINT(unsigned long long)\r
+\r
+       //////////////////\r
+       // float\r
+\r
+       template <typename T>\r
+       struct is_float\r
+       {\r
+               enum is_float_enum\r
+               {\r
+                       YES = 0,\r
+                       NO = 1\r
+               };\r
+       };\r
+\r
+#define GLM_DETAIL_IS_FLOAT(T) \\r
+       template <>                                     \\r
+       struct is_float<T>                      \\r
+       {                                                       \\r
+               enum is_float_enum              \\r
+               {                                               \\r
+                       YES = 1,                        \\r
+                       NO = 0                          \\r
+               };                                              \\r
+       }\r
+\r
+       //////////////////\r
+       // bool\r
+\r
+       template <typename T>\r
+       struct is_bool\r
+       {\r
+               enum is_bool_enum\r
+               {\r
+                       YES = 0,\r
+                       NO = 1\r
+               };\r
+       };\r
+       \r
+       template <>\r
+       struct is_bool<bool>\r
+       {\r
+               enum is_bool_enum\r
+               {\r
+                       YES = 1,\r
+                       NO = 0\r
+               };\r
+       };\r
+       \r
+       //////////////////\r
+       // vector\r
+\r
+       template <typename T>\r
+       struct is_vector\r
+       {\r
+               enum is_vector_enum\r
+               {\r
+                       YES = 0,\r
+                       NO = 1\r
+               };\r
+       };\r
+\r
+#define GLM_DETAIL_IS_VECTOR(T)        \\r
+       template <>                                     \\r
+       struct is_vector                        \\r
+       {                                                       \\r
+               enum is_vector_enum             \\r
+               {                                               \\r
+                       YES = 1,                        \\r
+                       NO = 0                          \\r
+               };                                              \\r
+       }\r
+\r
+       //////////////////\r
+       // matrix\r
+\r
+       template <typename T>\r
+       struct is_matrix\r
+       {\r
+               enum is_matrix_enum\r
+               {\r
+                       YES = 0,\r
+                       NO = 1\r
+               };\r
+       };\r
+\r
+#define GLM_DETAIL_IS_MATRIX(T)        \\r
+       template <>                                     \\r
+       struct is_matrix                        \\r
+       {                                                       \\r
+               enum is_matrix_enum             \\r
+               {                                               \\r
+                       YES = 1,                        \\r
+                       NO = 0                          \\r
+               };                                              \\r
+       }\r
+\r
+       //////////////////\r
+       // type\r
+\r
+       template <typename T>\r
+       struct type\r
+       {\r
+               enum type_enum\r
+               {\r
+                       is_float = is_float<T>::YES,\r
+                       is_int = is_int<T>::YES,\r
+                       is_uint = is_uint<T>::YES,\r
+                       is_bool = is_bool<T>::YES\r
+               };\r
+       };\r
+\r
+       //////////////////\r
+       // type\r
+\r
+       typedef signed char                                                     int8;\r
+       typedef signed short                                            int16;\r
+       typedef signed int                                                      int32;\r
+       typedef detail::sint64                                          int64;\r
+\r
+       typedef unsigned char                                           uint8;\r
+       typedef unsigned short                                          uint16;\r
+       typedef unsigned int                                            uint32;\r
+       typedef detail::uint64                                          uint64;\r
+\r
+       typedef detail::thalf                                           float16;\r
+       typedef float                                                           float32;\r
+       typedef double                                                          float64;\r
+\r
+}//namespace detail\r
+}//namespace glm\r
+\r
+#endif//glm_core_detail\r
diff --git a/glm/core/_swizzle.hpp b/glm/core/_swizzle.hpp
new file mode 100644 (file)
index 0000000..1fe9153
--- /dev/null
@@ -0,0 +1,1085 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-20\r
+// Updated : 2008-08-22\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/_swizzle.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_swizzle\r
+#define glm_core_swizzle\r
+\r
+namespace glm\r
+{\r
+       enum comp\r
+       {\r
+               X = 0,\r
+               R = 0,\r
+               S = 0,\r
+               Y = 1,\r
+               G = 1,\r
+               T = 1,\r
+               Z = 2,\r
+               B = 2,\r
+               P = 2,\r
+               W = 3,\r
+               A = 3,\r
+               Q = 3\r
+       };\r
+}//namespace glm\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)\r
+\r
+#define xx swizzle(glm::X, glm::X)\r
+#define yx swizzle(glm::Y, glm::X)\r
+#define zx swizzle(glm::Z, glm::X)\r
+#define wx swizzle(glm::W, glm::X)\r
+#define xy swizzle(glm::X, glm::Y)\r
+#define yy swizzle(glm::Y, glm::Y)\r
+#define zy swizzle(glm::Z, glm::Y)\r
+#define wy swizzle(glm::W, glm::Y)\r
+#define xz swizzle(glm::X, glm::Z)\r
+#define yz swizzle(glm::Y, glm::Z)\r
+#define zz swizzle(glm::Z, glm::Z)\r
+#define wz swizzle(glm::W, glm::Z)\r
+#define xw swizzle(glm::X, glm::W)\r
+#define yw swizzle(glm::Y, glm::W)\r
+#define zw swizzle(glm::Z, glm::W)\r
+#define ww swizzle(glm::W, glm::W)\r
+\r
+#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)\r
+\r
+#define rr swizzle(glm::X, glm::X)\r
+#define gr swizzle(glm::Y, glm::X)\r
+#define br swizzle(glm::Z, glm::X)\r
+#define ar swizzle(glm::W, glm::X)\r
+#define rg swizzle(glm::X, glm::Y)\r
+#define gg swizzle(glm::Y, glm::Y)\r
+#define bg swizzle(glm::Z, glm::Y)\r
+#define ag swizzle(glm::W, glm::Y)\r
+#define rb swizzle(glm::X, glm::Z)\r
+#define gb swizzle(glm::Y, glm::Z)\r
+#define bb swizzle(glm::Z, glm::Z)\r
+#define ab swizzle(glm::W, glm::Z)\r
+#define ra swizzle(glm::X, glm::W)\r
+#define ga swizzle(glm::Y, glm::W)\r
+#define ba swizzle(glm::Z, glm::W)\r
+#define aa swizzle(glm::W, glm::W)\r
+\r
+#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)\r
+\r
+#define ss swizzle(glm::X, glm::X)\r
+#define ts swizzle(glm::Y, glm::X)\r
+#define ps swizzle(glm::Z, glm::X)\r
+#define qs swizzle(glm::W, glm::X)\r
+#define st swizzle(glm::X, glm::Y)\r
+#define tt swizzle(glm::Y, glm::Y)\r
+#define pt swizzle(glm::Z, glm::Y)\r
+#define qt swizzle(glm::W, glm::Y)\r
+#define sp swizzle(glm::X, glm::Z)\r
+#define tp swizzle(glm::Y, glm::Z)\r
+#define pp swizzle(glm::Z, glm::Z)\r
+#define qp swizzle(glm::W, glm::Z)\r
+#define sq swizzle(glm::X, glm::W)\r
+#define tq swizzle(glm::Y, glm::W)\r
+#define pq swizzle(glm::Z, glm::W)\r
+#define qq swizzle(glm::W, glm::W)\r
+\r
+#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)\r
+\r
+#define xxx swizzle(glm::X, glm::X, glm::X)\r
+#define yxx swizzle(glm::Y, glm::X, glm::X)\r
+#define zxx swizzle(glm::Z, glm::X, glm::X)\r
+#define wxx swizzle(glm::W, glm::X, glm::X)\r
+#define xyx swizzle(glm::X, glm::Y, glm::X)\r
+#define yyx swizzle(glm::Y, glm::Y, glm::X)\r
+#define zyx swizzle(glm::Z, glm::Y, glm::X)\r
+#define wyx swizzle(glm::W, glm::Y, glm::X)\r
+#define xzx swizzle(glm::X, glm::Z, glm::X)\r
+#define yzx swizzle(glm::Y, glm::Z, glm::X)\r
+#define zzx swizzle(glm::Z, glm::Z, glm::X)\r
+#define wzx swizzle(glm::W, glm::Z, glm::X)\r
+#define xwx swizzle(glm::X, glm::W, glm::X)\r
+#define ywx swizzle(glm::Y, glm::W, glm::X)\r
+#define zwx swizzle(glm::Z, glm::W, glm::X)\r
+#define wwx swizzle(glm::W, glm::W, glm::X)\r
+#define xxy swizzle(glm::X, glm::X, glm::Y)\r
+#define yxy swizzle(glm::Y, glm::X, glm::Y)\r
+#define zxy swizzle(glm::Z, glm::X, glm::Y)\r
+#define wxy swizzle(glm::W, glm::X, glm::Y)\r
+#define xyy swizzle(glm::X, glm::Y, glm::Y)\r
+#define yyy swizzle(glm::Y, glm::Y, glm::Y)\r
+#define zyy swizzle(glm::Z, glm::Y, glm::Y)\r
+#define wyy swizzle(glm::W, glm::Y, glm::Y)\r
+#define xzy swizzle(glm::X, glm::Z, glm::Y)\r
+#define yzy swizzle(glm::Y, glm::Z, glm::Y)\r
+#define zzy swizzle(glm::Z, glm::Z, glm::Y)\r
+#define wzy swizzle(glm::W, glm::Z, glm::Y)\r
+#define xwy swizzle(glm::X, glm::W, glm::Y)\r
+#define ywy swizzle(glm::Y, glm::W, glm::Y)\r
+#define zwy swizzle(glm::Z, glm::W, glm::Y)\r
+#define wwy swizzle(glm::W, glm::W, glm::Y)\r
+#define xxz swizzle(glm::X, glm::X, glm::Z)\r
+#define yxz swizzle(glm::Y, glm::X, glm::Z)\r
+#define zxz swizzle(glm::Z, glm::X, glm::Z)\r
+#define wxz swizzle(glm::W, glm::X, glm::Z)\r
+#define xyz swizzle(glm::X, glm::Y, glm::Z)\r
+#define yyz swizzle(glm::Y, glm::Y, glm::Z)\r
+#define zyz swizzle(glm::Z, glm::Y, glm::Z)\r
+#define wyz swizzle(glm::W, glm::Y, glm::Z)\r
+#define xzz swizzle(glm::X, glm::Z, glm::Z)\r
+#define yzz swizzle(glm::Y, glm::Z, glm::Z)\r
+#define zzz swizzle(glm::Z, glm::Z, glm::Z)\r
+#define wzz swizzle(glm::W, glm::Z, glm::Z)\r
+#define xwz swizzle(glm::X, glm::W, glm::Z)\r
+#define ywz swizzle(glm::Y, glm::W, glm::Z)\r
+#define zwz swizzle(glm::Z, glm::W, glm::Z)\r
+#define wwz swizzle(glm::W, glm::W, glm::Z)\r
+#define xxw swizzle(glm::X, glm::X, glm::W)\r
+#define yxw swizzle(glm::Y, glm::X, glm::W)\r
+#define zxw swizzle(glm::Z, glm::X, glm::W)\r
+#define wxw swizzle(glm::W, glm::X, glm::W)\r
+#define xyw swizzle(glm::X, glm::Y, glm::W)\r
+#define yyw swizzle(glm::Y, glm::Y, glm::W)\r
+#define zyw swizzle(glm::Z, glm::Y, glm::W)\r
+#define wyw swizzle(glm::W, glm::Y, glm::W)\r
+#define xzw swizzle(glm::X, glm::Z, glm::W)\r
+#define yzw swizzle(glm::Y, glm::Z, glm::W)\r
+#define zzw swizzle(glm::Z, glm::Z, glm::W)\r
+#define wzw swizzle(glm::W, glm::Z, glm::W)\r
+#define xww swizzle(glm::X, glm::W, glm::W)\r
+#define yww swizzle(glm::Y, glm::W, glm::W)\r
+#define zww swizzle(glm::Z, glm::W, glm::W)\r
+#define www swizzle(glm::W, glm::W, glm::W)\r
+\r
+#endif// defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)\r
+\r
+#define rrr swizzle(glm::X, glm::X, glm::X)\r
+#define grr swizzle(glm::Y, glm::X, glm::X)\r
+#define brr swizzle(glm::Z, glm::X, glm::X)\r
+#define arr swizzle(glm::W, glm::X, glm::X)\r
+#define rgr swizzle(glm::X, glm::Y, glm::X)\r
+#define ggr swizzle(glm::Y, glm::Y, glm::X)\r
+#define bgr swizzle(glm::Z, glm::Y, glm::X)\r
+#define agr swizzle(glm::W, glm::Y, glm::X)\r
+#define rbr swizzle(glm::X, glm::Z, glm::X)\r
+#define gbr swizzle(glm::Y, glm::Z, glm::X)\r
+#define bbr swizzle(glm::Z, glm::Z, glm::X)\r
+#define abr swizzle(glm::W, glm::Z, glm::X)\r
+#define rar swizzle(glm::X, glm::W, glm::X)\r
+#define gar swizzle(glm::Y, glm::W, glm::X)\r
+#define bar swizzle(glm::Z, glm::W, glm::X)\r
+#define aar swizzle(glm::W, glm::W, glm::X)\r
+#define rrg swizzle(glm::X, glm::X, glm::Y)\r
+#define grg swizzle(glm::Y, glm::X, glm::Y)\r
+#define brg swizzle(glm::Z, glm::X, glm::Y)\r
+#define arg swizzle(glm::W, glm::X, glm::Y)\r
+#define rgg swizzle(glm::X, glm::Y, glm::Y)\r
+#define ggg swizzle(glm::Y, glm::Y, glm::Y)\r
+#define bgg swizzle(glm::Z, glm::Y, glm::Y)\r
+#define agg swizzle(glm::W, glm::Y, glm::Y)\r
+#define rbg swizzle(glm::X, glm::Z, glm::Y)\r
+#define gbg swizzle(glm::Y, glm::Z, glm::Y)\r
+#define bbg swizzle(glm::Z, glm::Z, glm::Y)\r
+#define abg swizzle(glm::W, glm::Z, glm::Y)\r
+#define rag swizzle(glm::X, glm::W, glm::Y)\r
+#define gag swizzle(glm::Y, glm::W, glm::Y)\r
+#define bag swizzle(glm::Z, glm::W, glm::Y)\r
+#define aag swizzle(glm::W, glm::W, glm::Y)\r
+#define rrb swizzle(glm::X, glm::X, glm::Z)\r
+#define grb swizzle(glm::Y, glm::X, glm::Z)\r
+#define brb swizzle(glm::Z, glm::X, glm::Z)\r
+#define arb swizzle(glm::W, glm::X, glm::Z)\r
+#define rgb swizzle(glm::X, glm::Y, glm::Z)\r
+#define ggb swizzle(glm::Y, glm::Y, glm::Z)\r
+#define bgb swizzle(glm::Z, glm::Y, glm::Z)\r
+#define agb swizzle(glm::W, glm::Y, glm::Z)\r
+#define rbb swizzle(glm::X, glm::Z, glm::Z)\r
+#define gbb swizzle(glm::Y, glm::Z, glm::Z)\r
+#define bbb swizzle(glm::Z, glm::Z, glm::Z)\r
+#define abb swizzle(glm::W, glm::Z, glm::Z)\r
+#define rab swizzle(glm::X, glm::W, glm::Z)\r
+#define gab swizzle(glm::Y, glm::W, glm::Z)\r
+#define bab swizzle(glm::Z, glm::W, glm::Z)\r
+#define aab swizzle(glm::W, glm::W, glm::Z)\r
+#define rra swizzle(glm::X, glm::X, glm::W)\r
+#define gra swizzle(glm::Y, glm::X, glm::W)\r
+#define bra swizzle(glm::Z, glm::X, glm::W)\r
+#define ara swizzle(glm::W, glm::X, glm::W)\r
+#define rga swizzle(glm::X, glm::Y, glm::W)\r
+#define gga swizzle(glm::Y, glm::Y, glm::W)\r
+#define bga swizzle(glm::Z, glm::Y, glm::W)\r
+#define aga swizzle(glm::W, glm::Y, glm::W)\r
+#define rba swizzle(glm::X, glm::Z, glm::W)\r
+#define gba swizzle(glm::Y, glm::Z, glm::W)\r
+#define bba swizzle(glm::Z, glm::Z, glm::W)\r
+#define aba swizzle(glm::W, glm::Z, glm::W)\r
+#define raa swizzle(glm::X, glm::W, glm::W)\r
+#define gaa swizzle(glm::Y, glm::W, glm::W)\r
+#define baa swizzle(glm::Z, glm::W, glm::W)\r
+#define aaa swizzle(glm::W, glm::W, glm::W)\r
+\r
+#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)\r
+\r
+#define sss swizzle(glm::X, glm::X, glm::X)\r
+#define tss swizzle(glm::Y, glm::X, glm::X)\r
+#define pss swizzle(glm::Z, glm::X, glm::X)\r
+#define qss swizzle(glm::W, glm::X, glm::X)\r
+#define sts swizzle(glm::X, glm::Y, glm::X)\r
+#define tts swizzle(glm::Y, glm::Y, glm::X)\r
+#define pts swizzle(glm::Z, glm::Y, glm::X)\r
+#define qts swizzle(glm::W, glm::Y, glm::X)\r
+#define sps swizzle(glm::X, glm::Z, glm::X)\r
+#define tps swizzle(glm::Y, glm::Z, glm::X)\r
+#define pps swizzle(glm::Z, glm::Z, glm::X)\r
+#define qps swizzle(glm::W, glm::Z, glm::X)\r
+#define sqs swizzle(glm::X, glm::W, glm::X)\r
+#define tqs swizzle(glm::Y, glm::W, glm::X)\r
+#define pqs swizzle(glm::Z, glm::W, glm::X)\r
+#define qqs swizzle(glm::W, glm::W, glm::X)\r
+#define sst swizzle(glm::X, glm::X, glm::Y)\r
+#define tst swizzle(glm::Y, glm::X, glm::Y)\r
+#define pst swizzle(glm::Z, glm::X, glm::Y)\r
+#define qst swizzle(glm::W, glm::X, glm::Y)\r
+#define stt swizzle(glm::X, glm::Y, glm::Y)\r
+#define ttt swizzle(glm::Y, glm::Y, glm::Y)\r
+#define ptt swizzle(glm::Z, glm::Y, glm::Y)\r
+#define qtt swizzle(glm::W, glm::Y, glm::Y)\r
+#define spt swizzle(glm::X, glm::Z, glm::Y)\r
+#define tpt swizzle(glm::Y, glm::Z, glm::Y)\r
+#define ppt swizzle(glm::Z, glm::Z, glm::Y)\r
+#define qpt swizzle(glm::W, glm::Z, glm::Y)\r
+#define sqt swizzle(glm::X, glm::W, glm::Y)\r
+#define tqt swizzle(glm::Y, glm::W, glm::Y)\r
+#define pqt swizzle(glm::Z, glm::W, glm::Y)\r
+#define qqt swizzle(glm::W, glm::W, glm::Y)\r
+#define ssp swizzle(glm::X, glm::X, glm::Z)\r
+#define tsp swizzle(glm::Y, glm::X, glm::Z)\r
+#define psp swizzle(glm::Z, glm::X, glm::Z)\r
+#define qsp swizzle(glm::W, glm::X, glm::Z)\r
+#define stp swizzle(glm::X, glm::Y, glm::Z)\r
+#define ttp swizzle(glm::Y, glm::Y, glm::Z)\r
+#define ptp swizzle(glm::Z, glm::Y, glm::Z)\r
+#define qtp swizzle(glm::W, glm::Y, glm::Z)\r
+#define spp swizzle(glm::X, glm::Z, glm::Z)\r
+#define tpp swizzle(glm::Y, glm::Z, glm::Z)\r
+#define ppp swizzle(glm::Z, glm::Z, glm::Z)\r
+#define qpp swizzle(glm::W, glm::Z, glm::Z)\r
+#define sqp swizzle(glm::X, glm::W, glm::Z)\r
+#define tqp swizzle(glm::Y, glm::W, glm::Z)\r
+#define pqp swizzle(glm::Z, glm::W, glm::Z)\r
+#define qqp swizzle(glm::W, glm::W, glm::Z)\r
+#define ssq swizzle(glm::X, glm::X, glm::W)\r
+#define tsq swizzle(glm::Y, glm::X, glm::W)\r
+#define psq swizzle(glm::Z, glm::X, glm::W)\r
+#define qsq swizzle(glm::W, glm::X, glm::W)\r
+#define stq swizzle(glm::X, glm::Y, glm::W)\r
+#define ttq swizzle(glm::Y, glm::Y, glm::W)\r
+#define ptq swizzle(glm::Z, glm::Y, glm::W)\r
+#define qtq swizzle(glm::W, glm::Y, glm::W)\r
+#define spq swizzle(glm::X, glm::Z, glm::W)\r
+#define tpq swizzle(glm::Y, glm::Z, glm::W)\r
+#define ppq swizzle(glm::Z, glm::Z, glm::W)\r
+#define qpq swizzle(glm::W, glm::Z, glm::W)\r
+#define sqq swizzle(glm::X, glm::W, glm::W)\r
+#define tqq swizzle(glm::Y, glm::W, glm::W)\r
+#define pqq swizzle(glm::Z, glm::W, glm::W)\r
+#define qqq swizzle(glm::W, glm::W, glm::W)\r
+\r
+#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)\r
+\r
+#define xxxx swizzle(glm::X, glm::X, glm::X, glm::X)\r
+#define yxxx swizzle(glm::Y, glm::X, glm::X, glm::X)\r
+#define zxxx swizzle(glm::Z, glm::X, glm::X, glm::X)\r
+#define wxxx swizzle(glm::W, glm::X, glm::X, glm::X)\r
+#define xyxx swizzle(glm::X, glm::Y, glm::X, glm::X)\r
+#define yyxx swizzle(glm::Y, glm::Y, glm::X, glm::X)\r
+#define zyxx swizzle(glm::Z, glm::Y, glm::X, glm::X)\r
+#define wyxx swizzle(glm::W, glm::Y, glm::X, glm::X)\r
+#define xzxx swizzle(glm::X, glm::Z, glm::X, glm::X)\r
+#define yzxx swizzle(glm::Y, glm::Z, glm::X, glm::X)\r
+#define zzxx swizzle(glm::Z, glm::Z, glm::X, glm::X)\r
+#define wzxx swizzle(glm::W, glm::Z, glm::X, glm::X)\r
+#define xwxx swizzle(glm::X, glm::W, glm::X, glm::X)\r
+#define ywxx swizzle(glm::Y, glm::W, glm::X, glm::X)\r
+#define zwxx swizzle(glm::Z, glm::W, glm::X, glm::X)\r
+#define wwxx swizzle(glm::W, glm::W, glm::X, glm::X)\r
+#define xxyx swizzle(glm::X, glm::X, glm::Y, glm::X)\r
+#define yxyx swizzle(glm::Y, glm::X, glm::Y, glm::X)\r
+#define zxyx swizzle(glm::Z, glm::X, glm::Y, glm::X)\r
+#define wxyx swizzle(glm::W, glm::X, glm::Y, glm::X)\r
+#define xyyx swizzle(glm::X, glm::Y, glm::Y, glm::X)\r
+#define yyyx swizzle(glm::Y, glm::Y, glm::Y, glm::X)\r
+#define zyyx swizzle(glm::Z, glm::Y, glm::Y, glm::X)\r
+#define wyyx swizzle(glm::W, glm::Y, glm::Y, glm::X)\r
+#define xzyx swizzle(glm::X, glm::Z, glm::Y, glm::X)\r
+#define yzyx swizzle(glm::Y, glm::Z, glm::Y, glm::X)\r
+#define zzyx swizzle(glm::Z, glm::Z, glm::Y, glm::X)\r
+#define wzyx swizzle(glm::W, glm::Z, glm::Y, glm::X)\r
+#define xwyx swizzle(glm::X, glm::W, glm::Y, glm::X)\r
+#define ywyx swizzle(glm::Y, glm::W, glm::Y, glm::X)\r
+#define zwyx swizzle(glm::Z, glm::W, glm::Y, glm::X)\r
+#define wwyx swizzle(glm::W, glm::W, glm::Y, glm::X)\r
+#define xxzx swizzle(glm::X, glm::X, glm::Z, glm::X)\r
+#define yxzx swizzle(glm::Y, glm::X, glm::Z, glm::X)\r
+#define zxzx swizzle(glm::Z, glm::X, glm::Z, glm::X)\r
+#define wxzx swizzle(glm::W, glm::X, glm::Z, glm::X)\r
+#define xyzx swizzle(glm::X, glm::Y, glm::Z, glm::X)\r
+#define yyzx swizzle(glm::Y, glm::Y, glm::Z, glm::X)\r
+#define zyzx swizzle(glm::Z, glm::Y, glm::Z, glm::X)\r
+#define wyzx swizzle(glm::W, glm::Y, glm::Z, glm::X)\r
+#define xzzx swizzle(glm::X, glm::Z, glm::Z, glm::X)\r
+#define yzzx swizzle(glm::Y, glm::Z, glm::Z, glm::X)\r
+#define zzzx swizzle(glm::Z, glm::Z, glm::Z, glm::X)\r
+#define wzzx swizzle(glm::W, glm::Z, glm::Z, glm::X)\r
+#define xwzx swizzle(glm::X, glm::W, glm::Z, glm::X)\r
+#define ywzx swizzle(glm::Y, glm::W, glm::Z, glm::X)\r
+#define zwzx swizzle(glm::Z, glm::W, glm::Z, glm::X)\r
+#define wwzx swizzle(glm::W, glm::W, glm::Z, glm::X)\r
+#define xxwx swizzle(glm::X, glm::X, glm::W, glm::X)\r
+#define yxwx swizzle(glm::Y, glm::X, glm::W, glm::X)\r
+#define zxwx swizzle(glm::Z, glm::X, glm::W, glm::X)\r
+#define wxwx swizzle(glm::W, glm::X, glm::W, glm::X)\r
+#define xywx swizzle(glm::X, glm::Y, glm::W, glm::X)\r
+#define yywx swizzle(glm::Y, glm::Y, glm::W, glm::X)\r
+#define zywx swizzle(glm::Z, glm::Y, glm::W, glm::X)\r
+#define wywx swizzle(glm::W, glm::Y, glm::W, glm::X)\r
+#define xzwx swizzle(glm::X, glm::Z, glm::W, glm::X)\r
+#define yzwx swizzle(glm::Y, glm::Z, glm::W, glm::X)\r
+#define zzwx swizzle(glm::Z, glm::Z, glm::W, glm::X)\r
+#define wzwx swizzle(glm::W, glm::Z, glm::W, glm::X)\r
+#define xwwx swizzle(glm::X, glm::W, glm::W, glm::X)\r
+#define ywwx swizzle(glm::Y, glm::W, glm::W, glm::X)\r
+#define zwwx swizzle(glm::Z, glm::W, glm::W, glm::X)\r
+#define wwwx swizzle(glm::W, glm::W, glm::W, glm::X)\r
+#define xxxy swizzle(glm::X, glm::X, glm::X, glm::Y)\r
+#define yxxy swizzle(glm::Y, glm::X, glm::X, glm::Y)\r
+#define zxxy swizzle(glm::Z, glm::X, glm::X, glm::Y)\r
+#define wxxy swizzle(glm::W, glm::X, glm::X, glm::Y)\r
+#define xyxy swizzle(glm::X, glm::Y, glm::X, glm::Y)\r
+#define yyxy swizzle(glm::Y, glm::Y, glm::X, glm::Y)\r
+#define zyxy swizzle(glm::Z, glm::Y, glm::X, glm::Y)\r
+#define wyxy swizzle(glm::W, glm::Y, glm::X, glm::Y)\r
+#define xzxy swizzle(glm::X, glm::Z, glm::X, glm::Y)\r
+#define yzxy swizzle(glm::Y, glm::Z, glm::X, glm::Y)\r
+#define zzxy swizzle(glm::Z, glm::Z, glm::X, glm::Y)\r
+#define wzxy swizzle(glm::W, glm::Z, glm::X, glm::Y)\r
+#define xwxy swizzle(glm::X, glm::W, glm::X, glm::Y)\r
+#define ywxy swizzle(glm::Y, glm::W, glm::X, glm::Y)\r
+#define zwxy swizzle(glm::Z, glm::W, glm::X, glm::Y)\r
+#define wwxy swizzle(glm::W, glm::W, glm::X, glm::Y)\r
+#define xxyy swizzle(glm::X, glm::X, glm::Y, glm::Y)\r
+#define yxyy swizzle(glm::Y, glm::X, glm::Y, glm::Y)\r
+#define zxyy swizzle(glm::Z, glm::X, glm::Y, glm::Y)\r
+#define wxyy swizzle(glm::W, glm::X, glm::Y, glm::Y)\r
+#define xyyy swizzle(glm::X, glm::Y, glm::Y, glm::Y)\r
+#define yyyy swizzle(glm::Y, glm::Y, glm::Y, glm::Y)\r
+#define zyyy swizzle(glm::Z, glm::Y, glm::Y, glm::Y)\r
+#define wyyy swizzle(glm::W, glm::Y, glm::Y, glm::Y)\r
+#define xzyy swizzle(glm::X, glm::Z, glm::Y, glm::Y)\r
+#define yzyy swizzle(glm::Y, glm::Z, glm::Y, glm::Y)\r
+#define zzyy swizzle(glm::Z, glm::Z, glm::Y, glm::Y)\r
+#define wzyy swizzle(glm::W, glm::Z, glm::Y, glm::Y)\r
+#define xwyy swizzle(glm::X, glm::W, glm::Y, glm::Y)\r
+#define ywyy swizzle(glm::Y, glm::W, glm::Y, glm::Y)\r
+#define zwyy swizzle(glm::Z, glm::W, glm::Y, glm::Y)\r
+#define wwyy swizzle(glm::W, glm::W, glm::Y, glm::Y)\r
+#define xxzy swizzle(glm::X, glm::X, glm::Z, glm::Y)\r
+#define yxzy swizzle(glm::Y, glm::X, glm::Z, glm::Y)\r
+#define zxzy swizzle(glm::Z, glm::X, glm::Z, glm::Y)\r
+#define wxzy swizzle(glm::W, glm::X, glm::Z, glm::Y)\r
+#define xyzy swizzle(glm::X, glm::Y, glm::Z, glm::Y)\r
+#define yyzy swizzle(glm::Y, glm::Y, glm::Z, glm::Y)\r
+#define zyzy swizzle(glm::Z, glm::Y, glm::Z, glm::Y)\r
+#define wyzy swizzle(glm::W, glm::Y, glm::Z, glm::Y)\r
+#define xzzy swizzle(glm::X, glm::Z, glm::Z, glm::Y)\r
+#define yzzy swizzle(glm::Y, glm::Z, glm::Z, glm::Y)\r
+#define zzzy swizzle(glm::Z, glm::Z, glm::Z, glm::Y)\r
+#define wzzy swizzle(glm::W, glm::Z, glm::Z, glm::Y)\r
+#define xwzy swizzle(glm::X, glm::W, glm::Z, glm::Y)\r
+#define ywzy swizzle(glm::Y, glm::W, glm::Z, glm::Y)\r
+#define zwzy swizzle(glm::Z, glm::W, glm::Z, glm::Y)\r
+#define wwzy swizzle(glm::W, glm::W, glm::Z, glm::Y)\r
+#define xxwy swizzle(glm::X, glm::X, glm::W, glm::Y)\r
+#define yxwy swizzle(glm::Y, glm::X, glm::W, glm::Y)\r
+#define zxwy swizzle(glm::Z, glm::X, glm::W, glm::Y)\r
+#define wxwy swizzle(glm::W, glm::X, glm::W, glm::Y)\r
+#define xywy swizzle(glm::X, glm::Y, glm::W, glm::Y)\r
+#define yywy swizzle(glm::Y, glm::Y, glm::W, glm::Y)\r
+#define zywy swizzle(glm::Z, glm::Y, glm::W, glm::Y)\r
+#define wywy swizzle(glm::W, glm::Y, glm::W, glm::Y)\r
+#define xzwy swizzle(glm::X, glm::Z, glm::W, glm::Y)\r
+#define yzwy swizzle(glm::Y, glm::Z, glm::W, glm::Y)\r
+#define zzwy swizzle(glm::Z, glm::Z, glm::W, glm::Y)\r
+#define wzwy swizzle(glm::W, glm::Z, glm::W, glm::Y)\r
+#define xwwy swizzle(glm::X, glm::W, glm::W, glm::Y)\r
+#define ywwy swizzle(glm::Y, glm::W, glm::W, glm::Y)\r
+#define zwwy swizzle(glm::Z, glm::W, glm::W, glm::Y)\r
+#define wwwy swizzle(glm::W, glm::W, glm::W, glm::Y)\r
+#define xxxz swizzle(glm::X, glm::X, glm::X, glm::Z)\r
+#define yxxz swizzle(glm::Y, glm::X, glm::X, glm::Z)\r
+#define zxxz swizzle(glm::Z, glm::X, glm::X, glm::Z)\r
+#define wxxz swizzle(glm::W, glm::X, glm::X, glm::Z)\r
+#define xyxz swizzle(glm::X, glm::Y, glm::X, glm::Z)\r
+#define yyxz swizzle(glm::Y, glm::Y, glm::X, glm::Z)\r
+#define zyxz swizzle(glm::Z, glm::Y, glm::X, glm::Z)\r
+#define wyxz swizzle(glm::W, glm::Y, glm::X, glm::Z)\r
+#define xzxz swizzle(glm::X, glm::Z, glm::X, glm::Z)\r
+#define yzxz swizzle(glm::Y, glm::Z, glm::X, glm::Z)\r
+#define zzxz swizzle(glm::Z, glm::Z, glm::X, glm::Z)\r
+#define wzxz swizzle(glm::W, glm::Z, glm::X, glm::Z)\r
+#define xwxz swizzle(glm::X, glm::W, glm::X, glm::Z)\r
+#define ywxz swizzle(glm::Y, glm::W, glm::X, glm::Z)\r
+#define zwxz swizzle(glm::Z, glm::W, glm::X, glm::Z)\r
+#define wwxz swizzle(glm::W, glm::W, glm::X, glm::Z)\r
+#define xxyz swizzle(glm::X, glm::X, glm::Y, glm::Z)\r
+#define yxyz swizzle(glm::Y, glm::X, glm::Y, glm::Z)\r
+#define zxyz swizzle(glm::Z, glm::X, glm::Y, glm::Z)\r
+#define wxyz swizzle(glm::W, glm::X, glm::Y, glm::Z)\r
+#define xyyz swizzle(glm::X, glm::Y, glm::Y, glm::Z)\r
+#define yyyz swizzle(glm::Y, glm::Y, glm::Y, glm::Z)\r
+#define zyyz swizzle(glm::Z, glm::Y, glm::Y, glm::Z)\r
+#define wyyz swizzle(glm::W, glm::Y, glm::Y, glm::Z)\r
+#define xzyz swizzle(glm::X, glm::Z, glm::Y, glm::Z)\r
+#define yzyz swizzle(glm::Y, glm::Z, glm::Y, glm::Z)\r
+#define zzyz swizzle(glm::Z, glm::Z, glm::Y, glm::Z)\r
+#define wzyz swizzle(glm::W, glm::Z, glm::Y, glm::Z)\r
+#define xwyz swizzle(glm::X, glm::W, glm::Y, glm::Z)\r
+#define ywyz swizzle(glm::Y, glm::W, glm::Y, glm::Z)\r
+#define zwyz swizzle(glm::Z, glm::W, glm::Y, glm::Z)\r
+#define wwyz swizzle(glm::W, glm::W, glm::Y, glm::Z)\r
+#define xxzz swizzle(glm::X, glm::X, glm::Z, glm::Z)\r
+#define yxzz swizzle(glm::Y, glm::X, glm::Z, glm::Z)\r
+#define zxzz swizzle(glm::Z, glm::X, glm::Z, glm::Z)\r
+#define wxzz swizzle(glm::W, glm::X, glm::Z, glm::Z)\r
+#define xyzz swizzle(glm::X, glm::Y, glm::Z, glm::Z)\r
+#define yyzz swizzle(glm::Y, glm::Y, glm::Z, glm::Z)\r
+#define zyzz swizzle(glm::Z, glm::Y, glm::Z, glm::Z)\r
+#define wyzz swizzle(glm::W, glm::Y, glm::Z, glm::Z)\r
+#define xzzz swizzle(glm::X, glm::Z, glm::Z, glm::Z)\r
+#define yzzz swizzle(glm::Y, glm::Z, glm::Z, glm::Z)\r
+#define zzzz swizzle(glm::Z, glm::Z, glm::Z, glm::Z)\r
+#define wzzz swizzle(glm::W, glm::Z, glm::Z, glm::Z)\r
+#define xwzz swizzle(glm::X, glm::W, glm::Z, glm::Z)\r
+#define ywzz swizzle(glm::Y, glm::W, glm::Z, glm::Z)\r
+#define zwzz swizzle(glm::Z, glm::W, glm::Z, glm::Z)\r
+#define wwzz swizzle(glm::W, glm::W, glm::Z, glm::Z)\r
+#define xxwz swizzle(glm::X, glm::X, glm::W, glm::Z)\r
+#define yxwz swizzle(glm::Y, glm::X, glm::W, glm::Z)\r
+#define zxwz swizzle(glm::Z, glm::X, glm::W, glm::Z)\r
+#define wxwz swizzle(glm::W, glm::X, glm::W, glm::Z)\r
+#define xywz swizzle(glm::X, glm::Y, glm::W, glm::Z)\r
+#define yywz swizzle(glm::Y, glm::Y, glm::W, glm::Z)\r
+#define zywz swizzle(glm::Z, glm::Y, glm::W, glm::Z)\r
+#define wywz swizzle(glm::W, glm::Y, glm::W, glm::Z)\r
+#define xzwz swizzle(glm::X, glm::Z, glm::W, glm::Z)\r
+#define yzwz swizzle(glm::Y, glm::Z, glm::W, glm::Z)\r
+#define zzwz swizzle(glm::Z, glm::Z, glm::W, glm::Z)\r
+#define wzwz swizzle(glm::W, glm::Z, glm::W, glm::Z)\r
+#define xwwz swizzle(glm::X, glm::W, glm::W, glm::Z)\r
+#define ywwz swizzle(glm::Y, glm::W, glm::W, glm::Z)\r
+#define zwwz swizzle(glm::Z, glm::W, glm::W, glm::Z)\r
+#define wwwz swizzle(glm::W, glm::W, glm::W, glm::Z)\r
+#define xxxw swizzle(glm::X, glm::X, glm::X, glm::W)\r
+#define yxxw swizzle(glm::Y, glm::X, glm::X, glm::W)\r
+#define zxxw swizzle(glm::Z, glm::X, glm::X, glm::W)\r
+#define wxxw swizzle(glm::W, glm::X, glm::X, glm::W)\r
+#define xyxw swizzle(glm::X, glm::Y, glm::X, glm::W)\r
+#define yyxw swizzle(glm::Y, glm::Y, glm::X, glm::W)\r
+#define zyxw swizzle(glm::Z, glm::Y, glm::X, glm::W)\r
+#define wyxw swizzle(glm::W, glm::Y, glm::X, glm::W)\r
+#define xzxw swizzle(glm::X, glm::Z, glm::X, glm::W)\r
+#define yzxw swizzle(glm::Y, glm::Z, glm::X, glm::W)\r
+#define zzxw swizzle(glm::Z, glm::Z, glm::X, glm::W)\r
+#define wzxw swizzle(glm::W, glm::Z, glm::X, glm::W)\r
+#define xwxw swizzle(glm::X, glm::W, glm::X, glm::W)\r
+#define ywxw swizzle(glm::Y, glm::W, glm::X, glm::W)\r
+#define zwxw swizzle(glm::Z, glm::W, glm::X, glm::W)\r
+#define wwxw swizzle(glm::W, glm::W, glm::X, glm::W)\r
+#define xxyw swizzle(glm::X, glm::X, glm::Y, glm::W)\r
+#define yxyw swizzle(glm::Y, glm::X, glm::Y, glm::W)\r
+#define zxyw swizzle(glm::Z, glm::X, glm::Y, glm::W)\r
+#define wxyw swizzle(glm::W, glm::X, glm::Y, glm::W)\r
+#define xyyw swizzle(glm::X, glm::Y, glm::Y, glm::W)\r
+#define yyyw swizzle(glm::Y, glm::Y, glm::Y, glm::W)\r
+#define zyyw swizzle(glm::Z, glm::Y, glm::Y, glm::W)\r
+#define wyyw swizzle(glm::W, glm::Y, glm::Y, glm::W)\r
+#define xzyw swizzle(glm::X, glm::Z, glm::Y, glm::W)\r
+#define yzyw swizzle(glm::Y, glm::Z, glm::Y, glm::W)\r
+#define zzyw swizzle(glm::Z, glm::Z, glm::Y, glm::W)\r
+#define wzyw swizzle(glm::W, glm::Z, glm::Y, glm::W)\r
+#define xwyw swizzle(glm::X, glm::W, glm::Y, glm::W)\r
+#define ywyw swizzle(glm::Y, glm::W, glm::Y, glm::W)\r
+#define zwyw swizzle(glm::Z, glm::W, glm::Y, glm::W)\r
+#define wwyw swizzle(glm::W, glm::W, glm::Y, glm::W)\r
+#define xxzw swizzle(glm::X, glm::X, glm::Z, glm::W)\r
+#define yxzw swizzle(glm::Y, glm::X, glm::Z, glm::W)\r
+#define zxzw swizzle(glm::Z, glm::X, glm::Z, glm::W)\r
+#define wxzw swizzle(glm::W, glm::X, glm::Z, glm::W)\r
+#define xyzw swizzle(glm::X, glm::Y, glm::Z, glm::W)\r
+#define yyzw swizzle(glm::Y, glm::Y, glm::Z, glm::W)\r
+#define zyzw swizzle(glm::Z, glm::Y, glm::Z, glm::W)\r
+#define wyzw swizzle(glm::W, glm::Y, glm::Z, glm::W)\r
+#define xzzw swizzle(glm::X, glm::Z, glm::Z, glm::W)\r
+#define yzzw swizzle(glm::Y, glm::Z, glm::Z, glm::W)\r
+#define zzzw swizzle(glm::Z, glm::Z, glm::Z, glm::W)\r
+#define wzzw swizzle(glm::W, glm::Z, glm::Z, glm::W)\r
+#define xwzw swizzle(glm::X, glm::W, glm::Z, glm::W)\r
+#define ywzw swizzle(glm::Y, glm::W, glm::Z, glm::W)\r
+#define zwzw swizzle(glm::Z, glm::W, glm::Z, glm::W)\r
+#define wwzw swizzle(glm::W, glm::W, glm::Z, glm::W)\r
+#define xxww swizzle(glm::X, glm::X, glm::W, glm::W)\r
+#define yxww swizzle(glm::Y, glm::X, glm::W, glm::W)\r
+#define zxww swizzle(glm::Z, glm::X, glm::W, glm::W)\r
+#define wxww swizzle(glm::W, glm::X, glm::W, glm::W)\r
+#define xyww swizzle(glm::X, glm::Y, glm::W, glm::W)\r
+#define yyww swizzle(glm::Y, glm::Y, glm::W, glm::W)\r
+#define zyww swizzle(glm::Z, glm::Y, glm::W, glm::W)\r
+#define wyww swizzle(glm::W, glm::Y, glm::W, glm::W)\r
+#define xzww swizzle(glm::X, glm::Z, glm::W, glm::W)\r
+#define yzww swizzle(glm::Y, glm::Z, glm::W, glm::W)\r
+#define zzww swizzle(glm::Z, glm::Z, glm::W, glm::W)\r
+#define wzww swizzle(glm::W, glm::Z, glm::W, glm::W)\r
+#define xwww swizzle(glm::X, glm::W, glm::W, glm::W)\r
+#define ywww swizzle(glm::Y, glm::W, glm::W, glm::W)\r
+#define zwww swizzle(glm::Z, glm::W, glm::W, glm::W)\r
+#define wwww swizzle(glm::W, glm::W, glm::W, glm::W)\r
+\r
+#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_XYZW)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)\r
+\r
+#define rrrr swizzle(glm::X, glm::X, glm::X, glm::X)\r
+#define grrr swizzle(glm::Y, glm::X, glm::X, glm::X)\r
+#define brrr swizzle(glm::Z, glm::X, glm::X, glm::X)\r
+#define arrr swizzle(glm::W, glm::X, glm::X, glm::X)\r
+#define rgrr swizzle(glm::X, glm::Y, glm::X, glm::X)\r
+#define ggrr swizzle(glm::Y, glm::Y, glm::X, glm::X)\r
+#define bgrr swizzle(glm::Z, glm::Y, glm::X, glm::X)\r
+#define agrr swizzle(glm::W, glm::Y, glm::X, glm::X)\r
+#define rbrr swizzle(glm::X, glm::Z, glm::X, glm::X)\r
+#define gbrr swizzle(glm::Y, glm::Z, glm::X, glm::X)\r
+#define bbrr swizzle(glm::Z, glm::Z, glm::X, glm::X)\r
+#define abrr swizzle(glm::W, glm::Z, glm::X, glm::X)\r
+#define rarr swizzle(glm::X, glm::W, glm::X, glm::X)\r
+#define garr swizzle(glm::Y, glm::W, glm::X, glm::X)\r
+#define barr swizzle(glm::Z, glm::W, glm::X, glm::X)\r
+#define aarr swizzle(glm::W, glm::W, glm::X, glm::X)\r
+#define rrgr swizzle(glm::X, glm::X, glm::Y, glm::X)\r
+#define grgr swizzle(glm::Y, glm::X, glm::Y, glm::X)\r
+#define brgr swizzle(glm::Z, glm::X, glm::Y, glm::X)\r
+#define argr swizzle(glm::W, glm::X, glm::Y, glm::X)\r
+#define rggr swizzle(glm::X, glm::Y, glm::Y, glm::X)\r
+#define gggr swizzle(glm::Y, glm::Y, glm::Y, glm::X)\r
+#define bggr swizzle(glm::Z, glm::Y, glm::Y, glm::X)\r
+#define aggr swizzle(glm::W, glm::Y, glm::Y, glm::X)\r
+#define rbgr swizzle(glm::X, glm::Z, glm::Y, glm::X)\r
+#define gbgr swizzle(glm::Y, glm::Z, glm::Y, glm::X)\r
+#define bbgr swizzle(glm::Z, glm::Z, glm::Y, glm::X)\r
+#define abgr swizzle(glm::W, glm::Z, glm::Y, glm::X)\r
+#define ragr swizzle(glm::X, glm::W, glm::Y, glm::X)\r
+#define gagr swizzle(glm::Y, glm::W, glm::Y, glm::X)\r
+#define bagr swizzle(glm::Z, glm::W, glm::Y, glm::X)\r
+#define aagr swizzle(glm::W, glm::W, glm::Y, glm::X)\r
+#define rrbr swizzle(glm::X, glm::X, glm::Z, glm::X)\r
+#define grbr swizzle(glm::Y, glm::X, glm::Z, glm::X)\r
+#define brbr swizzle(glm::Z, glm::X, glm::Z, glm::X)\r
+#define arbr swizzle(glm::W, glm::X, glm::Z, glm::X)\r
+#define rgbr swizzle(glm::X, glm::Y, glm::Z, glm::X)\r
+#define ggbr swizzle(glm::Y, glm::Y, glm::Z, glm::X)\r
+#define bgbr swizzle(glm::Z, glm::Y, glm::Z, glm::X)\r
+#define agbr swizzle(glm::W, glm::Y, glm::Z, glm::X)\r
+#define rbbr swizzle(glm::X, glm::Z, glm::Z, glm::X)\r
+#define gbbr swizzle(glm::Y, glm::Z, glm::Z, glm::X)\r
+#define bbbr swizzle(glm::Z, glm::Z, glm::Z, glm::X)\r
+#define abbr swizzle(glm::W, glm::Z, glm::Z, glm::X)\r
+#define rabr swizzle(glm::X, glm::W, glm::Z, glm::X)\r
+#define gabr swizzle(glm::Y, glm::W, glm::Z, glm::X)\r
+#define babr swizzle(glm::Z, glm::W, glm::Z, glm::X)\r
+#define aabr swizzle(glm::W, glm::W, glm::Z, glm::X)\r
+#define rrar swizzle(glm::X, glm::X, glm::W, glm::X)\r
+#define grar swizzle(glm::Y, glm::X, glm::W, glm::X)\r
+#define brar swizzle(glm::Z, glm::X, glm::W, glm::X)\r
+#define arar swizzle(glm::W, glm::X, glm::W, glm::X)\r
+#define rgar swizzle(glm::X, glm::Y, glm::W, glm::X)\r
+#define ggar swizzle(glm::Y, glm::Y, glm::W, glm::X)\r
+#define bgar swizzle(glm::Z, glm::Y, glm::W, glm::X)\r
+#define agar swizzle(glm::W, glm::Y, glm::W, glm::X)\r
+#define rbar swizzle(glm::X, glm::Z, glm::W, glm::X)\r
+#define gbar swizzle(glm::Y, glm::Z, glm::W, glm::X)\r
+#define bbar swizzle(glm::Z, glm::Z, glm::W, glm::X)\r
+#define abar swizzle(glm::W, glm::Z, glm::W, glm::X)\r
+#define raar swizzle(glm::X, glm::W, glm::W, glm::X)\r
+#define gaar swizzle(glm::Y, glm::W, glm::W, glm::X)\r
+#define baar swizzle(glm::Z, glm::W, glm::W, glm::X)\r
+#define aaar swizzle(glm::W, glm::W, glm::W, glm::X)\r
+#define rrrg swizzle(glm::X, glm::X, glm::X, glm::Y)\r
+#define grrg swizzle(glm::Y, glm::X, glm::X, glm::Y)\r
+#define brrg swizzle(glm::Z, glm::X, glm::X, glm::Y)\r
+#define arrg swizzle(glm::W, glm::X, glm::X, glm::Y)\r
+#define rgrg swizzle(glm::X, glm::Y, glm::X, glm::Y)\r
+#define ggrg swizzle(glm::Y, glm::Y, glm::X, glm::Y)\r
+#define bgrg swizzle(glm::Z, glm::Y, glm::X, glm::Y)\r
+#define agrg swizzle(glm::W, glm::Y, glm::X, glm::Y)\r
+#define rbrg swizzle(glm::X, glm::Z, glm::X, glm::Y)\r
+#define gbrg swizzle(glm::Y, glm::Z, glm::X, glm::Y)\r
+#define bbrg swizzle(glm::Z, glm::Z, glm::X, glm::Y)\r
+#define abrg swizzle(glm::W, glm::Z, glm::X, glm::Y)\r
+#define rarg swizzle(glm::X, glm::W, glm::X, glm::Y)\r
+#define garg swizzle(glm::Y, glm::W, glm::X, glm::Y)\r
+#define barg swizzle(glm::Z, glm::W, glm::X, glm::Y)\r
+#define aarg swizzle(glm::W, glm::W, glm::X, glm::Y)\r
+#define rrgg swizzle(glm::X, glm::X, glm::Y, glm::Y)\r
+#define grgg swizzle(glm::Y, glm::X, glm::Y, glm::Y)\r
+#define brgg swizzle(glm::Z, glm::X, glm::Y, glm::Y)\r
+#define argg swizzle(glm::W, glm::X, glm::Y, glm::Y)\r
+#define rggg swizzle(glm::X, glm::Y, glm::Y, glm::Y)\r
+#define gggg swizzle(glm::Y, glm::Y, glm::Y, glm::Y)\r
+#define bggg swizzle(glm::Z, glm::Y, glm::Y, glm::Y)\r
+#define aggg swizzle(glm::W, glm::Y, glm::Y, glm::Y)\r
+#define rbgg swizzle(glm::X, glm::Z, glm::Y, glm::Y)\r
+#define gbgg swizzle(glm::Y, glm::Z, glm::Y, glm::Y)\r
+#define bbgg swizzle(glm::Z, glm::Z, glm::Y, glm::Y)\r
+#define abgg swizzle(glm::W, glm::Z, glm::Y, glm::Y)\r
+#define ragg swizzle(glm::X, glm::W, glm::Y, glm::Y)\r
+#define gagg swizzle(glm::Y, glm::W, glm::Y, glm::Y)\r
+#define bagg swizzle(glm::Z, glm::W, glm::Y, glm::Y)\r
+#define aagg swizzle(glm::W, glm::W, glm::Y, glm::Y)\r
+#define rrbg swizzle(glm::X, glm::X, glm::Z, glm::Y)\r
+#define grbg swizzle(glm::Y, glm::X, glm::Z, glm::Y)\r
+#define brbg swizzle(glm::Z, glm::X, glm::Z, glm::Y)\r
+#define arbg swizzle(glm::W, glm::X, glm::Z, glm::Y)\r
+#define rgbg swizzle(glm::X, glm::Y, glm::Z, glm::Y)\r
+#define ggbg swizzle(glm::Y, glm::Y, glm::Z, glm::Y)\r
+#define bgbg swizzle(glm::Z, glm::Y, glm::Z, glm::Y)\r
+#define agbg swizzle(glm::W, glm::Y, glm::Z, glm::Y)\r
+#define rbbg swizzle(glm::X, glm::Z, glm::Z, glm::Y)\r
+#define gbbg swizzle(glm::Y, glm::Z, glm::Z, glm::Y)\r
+#define bbbg swizzle(glm::Z, glm::Z, glm::Z, glm::Y)\r
+#define abbg swizzle(glm::W, glm::Z, glm::Z, glm::Y)\r
+#define rabg swizzle(glm::X, glm::W, glm::Z, glm::Y)\r
+#define gabg swizzle(glm::Y, glm::W, glm::Z, glm::Y)\r
+#define babg swizzle(glm::Z, glm::W, glm::Z, glm::Y)\r
+#define aabg swizzle(glm::W, glm::W, glm::Z, glm::Y)\r
+#define rrag swizzle(glm::X, glm::X, glm::W, glm::Y)\r
+#define grag swizzle(glm::Y, glm::X, glm::W, glm::Y)\r
+#define brag swizzle(glm::Z, glm::X, glm::W, glm::Y)\r
+#define arag swizzle(glm::W, glm::X, glm::W, glm::Y)\r
+#define rgag swizzle(glm::X, glm::Y, glm::W, glm::Y)\r
+#define ggag swizzle(glm::Y, glm::Y, glm::W, glm::Y)\r
+#define bgag swizzle(glm::Z, glm::Y, glm::W, glm::Y)\r
+#define agag swizzle(glm::W, glm::Y, glm::W, glm::Y)\r
+#define rbag swizzle(glm::X, glm::Z, glm::W, glm::Y)\r
+#define gbag swizzle(glm::Y, glm::Z, glm::W, glm::Y)\r
+#define bbag swizzle(glm::Z, glm::Z, glm::W, glm::Y)\r
+#define abag swizzle(glm::W, glm::Z, glm::W, glm::Y)\r
+#define raag swizzle(glm::X, glm::W, glm::W, glm::Y)\r
+#define gaag swizzle(glm::Y, glm::W, glm::W, glm::Y)\r
+#define baag swizzle(glm::Z, glm::W, glm::W, glm::Y)\r
+#define aaag swizzle(glm::W, glm::W, glm::W, glm::Y)\r
+#define rrrb swizzle(glm::X, glm::X, glm::X, glm::Z)\r
+#define grrb swizzle(glm::Y, glm::X, glm::X, glm::Z)\r
+#define brrb swizzle(glm::Z, glm::X, glm::X, glm::Z)\r
+#define arrb swizzle(glm::W, glm::X, glm::X, glm::Z)\r
+#define rgrb swizzle(glm::X, glm::Y, glm::X, glm::Z)\r
+#define ggrb swizzle(glm::Y, glm::Y, glm::X, glm::Z)\r
+#define bgrb swizzle(glm::Z, glm::Y, glm::X, glm::Z)\r
+#define agrb swizzle(glm::W, glm::Y, glm::X, glm::Z)\r
+#define rbrb swizzle(glm::X, glm::Z, glm::X, glm::Z)\r
+#define gbrb swizzle(glm::Y, glm::Z, glm::X, glm::Z)\r
+#define bbrb swizzle(glm::Z, glm::Z, glm::X, glm::Z)\r
+#define abrb swizzle(glm::W, glm::Z, glm::X, glm::Z)\r
+#define rarb swizzle(glm::X, glm::W, glm::X, glm::Z)\r
+#define garb swizzle(glm::Y, glm::W, glm::X, glm::Z)\r
+#define barb swizzle(glm::Z, glm::W, glm::X, glm::Z)\r
+#define aarb swizzle(glm::W, glm::W, glm::X, glm::Z)\r
+#define rrgb swizzle(glm::X, glm::X, glm::Y, glm::Z)\r
+#define grgb swizzle(glm::Y, glm::X, glm::Y, glm::Z)\r
+#define brgb swizzle(glm::Z, glm::X, glm::Y, glm::Z)\r
+#define argb swizzle(glm::W, glm::X, glm::Y, glm::Z)\r
+#define rggb swizzle(glm::X, glm::Y, glm::Y, glm::Z)\r
+#define gggb swizzle(glm::Y, glm::Y, glm::Y, glm::Z)\r
+#define bggb swizzle(glm::Z, glm::Y, glm::Y, glm::Z)\r
+#define aggb swizzle(glm::W, glm::Y, glm::Y, glm::Z)\r
+#define rbgb swizzle(glm::X, glm::Z, glm::Y, glm::Z)\r
+#define gbgb swizzle(glm::Y, glm::Z, glm::Y, glm::Z)\r
+#define bbgb swizzle(glm::Z, glm::Z, glm::Y, glm::Z)\r
+#define abgb swizzle(glm::W, glm::Z, glm::Y, glm::Z)\r
+#define ragb swizzle(glm::X, glm::W, glm::Y, glm::Z)\r
+#define gagb swizzle(glm::Y, glm::W, glm::Y, glm::Z)\r
+#define bagb swizzle(glm::Z, glm::W, glm::Y, glm::Z)\r
+#define aagb swizzle(glm::W, glm::W, glm::Y, glm::Z)\r
+#define rrbb swizzle(glm::X, glm::X, glm::Z, glm::Z)\r
+#define grbb swizzle(glm::Y, glm::X, glm::Z, glm::Z)\r
+#define brbb swizzle(glm::Z, glm::X, glm::Z, glm::Z)\r
+#define arbb swizzle(glm::W, glm::X, glm::Z, glm::Z)\r
+#define rgbb swizzle(glm::X, glm::Y, glm::Z, glm::Z)\r
+#define ggbb swizzle(glm::Y, glm::Y, glm::Z, glm::Z)\r
+#define bgbb swizzle(glm::Z, glm::Y, glm::Z, glm::Z)\r
+#define agbb swizzle(glm::W, glm::Y, glm::Z, glm::Z)\r
+#define rbbb swizzle(glm::X, glm::Z, glm::Z, glm::Z)\r
+#define gbbb swizzle(glm::Y, glm::Z, glm::Z, glm::Z)\r
+#define bbbb swizzle(glm::Z, glm::Z, glm::Z, glm::Z)\r
+#define abbb swizzle(glm::W, glm::Z, glm::Z, glm::Z)\r
+#define rabb swizzle(glm::X, glm::W, glm::Z, glm::Z)\r
+#define gabb swizzle(glm::Y, glm::W, glm::Z, glm::Z)\r
+#define babb swizzle(glm::Z, glm::W, glm::Z, glm::Z)\r
+#define aabb swizzle(glm::W, glm::W, glm::Z, glm::Z)\r
+#define rrab swizzle(glm::X, glm::X, glm::W, glm::Z)\r
+#define grab swizzle(glm::Y, glm::X, glm::W, glm::Z)\r
+#define brab swizzle(glm::Z, glm::X, glm::W, glm::Z)\r
+#define arab swizzle(glm::W, glm::X, glm::W, glm::Z)\r
+#define rgab swizzle(glm::X, glm::Y, glm::W, glm::Z)\r
+#define ggab swizzle(glm::Y, glm::Y, glm::W, glm::Z)\r
+#define bgab swizzle(glm::Z, glm::Y, glm::W, glm::Z)\r
+#define agab swizzle(glm::W, glm::Y, glm::W, glm::Z)\r
+#define rbab swizzle(glm::X, glm::Z, glm::W, glm::Z)\r
+#define gbab swizzle(glm::Y, glm::Z, glm::W, glm::Z)\r
+#define bbab swizzle(glm::Z, glm::Z, glm::W, glm::Z)\r
+#define abab swizzle(glm::W, glm::Z, glm::W, glm::Z)\r
+#define raab swizzle(glm::X, glm::W, glm::W, glm::Z)\r
+#define gaab swizzle(glm::Y, glm::W, glm::W, glm::Z)\r
+#define baab swizzle(glm::Z, glm::W, glm::W, glm::Z)\r
+#define aaab swizzle(glm::W, glm::W, glm::W, glm::Z)\r
+#define rrra swizzle(glm::X, glm::X, glm::X, glm::W)\r
+#define grra swizzle(glm::Y, glm::X, glm::X, glm::W)\r
+#define brra swizzle(glm::Z, glm::X, glm::X, glm::W)\r
+#define arra swizzle(glm::W, glm::X, glm::X, glm::W)\r
+#define rgra swizzle(glm::X, glm::Y, glm::X, glm::W)\r
+#define ggra swizzle(glm::Y, glm::Y, glm::X, glm::W)\r
+#define bgra swizzle(glm::Z, glm::Y, glm::X, glm::W)\r
+#define agra swizzle(glm::W, glm::Y, glm::X, glm::W)\r
+#define rbra swizzle(glm::X, glm::Z, glm::X, glm::W)\r
+#define gbra swizzle(glm::Y, glm::Z, glm::X, glm::W)\r
+#define bbra swizzle(glm::Z, glm::Z, glm::X, glm::W)\r
+#define abra swizzle(glm::W, glm::Z, glm::X, glm::W)\r
+#define rara swizzle(glm::X, glm::W, glm::X, glm::W)\r
+#define gara swizzle(glm::Y, glm::W, glm::X, glm::W)\r
+#define bara swizzle(glm::Z, glm::W, glm::X, glm::W)\r
+#define aara swizzle(glm::W, glm::W, glm::X, glm::W)\r
+#define rrga swizzle(glm::X, glm::X, glm::Y, glm::W)\r
+#define grga swizzle(glm::Y, glm::X, glm::Y, glm::W)\r
+#define brga swizzle(glm::Z, glm::X, glm::Y, glm::W)\r
+#define arga swizzle(glm::W, glm::X, glm::Y, glm::W)\r
+#define rgga swizzle(glm::X, glm::Y, glm::Y, glm::W)\r
+#define ggga swizzle(glm::Y, glm::Y, glm::Y, glm::W)\r
+#define bgga swizzle(glm::Z, glm::Y, glm::Y, glm::W)\r
+#define agga swizzle(glm::W, glm::Y, glm::Y, glm::W)\r
+#define rbga swizzle(glm::X, glm::Z, glm::Y, glm::W)\r
+#define gbga swizzle(glm::Y, glm::Z, glm::Y, glm::W)\r
+#define bbga swizzle(glm::Z, glm::Z, glm::Y, glm::W)\r
+#define abga swizzle(glm::W, glm::Z, glm::Y, glm::W)\r
+#define raga swizzle(glm::X, glm::W, glm::Y, glm::W)\r
+#define gaga swizzle(glm::Y, glm::W, glm::Y, glm::W)\r
+#define baga swizzle(glm::Z, glm::W, glm::Y, glm::W)\r
+#define aaga swizzle(glm::W, glm::W, glm::Y, glm::W)\r
+#define rrba swizzle(glm::X, glm::X, glm::Z, glm::W)\r
+#define grba swizzle(glm::Y, glm::X, glm::Z, glm::W)\r
+#define brba swizzle(glm::Z, glm::X, glm::Z, glm::W)\r
+#define arba swizzle(glm::W, glm::X, glm::Z, glm::W)\r
+#define rgba swizzle(glm::X, glm::Y, glm::Z, glm::W)\r
+#define ggba swizzle(glm::Y, glm::Y, glm::Z, glm::W)\r
+#define bgba swizzle(glm::Z, glm::Y, glm::Z, glm::W)\r
+#define agba swizzle(glm::W, glm::Y, glm::Z, glm::W)\r
+#define rbba swizzle(glm::X, glm::Z, glm::Z, glm::W)\r
+#define gbba swizzle(glm::Y, glm::Z, glm::Z, glm::W)\r
+#define bbba swizzle(glm::Z, glm::Z, glm::Z, glm::W)\r
+#define abba swizzle(glm::W, glm::Z, glm::Z, glm::W)\r
+#define raba swizzle(glm::X, glm::W, glm::Z, glm::W)\r
+#define gaba swizzle(glm::Y, glm::W, glm::Z, glm::W)\r
+#define baba swizzle(glm::Z, glm::W, glm::Z, glm::W)\r
+#define aaba swizzle(glm::W, glm::W, glm::Z, glm::W)\r
+#define rraa swizzle(glm::X, glm::X, glm::W, glm::W)\r
+#define graa swizzle(glm::Y, glm::X, glm::W, glm::W)\r
+#define braa swizzle(glm::Z, glm::X, glm::W, glm::W)\r
+#define araa swizzle(glm::W, glm::X, glm::W, glm::W)\r
+#define rgaa swizzle(glm::X, glm::Y, glm::W, glm::W)\r
+#define ggaa swizzle(glm::Y, glm::Y, glm::W, glm::W)\r
+#define bgaa swizzle(glm::Z, glm::Y, glm::W, glm::W)\r
+#define agaa swizzle(glm::W, glm::Y, glm::W, glm::W)\r
+#define rbaa swizzle(glm::X, glm::Z, glm::W, glm::W)\r
+#define gbaa swizzle(glm::Y, glm::Z, glm::W, glm::W)\r
+#define bbaa swizzle(glm::Z, glm::Z, glm::W, glm::W)\r
+#define abaa swizzle(glm::W, glm::Z, glm::W, glm::W)\r
+#define raaa swizzle(glm::X, glm::W, glm::W, glm::W)\r
+#define gaaa swizzle(glm::Y, glm::W, glm::W, glm::W)\r
+#define baaa swizzle(glm::Z, glm::W, glm::W, glm::W)\r
+#define aaaa swizzle(glm::W, glm::W, glm::W, glm::W)\r
+\r
+#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_RGBA)\r
+\r
+#if defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)\r
+\r
+#define ssss swizzle(glm::X, glm::X, glm::X, glm::X)\r
+#define tsss swizzle(glm::Y, glm::X, glm::X, glm::X)\r
+#define psss swizzle(glm::Z, glm::X, glm::X, glm::X)\r
+#define qsss swizzle(glm::W, glm::X, glm::X, glm::X)\r
+#define stss swizzle(glm::X, glm::Y, glm::X, glm::X)\r
+#define ttss swizzle(glm::Y, glm::Y, glm::X, glm::X)\r
+#define ptss swizzle(glm::Z, glm::Y, glm::X, glm::X)\r
+#define qtss swizzle(glm::W, glm::Y, glm::X, glm::X)\r
+#define spss swizzle(glm::X, glm::Z, glm::X, glm::X)\r
+#define tpss swizzle(glm::Y, glm::Z, glm::X, glm::X)\r
+#define ppss swizzle(glm::Z, glm::Z, glm::X, glm::X)\r
+#define qpss swizzle(glm::W, glm::Z, glm::X, glm::X)\r
+#define sqss swizzle(glm::X, glm::W, glm::X, glm::X)\r
+#define tqss swizzle(glm::Y, glm::W, glm::X, glm::X)\r
+#define pqss swizzle(glm::Z, glm::W, glm::X, glm::X)\r
+#define qqss swizzle(glm::W, glm::W, glm::X, glm::X)\r
+#define ssts swizzle(glm::X, glm::X, glm::Y, glm::X)\r
+#define tsts swizzle(glm::Y, glm::X, glm::Y, glm::X)\r
+#define psts swizzle(glm::Z, glm::X, glm::Y, glm::X)\r
+#define qsts swizzle(glm::W, glm::X, glm::Y, glm::X)\r
+#define stts swizzle(glm::X, glm::Y, glm::Y, glm::X)\r
+#define ttts swizzle(glm::Y, glm::Y, glm::Y, glm::X)\r
+#define ptts swizzle(glm::Z, glm::Y, glm::Y, glm::X)\r
+#define qtts swizzle(glm::W, glm::Y, glm::Y, glm::X)\r
+#define spts swizzle(glm::X, glm::Z, glm::Y, glm::X)\r
+#define tpts swizzle(glm::Y, glm::Z, glm::Y, glm::X)\r
+#define ppts swizzle(glm::Z, glm::Z, glm::Y, glm::X)\r
+#define qpts swizzle(glm::W, glm::Z, glm::Y, glm::X)\r
+#define sqts swizzle(glm::X, glm::W, glm::Y, glm::X)\r
+#define tqts swizzle(glm::Y, glm::W, glm::Y, glm::X)\r
+#define pqts swizzle(glm::Z, glm::W, glm::Y, glm::X)\r
+#define qqts swizzle(glm::W, glm::W, glm::Y, glm::X)\r
+#define ssps swizzle(glm::X, glm::X, glm::Z, glm::X)\r
+#define tsps swizzle(glm::Y, glm::X, glm::Z, glm::X)\r
+#define psps swizzle(glm::Z, glm::X, glm::Z, glm::X)\r
+#define qsps swizzle(glm::W, glm::X, glm::Z, glm::X)\r
+#define stps swizzle(glm::X, glm::Y, glm::Z, glm::X)\r
+#define ttps swizzle(glm::Y, glm::Y, glm::Z, glm::X)\r
+#define ptps swizzle(glm::Z, glm::Y, glm::Z, glm::X)\r
+#define qtps swizzle(glm::W, glm::Y, glm::Z, glm::X)\r
+#define spps swizzle(glm::X, glm::Z, glm::Z, glm::X)\r
+#define tpps swizzle(glm::Y, glm::Z, glm::Z, glm::X)\r
+#define ppps swizzle(glm::Z, glm::Z, glm::Z, glm::X)\r
+#define qpps swizzle(glm::W, glm::Z, glm::Z, glm::X)\r
+#define sqps swizzle(glm::X, glm::W, glm::Z, glm::X)\r
+#define tqps swizzle(glm::Y, glm::W, glm::Z, glm::X)\r
+#define pqps swizzle(glm::Z, glm::W, glm::Z, glm::X)\r
+#define qqps swizzle(glm::W, glm::W, glm::Z, glm::X)\r
+#define ssqs swizzle(glm::X, glm::X, glm::W, glm::X)\r
+#define tsqs swizzle(glm::Y, glm::X, glm::W, glm::X)\r
+#define psqs swizzle(glm::Z, glm::X, glm::W, glm::X)\r
+#define qsqs swizzle(glm::W, glm::X, glm::W, glm::X)\r
+#define stqs swizzle(glm::X, glm::Y, glm::W, glm::X)\r
+#define ttqs swizzle(glm::Y, glm::Y, glm::W, glm::X)\r
+#define ptqs swizzle(glm::Z, glm::Y, glm::W, glm::X)\r
+#define qtqs swizzle(glm::W, glm::Y, glm::W, glm::X)\r
+#define spqs swizzle(glm::X, glm::Z, glm::W, glm::X)\r
+#define tpqs swizzle(glm::Y, glm::Z, glm::W, glm::X)\r
+#define ppqs swizzle(glm::Z, glm::Z, glm::W, glm::X)\r
+#define qpqs swizzle(glm::W, glm::Z, glm::W, glm::X)\r
+#define sqqs swizzle(glm::X, glm::W, glm::W, glm::X)\r
+#define tqqs swizzle(glm::Y, glm::W, glm::W, glm::X)\r
+#define pqqs swizzle(glm::Z, glm::W, glm::W, glm::X)\r
+#define qqqs swizzle(glm::W, glm::W, glm::W, glm::X)\r
+#define ssst swizzle(glm::X, glm::X, glm::X, glm::Y)\r
+#define tsst swizzle(glm::Y, glm::X, glm::X, glm::Y)\r
+#define psst swizzle(glm::Z, glm::X, glm::X, glm::Y)\r
+#define qsst swizzle(glm::W, glm::X, glm::X, glm::Y)\r
+#define stst swizzle(glm::X, glm::Y, glm::X, glm::Y)\r
+#define ttst swizzle(glm::Y, glm::Y, glm::X, glm::Y)\r
+#define ptst swizzle(glm::Z, glm::Y, glm::X, glm::Y)\r
+#define qtst swizzle(glm::W, glm::Y, glm::X, glm::Y)\r
+#define spst swizzle(glm::X, glm::Z, glm::X, glm::Y)\r
+#define tpst swizzle(glm::Y, glm::Z, glm::X, glm::Y)\r
+#define ppst swizzle(glm::Z, glm::Z, glm::X, glm::Y)\r
+#define qpst swizzle(glm::W, glm::Z, glm::X, glm::Y)\r
+#define sqst swizzle(glm::X, glm::W, glm::X, glm::Y)\r
+#define tqst swizzle(glm::Y, glm::W, glm::X, glm::Y)\r
+#define pqst swizzle(glm::Z, glm::W, glm::X, glm::Y)\r
+#define qqst swizzle(glm::W, glm::W, glm::X, glm::Y)\r
+#define sstt swizzle(glm::X, glm::X, glm::Y, glm::Y)\r
+#define tstt swizzle(glm::Y, glm::X, glm::Y, glm::Y)\r
+#define pstt swizzle(glm::Z, glm::X, glm::Y, glm::Y)\r
+#define qstt swizzle(glm::W, glm::X, glm::Y, glm::Y)\r
+#define sttt swizzle(glm::X, glm::Y, glm::Y, glm::Y)\r
+#define tttt swizzle(glm::Y, glm::Y, glm::Y, glm::Y)\r
+#define pttt swizzle(glm::Z, glm::Y, glm::Y, glm::Y)\r
+#define qttt swizzle(glm::W, glm::Y, glm::Y, glm::Y)\r
+#define sptt swizzle(glm::X, glm::Z, glm::Y, glm::Y)\r
+#define tptt swizzle(glm::Y, glm::Z, glm::Y, glm::Y)\r
+#define pptt swizzle(glm::Z, glm::Z, glm::Y, glm::Y)\r
+#define qptt swizzle(glm::W, glm::Z, glm::Y, glm::Y)\r
+#define sqtt swizzle(glm::X, glm::W, glm::Y, glm::Y)\r
+#define tqtt swizzle(glm::Y, glm::W, glm::Y, glm::Y)\r
+#define pqtt swizzle(glm::Z, glm::W, glm::Y, glm::Y)\r
+#define qqtt swizzle(glm::W, glm::W, glm::Y, glm::Y)\r
+#define sspt swizzle(glm::X, glm::X, glm::Z, glm::Y)\r
+#define tspt swizzle(glm::Y, glm::X, glm::Z, glm::Y)\r
+#define pspt swizzle(glm::Z, glm::X, glm::Z, glm::Y)\r
+#define qspt swizzle(glm::W, glm::X, glm::Z, glm::Y)\r
+#define stpt swizzle(glm::X, glm::Y, glm::Z, glm::Y)\r
+#define ttpt swizzle(glm::Y, glm::Y, glm::Z, glm::Y)\r
+#define ptpt swizzle(glm::Z, glm::Y, glm::Z, glm::Y)\r
+#define qtpt swizzle(glm::W, glm::Y, glm::Z, glm::Y)\r
+#define sppt swizzle(glm::X, glm::Z, glm::Z, glm::Y)\r
+#define tppt swizzle(glm::Y, glm::Z, glm::Z, glm::Y)\r
+#define pppt swizzle(glm::Z, glm::Z, glm::Z, glm::Y)\r
+#define qppt swizzle(glm::W, glm::Z, glm::Z, glm::Y)\r
+#define sqpt swizzle(glm::X, glm::W, glm::Z, glm::Y)\r
+#define tqpt swizzle(glm::Y, glm::W, glm::Z, glm::Y)\r
+#define pqpt swizzle(glm::Z, glm::W, glm::Z, glm::Y)\r
+#define qqpt swizzle(glm::W, glm::W, glm::Z, glm::Y)\r
+#define ssqt swizzle(glm::X, glm::X, glm::W, glm::Y)\r
+#define tsqt swizzle(glm::Y, glm::X, glm::W, glm::Y)\r
+#define psqt swizzle(glm::Z, glm::X, glm::W, glm::Y)\r
+#define qsqt swizzle(glm::W, glm::X, glm::W, glm::Y)\r
+#define stqt swizzle(glm::X, glm::Y, glm::W, glm::Y)\r
+#define ttqt swizzle(glm::Y, glm::Y, glm::W, glm::Y)\r
+#define ptqt swizzle(glm::Z, glm::Y, glm::W, glm::Y)\r
+#define qtqt swizzle(glm::W, glm::Y, glm::W, glm::Y)\r
+#define spqt swizzle(glm::X, glm::Z, glm::W, glm::Y)\r
+#define tpqt swizzle(glm::Y, glm::Z, glm::W, glm::Y)\r
+#define ppqt swizzle(glm::Z, glm::Z, glm::W, glm::Y)\r
+#define qpqt swizzle(glm::W, glm::Z, glm::W, glm::Y)\r
+#define sqqt swizzle(glm::X, glm::W, glm::W, glm::Y)\r
+#define tqqt swizzle(glm::Y, glm::W, glm::W, glm::Y)\r
+#define pqqt swizzle(glm::Z, glm::W, glm::W, glm::Y)\r
+#define qqqt swizzle(glm::W, glm::W, glm::W, glm::Y)\r
+#define sssp swizzle(glm::X, glm::X, glm::X, glm::Z)\r
+#define tssp swizzle(glm::Y, glm::X, glm::X, glm::Z)\r
+#define pssp swizzle(glm::Z, glm::X, glm::X, glm::Z)\r
+#define qssp swizzle(glm::W, glm::X, glm::X, glm::Z)\r
+#define stsp swizzle(glm::X, glm::Y, glm::X, glm::Z)\r
+#define ttsp swizzle(glm::Y, glm::Y, glm::X, glm::Z)\r
+#define ptsp swizzle(glm::Z, glm::Y, glm::X, glm::Z)\r
+#define qtsp swizzle(glm::W, glm::Y, glm::X, glm::Z)\r
+#define spsp swizzle(glm::X, glm::Z, glm::X, glm::Z)\r
+#define tpsp swizzle(glm::Y, glm::Z, glm::X, glm::Z)\r
+#define ppsp swizzle(glm::Z, glm::Z, glm::X, glm::Z)\r
+#define qpsp swizzle(glm::W, glm::Z, glm::X, glm::Z)\r
+#define sqsp swizzle(glm::X, glm::W, glm::X, glm::Z)\r
+#define tqsp swizzle(glm::Y, glm::W, glm::X, glm::Z)\r
+#define pqsp swizzle(glm::Z, glm::W, glm::X, glm::Z)\r
+#define qqsp swizzle(glm::W, glm::W, glm::X, glm::Z)\r
+#define sstp swizzle(glm::X, glm::X, glm::Y, glm::Z)\r
+#define tstp swizzle(glm::Y, glm::X, glm::Y, glm::Z)\r
+#define pstp swizzle(glm::Z, glm::X, glm::Y, glm::Z)\r
+#define qstp swizzle(glm::W, glm::X, glm::Y, glm::Z)\r
+#define sttp swizzle(glm::X, glm::Y, glm::Y, glm::Z)\r
+#define tttp swizzle(glm::Y, glm::Y, glm::Y, glm::Z)\r
+#define pttp swizzle(glm::Z, glm::Y, glm::Y, glm::Z)\r
+#define qttp swizzle(glm::W, glm::Y, glm::Y, glm::Z)\r
+#define sptp swizzle(glm::X, glm::Z, glm::Y, glm::Z)\r
+#define tptp swizzle(glm::Y, glm::Z, glm::Y, glm::Z)\r
+#define pptp swizzle(glm::Z, glm::Z, glm::Y, glm::Z)\r
+#define qptp swizzle(glm::W, glm::Z, glm::Y, glm::Z)\r
+#define sqtp swizzle(glm::X, glm::W, glm::Y, glm::Z)\r
+#define tqtp swizzle(glm::Y, glm::W, glm::Y, glm::Z)\r
+#define pqtp swizzle(glm::Z, glm::W, glm::Y, glm::Z)\r
+#define qqtp swizzle(glm::W, glm::W, glm::Y, glm::Z)\r
+#define sspp swizzle(glm::X, glm::X, glm::Z, glm::Z)\r
+#define tspp swizzle(glm::Y, glm::X, glm::Z, glm::Z)\r
+#define pspp swizzle(glm::Z, glm::X, glm::Z, glm::Z)\r
+#define qspp swizzle(glm::W, glm::X, glm::Z, glm::Z)\r
+#define stpp swizzle(glm::X, glm::Y, glm::Z, glm::Z)\r
+#define ttpp swizzle(glm::Y, glm::Y, glm::Z, glm::Z)\r
+#define ptpp swizzle(glm::Z, glm::Y, glm::Z, glm::Z)\r
+#define qtpp swizzle(glm::W, glm::Y, glm::Z, glm::Z)\r
+#define sppp swizzle(glm::X, glm::Z, glm::Z, glm::Z)\r
+#define tppp swizzle(glm::Y, glm::Z, glm::Z, glm::Z)\r
+#define pppp swizzle(glm::Z, glm::Z, glm::Z, glm::Z)\r
+#define qppp swizzle(glm::W, glm::Z, glm::Z, glm::Z)\r
+#define sqpp swizzle(glm::X, glm::W, glm::Z, glm::Z)\r
+#define tqpp swizzle(glm::Y, glm::W, glm::Z, glm::Z)\r
+#define pqpp swizzle(glm::Z, glm::W, glm::Z, glm::Z)\r
+#define qqpp swizzle(glm::W, glm::W, glm::Z, glm::Z)\r
+#define ssqp swizzle(glm::X, glm::X, glm::W, glm::Z)\r
+#define tsqp swizzle(glm::Y, glm::X, glm::W, glm::Z)\r
+#define psqp swizzle(glm::Z, glm::X, glm::W, glm::Z)\r
+#define qsqp swizzle(glm::W, glm::X, glm::W, glm::Z)\r
+#define stqp swizzle(glm::X, glm::Y, glm::W, glm::Z)\r
+#define ttqp swizzle(glm::Y, glm::Y, glm::W, glm::Z)\r
+#define ptqp swizzle(glm::Z, glm::Y, glm::W, glm::Z)\r
+#define qtqp swizzle(glm::W, glm::Y, glm::W, glm::Z)\r
+#define spqp swizzle(glm::X, glm::Z, glm::W, glm::Z)\r
+#define tpqp swizzle(glm::Y, glm::Z, glm::W, glm::Z)\r
+#define ppqp swizzle(glm::Z, glm::Z, glm::W, glm::Z)\r
+#define qpqp swizzle(glm::W, glm::Z, glm::W, glm::Z)\r
+#define sqqp swizzle(glm::X, glm::W, glm::W, glm::Z)\r
+#define tqqp swizzle(glm::Y, glm::W, glm::W, glm::Z)\r
+#define pqqp swizzle(glm::Z, glm::W, glm::W, glm::Z)\r
+#define qqqp swizzle(glm::W, glm::W, glm::W, glm::Z)\r
+#define sssq swizzle(glm::X, glm::X, glm::X, glm::W)\r
+#define tssq swizzle(glm::Y, glm::X, glm::X, glm::W)\r
+#define pssq swizzle(glm::Z, glm::X, glm::X, glm::W)\r
+#define qssq swizzle(glm::W, glm::X, glm::X, glm::W)\r
+#define stsq swizzle(glm::X, glm::Y, glm::X, glm::W)\r
+#define ttsq swizzle(glm::Y, glm::Y, glm::X, glm::W)\r
+#define ptsq swizzle(glm::Z, glm::Y, glm::X, glm::W)\r
+#define qtsq swizzle(glm::W, glm::Y, glm::X, glm::W)\r
+#define spsq swizzle(glm::X, glm::Z, glm::X, glm::W)\r
+#define tpsq swizzle(glm::Y, glm::Z, glm::X, glm::W)\r
+#define ppsq swizzle(glm::Z, glm::Z, glm::X, glm::W)\r
+#define qpsq swizzle(glm::W, glm::Z, glm::X, glm::W)\r
+#define sqsq swizzle(glm::X, glm::W, glm::X, glm::W)\r
+#define tqsq swizzle(glm::Y, glm::W, glm::X, glm::W)\r
+#define pqsq swizzle(glm::Z, glm::W, glm::X, glm::W)\r
+#define qqsq swizzle(glm::W, glm::W, glm::X, glm::W)\r
+#define sstq swizzle(glm::X, glm::X, glm::Y, glm::W)\r
+#define tstq swizzle(glm::Y, glm::X, glm::Y, glm::W)\r
+#define pstq swizzle(glm::Z, glm::X, glm::Y, glm::W)\r
+#define qstq swizzle(glm::W, glm::X, glm::Y, glm::W)\r
+#define sttq swizzle(glm::X, glm::Y, glm::Y, glm::W)\r
+#define tttq swizzle(glm::Y, glm::Y, glm::Y, glm::W)\r
+#define pttq swizzle(glm::Z, glm::Y, glm::Y, glm::W)\r
+#define qttq swizzle(glm::W, glm::Y, glm::Y, glm::W)\r
+#define sptq swizzle(glm::X, glm::Z, glm::Y, glm::W)\r
+#define tptq swizzle(glm::Y, glm::Z, glm::Y, glm::W)\r
+#define pptq swizzle(glm::Z, glm::Z, glm::Y, glm::W)\r
+#define qptq swizzle(glm::W, glm::Z, glm::Y, glm::W)\r
+#define sqtq swizzle(glm::X, glm::W, glm::Y, glm::W)\r
+#define tqtq swizzle(glm::Y, glm::W, glm::Y, glm::W)\r
+#define pqtq swizzle(glm::Z, glm::W, glm::Y, glm::W)\r
+#define qqtq swizzle(glm::W, glm::W, glm::Y, glm::W)\r
+#define sspq swizzle(glm::X, glm::X, glm::Z, glm::W)\r
+#define tspq swizzle(glm::Y, glm::X, glm::Z, glm::W)\r
+#define pspq swizzle(glm::Z, glm::X, glm::Z, glm::W)\r
+#define qspq swizzle(glm::W, glm::X, glm::Z, glm::W)\r
+#define stpq swizzle(glm::X, glm::Y, glm::Z, glm::W)\r
+#define ttpq swizzle(glm::Y, glm::Y, glm::Z, glm::W)\r
+#define ptpq swizzle(glm::Z, glm::Y, glm::Z, glm::W)\r
+#define qtpq swizzle(glm::W, glm::Y, glm::Z, glm::W)\r
+#define sppq swizzle(glm::X, glm::Z, glm::Z, glm::W)\r
+#define tppq swizzle(glm::Y, glm::Z, glm::Z, glm::W)\r
+#define pppq swizzle(glm::Z, glm::Z, glm::Z, glm::W)\r
+#define qppq swizzle(glm::W, glm::Z, glm::Z, glm::W)\r
+#define sqpq swizzle(glm::X, glm::W, glm::Z, glm::W)\r
+#define tqpq swizzle(glm::Y, glm::W, glm::Z, glm::W)\r
+#define pqpq swizzle(glm::Z, glm::W, glm::Z, glm::W)\r
+#define qqpq swizzle(glm::W, glm::W, glm::Z, glm::W)\r
+#define ssqq swizzle(glm::X, glm::X, glm::W, glm::W)\r
+#define tsqq swizzle(glm::Y, glm::X, glm::W, glm::W)\r
+#define psqq swizzle(glm::Z, glm::X, glm::W, glm::W)\r
+#define qsqq swizzle(glm::W, glm::X, glm::W, glm::W)\r
+#define stqq swizzle(glm::X, glm::Y, glm::W, glm::W)\r
+#define ttqq swizzle(glm::Y, glm::Y, glm::W, glm::W)\r
+#define ptqq swizzle(glm::Z, glm::Y, glm::W, glm::W)\r
+#define qtqq swizzle(glm::W, glm::Y, glm::W, glm::W)\r
+#define spqq swizzle(glm::X, glm::Z, glm::W, glm::W)\r
+#define tpqq swizzle(glm::Y, glm::Z, glm::W, glm::W)\r
+#define ppqq swizzle(glm::Z, glm::Z, glm::W, glm::W)\r
+#define qpqq swizzle(glm::W, glm::Z, glm::W, glm::W)\r
+#define sqqq swizzle(glm::X, glm::W, glm::W, glm::W)\r
+#define tqqq swizzle(glm::Y, glm::W, glm::W, glm::W)\r
+#define pqqq swizzle(glm::Z, glm::W, glm::W, glm::W)\r
+#define qqqq swizzle(glm::W, glm::W, glm::W, glm::W)\r
+\r
+#endif//defined(GLM_SWIZZLE) && (GLM_SWIZZLE & GLM_SWIZZLE_STPQ)\r
+\r
+#endif//glm_core_swizzle\r
diff --git a/glm/core/_swizzle.inl b/glm/core/_swizzle.inl
new file mode 100644 (file)
index 0000000..e3202be
--- /dev/null
@@ -0,0 +1,20 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-27\r
+// Updated : 2006-04-27\r
+// Licence : This source is under MIT License\r
+// File    : _swizzle.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef __swizzle_inl__\r
+#define __swizzle_inl__\r
+\r
+#include "./_swizzle.h"\r
+\r
+namespace glm\r
+{\r
+\r
+}\r
+\r
+#endif//__swizzle_inl__\r
diff --git a/glm/core/func_common.hpp b/glm/core/func_common.hpp
new file mode 100644 (file)
index 0000000..f1100f7
--- /dev/null
@@ -0,0 +1,185 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-03-08\r
+// Updated : 2008-03-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_common.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_func_common\r
+#define glm_core_func_common\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_core_func_common();\r
+       }//namespace test\r
+\r
+       namespace core{\r
+       namespace function{\r
+       //! Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace.\r
+       namespace common{\r
+\r
+       //! Returns x if x >= 0; otherwise, it returns -x. \r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genFIType> \r
+       genFIType abs(genFIType const & x);\r
+\r
+       //! Returns 1.0 if x > 0, 0.0 if x = 0, or -1.0 if x < 0. \r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genFIType> \r
+       genFIType sign(genFIType const & x);\r
+\r
+    //! Returns a value equal to the nearest integer that is less then or equal to x. \r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genType> \r
+       genType floor(genType const & x);\r
+\r
+       //! Returns a value equal to the nearest integer to x \r
+       //! whose absolute value is not larger than the absolute value of x. \r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genType> \r
+       genType trunc(genType const & x);\r
+\r
+       //! Returns a value equal to the nearest integer to x. \r
+       //! The fraction 0.5 will round in a direction chosen by the \r
+       //! implementation, presumably the direction that is fastest. \r
+       //! This includes the possibility that round(x) returns the \r
+       //! same value as roundEven(x) for all values of x. \r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genType> \r
+       genType round(genType const & x);\r
+\r
+       //! Returns a value equal to the nearest integer to x.\r
+       //! A fractional part of 0.5 will round toward the nearest even\r
+       //! integer. (Both 3.5 and 4.5 for x will return 4.0.) \r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genType> \r
+       genType roundEven(genType const & x);\r
+\r
+       //! Returns a value equal to the nearest integer \r
+       //! that is greater than or equal to x. \r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+    template <typename genType> \r
+       genType ceil(genType const & x);\r
+\r
+       //! Return x - floor(x).\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+    template <typename genType> \r
+       genType fract(genType const & x);\r
+\r
+       //! Modulus. Returns x - y * floor(x / y) \r
+       //! for each component in x using the floating point value y.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+    template <typename genTypeT, typename genTypeU> \r
+       genTypeT mod(\r
+               genTypeT const & x, \r
+               genTypeU const & y);\r
+\r
+       //! Returns the fractional part of x and sets i to the integer\r
+       //! part (as a whole number floating point value). Both the\r
+       //! return value and the output parameter will have the same\r
+       //! sign as x.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genType> \r
+       genType modf(\r
+               genType const & x, \r
+               genType & i);\r
+\r
+    //! Returns y if y < x; otherwise, it returns x.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genUIFTypeT, typename genUIFTypeU> \r
+       genUIFTypeT min(\r
+               genUIFTypeT const & x, \r
+               genUIFTypeU const & y);\r
+\r
+    //! Returns y if x < y; otherwise, it returns x.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genUIFTypeT, typename genUIFTypeU> \r
+       genUIFTypeT max(\r
+               genUIFTypeT const & x, \r
+               genUIFTypeU const & y);\r
+\r
+    //! Returns min(max(x, minVal), maxVal) for each component in x \r
+       //! using the floating-point values minVal and maxVal.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genUIFTypeT, typename genUIFTypeU> \r
+       genUIFTypeT clamp(\r
+               genUIFTypeT const & x, \r
+               genUIFTypeU const & minVal, \r
+               genUIFTypeU const & maxVal); \r
+\r
+       //! \return If genTypeU is a floating scalar or vector: \r
+       //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of \r
+       //! x and y using the floating-point value a. \r
+       //! The value for a is not restricted to the range [0, 1].\r
+       //!\r
+       //! \return If genTypeU is a boolean scalar or vector: \r
+       //! Selects which vector each returned component comes\r
+       //! from. For a component of a that is false, the\r
+       //! corresponding component of x is returned. For a\r
+       //! component of a that is true, the corresponding\r
+       //! component of y is returned. Components of x and y that\r
+       //! are not selected are allowed to be invalid floating point\r
+       //! values and will have no effect on the results. Thus, this\r
+       //! provides different functionality than\r
+       //! genType mix(genType x, genType y, genType(a))\r
+       //! where a is a Boolean vector.\r
+       //! \r
+       //! From GLSL 1.30.08 specification, section 8.3\r
+       //! \r
+       //! \param[in]  x Floating point scalar or vector.\r
+       //! \param[in]  y Floating point scalar or vector.\r
+       //! \param[in]  a Floating point or boolean scalar or vector.\r
+       //!\r
+       // \todo Test when 'a' is a boolean.\r
+       template <typename genTypeT, typename genTypeU> \r
+       genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a);\r
+\r
+       //! Returns 0.0 if x < edge, otherwise it returns 1.0.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genTypeT, typename genTypeU> \r
+       genTypeU step(genTypeT const & edge, genTypeU const & x);\r
+\r
+       //! Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and\r
+       //! performs smooth Hermite interpolation between 0 and 1\r
+       //! when edge0 < x < edge1. This is useful in cases where\r
+       //! you would want a threshold function with a smooth\r
+       //! transition. This is equivalent to:\r
+       //! genType t;\r
+       //! t = clamp ((x \96 edge0) / (edge1 \96 edge0), 0, 1);\r
+       //! return t * t * (3 \96 2 * t);\r
+       //! Results are undefined if edge0 >= edge1.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genTypeT, typename genTypeU> \r
+       genTypeU smoothstep(genTypeT const & edge0, genTypeT const & edge1, genTypeU const & x);\r
+\r
+       //! Returns true if x holds a NaN (not a number)\r
+       //! representation in the underlying implementation's set of\r
+       //! floating point representations. Returns false otherwise,\r
+       //! including for implementations with no NaN\r
+       //! representations.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genType> \r
+       typename genType::bool_type isnan(genType const & x);\r
+\r
+       //! Returns true if x holds a positive infinity or negative\r
+       //! infinity representation in the underlying implementation's\r
+       //! set of floating point representations. Returns false\r
+       //! otherwise, including for implementations with no infinity\r
+       //! representations.\r
+       //! (From GLSL 1.30.08 specification, section 8.3)\r
+       template <typename genType> \r
+       typename genType::bool_type isinf(genType const & x);\r
+\r
+       }//namespace common\r
+       }//namespace function\r
+       }//namespace core\r
+\r
+       using namespace core::function::common;\r
+}//namespace glm\r
+\r
+#include "func_common.inl"\r
+\r
+#endif//glm_core_func_common\r
diff --git a/glm/core/func_common.inl b/glm/core/func_common.inl
new file mode 100644 (file)
index 0000000..89a4a0f
--- /dev/null
@@ -0,0 +1,1270 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-09-04\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_common.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace function{\r
+       namespace common{\r
+\r
+       // abs\r
+    template <typename genFIType>\r
+    inline genFIType abs(\r
+               genFIType const & x)\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<genFIType>::is_float || \r
+                       detail::type<genFIType>::is_int ||\r
+                       detail::type<genFIType>::is_uint);\r
+        return x >= genFIType(0) ? x : -x;\r
+    }\r
+\r
+       //template <typename T> \r
+       //inline detail::tvec1<T> abs(\r
+       //      detail::tvec1<T> const & v)\r
+       //{\r
+       //      return detail::tvec1<T>(\r
+       //              abs(v.x));      \r
+       //}\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> abs(\r
+               detail::tvec2<T> const & v)\r
+    {\r
+        return detail::tvec2<T>(\r
+            abs(v.x),\r
+            abs(v.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> abs(\r
+               detail::tvec3<T> const & v)\r
+    {\r
+        return detail::tvec3<T>(\r
+            abs(v.x),\r
+            abs(v.y),\r
+            abs(v.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> abs(\r
+               detail::tvec4<T> const & v)\r
+    {\r
+        return detail::tvec4<T>(\r
+            abs(v.x),\r
+            abs(v.y),\r
+            abs(v.z),\r
+            abs(v.w));\r
+    }\r
+\r
+    // sign\r
+\r
+       //Try something like based on x >> 31 to get the sign bit\r
+    template <typename genFIType> \r
+       inline genFIType sign(\r
+               genFIType const & x)\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<genFIType>::is_float || \r
+                       detail::type<genFIType>::is_int);\r
+        \r
+               genFIType result;\r
+               if(x > genFIType(0))\r
+            result = genFIType(1);\r
+        else if(x < genFIType(0))\r
+            result = genFIType(-1);\r
+        else\r
+            result = genFIType(0);\r
+        return result;\r
+       }\r
+       \r
+    template <typename valFIType>\r
+    inline detail::tvec2<valFIType> sign(\r
+               detail::tvec2<valFIType> const & x)\r
+    {\r
+        return detail::tvec2<valFIType>(\r
+            sign(x.x),\r
+            sign(x.y));\r
+    }\r
+\r
+    template <typename valFIType>\r
+    inline detail::tvec3<valFIType> sign(\r
+               detail::tvec3<valFIType> const & x)\r
+    {\r
+        return detail::tvec3<valFIType>(\r
+            sign(x.x),\r
+            sign(x.y),\r
+            sign(x.z));\r
+    }\r
+\r
+    template <typename valFIType>\r
+    inline detail::tvec4<valFIType> sign(\r
+               detail::tvec4<valFIType> const & x)\r
+    {\r
+        return detail::tvec4<valFIType>(\r
+            sign(x.x),\r
+            sign(x.y),\r
+            sign(x.z),\r
+            sign(x.w));\r
+    }\r
+\r
+    // floor\r
+    template <typename genType>\r
+    inline genType floor(genType const& x)\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::floor(x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> floor(detail::tvec2<valType> const& x)\r
+    {\r
+        return detail::tvec2<valType>(\r
+            floor(x.x),\r
+            floor(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> floor(detail::tvec3<valType> const& x)\r
+    {\r
+        return detail::tvec3<valType>(\r
+            floor(x.x),\r
+            floor(x.y),\r
+            floor(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> floor(detail::tvec4<valType> const& x)\r
+    {\r
+        return detail::tvec4<valType>(\r
+            floor(x.x),\r
+            floor(x.y),\r
+            floor(x.z),\r
+            floor(x.w));\r
+    }\r
+\r
+    // trunc\r
+    template <typename genType>\r
+    inline genType trunc(genType const& x)\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+        return floor(abs(x));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> trunc(detail::tvec2<valType> const& x)\r
+    {\r
+        return detail::tvec2<valType>(\r
+            trunc(x.x),\r
+            trunc(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> trunc(detail::tvec3<valType> const& x)\r
+    {\r
+        return detail::tvec3<valType>(\r
+            trunc(x.x),\r
+            trunc(x.y),\r
+            trunc(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> trunc(detail::tvec4<valType> const& x)\r
+    {\r
+        return detail::tvec4<valType>(\r
+            trunc(x.x),\r
+            trunc(x.y),\r
+            trunc(x.z),\r
+            trunc(x.w));\r
+    }\r
+\r
+    // round\r
+    template <typename genType>\r
+    inline genType round(genType const& x)\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return genType(int(x + genType(0.5)));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> round(detail::tvec2<valType> const& x)\r
+    {\r
+        return detail::tvec2<valType>(\r
+            round(x.x),\r
+            round(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> round(detail::tvec3<valType> const& x)\r
+    {\r
+        return detail::tvec3<valType>(\r
+            round(x.x),\r
+            round(x.y),\r
+            round(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> round(detail::tvec4<valType> const& x)\r
+    {\r
+        return detail::tvec4<valType>(\r
+            round(x.x),\r
+            round(x.y),\r
+            round(x.z),\r
+            round(x.w));\r
+    }\r
+\r
+    // roundEven\r
+    template <typename genType>\r
+    inline genType roundEven(genType const& x)\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return genType(int(x + genType(int(x) % 2)));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> roundEven(detail::tvec2<valType> const& x)\r
+    {\r
+        return detail::tvec2<valType>(\r
+            roundEven(x.x),\r
+            roundEven(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> roundEven(detail::tvec3<valType> const& x)\r
+    {\r
+        return detail::tvec3<valType>(\r
+            roundEven(x.x),\r
+            roundEven(x.y),\r
+            roundEven(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> roundEven(detail::tvec4<valType> const& x)\r
+    {\r
+        return detail::tvec4<valType>(\r
+            roundEven(x.x),\r
+            roundEven(x.y),\r
+            roundEven(x.z),\r
+            roundEven(x.w));\r
+    }\r
+\r
+    // ceil\r
+    template <typename genType>\r
+    inline genType ceil(genType const & x)\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::ceil(x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> ceil(detail::tvec2<valType> const & x)\r
+    {\r
+        return detail::tvec2<valType>(\r
+            ceil(x.x),\r
+            ceil(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> ceil(detail::tvec3<valType> const & x)\r
+    {\r
+        return detail::tvec3<valType>(\r
+            ceil(x.x),\r
+            ceil(x.y),\r
+            ceil(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> ceil(detail::tvec4<valType> const & x)\r
+    {\r
+        return detail::tvec4<valType>(\r
+            ceil(x.x),\r
+            ceil(x.y),\r
+            ceil(x.z),\r
+            ceil(x.w));\r
+    }\r
+\r
+    // fract\r
+    template <typename genType>\r
+    inline genType fract\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return x - ::std::floor(x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> fract\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            fract(x.x),\r
+            fract(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> fract\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            fract(x.x),\r
+            fract(x.y),\r
+            fract(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> fract\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            fract(x.x),\r
+            fract(x.y),\r
+            fract(x.z),\r
+            fract(x.w));\r
+    }\r
+\r
+    // mod\r
+    template <typename genType>\r
+    inline genType mod\r
+       (\r
+               genType const & x, \r
+               genType const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return x - y * floor(x / y);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> mod\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            mod(x.x, y),\r
+            mod(x.y, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> mod\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            mod(x.x, y),\r
+            mod(x.y, y),\r
+            mod(x.z, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> mod\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            mod(x.x, y),\r
+            mod(x.y, y),\r
+            mod(x.z, y),\r
+            mod(x.w, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> mod\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            mod(x.x, y.x),\r
+            mod(x.y, y.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> mod\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            mod(x.x, y.x),\r
+            mod(x.y, y.y),\r
+            mod(x.z, y.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> mod\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            mod(x.x, y.x),\r
+            mod(x.y, y.y),\r
+            mod(x.z, y.z),\r
+            mod(x.w, y.w));\r
+    }\r
+\r
+    // modf\r
+    template <typename genType>\r
+    inline genType modf\r
+       (\r
+               genType const & x, \r
+               genType & i\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               i = glm::floor(x);\r
+\r
+        return x - i;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> modf\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            modf(x.x, y.x),\r
+            modf(x.y, y.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> modf\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            modf(x.x, y.x),\r
+            modf(x.y, y.y),\r
+            modf(x.z, y.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> modf\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            modf(x.x, y.x),\r
+            modf(x.y, y.y),\r
+            modf(x.z, y.z),\r
+            modf(x.w, y.w));\r
+    }\r
+\r
+       //// Only valid if (INT_MIN <= x-y <= INT_MAX)\r
+       //// min(x,y)\r
+       //r = y + ((x - y) & ((x - y) >> (sizeof(int) *\r
+       //CHAR_BIT \96 1)));\r
+       //// max(x,y)\r
+       //r = x - ((x - y) & ((x - y) >> (sizeof(int) *\r
+       //CHAR_BIT - 1)));\r
+\r
+    // min\r
+    template <typename genType>\r
+    inline genType min\r
+       (\r
+               genType const & x, \r
+               genType const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<genType>::is_float || \r
+                       detail::type<genType>::is_int ||\r
+                       detail::type<genType>::is_uint);\r
+\r
+        return x < y ? x : y;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> min\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            min(x.x, y),\r
+            min(x.y, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> min\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            min(x.x, y),\r
+            min(x.y, y),\r
+            min(x.z, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> min\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            min(x.x, y),\r
+            min(x.y, y),\r
+            min(x.z, y),\r
+            min(x.w, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> min\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            min(x.x, y.x),\r
+            min(x.y, y.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> min\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            min(x.x, y.x),\r
+            min(x.y, y.y),\r
+            min(x.z, y.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> min\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            min(x.x, y.x),\r
+            min(x.y, y.y),\r
+            min(x.z, y.z),\r
+            min(x.w, y.w));\r
+    }\r
+\r
+    // max\r
+    template <typename genType>\r
+    inline genType max\r
+       (\r
+               genType const & x, \r
+               genType const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<genType>::is_float || \r
+                       detail::type<genType>::is_int ||\r
+                       detail::type<genType>::is_uint);\r
+\r
+               return x > y ? x : y;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> max\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            max(x.x, y),\r
+            max(x.y, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> max\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            max(x.x, y),\r
+            max(x.y, y),\r
+            max(x.z, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> max\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               valType y\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            max(x.x, y),\r
+            max(x.y, y),\r
+            max(x.z, y),\r
+            max(x.w, y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> max\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            max(x.x, y.x),\r
+            max(x.y, y.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> max\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            max(x.x, y.x),\r
+            max(x.y, y.y),\r
+            max(x.z, y.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> max\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y)\r
+    {\r
+        return detail::tvec4<valType>(\r
+            max(x.x, y.x),\r
+            max(x.y, y.y),\r
+            max(x.z, y.z),\r
+            max(x.w, y.w));\r
+    }\r
+\r
+    // clamp\r
+    template <typename valType>\r
+    inline valType clamp\r
+       (\r
+               valType const & x, \r
+               valType const & minVal, \r
+               valType const & maxVal\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int ||\r
+                       detail::type<valType>::is_uint);\r
+               \r
+               if(x >= maxVal) return maxVal; \r
+        if(x <= minVal) return minVal;\r
+           return x;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> clamp\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               valType minVal, \r
+               valType maxVal\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            clamp(x.x, minVal, maxVal),\r
+            clamp(x.y, minVal, maxVal));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> clamp\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               valType minVal, \r
+               valType maxVal\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            clamp(x.x, minVal, maxVal),\r
+            clamp(x.y, minVal, maxVal),\r
+            clamp(x.z, minVal, maxVal));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> clamp\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               valType minVal, \r
+               valType maxVal\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            clamp(x.x, minVal, maxVal),\r
+            clamp(x.y, minVal, maxVal),\r
+            clamp(x.z, minVal, maxVal),\r
+            clamp(x.w, minVal, maxVal));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> clamp\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & minVal, \r
+               detail::tvec2<valType> const & maxVal\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            clamp(x.x, minVal.x, maxVal.x),\r
+            clamp(x.y, minVal.y, maxVal.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> clamp\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & minVal, \r
+               detail::tvec3<valType> const & maxVal\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            clamp(x.x, minVal.x, maxVal.x),\r
+            clamp(x.y, minVal.y, maxVal.y),\r
+            clamp(x.z, minVal.z, maxVal.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> clamp\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & minVal, \r
+               detail::tvec4<valType> const & maxVal\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            clamp(x.x, minVal.x, maxVal.x),\r
+            clamp(x.y, minVal.y, maxVal.y),\r
+            clamp(x.z, minVal.z, maxVal.z),\r
+            clamp(x.w, minVal.w, maxVal.w));\r
+    }\r
+\r
+       // mix\r
+       template <typename genTypeT, typename genTypeU>\r
+       inline genTypeT mix\r
+       (\r
+               genTypeT const & x, \r
+               genTypeT const & y, \r
+               genTypeU const & a\r
+       )\r
+       {\r
+               // It could be a vector too\r
+               //GLM_STATIC_ASSERT(\r
+               //      detail::type<genTypeT>::is_float && \r
+               //      detail::type<genTypeU>::is_float);\r
+\r
+               //return x + a * (y - x);\r
+               return genTypeU(x) + a * genTypeU(y - x);\r
+       }\r
+\r
+       template <typename valTypeA, typename valTypeB>\r
+       inline detail::tvec2<valTypeA> mix\r
+       (\r
+               detail::tvec2<valTypeA> const & x, \r
+               detail::tvec2<valTypeA> const & y, \r
+               valTypeB const & a\r
+       )\r
+       {\r
+               return detail::tvec2<valTypeA>(\r
+                       detail::tvec2<valTypeB>(x) + a * detail::tvec2<valTypeB>(y - x));\r
+       }\r
+\r
+       template <typename valTypeA, typename valTypeB>\r
+       inline detail::tvec3<valTypeA> mix\r
+       (\r
+               detail::tvec3<valTypeA> const & x, \r
+               detail::tvec3<valTypeA> const & y, \r
+               valTypeB const & a\r
+       )\r
+       {\r
+               return detail::tvec3<valTypeA>(\r
+                       detail::tvec3<valTypeB>(x) + a * detail::tvec3<valTypeB>(y - x));\r
+       }\r
+\r
+       template <typename valTypeA, typename valTypeB>\r
+       inline detail::tvec4<valTypeA> mix\r
+       (\r
+               detail::tvec4<valTypeA> const & x, \r
+               detail::tvec4<valTypeA> const & y, \r
+               valTypeB const & a\r
+       )\r
+       {\r
+               return detail::tvec4<valTypeA>(\r
+                       detail::tvec4<valTypeB>(x) + a * detail::tvec4<valTypeB>(y - x));\r
+       }\r
+\r
+       template <typename valTypeA, typename valTypeB>\r
+       inline detail::tvec2<valTypeA> mix\r
+       (\r
+               detail::tvec2<valTypeA> const & x, \r
+               detail::tvec2<valTypeA> const & y, \r
+               detail::tvec2<valTypeB> const & a\r
+       )\r
+       {\r
+               return detail::tvec2<valTypeA>(\r
+                       detail::tvec2<valTypeB>(x) + a * detail::tvec2<valTypeB>(y - x));\r
+       }\r
+\r
+       template <typename valTypeA, typename valTypeB>\r
+       inline detail::tvec3<valTypeA> mix\r
+       (\r
+               detail::tvec3<valTypeA> const & x, \r
+               detail::tvec3<valTypeA> const & y, \r
+               detail::tvec3<valTypeB> const & a\r
+       )\r
+       {\r
+               return detail::tvec3<valTypeA>(\r
+                       detail::tvec3<valTypeB>(x) + a * detail::tvec3<valTypeB>(y - x));\r
+       }\r
+\r
+       template <typename valTypeA, typename valTypeB>\r
+       inline detail::tvec4<valTypeA> mix\r
+       (\r
+               detail::tvec4<valTypeA> const & x, \r
+               detail::tvec4<valTypeA> const & y, \r
+               detail::tvec4<valTypeB> const & a\r
+       )\r
+       {\r
+               return detail::tvec4<valTypeA>(\r
+                       detail::tvec4<valTypeB>(x) + a * detail::tvec4<valTypeB>(y - x));\r
+       }\r
+\r
+       //template <typename genTypeT>\r
+       //inline genTypeT mix\r
+       //(\r
+       //      genTypeT const & x, \r
+       //      genTypeT const & y, \r
+       //      float const & a\r
+       //)\r
+       //{\r
+       //      // It could be a vector too\r
+       //      //GLM_STATIC_ASSERT(\r
+       //      //      detail::type<genTypeT>::is_float && \r
+       //      //      detail::type<genTypeU>::is_float);\r
+\r
+       //      return x + a * (y - x);\r
+       //}\r
+\r
+       template <typename genType>\r
+       inline genType mix\r
+       (\r
+               genType const & x, \r
+               genType const & y, \r
+               bool a\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return a ? x : y;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec2<valType> mix\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y, \r
+               typename detail::tvec2<valType>::bool_type a\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tvec2<valType> result;\r
+               for\r
+               (\r
+                       typename detail::tvec2<valType>::size_type i = 0; \r
+                       i < detail::tvec2<valType>::value_size(); \r
+                       ++i\r
+               )\r
+               {\r
+                       result[i] = a[i] ? x[i] : y[i];\r
+               }\r
+               return result;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec3<valType> mix\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y, \r
+               typename detail::tvec3<valType>::bool_type a\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tvec3<valType> result;\r
+               for\r
+               (\r
+                       typename detail::tvec3<valType>::size_type i = 0; \r
+                       i < detail::tvec3<valType>::value_size(); \r
+                       ++i\r
+               )\r
+               {\r
+                       result[i] = a[i] ? x[i] : y[i];\r
+               }\r
+               return result;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec4<valType> mix\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y, \r
+               typename detail::tvec4<valType>::bool_type a\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tvec4<valType> result;\r
+               for\r
+               (\r
+                       typename detail::tvec4<valType>::size_type i = 0; \r
+                       i < detail::tvec4<valType>::value_size(); \r
+                       ++i\r
+               )\r
+               {\r
+                       result[i] = a[i] ? x[i] : y[i];\r
+               }\r
+               return result;\r
+       }\r
+\r
+       // step\r
+    template <typename genType>\r
+    inline genType step\r
+       (\r
+               genType const & edge, \r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return x <= edge ? genType(0) : genType(1);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> step\r
+       (\r
+               valType const & edge, \r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            x.x <= edge ? valType(0) : valType(1),\r
+            x.y <= edge ? valType(0) : valType(1));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> step\r
+       (\r
+               valType const & edge, \r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+               return detail::tvec3<valType>(\r
+                       x.x <= edge ? valType(0) : valType(1),\r
+                       x.y <= edge ? valType(0) : valType(1),\r
+                       x.z <= edge ? valType(0) : valType(1));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> step\r
+       (\r
+               valType edge, \r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            x.x <= edge ? valType(0) : valType(1),\r
+            x.y <= edge ? valType(0) : valType(1),\r
+            x.z <= edge ? valType(0) : valType(1),\r
+            x.w <= edge ? valType(0) : valType(1));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> step\r
+       (\r
+               detail::tvec2<valType> const & edge, \r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            x.x <= edge.x ? valType(0) : valType(1),\r
+            x.y <= edge.y ? valType(0) : valType(1));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> step\r
+       (\r
+               detail::tvec3<valType> const & edge, \r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            x.x <= edge.x ? valType(0) : valType(1),\r
+            x.y <= edge.y ? valType(0) : valType(1),\r
+            x.z <= edge.z ? valType(0) : valType(1));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> step\r
+       (\r
+               detail::tvec4<valType> const & edge, \r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            x.x <= edge.x ? valType(0) : valType(1),\r
+            x.y <= edge.y ? valType(0) : valType(1),\r
+            x.z <= edge.z ? valType(0) : valType(1),\r
+            x.w <= edge.w ? valType(0) : valType(1));\r
+    }\r
+\r
+    // smoothstep\r
+    template <typename genType>\r
+    inline genType smoothstep\r
+       (\r
+               genType const & edge0, \r
+               genType const & edge1, \r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        genType tmp = clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1));\r
+        return tmp * tmp * (genType(3) - genType(2) * tmp);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> smoothstep\r
+       (\r
+               valType const & edge0, \r
+               valType const & edge1, \r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            smoothstep(edge0, edge1, x.x),\r
+            smoothstep(edge0, edge1, x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> smoothstep\r
+       (\r
+               valType const & edge0, \r
+               valType const & edge1, \r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            smoothstep(edge0, edge1, x.x),\r
+            smoothstep(edge0, edge1, x.y),\r
+            smoothstep(edge0, edge1, x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> smoothstep\r
+       (\r
+               valType const & edge0, \r
+               valType const & edge1, \r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            smoothstep(edge0, edge1, x.x),\r
+            smoothstep(edge0, edge1, x.y),\r
+            smoothstep(edge0, edge1, x.z),\r
+            smoothstep(edge0, edge1, x.w));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> smoothstep\r
+       (\r
+               detail::tvec2<valType> const & edge0, \r
+               detail::tvec2<valType> const & edge1, \r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            smoothstep(edge0.x, edge1.x, x.x),\r
+            smoothstep(edge0.y, edge1.y, x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> smoothstep\r
+       (\r
+               detail::tvec3<valType> const & edge0, \r
+               detail::tvec3<valType> const & edge1, \r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            smoothstep(edge0.x, edge1.x, x.x),\r
+            smoothstep(edge0.y, edge1.y, x.y),\r
+            smoothstep(edge0.z, edge1.z, x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> smoothstep\r
+       (\r
+               detail::tvec4<valType> const & edge0, \r
+               detail::tvec4<valType> const & edge1, \r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            smoothstep(edge0.x, edge1.x, x.x),\r
+            smoothstep(edge0.y, edge1.y, x.y),\r
+            smoothstep(edge0.z, edge1.z, x.z),\r
+            smoothstep(edge0.w, edge1.w, x.w));\r
+    }\r
+\r
+       template <typename genType> \r
+       inline typename genType::bool_type isnan\r
+       (\r
+               genType const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)\r
+               return typename genType::bool_type(_isnan(x));\r
+#else\r
+               return typename genType::bool_type(std::isnan(x));\r
+#endif\r
+       }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec2<valType>::bool_type isnan\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return typename detail::tvec2<valType>::bool_type(\r
+            isnan(x.x),\r
+            isnan(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec3<valType>::bool_type isnan\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return typename detail::tvec3<valType>::bool_type(\r
+            isnan(x.x),\r
+            isnan(x.y),\r
+            isnan(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec4<valType>::bool_type isnan\r
+       (\r
+               const detail::tvec4<valType>& x\r
+       )\r
+    {\r
+        return typename detail::tvec4<valType>::bool_type(\r
+            isnan(x.x),\r
+            isnan(x.y),\r
+            isnan(x.z),\r
+            isnan(x.w));\r
+    }\r
+\r
+       template <typename genType> \r
+       inline typename genType::bool_type isinf\r
+       (\r
+               genType const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)\r
+               return typename genType::bool_type(_fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF);\r
+#else\r
+               return typename genType::bool_type(std::isinf(x));\r
+#endif\r
+       }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec2<valType>::bool_type isinf\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return typename detail::tvec2<valType>::bool_type(\r
+            isnan(x.x),\r
+            isnan(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec3<valType>::bool_type isinf\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return typename detail::tvec3<valType>::bool_type(\r
+            isnan(x.x),\r
+            isnan(x.y),\r
+            isnan(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec4<valType>::bool_type isinf\r
+       (\r
+               const detail::tvec4<valType>& x\r
+       )\r
+    {\r
+        return typename detail::tvec4<valType>::bool_type(\r
+            isnan(x.x),\r
+            isnan(x.y),\r
+            isnan(x.z),\r
+            isnan(x.w));\r
+    }\r
+\r
+       }//namespace common\r
+       }//namespace function\r
+       }//namespace core\r
+}//namespace glm\r
diff --git a/glm/core/func_exponential.hpp b/glm/core/func_exponential.hpp
new file mode 100644 (file)
index 0000000..3f5e3b5
--- /dev/null
@@ -0,0 +1,71 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-08\r
+// Updated : 2008-09-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_exponential.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_func_exponential\r
+#define glm_core_func_exponential\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_core_func_exponential();\r
+       }//namespace test\r
+\r
+       namespace core{\r
+       namespace function{\r
+       //! Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace.\r
+       namespace exponential{\r
+\r
+       //! Returns x raised to the y power. \r
+       //! (From GLSL 1.30.08 specification, section 8.2)\r
+       template <typename genType> \r
+       genType pow(genType const & x, genType const & y);\r
+\r
+       //! Returns the natural exponentiation of x, i.e., e^x.\r
+       //! (From GLSL 1.30.08 specification, section 8.2)\r
+       template <typename genType> \r
+       genType exp(genType const & x);\r
+\r
+       //! Returns the natural logarithm of x, i.e., \r
+       //! returns the value y which satisfies the equation x = e^y. \r
+       //! Results are undefined if x <= 0.\r
+       //! (From GLSL 1.30.08 specification, section 8.2)\r
+       template <typename genType> \r
+       genType log(genType const & x);\r
+\r
+       //! Returns 2 raised to the x power.\r
+       //! (From GLSL 1.30.08 specification, section 8.2)\r
+       template <typename genType> \r
+       genType exp2(genType const & x);\r
+\r
+       //! Returns the base 2 log of x, i.e., returns the value y, \r
+       //! which satisfies the equation x = 2 ^ y.\r
+       //! (From GLSL 1.30.08 specification, section 8.2)\r
+       template <typename genType> \r
+       genType log2(genType const & x);\r
+\r
+       //! Returns the positive square root of x.\r
+       //! (From GLSL 1.30.08 specification, section 8.2)\r
+       template <typename genType> \r
+       genType sqrt(genType const & x);\r
+    \r
+       //! Returns the reciprocal of the positive square root of x.\r
+       //! (From GLSL 1.30.08 specification, section 8.2)\r
+       template <typename genType> \r
+       genType inversesqrt(genType const & x);\r
+\r
+       }//namespace exponential\r
+       }//namespace function\r
+       }//namespace core\r
+\r
+       using namespace core::function::exponential;\r
+}//namespace glm\r
+\r
+#include "func_exponential.inl"\r
+\r
+#endif//glm_core_func_exponential\r
diff --git a/glm/core/func_exponential.inl b/glm/core/func_exponential.inl
new file mode 100644 (file)
index 0000000..33e75ff
--- /dev/null
@@ -0,0 +1,358 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-09-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_exponential.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace function{\r
+       namespace exponential{\r
+\r
+    // pow\r
+    template <typename genType>\r
+    inline genType pow\r
+       (\r
+               genType const & x, \r
+               genType const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::pow(x, y);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> pow\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            pow(x.x, y.x),\r
+            pow(x.y, y.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> pow\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            pow(x.x, y.x),\r
+            pow(x.y, y.y),\r
+            pow(x.z, y.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> pow\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            pow(x.x, y.x),\r
+            pow(x.y, y.y),\r
+            pow(x.z, y.z),\r
+            pow(x.w, y.w));\r
+    }\r
+\r
+    // exp\r
+    template <typename genType>\r
+    inline genType exp\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::exp(x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> exp\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            exp(x.x),\r
+            exp(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> exp\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            exp(x.x),\r
+            exp(x.y),\r
+            exp(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> exp\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            exp(x.x),\r
+            exp(x.y),\r
+            exp(x.z),\r
+            exp(x.w));\r
+    }\r
+\r
+    // log\r
+    template <typename genType>\r
+    inline genType log\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::log(x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> log\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            log(x.x),\r
+            log(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> log\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            log(x.x),\r
+            log(x.y),\r
+            log(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> log\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            log(x.x),\r
+            log(x.y),\r
+            log(x.z),\r
+            log(x.w));\r
+    }\r
+\r
+    //exp2, ln2 = 0.69314718055994530941723212145818f\r
+    template <typename genType>\r
+    inline genType exp2\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::exp(genType(0.69314718055994530941723212145818) * x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> exp2\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            exp2(x.x),\r
+            exp2(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> exp2\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            exp2(x.x),\r
+            exp2(x.y),\r
+            exp2(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> exp2\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            exp2(x.x),\r
+            exp2(x.y),\r
+            exp2(x.z),\r
+            exp2(x.w));\r
+    }\r
+\r
+    // log2, ln2 = 0.69314718055994530941723212145818f\r
+    template <typename genType>\r
+    inline genType log2\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::log(x) / genType(0.69314718055994530941723212145818);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> log2\r
+       (\r
+               const detail::tvec2<valType>& x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            log2(x.x),\r
+            log2(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> log2\r
+       (\r
+               const detail::tvec3<valType>& x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            log2(x.x),\r
+            log2(x.y),\r
+            log2(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> log2\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            log2(x.x),\r
+            log2(x.y),\r
+            log2(x.z),\r
+            log2(x.w));\r
+    }\r
+\r
+    // sqrt\r
+    template <typename genType>\r
+    inline genType sqrt\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return genType(::std::sqrt(double(x)));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> sqrt\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            sqrt(x.x),\r
+            sqrt(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> sqrt\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            sqrt(x.x),\r
+            sqrt(x.y),\r
+            sqrt(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> sqrt\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            sqrt(x.x),\r
+            sqrt(x.y),\r
+            sqrt(x.z),\r
+            sqrt(x.w));\r
+    }\r
+\r
+    template <typename genType>\r
+    inline genType inversesqrt\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return genType(1) / ::std::sqrt(x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> inversesqrt\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            inversesqrt(x.x),\r
+            inversesqrt(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> inversesqrt\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            inversesqrt(x.x),\r
+            inversesqrt(x.y),\r
+            inversesqrt(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> inversesqrt\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            inversesqrt(x.x),\r
+            inversesqrt(x.y),\r
+            inversesqrt(x.z),\r
+            inversesqrt(x.w));\r
+    }\r
+\r
+       }//namespace exponential\r
+       }//namespace function\r
+       }//namespace core\r
+}//namespace glm\r
diff --git a/glm/core/func_geometric.hpp b/glm/core/func_geometric.hpp
new file mode 100644 (file)
index 0000000..b54c757
--- /dev/null
@@ -0,0 +1,76 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-09-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_geometric.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_func_geometric\r
+#define glm_core_func_geometric\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_core_func_geometric();\r
+       }//namespace test\r
+\r
+       namespace core{\r
+       namespace function{\r
+       //! Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace.\r
+       namespace geometric{\r
+\r
+       //! Returns the length of x, i.e., sqrt(x * x).\r
+       //! (From GLSL 1.30.08 specification, section 8.4)\r
+       template <typename genType> \r
+       typename genType::value_type length(genType const & x); \r
+\r
+       //! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).\r
+    //! (From GLSL 1.30.08 specification, section 8.4)\r
+       template <typename genType> \r
+       typename genType::value_type distance(genType const & p0, genType const & p1);\r
+\r
+       //! Returns the dot product of x and y, i.e., result = x * y.\r
+       //! (From GLSL 1.30.08 specification, section 8.4)\r
+    template <typename genType> \r
+       typename genType::value_type dot(genType const & x, genType const & y);\r
+\r
+       //! Returns the cross product of x and y.\r
+    //! (From GLSL 1.30.08 specification, section 8.4)\r
+    template <typename valType> \r
+       detail::tvec3<valType> cross(detail::tvec3<valType> const & x, detail::tvec3<valType> const & y);\r
+\r
+       //! Returns a vector in the same direction as x but with length of 1.\r
+       //! (From GLSL 1.30.08 specification, section 8.4)\r
+       template <typename genType> \r
+       genType normalize(genType const & x);\r
+\r
+       //! If dot(Nref, I) < 0.0, return N, otherwise, return -N.\r
+       //! (From GLSL 1.30.08 specification, section 8.4)\r
+    template <typename genType> \r
+       genType faceforward(genType const & N, genType const & I, genType const & Nref);\r
+  \r
+       //! For the incident vector I and surface orientation N, \r
+       //! returns the reflection direction : result = I - 2.0 * dot(N, I) * N.\r
+       //! (From GLSL 1.30.08 specification, section 8.4)\r
+    template <typename genType> \r
+       genType reflect(genType const & I, genType const & N);\r
+  \r
+       //! For the incident vector I and surface normal N, \r
+       //! and the ratio of indices of refraction eta, \r
+       //! return the refraction vector.\r
+       //! (From GLSL 1.30.08 specification, section 8.4)\r
+    template <typename genType> \r
+       genType refract(genType const & I, genType const & N, typename genType::value_type const & eta);\r
+\r
+       }//namespace geometric\r
+       }//namespace function\r
+       }//namespace core\r
+\r
+       using namespace core::function::geometric;\r
+}//namespace glm\r
+\r
+#include "func_geometric.inl"\r
+\r
+#endif//glm_core_func_geometric\r
diff --git a/glm/core/func_geometric.inl b/glm/core/func_geometric.inl
new file mode 100644 (file)
index 0000000..32871d6
--- /dev/null
@@ -0,0 +1,290 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-09-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_geometric.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace function{\r
+       namespace geometric{\r
+\r
+    // length\r
+    template <typename genType>\r
+       inline genType length\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        genType sqr = x * x;\r
+        return sqrt(sqr);\r
+    }\r
+               \r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::value_type length\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        valType sqr = x.x * x.x + x.y * x.y;\r
+        return sqrt(sqr);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec3<valType>::value_type length\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        valType sqr = x.x * x.x + x.y * x.y + x.z * x.z;\r
+        return sqrt(sqr);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec4<valType>::value_type length\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w;\r
+        return sqrt(sqr);\r
+    }\r
+\r
+    // distance\r
+       template <typename genType>\r
+    inline genType distance\r
+       (\r
+               genType const & p0, \r
+               genType const & p1\r
+       )\r
+    {\r
+        GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return length(p1 - p0);\r
+    }\r
\r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::value_type distance\r
+       (\r
+               detail::tvec2<valType> const & p0,\r
+               detail::tvec2<valType> const & p1\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        return length(p1 - p0);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec3<valType>::value_type distance\r
+       (\r
+               detail::tvec3<valType> const & p0,\r
+               detail::tvec3<valType> const & p1\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               return length(p1 - p0);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec4<valType>::value_type distance\r
+       (\r
+               detail::tvec4<valType> const & p0,\r
+               detail::tvec4<valType> const & p1\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               return length(p1 - p0);\r
+    }\r
+\r
+       // dot\r
+       template <typename genType>\r
+       inline genType dot\r
+       (\r
+               genType const & x, \r
+               genType const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return x * y;\r
+       }\r
+\r
+    template <typename valType>\r
+       inline typename detail::tvec2<valType>::value_type dot\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               return x.x * y.x + x.y * y.y;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline valType dot\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               return x.x * y.x + x.y * y.y + x.z * y.z;\r
+    }\r
+/* // SSE3\r
+    inline float dot(const tvec4<float>& x, const tvec4<float>& y)\r
+    {\r
+           float Result;\r
+           __asm\r
+        {\r
+                   mov         esi, x\r
+                   mov         edi, y\r
+                   movaps      xmm0, [esi]\r
+                   mulps       xmm0, [edi]\r
+                   haddps(     _xmm0, _xmm0 )\r
+                   haddps(     _xmm0, _xmm0 )\r
+                   movss       Result, xmm0\r
+           }\r
+           return Result;\r
+    }\r
+*/\r
+    template <typename valType>\r
+    inline valType dot\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w;\r
+    }\r
+\r
+    // cross\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> cross\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        return detail::tvec3<valType>(\r
+            x.y * y.z - y.y * x.z,\r
+            x.z * y.x - y.z * x.x,\r
+            x.x * y.y - y.x * x.y);\r
+    }\r
+\r
+    // normalize\r
+    template <typename genType>\r
+    inline genType normalize\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return x < genType(0) ? genType(-1) : genType(1);\r
+    }\r
+\r
+    // According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> normalize\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+               \r
+               valType sqr = x.x * x.x + x.y * x.y;\r
+           return x * inversesqrt(sqr);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> normalize\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType sqr = x.x * x.x + x.y * x.y + x.z * x.z;\r
+           return x * inversesqrt(sqr);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> normalize\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+               \r
+               valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w;\r
+           return x * inversesqrt(sqr);\r
+    }\r
+\r
+    // faceforward\r
+       template <typename genType>\r
+       inline genType faceforward\r
+       (\r
+               genType const & N, \r
+               genType const & I, \r
+               genType const & Nref\r
+       )\r
+       {\r
+               return dot(Nref, I) < 0 ? N : -N;\r
+       }\r
+\r
+       // reflect\r
+       template <typename genType>\r
+       genType reflect\r
+       (\r
+               genType const & I, \r
+               genType const & N\r
+       )\r
+       {\r
+               return I - N * dot(N, I) * float(2);\r
+       }\r
+\r
+    // refract\r
+    template <typename genType>\r
+    inline genType refract\r
+       (\r
+               genType const & I, \r
+               genType const & N, \r
+               typename genType::value_type const & eta\r
+       )\r
+    {\r
+               //It could be a vector\r
+               //GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        typename genType::value_type dotValue = dot(N, I);\r
+        typename genType::value_type k = typename genType::value_type(1) - eta * eta * (typename genType::value_type(1) - dotValue * dotValue);\r
+        if(k < typename genType::value_type(0))\r
+            return genType(0);\r
+        else\r
+            return eta * I - (eta * dotValue + sqrt(k)) * N;\r
+    }\r
+\r
+       }//namespace geometric\r
+       }//namespace function\r
+       }//namespace core\r
+}//namespace glm\r
diff --git a/glm/core/func_matrix.hpp b/glm/core/func_matrix.hpp
new file mode 100644 (file)
index 0000000..2c21dd2
--- /dev/null
@@ -0,0 +1,63 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-08-03\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_matrix.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_func_matrix\r
+#define glm_core_func_matrix\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_core_func_matrix();\r
+       }//namespace test\r
+\r
+       namespace core{\r
+       namespace function{\r
+       //! Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace.\r
+       namespace matrix{\r
+\r
+       //! Multiply matrix x by matrix y component-wise, i.e., \r
+       //! result[i][j] is the scalar product of x[i][j] and y[i][j].\r
+       //! (From GLSL 1.30.08 specification, section 8.5)\r
+       template <typename matType> \r
+       matType matrixCompMult(matType const & x, matType const & y);\r
+\r
+       //! Treats the first parameter c as a column vector \r
+       //! and the second parameter r as a row vector\r
+       //! and does a linear algebraic matrix multiply c * r.\r
+       //! (From GLSL 1.30.08 specification, section 8.5)\r
+       template <typename vecType, typename matType> \r
+       matType outerProduct(vecType const & c, vecType const & r);\r
+\r
+       //! Returns the transposed matrix of x\r
+       //! (From GLSL 1.30.08 specification, section 8.5)\r
+       template <typename matType> \r
+       typename matType::transpose_type transpose(matType const & x);\r
+       \r
+       //! Return the determinant of a matrix. \r
+       //! (From GLSL 1.50.09 specification, section 8.5). genType: mat2, mat3, mat4.\r
+       template <typename genType> \r
+       typename genType::value_type determinant(\r
+               genType const & m);\r
+\r
+       //! Return the inverse of a matrix. \r
+       //! (From GLSL 1.40.07 specification, section 8.5). genType: mat2, mat3, mat4.\r
+       template <typename genType> \r
+       genType inverse(\r
+               genType const & m);\r
+\r
+       }//namespace matrix\r
+       }//namespace function\r
+       }//namespace core\r
+\r
+       using namespace core::function::matrix;\r
+}//namespace glm\r
+\r
+#include "func_matrix.inl"\r
+\r
+#endif//glm_core_func_matrix\r
diff --git a/glm/core/func_matrix.inl b/glm/core/func_matrix.inl
new file mode 100644 (file)
index 0000000..2eb1351
--- /dev/null
@@ -0,0 +1,760 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-03-08\r
+// Updated : 2008-03-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_matrix.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace function{\r
+       namespace matrix{\r
+\r
+    // matrixCompMult\r
+/*\r
+    template <typename valType>\r
+    inline detail::tmat2x2<valType> matrixCompMult\r
+       (\r
+               detail::tmat2x2<valType> const & x, \r
+               detail::tmat2x2<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat2x2<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat2x2<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tmat3x3<valType> matrixCompMult\r
+       (\r
+               detail::tmat3x3<valType> const & x, \r
+               detail::tmat3x3<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat3x3<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat3x3<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat4x4<valType> matrixCompMult\r
+       (\r
+               detail::tmat4x4<valType> const & x, \r
+               detail::tmat4x4<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat4x4<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat4x4<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat2x3<valType> matrixCompMult\r
+       (\r
+               detail::tmat2x3<valType> const & x, \r
+               detail::tmat2x3<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat2x3<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat2x3<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat3x2<valType> matrixCompMult\r
+       (\r
+               detail::tmat3x2<valType> const & x, \r
+               detail::tmat3x2<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat3x2<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat3x2<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat2x4<valType> matrixCompMult\r
+       (\r
+               detail::tmat2x4<valType> const & x, \r
+               detail::tmat2x4<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat2x4<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat2x4<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat4x2<valType> matrixCompMult\r
+       (\r
+               detail::tmat4x2<valType> const & x, \r
+               detail::tmat4x2<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat4x2<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat4x2<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat3x4<valType> matrixCompMult\r
+       (\r
+               detail::tmat3x4<valType> const & x, \r
+               detail::tmat3x4<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat3x4<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat3x4<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat4x3<valType> matrixCompMult\r
+       (\r
+               detail::tmat4x3<valType> const & x, \r
+               detail::tmat4x3<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat4x3<valType> result;\r
+               for(std::size_t i = 0; i < detail::tmat4x3<valType>::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+*/\r
+    template <typename matType>\r
+    inline matType matrixCompMult\r
+       (\r
+               matType const & x, \r
+               matType const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<typename matType::value_type>::is_float);\r
+\r
+        matType result;\r
+               for(typename matType::size_type i = 0; i < typename matType::col_size(); ++i)\r
+                       result[i] = x[i] * y[i];\r
+        return result;\r
+    }\r
+\r
+       // outerProduct\r
+    template <typename valType>\r
+    inline detail::tmat2x2<valType> outerProduct\r
+       (\r
+               detail::tvec2<valType> const & c, \r
+               detail::tvec2<valType> const & r\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat2x2<valType> m;\r
+               m[0][0] = c[0] * r[0];\r
+               m[0][1] = c[1] * r[0];\r
+               m[1][0] = c[0] * r[1];\r
+               m[1][1] = c[1] * r[1];\r
+        return m;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat3x3<valType> outerProduct\r
+       (\r
+               detail::tvec3<valType> const & c, \r
+               detail::tvec3<valType> const & r\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat3x3<valType> m;\r
+               for(typename detail::tmat3x3<valType>::size_type i = 0; i < detail::tmat3x3<valType>::col_size(); ++i)\r
+                       m[i] = c * r[i];\r
+        return m;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat4x4<valType> outerProduct\r
+       (\r
+               detail::tvec4<valType> const & c, \r
+               detail::tvec4<valType> const & r\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat4x4<valType> m;\r
+               for(typename detail::tmat4x4<valType>::size_type i = 0; i < detail::tmat4x4<valType>::col_size(); ++i)\r
+                       m[i] = c * r[i];\r
+        return m;\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tmat2x3<valType> outerProduct\r
+       (\r
+               detail::tvec3<valType> const & c, \r
+               detail::tvec2<valType> const & r\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat2x3<valType> m;\r
+               m[0][0] = c.x * r.x;\r
+               m[0][1] = c.y * r.x;\r
+               m[0][2] = c.z * r.x;\r
+               m[1][0] = c.x * r.y;\r
+               m[1][1] = c.y * r.y;\r
+               m[1][2] = c.z * r.y;\r
+               return m;\r
+       }\r
+\r
+    template <typename valType>\r
+       inline detail::tmat3x2<valType> outerProduct\r
+       (\r
+               detail::tvec2<valType> const & c, \r
+               detail::tvec3<valType> const & r\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat3x2<valType> m;\r
+               m[0][0] = c.x * r.x;\r
+               m[0][1] = c.y * r.x;\r
+               m[1][0] = c.x * r.y;\r
+               m[1][1] = c.y * r.y;\r
+               m[2][0] = c.x * r.z;\r
+               m[2][1] = c.y * r.z;\r
+               return m;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tmat2x4<valType> outerProduct\r
+       (\r
+               detail::tvec2<valType> const & c, \r
+               detail::tvec4<valType> const & r\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat2x4<valType> m;\r
+               m[0][0] = c.x * r.x;\r
+               m[0][1] = c.y * r.x;\r
+               m[0][2] = c.z * r.x;\r
+               m[0][3] = c.w * r.x;\r
+               m[1][0] = c.x * r.y;\r
+               m[1][1] = c.y * r.y;\r
+               m[1][2] = c.z * r.y;\r
+               m[1][3] = c.w * r.y;\r
+               return m;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tmat4x2<valType> outerProduct\r
+       (\r
+               detail::tvec4<valType> const & c, \r
+               detail::tvec2<valType> const & r\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat4x2<valType> m;\r
+               m[0][0] = c.x * r.x;\r
+               m[0][1] = c.y * r.x;\r
+               m[1][0] = c.x * r.y;\r
+               m[1][1] = c.y * r.y;\r
+               m[2][0] = c.x * r.z;\r
+               m[2][1] = c.y * r.z;\r
+               m[3][0] = c.x * r.w;\r
+               m[3][1] = c.y * r.w;\r
+               return m;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tmat3x4<valType> outerProduct\r
+       (\r
+               detail::tvec4<valType> const & c, \r
+               detail::tvec3<valType> const & r\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat3x4<valType> m;\r
+               m[0][0] = c.x * r.x;\r
+               m[0][1] = c.y * r.x;\r
+               m[0][2] = c.z * r.x;\r
+               m[0][3] = c.w * r.x;\r
+               m[1][0] = c.x * r.y;\r
+               m[1][1] = c.y * r.y;\r
+               m[1][2] = c.z * r.y;\r
+               m[1][3] = c.w * r.y;\r
+               m[2][0] = c.x * r.z;\r
+               m[2][1] = c.y * r.z;\r
+               m[2][2] = c.z * r.z;\r
+               m[2][3] = c.w * r.z;\r
+               return m;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tmat4x3<valType> outerProduct\r
+       (\r
+               detail::tvec3<valType> const & c, \r
+               detail::tvec4<valType> const & r\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat4x3<valType> m;\r
+               m[0][0] = c.x * r.x;\r
+               m[0][1] = c.y * r.x;\r
+               m[0][2] = c.z * r.x;\r
+               m[1][0] = c.x * r.y;\r
+               m[1][1] = c.y * r.y;\r
+               m[1][2] = c.z * r.y;\r
+               m[2][0] = c.x * r.z;\r
+               m[2][1] = c.y * r.z;\r
+               m[2][2] = c.z * r.z;\r
+               m[3][0] = c.x * r.w;\r
+               m[3][1] = c.y * r.w;\r
+               m[3][2] = c.z * r.w;\r
+               return m;\r
+       }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat2x2<valType> transpose\r
+       (\r
+               detail::tmat2x2<valType> const & m\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat2x2<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat3x3<valType> transpose\r
+       (\r
+               detail::tmat3x3<valType> const & m\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat3x3<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+        result[0][2] = m[2][0];\r
+\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+        result[1][2] = m[2][1];\r
+\r
+        result[2][0] = m[0][2];\r
+        result[2][1] = m[1][2];\r
+        result[2][2] = m[2][2];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat4x4<valType> transpose\r
+       (\r
+               detail::tmat4x4<valType> const & m\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat4x4<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+        result[0][2] = m[2][0];\r
+        result[0][3] = m[3][0];\r
+\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+        result[1][2] = m[2][1];\r
+        result[1][3] = m[3][1];\r
+\r
+        result[2][0] = m[0][2];\r
+        result[2][1] = m[1][2];\r
+        result[2][2] = m[2][2];\r
+        result[2][3] = m[3][2];\r
+\r
+        result[3][0] = m[0][3];\r
+        result[3][1] = m[1][3];\r
+        result[3][2] = m[2][3];\r
+        result[3][3] = m[3][3];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat2x3<valType> transpose\r
+       (\r
+               detail::tmat3x2<valType> const & m\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat2x3<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+               result[0][2] = m[2][0];\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+               result[1][2] = m[2][1];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tmat3x2<valType> transpose\r
+       (\r
+               detail::tmat2x3<valType> const & m\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat3x2<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+        result[2][0] = m[0][2];\r
+        result[2][1] = m[1][2];\r
+        return result;\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tmat2x4<valType> transpose\r
+       (\r
+               detail::tmat4x2<valType> const & m\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat2x4<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+               result[0][2] = m[2][0];\r
+               result[0][3] = m[3][0];\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+               result[1][2] = m[2][1];\r
+               result[1][3] = m[3][1];\r
+               return result;\r
+       }\r
+\r
+    template <typename valType>\r
+       inline detail::tmat4x2<valType> transpose\r
+       (\r
+               detail::tmat2x4<valType> const & m\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat4x2<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+        result[2][0] = m[0][2];\r
+        result[2][1] = m[1][2];\r
+        result[3][0] = m[0][3];\r
+        result[3][1] = m[1][3];\r
+        return result;\r
+       }\r
+\r
+    template <typename valType>\r
+       inline detail::tmat3x4<valType> transpose\r
+       (\r
+               detail::tmat4x3<valType> const & m\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               detail::tmat3x4<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+               result[0][2] = m[2][0];\r
+               result[0][3] = m[3][0];\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+               result[1][2] = m[2][1];\r
+               result[1][3] = m[3][1];\r
+        result[2][0] = m[0][2];\r
+        result[2][1] = m[1][2];\r
+               result[2][2] = m[2][2];\r
+               result[2][3] = m[3][2];\r
+               return result;\r
+       }\r
+\r
+    template <typename valType>\r
+       inline detail::tmat4x3<valType> transpose\r
+       (\r
+               detail::tmat3x4<valType> const & m\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+        detail::tmat4x3<valType> result;\r
+        result[0][0] = m[0][0];\r
+        result[0][1] = m[1][0];\r
+               result[0][2] = m[2][0];\r
+        result[1][0] = m[0][1];\r
+        result[1][1] = m[1][1];\r
+               result[1][2] = m[2][1];\r
+        result[2][0] = m[0][2];\r
+        result[2][1] = m[1][2];\r
+               result[2][2] = m[2][2];\r
+        result[3][0] = m[0][3];\r
+        result[3][1] = m[1][3];\r
+               result[3][2] = m[2][3];\r
+        return result;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tmat2x2<valType>::value_type determinant\r
+       (\r
+               detail::tmat2x2<valType> const & m\r
+       )\r
+       {\r
+               return m[0][0] * m[1][1] - m[1][0] * m[0][1];\r
+       }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tmat3x3<valType>::value_type determinant\r
+       (\r
+               detail::tmat3x3<valType> const & m\r
+       )\r
+       {\r
+               return m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])\r
+                       - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])\r
+                       + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\r
+       }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tmat4x4<valType>::value_type determinant\r
+       (\r
+               detail::tmat4x4<valType> const & m\r
+       )\r
+       {\r
+               valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\r
+               valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\r
+               valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\r
+               valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\r
+               valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\r
+               valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\r
+\r
+               detail::tvec4<valType> DetCof(\r
+                       + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02),\r
+                       - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04),\r
+                       + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05),\r
+                       - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05));\r
+\r
+               return m[0][0] * DetCof[0]\r
+                        + m[0][1] * DetCof[1]\r
+                        + m[0][2] * DetCof[2]\r
+                        + m[0][3] * DetCof[3];\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat2x2<valType> inverse\r
+       (\r
+               detail::tmat2x2<valType> const & m\r
+       )\r
+       {\r
+               //valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];\r
+               valType Determinant = determinant(m);\r
+\r
+               detail::tmat2x2<valType> Inverse(\r
+                       + m[1][1] / Determinant,\r
+                       - m[1][0] / Determinant,\r
+                       - m[0][1] / Determinant, \r
+                       + m[0][0] / Determinant);\r
+\r
+               return Inverse;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat3x3<valType> inverse\r
+       (\r
+               detail::tmat3x3<valType> const & m\r
+       )\r
+       {\r
+               //valType Determinant = m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])\r
+               //                                      - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])\r
+               //                                      + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\r
+\r
+               valType Determinant = determinant(m);\r
+\r
+               detail::tmat3x3<valType> Inverse;\r
+               Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]);\r
+               Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]);\r
+               Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]);\r
+               Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]);\r
+               Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]);\r
+               Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]);\r
+               Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\r
+               Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]);\r
+               Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]);\r
+               Inverse /= Determinant;\r
+\r
+               return Inverse;\r
+       }\r
+\r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> inverseOgre\r
+       (\r
+               detail::tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        valType m00 = m[0][0], m01 = m[0][1], m02 = m[0][2], m03 = m[0][3];\r
+        valType m10 = m[1][0], m11 = m[1][1], m12 = m[1][2], m13 = m[1][3];\r
+        valType m20 = m[2][0], m21 = m[2][1], m22 = m[2][2], m23 = m[2][3];\r
+        valType m30 = m[3][0], m31 = m[3][1], m32 = m[3][2], m33 = m[3][3];\r
+\r
+        valType v0 = m20 * m31 - m21 * m30;\r
+        valType v1 = m20 * m32 - m22 * m30;\r
+        valType v2 = m20 * m33 - m23 * m30;\r
+        valType v3 = m21 * m32 - m22 * m31;\r
+        valType v4 = m21 * m33 - m23 * m31;\r
+        valType v5 = m22 * m33 - m23 * m32;\r
+\r
+        valType t00 = + (v5 * m11 - v4 * m12 + v3 * m13);\r
+        valType t10 = - (v5 * m10 - v2 * m12 + v1 * m13);\r
+        valType t20 = + (v4 * m10 - v2 * m11 + v0 * m13);\r
+        valType t30 = - (v3 * m10 - v1 * m11 + v0 * m12);\r
+\r
+        valType invDet = 1 / (t00 * m00 + t10 * m01 + t20 * m02 + t30 * m03);\r
+\r
+        valType d00 = t00 * invDet;\r
+        valType d10 = t10 * invDet;\r
+        valType d20 = t20 * invDet;\r
+        valType d30 = t30 * invDet;\r
+\r
+        valType d01 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;\r
+        valType d11 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;\r
+        valType d21 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;\r
+        valType d31 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;\r
+\r
+        v0 = m10 * m31 - m11 * m30;\r
+        v1 = m10 * m32 - m12 * m30;\r
+        v2 = m10 * m33 - m13 * m30;\r
+        v3 = m11 * m32 - m12 * m31;\r
+        v4 = m11 * m33 - m13 * m31;\r
+        v5 = m12 * m33 - m13 * m32;\r
+\r
+        valType d02 = + (v5 * m01 - v4 * m02 + v3 * m03) * invDet;\r
+        valType d12 = - (v5 * m00 - v2 * m02 + v1 * m03) * invDet;\r
+        valType d22 = + (v4 * m00 - v2 * m01 + v0 * m03) * invDet;\r
+        valType d32 = - (v3 * m00 - v1 * m01 + v0 * m02) * invDet;\r
+\r
+        v0 = m21 * m10 - m20 * m11;\r
+        v1 = m22 * m10 - m20 * m12;\r
+        v2 = m23 * m10 - m20 * m13;\r
+        v3 = m22 * m11 - m21 * m12;\r
+        v4 = m23 * m11 - m21 * m13;\r
+        v5 = m23 * m12 - m22 * m13;\r
+\r
+        valType d03 = - (v5 * m01 - v4 * m02 + v3 * m03) * invDet;\r
+        valType d13 = + (v5 * m00 - v2 * m02 + v1 * m03) * invDet;\r
+        valType d23 = - (v4 * m00 - v2 * m01 + v0 * m03) * invDet;\r
+        valType d33 = + (v3 * m00 - v1 * m01 + v0 * m02) * invDet;\r
+\r
+        return detail::tmat4x4<valType>(\r
+            d00, d01, d02, d03,\r
+            d10, d11, d12, d13,\r
+            d20, d21, d22, d23,\r
+            d30, d31, d32, d33);\r
+    }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat4x4<valType> inverse\r
+       (\r
+               detail::tmat4x4<valType> const & m\r
+       )\r
+       {\r
+               valType Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\r
+               valType Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\r
+               valType Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\r
+\r
+               valType Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\r
+               valType Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\r
+               valType Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\r
+\r
+               valType Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\r
+               valType Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\r
+               valType Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\r
+\r
+               valType Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\r
+               valType Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\r
+               valType Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\r
+\r
+               valType Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\r
+               valType Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\r
+               valType Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\r
+\r
+               valType Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\r
+               valType Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\r
+               valType Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\r
+\r
+               detail::tvec4<valType> const SignA(+1, -1, +1, -1);\r
+               detail::tvec4<valType> const SignB(-1, +1, -1, +1);\r
+\r
+               detail::tvec4<valType> Fac0(Coef00, Coef00, Coef02, Coef03);\r
+               detail::tvec4<valType> Fac1(Coef04, Coef04, Coef06, Coef07);\r
+               detail::tvec4<valType> Fac2(Coef08, Coef08, Coef10, Coef11);\r
+               detail::tvec4<valType> Fac3(Coef12, Coef12, Coef14, Coef15);\r
+               detail::tvec4<valType> Fac4(Coef16, Coef16, Coef18, Coef19);\r
+               detail::tvec4<valType> Fac5(Coef20, Coef20, Coef22, Coef23);\r
+\r
+               detail::tvec4<valType> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]);\r
+               detail::tvec4<valType> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]);\r
+               detail::tvec4<valType> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]);\r
+               detail::tvec4<valType> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]);\r
+\r
+               detail::tvec4<valType> Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);\r
+               detail::tvec4<valType> Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);\r
+               detail::tvec4<valType> Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);\r
+               detail::tvec4<valType> Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);\r
+\r
+               detail::tmat4x4<valType> Inverse(Inv0, Inv1, Inv2, Inv3);\r
+\r
+               detail::tvec4<valType> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);\r
+\r
+               valType Determinant = glm::dot(m[0], Row0);\r
+\r
+               Inverse /= Determinant;\r
+           \r
+               return Inverse;\r
+       }\r
+\r
+       }//namespace matrix\r
+       }//namespace function\r
+       }//namespace core\r
+}//namespace glm\r
diff --git a/glm/core/func_noise.hpp b/glm/core/func_noise.hpp
new file mode 100644 (file)
index 0000000..9aa7a72
--- /dev/null
@@ -0,0 +1,53 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-01\r
+// Updated : 2008-09-10\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_noise.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_func_noise\r
+#define glm_core_func_noise\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_core_func_noise();\r
+       }//namespace test\r
+\r
+       namespace core{\r
+       namespace function{\r
+       // Define all noise functions from Section 8.9 of GLSL 1.30.8 specification. Included in glm namespace.\r
+       namespace noise{\r
+\r
+       // Returns a 1D noise value based on the input value x.\r
+       // From GLSL 1.30.08 specification, section 8.9.\r
+       template <typename genType>\r
+       typename genType::value_type noise1(genType const & x);\r
+\r
+       // Returns a 2D noise value based on the input value x.\r
+       // From GLSL 1.30.08 specification, section 8.9.\r
+       template <typename genType>\r
+       detail::tvec2<typename genType::value_type> noise2(genType const & x);\r
+\r
+       // Returns a 3D noise value based on the input value x.\r
+       // From GLSL 1.30.08 specification, section 8.9.\r
+       template <typename genType>\r
+       detail::tvec3<typename genType::value_type> noise3(genType const & x);\r
+\r
+       // Returns a 4D noise value based on the input value x.\r
+       // From GLSL 1.30.08 specification, section 8.9.\r
+       template <typename genType>\r
+       detail::tvec4<typename genType::value_type> noise4(genType const & x);\r
+\r
+       }//namespace noise\r
+       }//namespace function\r
+       }//namespace core\r
+\r
+       using namespace core::function::noise;\r
+}//namespace glm\r
+\r
+#include "func_noise.inl"\r
+\r
+#endif//glm_core_func_noise\r
diff --git a/glm/core/func_noise.inl b/glm/core/func_noise.inl
new file mode 100644 (file)
index 0000000..51995d2
--- /dev/null
@@ -0,0 +1,305 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-01\r
+// Updated : 2008-09-23\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_noise.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace function{\r
+       namespace noise{\r
+\r
+       // noise1\r
+       template <typename genType>\r
+       inline genType noise1\r
+       (\r
+               genType const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               int iNbr = int(x + genType(3) / genType(2)) * 1103515245 + 12345;\r
+               return genType(int(iNbr / genType(65536)) % 32768) / genType(32767);\r
+       }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::value_type noise1\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+       {\r
+               valType tmp(0);\r
+               for(typename detail::tvec2<valType>::size_type i = 0; i < detail::tvec2<valType>::value_size(); ++i)\r
+                       tmp += x[i];\r
+               return noise1(tmp);\r
+       }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec3<valType>::value_type noise1\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+       {\r
+               valType tmp(0);\r
+               for(typename detail::tvec3<valType>::size_type i = 0; i < detail::tvec3<valType>::value_size(); ++i)\r
+                       tmp += x[i];\r
+               return noise1(tmp);\r
+       }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec4<valType>::value_type noise1\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+       {\r
+               valType tmp(0);\r
+               for(typename detail::tvec4<valType>::size_type i = 0; i < detail::tvec4<valType>::value_size(); ++i)\r
+                       tmp += x[i];\r
+               return noise1(tmp);\r
+       }\r
+\r
+       // noise2\r
+       template <typename genType>\r
+       inline detail::tvec2<genType> noise2\r
+       (\r
+               genType const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               genType f1 = x * genType(1103515245) + genType(12345);\r
+               genType f2 = f1 * genType(1103515245) + genType(12345);\r
+               return detail::tvec2<genType>(\r
+                       noise1(f1),\r
+                       noise1(f2));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec2<valType> noise2\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec2<valType>::size_type i = 0; i < detail::tvec2<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               \r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               return detail::tvec2<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec2<valType> noise2\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec3<valType>::size_type i = 0; i < detail::tvec3<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+\r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               return detail::tvec2<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec2<valType> noise2\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec4<valType>::size_type i = 0; i < detail::tvec4<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               \r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               return detail::tvec2<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2));\r
+       }\r
+\r
+       // noise3\r
+       template <typename genType>\r
+       inline detail::tvec3<genType> noise3\r
+       (\r
+               genType const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               genType f1 = x * genType(1103515245) + genType(12345);\r
+               genType f2 = f1 * genType(1103515245) + genType(12345);\r
+               genType f3 = f2 * genType(1103515245) + genType(12345);\r
+               return detail::tvec3<genType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec3<valType> noise3\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec2<valType>::size_type i = 0; i < detail::tvec2<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               valType f3 = f2 * valType(1103515245) + valType(12345);\r
+               return detail::tvec3<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec3<valType> noise3\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec3<valType>::size_type i = 0; i < detail::tvec3<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               valType f3 = f2 * valType(1103515245) + valType(12345);\r
+               return detail::tvec3<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec3<valType> noise3\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec4<valType>::size_type i = 0; i < detail::tvec4<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               valType f3 = f2 * valType(1103515245) + valType(12345);\r
+               return detail::tvec3<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3));\r
+       }\r
+\r
+       // noise4\r
+       template <typename genType>\r
+       inline detail::tvec4<genType> noise4\r
+       (\r
+               genType const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               genType f1 = x * genType(1103515245) + genType(12345);\r
+               genType f2 = f1 * genType(1103515245) + genType(12345);\r
+               genType f3 = f2 * genType(1103515245) + genType(12345);\r
+               genType f4 = f3 * genType(1103515245) + genType(12345);\r
+               return detail::tvec4<genType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3),\r
+                       noise1(f4));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec4<valType> noise4\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec2<valType>::size_type i = 0; i < detail::tvec2<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               valType f3 = f2 * valType(1103515245) + valType(12345);\r
+               valType f4 = f3 * valType(1103515245) + valType(12345);\r
+               return detail::tvec4<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3),\r
+                       noise1(f4));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec4<valType> noise4\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec3<valType>::size_type i = 0; i < detail::tvec3<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               valType f3 = f2 * valType(1103515245) + valType(12345);\r
+               valType f4 = f3 * valType(1103515245) + valType(12345);\r
+               return detail::tvec4<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3),\r
+                       noise1(f4));\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec4<valType> noise4\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(detail::type<valType>::is_float);\r
+\r
+               valType f0(0);\r
+               for(typename detail::tvec4<valType>::size_type i = 0; i < detail::tvec4<valType>::value_size(); ++i)\r
+                       f0 += x[i];\r
+               valType f1 = f0 * valType(1103515245) + valType(12345);\r
+               valType f2 = f1 * valType(1103515245) + valType(12345);\r
+               valType f3 = f2 * valType(1103515245) + valType(12345);\r
+               valType f4 = f3 * valType(1103515245) + valType(12345);\r
+               return detail::tvec4<valType>(\r
+                       noise1(f1),\r
+                       noise1(f2),\r
+                       noise1(f3),\r
+                       noise1(f4));\r
+       }\r
+\r
+       }//namespace noise\r
+       }//namespace function\r
+       }//namespace core\r
+}//namespace glm\r
diff --git a/glm/core/func_trigonometric.hpp b/glm/core/func_trigonometric.hpp
new file mode 100644 (file)
index 0000000..9ef0d94
--- /dev/null
@@ -0,0 +1,125 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-01\r
+// Updated : 2008-09-10\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_trigonometric.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_func_trigonometric\r
+#define glm_core_func_trigonometric\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_core_func_trigonometric();\r
+       }//namespace test\r
+\r
+       namespace core{\r
+       namespace function{\r
+       //! Define Angle and trigonometry functions \r
+       //! from Section 8.1 of GLSL 1.30.8 specification. \r
+       //! Included in glm namespace.\r
+       namespace trigonometric{\r
+\r
+       //! Converts degrees to radians and returns the result.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType radians(genType const & degrees);\r
+\r
+       //! Converts radians to degrees and returns the result.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType degrees(genType const & radians);\r
+\r
+       //! The standard trigonometric sine function. \r
+       //! The values returned by this function will range from [-1, 1].\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType sin(genType const & angle);\r
+\r
+       //! The standard trigonometric cosine function. \r
+       //! The values returned by this function will range from [-1, 1].\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType cos(genType const & angle);\r
+\r
+       //! The standard trigonometric tangent function.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType tan(genType const & angle); \r
+\r
+       //! Arc sine. Returns an angle whose sine is x. \r
+       //! The range of values returned by this function is [-PI/2, PI/2]. \r
+       //! Results are undefined if |x| > 1.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType asin(genType const & x);\r
+\r
+       //! Arc cosine. Returns an angle whose sine is x. \r
+       //! The range of values returned by this function is [0, PI]. \r
+       //! Results are undefined if |x| > 1.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType acos(genType const & x);\r
+\r
+       //! Arc tangent. Returns an angle whose tangent is y/x. \r
+       //! The signs of x and y are used to determine what \r
+       //! quadrant the angle is in. The range of values returned \r
+       //! by this function is [-PI, PI]. Results are undefined \r
+       //! if x and y are both 0. \r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType atan(genType const & y, genType const & x);\r
+\r
+       //! Arc tangent. Returns an angle whose tangent is y_over_x. \r
+       //! The range of values returned by this function is [-PI/2, PI/2].\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType atan(genType const & y_over_x);\r
+\r
+       //! Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType sinh(genType const & angle);\r
+\r
+       //! Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType cosh(genType const & angle);\r
+\r
+       //! Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType tanh(genType const & angle);\r
+\r
+       //! Arc hyperbolic sine; returns the inverse of sinh.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType asinh(genType const & x);\r
+       \r
+       //! Arc hyperbolic cosine; returns the non-negative inverse\r
+       //! of cosh. Results are undefined if x < 1.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType acosh(genType const & x);\r
+\r
+       //! Arc hyperbolic tangent; returns the inverse of tanh.\r
+       //! Results are undefined if abs(x) >= 1.\r
+       //! (From GLSL 1.30.08 specification, section 8.1)\r
+       template <typename genType> \r
+       genType atanh(genType const & x);\r
+\r
+       }//namespace trigonometric\r
+       }//namespace function\r
+       }//namespace core\r
+\r
+       using namespace core::function::trigonometric;\r
+}//namespace glm\r
+\r
+#include "func_trigonometric.inl"\r
+\r
+#endif//glm_core_func_trigonometric\r
+\r
+\r
diff --git a/glm/core/func_trigonometric.inl b/glm/core/func_trigonometric.inl
new file mode 100644 (file)
index 0000000..438e217
--- /dev/null
@@ -0,0 +1,745 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-09-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_trigonometric.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace function{\r
+       namespace trigonometric{\r
+\r
+    // radians\r
+    template <typename genType>\r
+    inline genType radians\r
+       (\r
+               genType const & degrees\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        const genType pi = genType(3.1415926535897932384626433832795);\r
+        return degrees * (pi / genType(180));\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tvec2<valType> radians\r
+       (\r
+               detail::tvec2<valType> const & degrees\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            radians(degrees.x),\r
+            radians(degrees.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> radians\r
+       (\r
+               detail::tvec3<valType> const & degrees\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            radians(degrees.x),\r
+            radians(degrees.y),\r
+            radians(degrees.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> radians\r
+       (\r
+               detail::tvec4<valType> const & degrees\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            radians(degrees.x),\r
+            radians(degrees.y),\r
+            radians(degrees.z),\r
+            radians(degrees.w));\r
+    }\r
+\r
+    // degrees\r
+    template <typename genType>\r
+    inline genType degrees\r
+       (\r
+               genType const & radians\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        const genType pi = genType(3.1415926535897932384626433832795);\r
+        return radians * (genType(180) / pi);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> degrees\r
+       (\r
+               detail::tvec2<valType> const & radians\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            degrees(radians.x),\r
+            degrees(radians.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> degrees\r
+       (       \r
+               detail::tvec3<valType> const & radians\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            degrees(radians.x),\r
+            degrees(radians.y),\r
+            degrees(radians.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> degrees\r
+       (\r
+               detail::tvec4<valType> const & radians\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            degrees(radians.x),\r
+            degrees(radians.y),\r
+            degrees(radians.z),\r
+            degrees(radians.w));\r
+    }\r
+\r
+    // sin\r
+    template <typename genType>\r
+    inline genType sin\r
+       (\r
+               genType const & angle\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return ::std::sin(angle);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> sin\r
+       (\r
+               detail::tvec2<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            sin(angle.x),\r
+            sin(angle.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> sin\r
+       (\r
+               detail::tvec3<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            sin(angle.x),\r
+            sin(angle.y),\r
+            sin(angle.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> sin\r
+       (\r
+               detail::tvec4<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            sin(angle.x),\r
+            sin(angle.y),\r
+            sin(angle.z),\r
+            sin(angle.w));\r
+    }\r
+\r
+    // cos\r
+    template <typename genType>\r
+    inline genType cos(genType const & angle)\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::cos(angle);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> cos\r
+       (\r
+               detail::tvec2<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            cos(angle.x),\r
+            cos(angle.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> cos\r
+       (\r
+               detail::tvec3<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            cos(angle.x),\r
+            cos(angle.y),\r
+            cos(angle.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> cos\r
+       (       \r
+               detail::tvec4<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            cos(angle.x),\r
+            cos(angle.y),\r
+            cos(angle.z),\r
+            cos(angle.w));\r
+    }\r
+\r
+    // tan\r
+    template <typename genType>\r
+    inline genType tan\r
+       (\r
+               genType const & angle\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::tan(angle);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> tan\r
+       (\r
+               detail::tvec2<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            tan(angle.x),\r
+            tan(angle.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> tan\r
+       (\r
+               detail::tvec3<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            tan(angle.x),\r
+            tan(angle.y),\r
+            tan(angle.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> tan\r
+       (\r
+               detail::tvec4<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            tan(angle.x),\r
+            tan(angle.y),\r
+            tan(angle.z),\r
+            tan(angle.w));\r
+    }\r
+\r
+    // asin\r
+    template <typename genType>\r
+    inline genType asin\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::asin(x);\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tvec2<valType> asin\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            asin(x.x),\r
+            asin(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tvec3<valType> asin\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            asin(x.x),\r
+            asin(x.y),\r
+            asin(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tvec4<valType> asin\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            asin(x.x),\r
+            asin(x.y),\r
+            asin(x.z),\r
+            asin(x.w));\r
+    }\r
+\r
+    // acos\r
+    template <typename genType>\r
+    inline genType acos\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::acos(x);\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tvec2<valType> acos\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            acos(x.x),\r
+            acos(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tvec3<valType> acos\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            acos(x.x),\r
+            acos(x.y),\r
+            acos(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+       inline detail::tvec4<valType> acos\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            acos(x.x),\r
+            acos(x.y),\r
+            acos(x.z),\r
+            acos(x.w));\r
+    }\r
+\r
+    // atan\r
+    template <typename genType>\r
+    inline genType atan\r
+       (\r
+               genType const & y, \r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::atan2(y, x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> atan\r
+       (\r
+               detail::tvec2<valType> const & y, \r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            atan(y.x, x.x),\r
+            atan(y.y, x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> atan\r
+       (\r
+               detail::tvec3<valType> const & y, \r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            atan(y.x, x.x),\r
+            atan(y.y, x.y),\r
+            atan(y.z, x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> atan\r
+       (\r
+               detail::tvec4<valType> const & y, \r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            atan(y.x, x.x),\r
+            atan(y.y, x.y),\r
+            atan(y.z, x.z),\r
+            atan(y.w, x.w));\r
+    }\r
+\r
+    template <typename genType>\r
+    inline genType atan\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+        return ::std::atan(x);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec2<valType> atan\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            atan(x.x),\r
+            atan(x.y));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec3<valType> atan\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            atan(x.x),\r
+            atan(x.y),\r
+            atan(x.z));\r
+    }\r
+\r
+    template <typename valType>\r
+    inline detail::tvec4<valType> atan\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            atan(x.x),\r
+            atan(x.y),\r
+            atan(x.z),\r
+            atan(x.w));\r
+    }\r
+\r
+    // sinh\r
+    template <typename genType> \r
+    inline genType sinh\r
+       (\r
+               genType const & angle\r
+       )\r
+    {\r
+        GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return std::sinh(angle);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec2<valType> sinh\r
+       (\r
+               detail::tvec2<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            sinh(angle.x),\r
+            sinh(angle.y));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> sinh\r
+       (\r
+               detail::tvec3<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            sinh(angle.x),\r
+            sinh(angle.y),\r
+            sinh(angle.z));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> sinh\r
+       (\r
+               detail::tvec4<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            sinh(angle.x),\r
+            sinh(angle.y),\r
+            sinh(angle.z),\r
+            sinh(angle.w));\r
+    }\r
+\r
+    // cosh\r
+    template <typename genType> \r
+    inline genType cosh\r
+       (\r
+               genType const & angle\r
+       )\r
+    {\r
+        GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return std::cosh(angle);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec2<valType> cosh\r
+       (\r
+               detail::tvec2<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            cosh(angle.x),\r
+            cosh(angle.y));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> cosh\r
+       (\r
+               detail::tvec3<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            cosh(angle.x),\r
+            cosh(angle.y),\r
+            cosh(angle.z));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> cosh\r
+       (\r
+               detail::tvec4<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            cosh(angle.x),\r
+            cosh(angle.y),\r
+            cosh(angle.z),\r
+            cosh(angle.w));\r
+    }\r
+\r
+    // tanh\r
+    template <typename genType>\r
+    inline genType tanh\r
+       (\r
+               genType const & angle\r
+       )\r
+    {\r
+        GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               return std::tanh(angle);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec2<valType> tanh\r
+       (\r
+               detail::tvec2<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            tanh(angle.x),\r
+            tanh(angle.y));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> tanh\r
+       (\r
+               detail::tvec3<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            tanh(angle.x),\r
+            tanh(angle.y),\r
+            tanh(angle.z));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> tanh\r
+       (\r
+               detail::tvec4<valType> const & angle\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            tanh(angle.x),\r
+            tanh(angle.y),\r
+            tanh(angle.z),\r
+            tanh(angle.w));\r
+    }\r
+\r
+    // asinh\r
+    template <typename genType> \r
+    inline genType asinh\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+               \r
+               return (x < genType(0) ? genType(-1) : (x > genType(0) ? genType(1) : genType(0))) * log(abs(x) + sqrt(genType(1) + x * x));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec2<valType> asinh\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            asinh(x.x),\r
+            asinh(x.y));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> asinh\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            asinh(x.x),\r
+            asinh(x.y),\r
+            asinh(x.z));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> asinh\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            asinh(x.x),\r
+            asinh(x.y),\r
+            asinh(x.z),\r
+            asinh(x.w));\r
+    }\r
+\r
+    // acosh\r
+    template <typename genType> \r
+    inline genType acosh\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+               if(x < genType(1))\r
+                       return genType(0);\r
+               return log(x + sqrt(x * x - genType(1)));\r
+    }\r
+\r
+       template <typename valType> \r
+       inline detail::tvec2<valType> acosh\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+       {\r
+               return detail::tvec2<valType>(\r
+                       acosh(x.x),\r
+                       acosh(x.y));\r
+       }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> acosh\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            acosh(x.x),\r
+            acosh(x.y),\r
+            acosh(x.z));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> acosh\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            acosh(x.x),\r
+            acosh(x.y),\r
+            acosh(x.z),\r
+            acosh(x.w));\r
+    }\r
+\r
+    // atanh\r
+    template <typename genType>\r
+    inline genType atanh\r
+       (\r
+               genType const & x\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+               \r
+               if(abs(x) >= genType(1))\r
+                       return 0;\r
+               return genType(0.5) * log((genType(1) + x) / (genType(1) - x));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec2<valType> atanh\r
+       (\r
+               detail::tvec2<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec2<valType>(\r
+            atanh(x.x),\r
+            atanh(x.y));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> atanh\r
+       (\r
+               detail::tvec3<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(\r
+            atanh(x.x),\r
+            atanh(x.y),\r
+            atanh(x.z));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> atanh\r
+       (\r
+               detail::tvec4<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            atanh(x.x),\r
+            atanh(x.y),\r
+            atanh(x.z),\r
+            atanh(x.w));\r
+    }\r
+\r
+       }//namespace trigonometric\r
+       }//namespace function\r
+       }//namespace core\r
+}//namespace glm\r
diff --git a/glm/core/func_vector_relational.hpp b/glm/core/func_vector_relational.hpp
new file mode 100644 (file)
index 0000000..2985684
--- /dev/null
@@ -0,0 +1,78 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-09-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_vector_relational.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_func_vector_relational\r
+#define glm_core_func_vector_relational\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_core_func_vector_relational();\r
+       }//namespace test\r
+\r
+       namespace core{\r
+       namespace function{\r
+       //! Define vector relational functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace.\r
+       namespace vector_relational{\r
+\r
+       //! Returns the component-wise compare of x < y.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+       template <typename vecType> \r
+       typename vecType::bool_type lessThan(vecType const & x, vecType const & y);\r
+\r
+       //! Returns the component-wise compare of x <= y.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y);\r
+\r
+       //! Returns the component-wise compare of x > y.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       typename vecType::bool_type greaterThan(vecType const & x, vecType const & y);\r
+\r
+       //! Returns the component-wise compare of x >= y.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y);\r
+\r
+       //! Returns the component-wise compare of x == y.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       typename vecType::bool_type equal(vecType const & x, vecType const & y);\r
+\r
+       //! Returns the component-wise compare of x != y.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       typename vecType::bool_type notEqual(vecType const & x, vecType const & y);\r
+\r
+       //! Returns true if any component of x is true.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       bool any(vecType const & x);\r
+\r
+       //! Returns true if all components of x are true.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       bool all(vecType const & x);\r
+\r
+       //! Returns the component-wise logical complement of x.\r
+       //! (From GLSL 1.30.08 specification, section 8.6)\r
+    template <typename vecType> \r
+       typename vecType::bool_type not_(vecType const & x);\r
+\r
+       }//namespace vector_relational\r
+       }//namespace function\r
+       }//namespace core\r
+\r
+       using namespace core::function::vector_relational;\r
+}//namespace glm\r
+\r
+#include "func_vector_relational.inl"\r
+\r
+#endif//glm_core_func_vector_relational\r
diff --git a/glm/core/func_vector_relational.inl b/glm/core/func_vector_relational.inl
new file mode 100644 (file)
index 0000000..b5d4893
--- /dev/null
@@ -0,0 +1,359 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-03\r
+// Updated : 2008-09-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/func_vector_relational.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace function{\r
+       namespace vector_relational{\r
+\r
+    // lessThan\r
+    template <typename valType>\r
+    inline typename detail::tvec2<valType>::bool_type lessThan\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+\r
+        return typename detail::tvec2<bool>::bool_type(x.x < y.x, x.y < y.y);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec3<valType>::bool_type lessThan\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+               \r
+               return typename detail::tvec3<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z);\r
+    }\r
+\r
+    template <typename valType>\r
+    inline typename detail::tvec4<valType>::bool_type lessThan\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+       \r
+               return typename detail::tvec4<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);\r
+    }\r
+\r
+    // lessThanEqual\r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::bool_type lessThanEqual\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+\r
+               return typename detail::tvec2<bool>::bool_type(x.x <= y.x, x.y <= y.y);\r
+       }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec3<valType>::bool_type lessThanEqual\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+               \r
+               return typename detail::tvec3<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec4<valType>::bool_type lessThanEqual\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+    {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+               \r
+               return typename detail::tvec4<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);\r
+    }\r
+\r
+    // greaterThan\r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::bool_type greaterThan\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+\r
+               return typename detail::tvec2<bool>::bool_type(x.x > y.x, x.y > y.y);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec3<valType>::bool_type greaterThan\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+               \r
+               return typename detail::tvec3<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec4<valType>::bool_type greaterThan\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+               \r
+               return typename detail::tvec4<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);\r
+    }\r
+\r
+    // greaterThanEqual\r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::bool_type greaterThanEqual\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+\r
+               return typename detail::tvec2<bool>::bool_type(x.x >= y.x, x.y >= y.y);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec3<valType>::bool_type greaterThanEqual\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+\r
+               return typename detail::tvec3<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec4<valType>::bool_type greaterThanEqual\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint);\r
+\r
+               return typename detail::tvec4<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);\r
+    }\r
+\r
+    // equal\r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::bool_type equal\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint || \r
+                       detail::type<valType>::is_bool);\r
+\r
+               return typename detail::tvec2<valType>::bool_type(x.x == y.x, x.y == y.y);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec3<valType>::bool_type equal\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint || \r
+                       detail::type<valType>::is_bool);\r
+\r
+               return typename detail::tvec3<valType>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec4<valType>::bool_type equal\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint || \r
+                       detail::type<valType>::is_bool);\r
+\r
+               return typename detail::tvec4<valType>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);\r
+    }\r
+\r
+    // notEqual\r
+       template <typename valType>\r
+       inline typename detail::tvec2<valType>::bool_type notEqual\r
+       (\r
+               detail::tvec2<valType> const & x, \r
+               detail::tvec2<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint || \r
+                       detail::type<valType>::is_bool);\r
+\r
+               return typename detail::tvec2<valType>::bool_type(x.x != y.x, x.y != y.y);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec3<valType>::bool_type notEqual\r
+       (\r
+               detail::tvec3<valType> const & x, \r
+               detail::tvec3<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint || \r
+                       detail::type<valType>::is_bool);\r
+\r
+               return typename detail::tvec3<valType>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z);\r
+    }\r
+\r
+       template <typename valType>\r
+       inline typename detail::tvec4<valType>::bool_type notEqual\r
+       (\r
+               detail::tvec4<valType> const & x, \r
+               detail::tvec4<valType> const & y\r
+       )\r
+       {\r
+               GLM_STATIC_ASSERT(\r
+                       detail::type<valType>::is_float || \r
+                       detail::type<valType>::is_int || \r
+                       detail::type<valType>::is_uint || \r
+                       detail::type<valType>::is_bool);\r
+\r
+               return typename detail::tvec4<valType>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);\r
+    }\r
+\r
+    // any\r
+    inline bool any(detail::tvec2<bool> const & x)\r
+    {\r
+               return x.x || x.y;\r
+    }\r
+\r
+    inline bool any(detail::tvec3<bool> const & x)\r
+    {\r
+        return x.x || x.y || x.z;\r
+    }\r
+\r
+    inline bool any(detail::tvec4<bool> const & x)\r
+    {\r
+        return x.x || x.y || x.z || x.w;\r
+    }\r
+\r
+    // all\r
+    inline bool all(const detail::tvec2<bool>& x)\r
+    {\r
+        return x.x && x.y;\r
+    }\r
+\r
+    inline bool all(const detail::tvec3<bool>& x)\r
+    {\r
+        return x.x && x.y && x.z;\r
+    }\r
+\r
+    inline bool all(const detail::tvec4<bool>& x)\r
+    {\r
+        return x.x && x.y && x.z && x.w;\r
+    }\r
+\r
+       // not\r
+    inline detail::tvec2<bool>::bool_type not_\r
+       (\r
+               detail::tvec2<bool> const & v\r
+       )\r
+    {\r
+        return detail::tvec2<bool>::bool_type(!v.x, !v.y);\r
+    }\r
+\r
+    inline detail::tvec3<bool>::bool_type not_\r
+       (\r
+               detail::tvec3<bool> const & v\r
+       )\r
+    {\r
+        return detail::tvec3<bool>::bool_type(!v.x, !v.y, !v.z);\r
+    }\r
+\r
+       inline detail::tvec4<bool>::bool_type not_\r
+       (\r
+               detail::tvec4<bool> const & v\r
+       )\r
+    {\r
+        return detail::tvec4<bool>::bool_type(!v.x, !v.y, !v.z, !v.w);\r
+    }\r
+\r
+       }//namespace vector_relational\r
+       }//namespace function\r
+       }//namespace core\r
+}//namespace glm\r
+\r
diff --git a/glm/core/hint.hpp b/glm/core/hint.hpp
new file mode 100644 (file)
index 0000000..c8ffc72
--- /dev/null
@@ -0,0 +1,21 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-14\r
+// Updated : 2008-08-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/hint.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type\r
+#define glm_core_type\r
+\r
+namespace glm\r
+{\r
+       // Use dont_care, nicest and fastest to optimize implementations.\r
+       class dont_care {};\r
+       class nicest {};\r
+       class fastest {};\r
+};\r
+\r
+#endif//glm_core_type\r
diff --git a/glm/core/intrinsic_common.hpp b/glm/core/intrinsic_common.hpp
new file mode 100644 (file)
index 0000000..3dc224d
--- /dev/null
@@ -0,0 +1,60 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-11\r
+// Updated : 2009-05-11\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_common.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef GLM_DETAIL_INTRINSIC_COMMON_INCLUDED\r
+#define GLM_DETAIL_INTRINSIC_COMMON_INCLUDED\r
+\r
+//#include <mmintrin.h>\r
+//#include <emmintrin.h>\r
+#include <xmmintrin.h>\r
+#include <emmintrin.h>\r
+\r
+__m128 _mm_abs_ps(__m128 x);\r
+\r
+__m128 _mm_sgn_ps(__m128 x);\r
+\r
+//floor\r
+__m128 _mm_flr_ps(__m128 v);\r
+\r
+//trunc\r
+__m128 _mm_trc_ps(__m128 v);\r
+\r
+//round\r
+__m128 _mm_rnd_ps(__m128 v);\r
+\r
+//roundEven\r
+__m128 _mm_rde_ps(__m128 v);\r
+\r
+__m128 _mm_ceil_ps(__m128 v);\r
+\r
+__m128 _mm_frc_ps(__m128 x);\r
+\r
+__m128 _mm_mod_ps(__m128 x, __m128 y);\r
+\r
+__m128 _mm_modf_ps(__m128 x, __m128i & i);\r
+\r
+//inline __m128 _mm_min_ps(__m128 x, __m128 y)\r
+\r
+//inline __m128 _mm_max_ps(__m128 x, __m128 y)\r
+\r
+__m128 _mm_clp_ps(__m128 v, __m128 minVal, __m128 maxVal);\r
+\r
+__m128 _mm_mix_ps(__m128 v1, __m128 v2, __m128 a);\r
+\r
+__m128 _mm_stp_ps(__m128 edge, __m128 x);\r
+\r
+__m128 _mm_ssp_ps(__m128 edge0, __m128 edge1, __m128 x);\r
+\r
+__m128 _mm_nan_ps(__m128 x);\r
+\r
+__m128 _mm_inf_ps(__m128 x);\r
+\r
+#include "intrinsic_common.inl"\r
+\r
+#endif//GLM_DETAIL_INTRINSIC_COMMON_INCLUDED\r
diff --git a/glm/core/intrinsic_common.inl b/glm/core/intrinsic_common.inl
new file mode 100644 (file)
index 0000000..f96e217
--- /dev/null
@@ -0,0 +1,268 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-08\r
+// Updated : 2009-05-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_common.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       union ieee754_QNAN\r
+       {\r
+          const float f;\r
+          struct\r
+          {\r
+                 const unsigned int mantissa:23, exp:8, sign:1;\r
+          };\r
+          \r
+          ieee754_QNAN() : f(0.0), mantissa(0x7FFFFF), exp(0xFF), sign(0x0) {}\r
+       };\r
+\r
+       static const __m128 zero = _mm_setzero_ps();\r
+       static const __m128 one = _mm_set_ps1(1.0f);\r
+       static const __m128 minus_one = _mm_set_ps1(-1.0f);\r
+       static const __m128 two = _mm_set_ps1(2.0f);\r
+       static const __m128 three = _mm_set_ps1(3.0f);\r
+       static const __m128 pi = _mm_set_ps1(3.1415926535897932384626433832795f);\r
+       static const __m128 hundred_eighty = _mm_set_ps1(180.f);\r
+       static const __m128 pi_over_hundred_eighty = _mm_set_ps1(0.017453292519943295769236907684886f);\r
+       static const __m128 hundred_eighty_over_pi = _mm_set_ps1(57.295779513082320876798154814105f);\r
+\r
+       static const ieee754_QNAN absMask;\r
+       static const __m128 abs4Mask = _mm_set_ps1(absMask.f);\r
+\r
+       static const __m128 _epi32_sign_mask;// = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));\r
+       static const __m128 _epi32_inv_sign_mask;// = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF));\r
+       static const __m128 _epi32_mant_mask;// = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000));\r
+       static const __m128 _epi32_inv_mant_mask;// = _mm_castsi128_ps(_mm_set1_epi32(0x807FFFFF));\r
+       static const __m128 _epi32_min_norm_pos;// = _mm_castsi128_ps(_mm_set1_epi32(0x00800000));\r
+       static const __m128 _epi32_0 = _mm_set_ps1(0);\r
+       static const __m128 _epi32_1 = _mm_set_ps1(1);\r
+       static const __m128 _epi32_2 = _mm_set_ps1(2);\r
+       static const __m128 _epi32_3 = _mm_set_ps1(3);\r
+       static const __m128 _epi32_4 = _mm_set_ps1(4);\r
+       static const __m128 _epi32_5 = _mm_set_ps1(5);\r
+       static const __m128 _epi32_6 = _mm_set_ps1(6);\r
+       static const __m128 _epi32_7 = _mm_set_ps1(7);\r
+       static const __m128 _epi32_8 = _mm_set_ps1(8);\r
+       static const __m128 _epi32_9 = _mm_set_ps1(9);\r
+       static const __m128 _epi32_127 = _mm_set_ps1(127);\r
+       static const __m128 _epi32_ninf;// = _mm_castsi128_ps(_mm_set1_epi32(0xFF800000));\r
+       static const __m128 _epi32_pinf;// = _mm_castsi128_ps(_mm_set1_epi32(0x7F800000));\r
+\r
+       static const __m128 _ps_1_3 = _mm_set_ps1(0.33333333333333333333333333333333f);\r
+       static const __m128 _ps_0p5 = _mm_set_ps1(0.5f);\r
+       static const __m128 _ps_1 = _mm_set_ps1(1.0f);\r
+       static const __m128 _ps_m1 = _mm_set_ps1(-1.0f);\r
+       static const __m128 _ps_2 = _mm_set_ps1(2.0f);\r
+       static const __m128 _ps_3 = _mm_set_ps1(3.0f);\r
+       static const __m128 _ps_127 = _mm_set_ps1(127.0f);\r
+       static const __m128 _ps_255 = _mm_set_ps1(255.0f);\r
+       static const __m128 _ps_2pow23 = _mm_set_ps1(8388608.0f);\r
+\r
+       static const __m128 _ps_1_0_0_0 = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f);\r
+       static const __m128 _ps_0_1_0_0 = _mm_set_ps(0.0f, 1.0f, 0.0f, 0.0f);\r
+       static const __m128 _ps_0_0_1_0 = _mm_set_ps(0.0f, 0.0f, 1.0f, 0.0f);\r
+       static const __m128 _ps_0_0_0_1 = _mm_set_ps(0.0f, 0.0f, 0.0f, 1.0f);\r
+\r
+       static const __m128 _ps_pi = _mm_set_ps1(3.1415926535897932384626433832795f);\r
+       static const __m128 _ps_pi2 = _mm_set_ps1(6.283185307179586476925286766560f);\r
+       static const __m128 _ps_2_pi = _mm_set_ps1(0.63661977236758134307553505349006f);\r
+       static const __m128 _ps_pi_2 = _mm_set_ps1(1.5707963267948966192313216916398f);\r
+       static const __m128 _ps_4_pi = _mm_set_ps1(1.2732395447351626861510701069801f);\r
+       static const __m128 _ps_pi_4 = _mm_set_ps1(0.78539816339744830961566084581988f);\r
+\r
+       static const __m128 _ps_sincos_p0 = _mm_set_ps1(0.15707963267948963959e1f);\r
+       static const __m128 _ps_sincos_p1 = _mm_set_ps1(-0.64596409750621907082e0f);\r
+       static const __m128 _ps_sincos_p2 = _mm_set_ps1(0.7969262624561800806e-1f);\r
+       static const __m128 _ps_sincos_p3 = _mm_set_ps1(-0.468175413106023168e-2f);\r
+       static const __m128 _ps_tan_p0 = _mm_set_ps1(-1.79565251976484877988e7f);\r
+       static const __m128 _ps_tan_p1 = _mm_set_ps1(1.15351664838587416140e6f);\r
+       static const __m128 _ps_tan_p2 = _mm_set_ps1(-1.30936939181383777646e4f);\r
+       static const __m128 _ps_tan_q0 = _mm_set_ps1(-5.38695755929454629881e7f);\r
+       static const __m128 _ps_tan_q1 = _mm_set_ps1(2.50083801823357915839e7f);\r
+       static const __m128 _ps_tan_q2 = _mm_set_ps1(-1.32089234440210967447e6f);\r
+       static const __m128 _ps_tan_q3 = _mm_set_ps1(1.36812963470692954678e4f);\r
+       static const __m128 _ps_tan_poleval = _mm_set_ps1(3.68935e19f);\r
+       static const __m128 _ps_atan_t0 = _mm_set_ps1(-0.91646118527267623468e-1f);\r
+       static const __m128 _ps_atan_t1 = _mm_set_ps1(-0.13956945682312098640e1f);\r
+       static const __m128 _ps_atan_t2 = _mm_set_ps1(-0.94393926122725531747e2f);\r
+       static const __m128 _ps_atan_t3 = _mm_set_ps1(0.12888383034157279340e2f);\r
+       static const __m128 _ps_atan_s0 = _mm_set_ps1(0.12797564625607904396e1f);\r
+       static const __m128 _ps_atan_s1 = _mm_set_ps1(0.21972168858277355914e1f);\r
+       static const __m128 _ps_atan_s2 = _mm_set_ps1(0.68193064729268275701e1f);\r
+       static const __m128 _ps_atan_s3 = _mm_set_ps1(0.28205206687035841409e2f);\r
+\r
+       static const __m128 _ps_exp_hi = _mm_set_ps1(88.3762626647949f);\r
+       static const __m128 _ps_exp_lo = _mm_set_ps1(-88.3762626647949f);\r
+       static const __m128 _ps_exp_rln2 = _mm_set_ps1(1.4426950408889634073599f);\r
+       static const __m128 _ps_exp_p0 = _mm_set_ps1(1.26177193074810590878e-4f);\r
+       static const __m128 _ps_exp_p1 = _mm_set_ps1(3.02994407707441961300e-2f);\r
+       static const __m128 _ps_exp_q0 = _mm_set_ps1(3.00198505138664455042e-6f);\r
+       static const __m128 _ps_exp_q1 = _mm_set_ps1(2.52448340349684104192e-3f);\r
+       static const __m128 _ps_exp_q2 = _mm_set_ps1(2.27265548208155028766e-1f);\r
+       static const __m128 _ps_exp_q3 = _mm_set_ps1(2.00000000000000000009e0f);\r
+       static const __m128 _ps_exp_c1 = _mm_set_ps1(6.93145751953125e-1f);\r
+       static const __m128 _ps_exp_c2 = _mm_set_ps1(1.42860682030941723212e-6f);\r
+       static const __m128 _ps_exp2_hi = _mm_set_ps1(127.4999961853f);\r
+       static const __m128 _ps_exp2_lo = _mm_set_ps1(-127.4999961853f);\r
+       static const __m128 _ps_exp2_p0 = _mm_set_ps1(2.30933477057345225087e-2f);\r
+       static const __m128 _ps_exp2_p1 = _mm_set_ps1(2.02020656693165307700e1f);\r
+       static const __m128 _ps_exp2_p2 = _mm_set_ps1(1.51390680115615096133e3f);\r
+       static const __m128 _ps_exp2_q0 = _mm_set_ps1(2.33184211722314911771e2f);\r
+       static const __m128 _ps_exp2_q1 = _mm_set_ps1(4.36821166879210612817e3f);\r
+       static const __m128 _ps_log_p0 = _mm_set_ps1(-7.89580278884799154124e-1f);\r
+       static const __m128 _ps_log_p1 = _mm_set_ps1(1.63866645699558079767e1f);\r
+       static const __m128 _ps_log_p2 = _mm_set_ps1(-6.41409952958715622951e1f);\r
+       static const __m128 _ps_log_q0 = _mm_set_ps1(-3.56722798256324312549e1f);\r
+       static const __m128 _ps_log_q1 = _mm_set_ps1(3.12093766372244180303e2f);\r
+       static const __m128 _ps_log_q2 = _mm_set_ps1(-7.69691943550460008604e2f);\r
+       static const __m128 _ps_log_c0 = _mm_set_ps1(0.693147180559945f);\r
+       static const __m128 _ps_log2_c0 = _mm_set_ps1(1.44269504088896340735992f);\r
+\r
+}//namespace detail\r
+}//namespace glm\r
+\r
+inline __m128 _mm_abs_ps(__m128 x)\r
+{\r
+       return _mm_and_ps(glm::detail::abs4Mask, x);\r
+} \r
+\r
+inline __m128 _mm_sgn_ps(__m128 x)\r
+{\r
+       //__m128 cmp0 = _mm_cmpeq_ps(x, zero);\r
+       //__m128 cmp1 = _mm_cmple_ps(x, zero);\r
+       //__m128 cmp2 = _mm_cmpge_ps(x, zero);\r
+\r
+       __m128 result;\r
+       __m128 cmp0 = _mm_cmpeq_ps(x, glm::detail::zero);\r
+       if(_mm_movemask_ps(cmp0) == 0)\r
+               result = glm::detail::zero;\r
+       else\r
+       {\r
+               __m128 cmp1 = _mm_cmpge_ps(x, glm::detail::zero);\r
+               //__m128 cmp2 = _mm_cmple_ps(x, glm::detail::zero);\r
+               if(_mm_movemask_ps(cmp1) > 0)\r
+                       result = glm::detail::one;\r
+               else //if(_mm_movemask_ps(cmp2) > 0)\r
+                       result = glm::detail::minus_one;\r
+       }\r
+       return result;\r
+}\r
+\r
+//floor\r
+inline __m128 _mm_flr_ps(__m128 x)\r
+{\r
+       __m128 rnd0 = _mm_rnd_ps(x);\r
+       __m128 cmp0 = _mm_cmplt_ps(x, rnd0);\r
+       __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1);\r
+       __m128 sub0 = _mm_sub_ps(rnd0, and0);\r
+       return sub0;\r
+}\r
+\r
+//trunc\r
+inline __m128 _mm_trc_ps(__m128 v)\r
+{\r
+\r
+}\r
+\r
+//round\r
+inline __m128 _mm_rnd_ps(__m128 x)\r
+{\r
+       __m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x);\r
+       __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23);\r
+       __m128 add0 = _mm_add_ps(x, or0);\r
+       __m128 sub0 = _mm_sub_ps(add0, or0);\r
+       return sub0;\r
+}\r
+\r
+//roundEven\r
+inline __m128 _mm_rde_ps(__m128 v)\r
+{\r
+\r
+}\r
+\r
+inline __m128 _mm_ceil_ps(__m128 x)\r
+{\r
+       __m128 rnd0 = _mm_rnd_ps(x);\r
+       __m128 cmp0 = _mm_cmpgt_ps(x, rnd0);\r
+       __m128 and0 = _mm_and_ps(cmp0, glm::detail::_ps_1);\r
+       __m128 add0 = _mm_add_ps(rnd0, and0);\r
+       return add0;\r
+}\r
+\r
+inline __m128 _mm_frc_ps(__m128 x)\r
+{\r
+       __m128 flr0 = _mm_flr_ps(x);\r
+       __m128 sub0 = _mm_sub_ps(x, flr0);\r
+       return sub0;\r
+}\r
+\r
+inline __m128 _mm_mod_ps(__m128 x, __m128 y)\r
+{\r
+       __m128 div0 = _mm_div_ps(x, y);\r
+       __m128 flr0 = _mm_flr_ps(div0);\r
+       __m128 mul0 = _mm_mul_ps(y, flr0);\r
+       __m128 sub0 = _mm_sub_ps(x, mul0);\r
+       return sub0;\r
+}\r
+\r
+inline __m128 _mm_modf_ps(__m128 x, __m128i & i)\r
+{\r
+\r
+}\r
+\r
+//inline __m128 _mm_min_ps(__m128 x, __m128 y)\r
+\r
+//inline __m128 _mm_max_ps(__m128 x, __m128 y)\r
+\r
+inline __m128 _mm_clp_ps(__m128 v, __m128 minVal, __m128 maxVal)\r
+{\r
+       __m128 min0 = _mm_min_ps(v, maxVal);\r
+       __m128 max0 = _mm_max_ps(min0, minVal);\r
+       return max0;\r
+}\r
+\r
+inline __m128 _mm_mix_ps(__m128 v1, __m128 v2, __m128 a)\r
+{\r
+       __m128 sub0 = _mm_sub_ps(glm::detail::one, a);\r
+       __m128 mul0 = _mm_mul_ps(v1, sub0);\r
+       __m128 mul1 = _mm_mul_ps(v2, a);\r
+       __m128 add0 = _mm_add_ps(mul0, mul1);\r
+       return add0;\r
+}\r
+\r
+inline __m128 _mm_stp_ps(__m128 edge, __m128 x)\r
+{\r
+       __m128 cmp = _mm_cmple_ps(x, edge);\r
+       if(_mm_movemask_ps(cmp) == 0)\r
+               return glm::detail::one;\r
+       else\r
+               return glm::detail::zero;\r
+}\r
+\r
+inline __m128 _mm_ssp_ps(__m128 edge0, __m128 edge1, __m128 x)\r
+{\r
+       __m128 sub0 = _mm_sub_ps(x, edge0);\r
+       __m128 sub1 = _mm_sub_ps(edge1, edge0);\r
+       __m128 div0 = _mm_sub_ps(sub0, sub1);\r
+       __m128 clp0 = _mm_clp_ps(div0, glm::detail::zero, glm::detail::one);\r
+       __m128 mul0 = _mm_mul_ps(glm::detail::two, clp0);\r
+       __m128 sub2 = _mm_sub_ps(glm::detail::three, mul0);\r
+       __m128 mul1 = _mm_mul_ps(clp0, clp0);\r
+       __m128 mul2 = _mm_mul_ps(mul1, sub2);\r
+       return mul2;\r
+}\r
+\r
+inline __m128 _mm_nan_ps(__m128 x)\r
+{\r
+\r
+}\r
+\r
+inline __m128 _mm_inf_ps(__m128 x)\r
+{\r
+\r
+}\r
diff --git a/glm/core/intrinsic_exponential.hpp b/glm/core/intrinsic_exponential.hpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/core/intrinsic_exponential.inl b/glm/core/intrinsic_exponential.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/core/intrinsic_geometric.hpp b/glm/core/intrinsic_geometric.hpp
new file mode 100644 (file)
index 0000000..c536916
--- /dev/null
@@ -0,0 +1,45 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-08\r
+// Updated : 2009-05-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_geometric.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_intrinsic_geometric\r
+#define glm_core_intrinsic_geometric\r
+\r
+#include "intrinsic_common.hpp"\r
+\r
+//length\r
+__m128 _mm_len_ps(__m128 x);\r
+\r
+//distance\r
+__m128 _mm_dst_ps(__m128 p0, __m128 p1);\r
+\r
+//dot\r
+__m128 _mm_dot_ps(__m128 v1, __m128 v2);\r
+\r
+// SSE1\r
+__m128 _mm_dot_ss(__m128 v1, __m128 v2);\r
+\r
+//cross\r
+__m128 _mm_xpd_ps(__m128 v1, __m128 v2);\r
+\r
+//normalize\r
+__m128 _mm_nrm_ps(__m128 v);\r
+\r
+//faceforward\r
+__m128 _mm_ffd_ps(__m128 N, __m128 I, __m128 Nref);\r
+\r
+//reflect\r
+__m128 _mm_rfe_ps(__m128 I, __m128 N);\r
+\r
+//refract\r
+__m128 _mm_rfa_ps(__m128 I, __m128 N, __m128 eta);\r
+\r
+\r
+#include "intrinsic_geometric.inl"\r
+\r
+#endif//glm_core_intrinsic_geometric\r
diff --git a/glm/core/intrinsic_geometric.inl b/glm/core/intrinsic_geometric.inl
new file mode 100644 (file)
index 0000000..d0382ab
--- /dev/null
@@ -0,0 +1,117 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-08\r
+// Updated : 2009-05-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_geometric.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+//length\r
+inline __m128 _mm_len_ps(__m128 x)\r
+{\r
+    __m128 dot0 = _mm_dot_ps(x, x);\r
+       __m128 sqt0 = _mm_sqrt_ps(dot0);\r
+    return sqt0;\r
+}\r
+\r
+//distance\r
+inline __m128 _mm_dst_ps(__m128 p0, __m128 p1)\r
+{\r
+       __m128 sub0 = _mm_sub_ps(p0, p1);\r
+    __m128 len0 = _mm_len_ps(sub0);\r
+    return len0;\r
+}\r
+\r
+//dot\r
+inline __m128 _mm_dot_ps(__m128 v1, __m128 v2)\r
+{\r
+       __m128 mul0 = _mm_mul_ps(v1, v2);\r
+       __m128 swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1));\r
+       __m128 add0 = _mm_add_ps(mul0, swp0);\r
+       __m128 swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3));\r
+       __m128 add1 = _mm_add_ps(add0, swp1);\r
+       return add1;\r
+}\r
+\r
+// SSE1\r
+inline __m128 _mm_dot_ss(__m128 v1, __m128 v2)\r
+{\r
+       __m128 mul0 = _mm_mul_ps(v1, v2);\r
+       __m128 mov0 = _mm_movehl_ps(mul0, mul0);\r
+       __m128 add0 = _mm_add_ps(mov0, mul0);\r
+       __m128 swp1 = _mm_shuffle_ps(add0, add0, 1);\r
+       __m128 add1 = _mm_add_ss(add0, swp1);\r
+       return add1;\r
+}\r
+\r
+//cross\r
+inline __m128 _mm_xpd_ps(__m128 v1, __m128 v2)\r
+{\r
+       __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1));\r
+       __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2));\r
+       __m128 swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1));\r
+       __m128 swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2));\r
+       __m128 mul0 = _mm_mul_ps(swp0, swp3);\r
+       __m128 mul1 = _mm_mul_ps(swp1, swp2);\r
+       __m128 sub0 = _mm_sub_ps(mul0, mul1);\r
+       return sub0;\r
+}\r
+\r
+//normalize\r
+inline __m128 _mm_nrm_ps(__m128 v)\r
+{\r
+       __m128 dot0 = _mm_dot_ps(v, v);\r
+       __m128 isr0 = _mm_rsqrt_ps(dot0);\r
+       __m128 mul0 = _mm_mul_ps(v, isr0);\r
+       return mul0;\r
+}\r
+\r
+//faceforward\r
+inline __m128 _mm_ffd_ps(__m128 N, __m128 I, __m128 Nref)\r
+{\r
+       //__m128 dot0 = _mm_dot_ps(v, v);\r
+       //__m128 neg0 = _mm_neg_ps(N);\r
+       //__m128 sgn0 = _mm_sgn_ps(dot0);\r
+       //__m128 mix0 = _mm_mix_ps(N, neg0, sgn0);\r
+       //return mix0;\r
+\r
+       __m128 dot0 = _mm_dot_ps(Nref, I);\r
+       __m128 sgn0 = _mm_sgn_ps(dot0);\r
+       __m128 mul0 = _mm_mul_ps(sgn0, glm::detail::minus_one);\r
+       __m128 mul1 = _mm_mul_ps(N, mul0);\r
+       return mul1;\r
+}\r
+\r
+//reflect\r
+inline __m128 _mm_rfe_ps(__m128 I, __m128 N)\r
+{\r
+       __m128 dot0 = _mm_dot_ps(N, I);\r
+       __m128 mul0 = _mm_mul_ps(N, I);\r
+       __m128 mul1 = _mm_mul_ps(mul0, glm::detail::two);\r
+       __m128 sub0 = _mm_sub_ps(I, mul1);\r
+       return sub0;\r
+}\r
+\r
+//refract\r
+inline __m128 _mm_rfa_ps(__m128 I, __m128 N, __m128 eta)\r
+{\r
+       __m128 dot0 = _mm_dot_ps(N, I);\r
+       __m128 mul0 = _mm_mul_ps(eta, eta);\r
+       __m128 mul1 = _mm_mul_ps(dot0, dot0);\r
+       __m128 sub0 = _mm_sub_ps(glm::detail::one, mul0);\r
+       __m128 sub1 = _mm_sub_ps(glm::detail::one, mul1);\r
+       __m128 mul2 = _mm_mul_ps(sub0, sub1);\r
+       \r
+       if(_mm_movemask_ps(_mm_cmplt_ss(mul2, glm::detail::zero)) == 0)\r
+               return glm::detail::zero;\r
+\r
+       __m128 sqt0 = _mm_sqrt_ps(mul2);\r
+       __m128 mul3 = _mm_mul_ps(eta, dot0);\r
+       __m128 add0 = _mm_add_ps(mul3, sqt0);\r
+       __m128 mul4 = _mm_mul_ps(add0, N);\r
+       __m128 mul5 = _mm_mul_ps(eta, I);\r
+       __m128 sub2 = _mm_sub_ps(mul5, mul4);\r
+\r
+       return sub2;\r
+}\r
diff --git a/glm/core/intrinsic_matrix.hpp b/glm/core/intrinsic_matrix.hpp
new file mode 100644 (file)
index 0000000..f57ffb1
--- /dev/null
@@ -0,0 +1,36 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-06-05\r
+// Updated : 2009-06-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_common.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef GLM_DETAIL_INTRINSIC_MATRIX_INCLUDED\r
+#define GLM_DETAIL_INTRINSIC_MATRIX_INCLUDED\r
+\r
+#include "../glm.hpp"\r
+\r
+#include <xmmintrin.h>\r
+#include <emmintrin.h>\r
+\r
+void _mm_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);\r
+\r
+void _mm_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);\r
+\r
+__m128 _mm_mul_ps(__m128 m[4], __m128 v);\r
+\r
+__m128 _mm_mul_ps(__m128 v, __m128 m[4]);\r
+\r
+void _mm_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]);\r
+\r
+void _mm_transpose_ps(__m128 const in[4], __m128 out[4]);\r
+\r
+void _mm_inverse_ps(__m128 const in[4], __m128 out[4]);\r
+\r
+void _mm_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]);\r
+\r
+#include "intrinsic_matrix.inl"\r
+\r
+#endif//GLM_DETAIL_INTRINSIC_MATRIX_INCLUDED\r
diff --git a/glm/core/intrinsic_matrix.inl b/glm/core/intrinsic_matrix.inl
new file mode 100644 (file)
index 0000000..3e80ed3
--- /dev/null
@@ -0,0 +1,704 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-06-05\r
+// Updated : 2009-06-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_common.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+static const __m128 one = _mm_set_ps1(1.0f);\r
+static const __m128 pi = _mm_set_ps1(3.141592653589793238462643383279f);\r
+static const __m128 _m128_rad_ps = _mm_set_ps1(3.141592653589793238462643383279f / 180.f);\r
+static const __m128 _m128_deg_ps = _mm_set_ps1(180.f / 3.141592653589793238462643383279f);\r
+\r
+inline void _mm_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4])\r
+{\r
+       {\r
+               out[0] = _mm_add_ps(in1[0], in2[0]);\r
+               out[1] = _mm_add_ps(in1[1], in2[1]);\r
+               out[2] = _mm_add_ps(in1[2], in2[2]);\r
+               out[3] = _mm_add_ps(in1[3], in2[3]);\r
+       }\r
+}\r
+\r
+inline void _mm_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4])\r
+{\r
+       {\r
+               out[0] = _mm_sub_ps(in1[0], in2[0]);\r
+               out[1] = _mm_sub_ps(in1[1], in2[1]);\r
+               out[2] = _mm_sub_ps(in1[2], in2[2]);\r
+               out[3] = _mm_sub_ps(in1[3], in2[3]);\r
+       }\r
+}\r
+\r
+inline __m128 _mm_mul_ps(__m128 m[4], __m128 v)\r
+{\r
+       __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1));\r
+       __m128 v2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2));\r
+       __m128 v3 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+       __m128 m0 = _mm_mul_ps(m[0], v0);\r
+       __m128 m1 = _mm_mul_ps(m[1], v1);\r
+       __m128 m2 = _mm_mul_ps(m[2], v2);\r
+       __m128 m3 = _mm_mul_ps(m[3], v3);\r
+\r
+       __m128 a0 = _mm_add_ps(m0, m1);\r
+       __m128 a1 = _mm_add_ps(m2, m3);\r
+       __m128 a2 = _mm_add_ps(a0, a1);\r
+\r
+       return a2;\r
+}\r
+\r
+inline __m128 _mm_mul_ps(__m128 v, __m128 m[4])\r
+{\r
+       __m128 i0 = m[0];\r
+       __m128 i1 = m[1];\r
+       __m128 i2 = m[2];\r
+       __m128 i3 = m[3];\r
+\r
+       __m128 m0 = _mm_mul_ps(v, i0);\r
+       __m128 m1 = _mm_mul_ps(v, i1);\r
+       __m128 m2 = _mm_mul_ps(v, i2);\r
+       __m128 m3 = _mm_mul_ps(v, i3);\r
+\r
+       __m128 u0 = _mm_unpacklo_ps(m0, m1);\r
+       __m128 u1 = _mm_unpackhi_ps(m0, m1);\r
+       __m128 a0 = _mm_add_ps(u0, u1);\r
+\r
+       __m128 u2 = _mm_unpacklo_ps(m2, m3);\r
+       __m128 u3 = _mm_unpackhi_ps(m2, m3);\r
+       __m128 a1 = _mm_add_ps(u2, u3);\r
+\r
+       __m128 f0 = _mm_movelh_ps(a0, a1);\r
+       __m128 f1 = _mm_movehl_ps(a1, a0);\r
+       __m128 f2 = _mm_add_ps(f0, f1);\r
+\r
+       return f2;\r
+}\r
+\r
+inline void _mm_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4])\r
+{\r
+       {\r
+               __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 e1 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 e2 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 e3 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 m0 = _mm_mul_ps(in1[0], e0);\r
+               __m128 m1 = _mm_mul_ps(in1[1], e1);\r
+               __m128 m2 = _mm_mul_ps(in1[2], e2);\r
+               __m128 m3 = _mm_mul_ps(in1[3], e3);\r
+\r
+               __m128 a0 = _mm_add_ps(m0, m1);\r
+               __m128 a1 = _mm_add_ps(m2, m3);\r
+               __m128 a2 = _mm_add_ps(a0, a1);\r
+\r
+               out[0] = a2;\r
+       }\r
+\r
+       {\r
+               __m128 e0 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 e1 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 e2 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 e3 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 m0 = _mm_mul_ps(in1[0], e0);\r
+               __m128 m1 = _mm_mul_ps(in1[1], e1);\r
+               __m128 m2 = _mm_mul_ps(in1[2], e2);\r
+               __m128 m3 = _mm_mul_ps(in1[3], e3);\r
+\r
+               __m128 a0 = _mm_add_ps(m0, m1);\r
+               __m128 a1 = _mm_add_ps(m2, m3);\r
+               __m128 a2 = _mm_add_ps(a0, a1);\r
+\r
+               out[1] = a2;\r
+       }\r
+\r
+       {\r
+               __m128 e0 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 e1 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 e2 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 e3 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 m0 = _mm_mul_ps(in1[0], e0);\r
+               __m128 m1 = _mm_mul_ps(in1[1], e1);\r
+               __m128 m2 = _mm_mul_ps(in1[2], e2);\r
+               __m128 m3 = _mm_mul_ps(in1[3], e3);\r
+\r
+               __m128 a0 = _mm_add_ps(m0, m1);\r
+               __m128 a1 = _mm_add_ps(m2, m3);\r
+               __m128 a2 = _mm_add_ps(a0, a1);\r
+\r
+               out[2] = a2;\r
+       }\r
+\r
+       {\r
+               //(__m128&)_mm_shuffle_epi32(__m128i&)in2[0], _MM_SHUFFLE(3, 3, 3, 3))\r
+               __m128 e0 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 e1 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 e2 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 e3 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 m0 = _mm_mul_ps(in1[0], e0);\r
+               __m128 m1 = _mm_mul_ps(in1[1], e1);\r
+               __m128 m2 = _mm_mul_ps(in1[2], e2);\r
+               __m128 m3 = _mm_mul_ps(in1[3], e3);\r
+\r
+               __m128 a0 = _mm_add_ps(m0, m1);\r
+               __m128 a1 = _mm_add_ps(m2, m3);\r
+               __m128 a2 = _mm_add_ps(a0, a1);\r
+\r
+               out[3] = a2;\r
+       }\r
+}\r
+\r
+inline void _mm_transpose_ps(__m128 const in[4], __m128 out[4])\r
+{\r
+    __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44);\r
+    __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE);\r
+    __m128 tmp1 = _mm_shuffle_ps(in[2], in[3], 0x44);\r
+    __m128 tmp3 = _mm_shuffle_ps(in[2], in[3], 0xEE);\r
+\r
+    out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88);\r
+    out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD);\r
+    out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88);\r
+    out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD);\r
+}\r
+\r
+inline void _mm_inverse_ps(__m128 const in[4], __m128 out[4])\r
+{\r
+       __m128 Fac0;\r
+       {\r
+               //      valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\r
+               //      valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\r
+               //      valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\r
+               //      valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac0 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac1;\r
+       {\r
+               //      valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\r
+               //      valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\r
+               //      valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\r
+               //      valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac1 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+\r
+       __m128 Fac2;\r
+       {\r
+               //      valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\r
+               //      valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\r
+               //      valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\r
+               //      valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac2 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac3;\r
+       {\r
+               //      valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\r
+               //      valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\r
+               //      valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\r
+               //      valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac3 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac4;\r
+       {\r
+               //      valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\r
+               //      valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\r
+               //      valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\r
+               //      valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac4 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac5;\r
+       {\r
+               //      valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\r
+               //      valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\r
+               //      valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\r
+               //      valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac5 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f);\r
+       __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f);\r
+\r
+       // m[1][0]\r
+       // m[0][0]\r
+       // m[0][0]\r
+       // m[0][0]\r
+       __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // m[1][1]\r
+       // m[0][1]\r
+       // m[0][1]\r
+       // m[0][1]\r
+       __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1));\r
+       __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // m[1][2]\r
+       // m[0][2]\r
+       // m[0][2]\r
+       // m[0][2]\r
+       __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2));\r
+       __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // m[1][3]\r
+       // m[0][3]\r
+       // m[0][3]\r
+       // m[0][3]\r
+       __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3));\r
+       __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // col0\r
+       // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]),\r
+       // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]),\r
+       // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]),\r
+       // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]),\r
+       __m128 Mul00 = _mm_mul_ps(Vec1, Fac0);\r
+       __m128 Mul01 = _mm_mul_ps(Vec2, Fac1);\r
+       __m128 Mul02 = _mm_mul_ps(Vec3, Fac2);\r
+       __m128 Sub00 = _mm_sub_ps(Mul00, Mul01);\r
+       __m128 Add00 = _mm_add_ps(Sub00, Mul02);\r
+       __m128 Inv0 = _mm_mul_ps(SignB, Add00);\r
+\r
+       // col1\r
+       // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]),\r
+       // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]),\r
+       // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]),\r
+       // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]),\r
+       __m128 Mul03 = _mm_mul_ps(Vec0, Fac0);\r
+       __m128 Mul04 = _mm_mul_ps(Vec2, Fac3);\r
+       __m128 Mul05 = _mm_mul_ps(Vec3, Fac4);\r
+       __m128 Sub01 = _mm_sub_ps(Mul03, Mul04);\r
+       __m128 Add01 = _mm_add_ps(Sub01, Mul05);\r
+       __m128 Inv1 = _mm_mul_ps(SignA, Add01);\r
+\r
+       // col2\r
+       // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]),\r
+       // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]),\r
+       // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]),\r
+       // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]),\r
+       __m128 Mul06 = _mm_mul_ps(Vec0, Fac1);\r
+       __m128 Mul07 = _mm_mul_ps(Vec1, Fac3);\r
+       __m128 Mul08 = _mm_mul_ps(Vec3, Fac5);\r
+       __m128 Sub02 = _mm_sub_ps(Mul06, Mul07);\r
+       __m128 Add02 = _mm_add_ps(Sub02, Mul08);\r
+       __m128 Inv2 = _mm_mul_ps(SignB, Add02);\r
+\r
+       // col3\r
+       // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]),\r
+       // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]),\r
+       // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]),\r
+       // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3]));\r
+       __m128 Mul09 = _mm_mul_ps(Vec0, Fac2);\r
+       __m128 Mul10 = _mm_mul_ps(Vec1, Fac4);\r
+       __m128 Mul11 = _mm_mul_ps(Vec2, Fac5);\r
+       __m128 Sub03 = _mm_sub_ps(Mul09, Mul10);\r
+       __m128 Add03 = _mm_add_ps(Sub03, Mul11);\r
+       __m128 Inv3 = _mm_mul_ps(SignA, Add03);\r
+\r
+       __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0));\r
+\r
+       //      valType Determinant = m[0][0] * Inverse[0][0] \r
+       //                                              + m[0][1] * Inverse[1][0] \r
+       //                                              + m[0][2] * Inverse[2][0] \r
+       //                                              + m[0][3] * Inverse[3][0];\r
+       __m128 Det0 = _mm_dot_ps(in[0], Row2);\r
+       __m128 Rcp0 = _mm_div_ps(one, Det0);\r
+       //__m128 Rcp0 = _mm_rcp_ps(Det0);\r
+\r
+       //      Inverse /= Determinant;\r
+       out[0] = _mm_mul_ps(Inv0, Rcp0);\r
+       out[1] = _mm_mul_ps(Inv1, Rcp0);\r
+       out[2] = _mm_mul_ps(Inv2, Rcp0);\r
+       out[3] = _mm_mul_ps(Inv3, Rcp0);\r
+}\r
+\r
+inline void _mm_inverse_fast_ps(__m128 const in[4], __m128 out[4])\r
+{\r
+       __m128 Fac0;\r
+       {\r
+               //      valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\r
+               //      valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\r
+               //      valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\r
+               //      valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac0 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac1;\r
+       {\r
+               //      valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\r
+               //      valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\r
+               //      valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\r
+               //      valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac1 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+\r
+       __m128 Fac2;\r
+       {\r
+               //      valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\r
+               //      valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\r
+               //      valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\r
+               //      valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac2 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac3;\r
+       {\r
+               //      valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\r
+               //      valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\r
+               //      valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\r
+               //      valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac3 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac4;\r
+       {\r
+               //      valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\r
+               //      valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\r
+               //      valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\r
+               //      valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac4 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 Fac5;\r
+       {\r
+               //      valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\r
+               //      valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\r
+               //      valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\r
+               //      valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\r
+\r
+               __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1));\r
+               __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0));\r
+\r
+               __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0));\r
+               __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0));\r
+               __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1));\r
+\r
+               __m128 Mul00 = _mm_mul_ps(Swp00, Swp01);\r
+               __m128 Mul01 = _mm_mul_ps(Swp02, Swp03);\r
+               Fac5 = _mm_sub_ps(Mul00, Mul01);\r
+\r
+               bool stop = true;\r
+       }\r
+\r
+       __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f);\r
+       __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f);\r
+\r
+       // m[1][0]\r
+       // m[0][0]\r
+       // m[0][0]\r
+       // m[0][0]\r
+       __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // m[1][1]\r
+       // m[0][1]\r
+       // m[0][1]\r
+       // m[0][1]\r
+       __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1));\r
+       __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // m[1][2]\r
+       // m[0][2]\r
+       // m[0][2]\r
+       // m[0][2]\r
+       __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2));\r
+       __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // m[1][3]\r
+       // m[0][3]\r
+       // m[0][3]\r
+       // m[0][3]\r
+       __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3));\r
+       __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0));\r
+\r
+       // col0\r
+       // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]),\r
+       // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]),\r
+       // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]),\r
+       // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]),\r
+       __m128 Mul00 = _mm_mul_ps(Vec1, Fac0);\r
+       __m128 Mul01 = _mm_mul_ps(Vec2, Fac1);\r
+       __m128 Mul02 = _mm_mul_ps(Vec3, Fac2);\r
+       __m128 Sub00 = _mm_sub_ps(Mul00, Mul01);\r
+       __m128 Add00 = _mm_add_ps(Sub00, Mul02);\r
+       __m128 Inv0 = _mm_mul_ps(SignB, Add00);\r
+\r
+       // col1\r
+       // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]),\r
+       // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]),\r
+       // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]),\r
+       // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]),\r
+       __m128 Mul03 = _mm_mul_ps(Vec0, Fac0);\r
+       __m128 Mul04 = _mm_mul_ps(Vec2, Fac3);\r
+       __m128 Mul05 = _mm_mul_ps(Vec3, Fac4);\r
+       __m128 Sub01 = _mm_sub_ps(Mul03, Mul04);\r
+       __m128 Add01 = _mm_add_ps(Sub01, Mul05);\r
+       __m128 Inv1 = _mm_mul_ps(SignA, Add01);\r
+\r
+       // col2\r
+       // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]),\r
+       // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]),\r
+       // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]),\r
+       // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]),\r
+       __m128 Mul06 = _mm_mul_ps(Vec0, Fac1);\r
+       __m128 Mul07 = _mm_mul_ps(Vec1, Fac3);\r
+       __m128 Mul08 = _mm_mul_ps(Vec3, Fac5);\r
+       __m128 Sub02 = _mm_sub_ps(Mul06, Mul07);\r
+       __m128 Add02 = _mm_add_ps(Sub02, Mul08);\r
+       __m128 Inv2 = _mm_mul_ps(SignB, Add02);\r
+\r
+       // col3\r
+       // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]),\r
+       // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]),\r
+       // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]),\r
+       // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3]));\r
+       __m128 Mul09 = _mm_mul_ps(Vec0, Fac2);\r
+       __m128 Mul10 = _mm_mul_ps(Vec1, Fac4);\r
+       __m128 Mul11 = _mm_mul_ps(Vec2, Fac5);\r
+       __m128 Sub03 = _mm_sub_ps(Mul09, Mul10);\r
+       __m128 Add03 = _mm_add_ps(Sub03, Mul11);\r
+       __m128 Inv3 = _mm_mul_ps(SignA, Add03);\r
+\r
+       __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0));\r
+\r
+       //      valType Determinant = m[0][0] * Inverse[0][0] \r
+       //                                              + m[0][1] * Inverse[1][0] \r
+       //                                              + m[0][2] * Inverse[2][0] \r
+       //                                              + m[0][3] * Inverse[3][0];\r
+       __m128 Det0 = _mm_dot_ps(in[0], Row2);\r
+       __m128 Rcp0 = _mm_rcp_ps(Det0);\r
+       //__m128 Rcp0 = _mm_div_ps(one, Det0);\r
+       //      Inverse /= Determinant;\r
+       out[0] = _mm_mul_ps(Inv0, Rcp0);\r
+       out[1] = _mm_mul_ps(Inv1, Rcp0);\r
+       out[2] = _mm_mul_ps(Inv2, Rcp0);\r
+       out[3] = _mm_mul_ps(Inv3, Rcp0);\r
+}\r
+\r
+\r
+void _mm_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4])\r
+{\r
+       float a = glm::radians(Angle);\r
+    float c = cos(a);\r
+    float s = sin(a);\r
+\r
+       glm::vec4 AxisA(v[0], v[1], v[2], float(0));\r
+       __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x);\r
+    __m128 AxisC = _mm_nrm_ps(AxisB);\r
+\r
+       __m128 Cos0 = _mm_set_ss(c);\r
+       __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 Sin0 = _mm_set_ss(s);\r
+       __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0));\r
+\r
+       // detail::tvec3<valType> temp = (valType(1) - c) * axis;\r
+       __m128 Temp0 = _mm_sub_ps(one, CosA);\r
+       __m128 Temp1 = _mm_mul_ps(Temp0, AxisC);\r
+       \r
+       //Rotate[0][0] = c + temp[0] * axis[0];\r
+       //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2];\r
+       //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1];\r
+       __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0));\r
+       __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC);\r
+       __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0));\r
+       __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0);\r
+       __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f);\r
+       __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3));\r
+       __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2);\r
+       __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3);\r
+\r
+       //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2];\r
+       //Rotate[1][1] = c + temp[1] * axis[1];\r
+       //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0];\r
+       __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1));\r
+       __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC);\r
+       __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1));\r
+       __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0);\r
+       __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f);\r
+       __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2));\r
+       __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2);\r
+       __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3);\r
+\r
+    //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1];\r
+    //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0];\r
+    //Rotate[2][2] = c + temp[2] * axis[2];\r
+       __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2));\r
+       __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC);\r
+       __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1));\r
+       __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0);\r
+       __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f);\r
+       __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1));\r
+       __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2);\r
+       __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3);\r
+\r
+       __m128 Result[4];\r
+       Result[0] = TmpA4;\r
+       Result[1] = TmpB4;\r
+       Result[2] = TmpC4;\r
+       Result[2] = _mm_set_ps(1, 0, 0, 0);\r
+\r
+       //detail::tmat4x4<valType> Result(detail::tmat4x4<valType>::null);\r
+       //Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2];\r
+       //Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2];\r
+       //Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2];\r
+       //Result[3] = m[3];\r
+       //return Result;\r
+       _mm_mul_ps(in, Result, out);\r
+}\r
diff --git a/glm/core/intrinsic_trigonometric.hpp b/glm/core/intrinsic_trigonometric.hpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/core/intrinsic_trigonometric.inl b/glm/core/intrinsic_trigonometric.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/core/intrinsic_vector_relational.hpp b/glm/core/intrinsic_vector_relational.hpp
new file mode 100644 (file)
index 0000000..1560829
--- /dev/null
@@ -0,0 +1,18 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-06-09\r
+// Updated : 2009-06-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_vector_relational.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef GLM_DETAIL_INTRINSIC_VECTOR_RELATIONAL_INCLUDED\r
+#define GLM_DETAIL_INTRINSIC_VECTOR_RELATIONAL_INCLUDED\r
+\r
+#include <xmmintrin.h>\r
+#include <emmintrin.h>\r
+\r
+#include "intrinsic_vector_relational.inl"\r
+\r
+#endif//GLM_DETAIL_INTRINSIC_VECTOR_RELATIONAL_INCLUDED\r
diff --git a/glm/core/intrinsic_vector_relational.inl b/glm/core/intrinsic_vector_relational.inl
new file mode 100644 (file)
index 0000000..87fec8f
--- /dev/null
@@ -0,0 +1,347 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-06-09\r
+// Updated : 2009-06-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/intrinsic_vector_relational.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+//\r
+//// lessThan\r
+//template <typename valType>\r
+//inline typename detail::tvec2<valType>::bool_type lessThan\r
+//(\r
+//     detail::tvec2<valType> const & x, \r
+//     detail::tvec2<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//\r
+//    return typename detail::tvec2<bool>::bool_type(x.x < y.x, x.y < y.y);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec3<valType>::bool_type lessThan\r
+//(\r
+//     detail::tvec3<valType> const & x, \r
+//     detail::tvec3<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//     \r
+//     return typename detail::tvec3<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec4<valType>::bool_type lessThan\r
+//(\r
+//     detail::tvec4<valType> const & x, \r
+//     detail::tvec4<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//\r
+//     return typename detail::tvec4<bool>::bool_type(x.x < y.x, x.y < y.y, x.z < y.z, x.w < y.w);\r
+//}\r
+//\r
+//// lessThanEqual\r
+//template <typename valType>\r
+//inline typename detail::tvec2<valType>::bool_type lessThanEqual\r
+//(\r
+//     detail::tvec2<valType> const & x, \r
+//     detail::tvec2<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//\r
+//     return typename detail::tvec2<bool>::bool_type(x.x <= y.x, x.y <= y.y);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec3<valType>::bool_type lessThanEqual\r
+//(\r
+//     detail::tvec3<valType> const & x, \r
+//     detail::tvec3<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//     \r
+//     return typename detail::tvec3<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec4<valType>::bool_type lessThanEqual\r
+//(\r
+//     detail::tvec4<valType> const & x, \r
+//     detail::tvec4<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//     \r
+//     return typename detail::tvec4<bool>::bool_type(x.x <= y.x, x.y <= y.y, x.z <= y.z, x.w <= y.w);\r
+//}\r
+//\r
+//// greaterThan\r
+//template <typename valType>\r
+//inline typename detail::tvec2<valType>::bool_type greaterThan\r
+//(\r
+//     detail::tvec2<valType> const & x, \r
+//     detail::tvec2<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//\r
+//     return typename detail::tvec2<bool>::bool_type(x.x > y.x, x.y > y.y);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec3<valType>::bool_type greaterThan\r
+//(\r
+//     detail::tvec3<valType> const & x, \r
+//     detail::tvec3<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//     \r
+//     return typename detail::tvec3<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec4<valType>::bool_type greaterThan\r
+//(\r
+//     detail::tvec4<valType> const & x, \r
+//     detail::tvec4<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//     \r
+//     return typename detail::tvec4<bool>::bool_type(x.x > y.x, x.y > y.y, x.z > y.z, x.w > y.w);\r
+//}\r
+//\r
+//// greaterThanEqual\r
+//template <typename valType>\r
+//inline typename detail::tvec2<valType>::bool_type greaterThanEqual\r
+//(\r
+//     detail::tvec2<valType> const & x, \r
+//     detail::tvec2<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//\r
+//     return typename detail::tvec2<bool>::bool_type(x.x >= y.x, x.y >= y.y);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec3<valType>::bool_type greaterThanEqual\r
+//(\r
+//     detail::tvec3<valType> const & x, \r
+//     detail::tvec3<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//\r
+//     return typename detail::tvec3<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec4<valType>::bool_type greaterThanEqual\r
+//(\r
+//     detail::tvec4<valType> const & x, \r
+//     detail::tvec4<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint);\r
+//\r
+//     return typename detail::tvec4<bool>::bool_type(x.x >= y.x, x.y >= y.y, x.z >= y.z, x.w >= y.w);\r
+//}\r
+//\r
+//// equal\r
+//template <typename valType>\r
+//inline typename detail::tvec2<valType>::bool_type equal\r
+//(\r
+//     detail::tvec2<valType> const & x, \r
+//     detail::tvec2<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint || \r
+//             detail::type<valType>::is_bool);\r
+//\r
+//     return typename detail::tvec2<valType>::bool_type(x.x == y.x, x.y == y.y);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec3<valType>::bool_type equal\r
+//(\r
+//     detail::tvec3<valType> const & x, \r
+//     detail::tvec3<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint || \r
+//             detail::type<valType>::is_bool);\r
+//\r
+//     return typename detail::tvec3<valType>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec4<valType>::bool_type equal\r
+//(\r
+//     detail::tvec4<valType> const & x, \r
+//     detail::tvec4<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint || \r
+//             detail::type<valType>::is_bool);\r
+//\r
+//     return typename detail::tvec4<valType>::bool_type(x.x == y.x, x.y == y.y, x.z == y.z, x.w == y.w);\r
+//}\r
+//\r
+//// notEqual\r
+//template <typename valType>\r
+//inline typename detail::tvec2<valType>::bool_type notEqual\r
+//(\r
+//     detail::tvec2<valType> const & x, \r
+//     detail::tvec2<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint || \r
+//             detail::type<valType>::is_bool);\r
+//\r
+//     return typename detail::tvec2<valType>::bool_type(x.x != y.x, x.y != y.y);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec3<valType>::bool_type notEqual\r
+//(\r
+//     detail::tvec3<valType> const & x, \r
+//     detail::tvec3<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint || \r
+//             detail::type<valType>::is_bool);\r
+//\r
+//     return typename detail::tvec3<valType>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z);\r
+//}\r
+//\r
+//template <typename valType>\r
+//inline typename detail::tvec4<valType>::bool_type notEqual\r
+//(\r
+//     detail::tvec4<valType> const & x, \r
+//     detail::tvec4<valType> const & y\r
+//)\r
+//{\r
+//     GLM_STATIC_ASSERT(\r
+//             detail::type<valType>::is_float || \r
+//             detail::type<valType>::is_int || \r
+//             detail::type<valType>::is_uint || \r
+//             detail::type<valType>::is_bool);\r
+//\r
+//     return typename detail::tvec4<valType>::bool_type(x.x != y.x, x.y != y.y, x.z != y.z, x.w != y.w);\r
+//}\r
+//\r
+//// any\r
+//inline bool any(detail::tvec2<bool> const & x)\r
+//{\r
+//     return x.x || x.y;\r
+//}\r
+//\r
+//inline bool any(detail::tvec3<bool> const & x)\r
+//{\r
+//    return x.x || x.y || x.z;\r
+//}\r
+//\r
+//inline bool any(detail::tvec4<bool> const & x)\r
+//{\r
+//    return x.x || x.y || x.z || x.w;\r
+//}\r
+//\r
+//// all\r
+//inline bool all(const detail::tvec2<bool>& x)\r
+//{\r
+//    return x.x && x.y;\r
+//}\r
+//\r
+//inline bool all(const detail::tvec3<bool>& x)\r
+//{\r
+//    return x.x && x.y && x.z;\r
+//}\r
+//\r
+//inline bool all(const detail::tvec4<bool>& x)\r
+//{\r
+//    return x.x && x.y && x.z && x.w;\r
+//}\r
+//\r
+//// not\r
+//inline detail::tvec2<bool>::bool_type not_\r
+//(\r
+//     detail::tvec2<bool> const & v\r
+//)\r
+//{\r
+//    return detail::tvec2<bool>::bool_type(!v.x, !v.y);\r
+//}\r
+//\r
+//inline detail::tvec3<bool>::bool_type not_\r
+//(\r
+//     detail::tvec3<bool> const & v\r
+//)\r
+//{\r
+//    return detail::tvec3<bool>::bool_type(!v.x, !v.y, !v.z);\r
+//}\r
+//\r
+//inline detail::tvec4<bool>::bool_type not_\r
+//(\r
+//     detail::tvec4<bool> const & v\r
+//)\r
+//{\r
+//    return detail::tvec4<bool>::bool_type(!v.x, !v.y, !v.z, !v.w);\r
+//}
\ No newline at end of file
diff --git a/glm/core/type.hpp b/glm/core/type.hpp
new file mode 100644 (file)
index 0000000..e4bba56
--- /dev/null
@@ -0,0 +1,34 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-01-08\r
+// Updated : 2008-01-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type\r
+#define glm_core_type\r
+\r
+#include "type_half.hpp"\r
+#include "type_float.hpp"\r
+#include "type_int.hpp"\r
+\r
+#include "type_gentype.hpp"\r
+\r
+#include "type_vec1.hpp"\r
+#include "type_vec2.hpp"\r
+#include "type_vec3.hpp"\r
+#include "type_vec4.hpp"\r
+\r
+#include "type_mat2x2.hpp"\r
+#include "type_mat2x3.hpp"\r
+#include "type_mat2x4.hpp"\r
+#include "type_mat3x2.hpp"\r
+#include "type_mat3x3.hpp"\r
+#include "type_mat3x4.hpp"\r
+#include "type_mat4x2.hpp"\r
+#include "type_mat4x3.hpp"\r
+#include "type_mat4x4.hpp"\r
+\r
+#endif//glm_core_type\r
diff --git a/glm/core/type_float.hpp b/glm/core/type_float.hpp
new file mode 100644 (file)
index 0000000..a6e5732
--- /dev/null
@@ -0,0 +1,74 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-22\r
+// Updated : 2008-09-17\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_float.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_float\r
+#define glm_core_type_float\r
+\r
+#include "type_half.hpp"\r
+#include "../setup.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               GLM_DETAIL_IS_FLOAT(detail::thalf);\r
+               GLM_DETAIL_IS_FLOAT(float);\r
+               GLM_DETAIL_IS_FLOAT(double);\r
+               GLM_DETAIL_IS_FLOAT(long double);\r
+       }\r
+       //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace scalar{\r
+\r
+       namespace precision\r
+       {\r
+#ifdef GLM_USE_HALF_SCALAR\r
+               typedef detail::thalf           lowp_float_t;\r
+#else//GLM_USE_HALF_SCALAR\r
+               typedef float                           lowp_float_t;\r
+#endif//GLM_USE_HALF_SCALAR\r
+               typedef float                           mediump_float_t;\r
+               typedef double                          highp_float_t;\r
+\r
+               //! Low precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification\r
+               typedef lowp_float_t            lowp_float;\r
+               //! Medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification\r
+               typedef mediump_float_t         mediump_float;\r
+               //! High precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification\r
+               typedef highp_float_t           highp_float;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION \r
+       typedef precision::mediump_float_t              float_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)\r
+       typedef precision::highp_float_t                float_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)\r
+       typedef precision::mediump_float_t              float_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)\r
+       typedef precision::lowp_float_t                 float_t;\r
+#else\r
+       #       pragma message("GLM message: Precisson undefined for float numbers.");\r
+       typedef precision::mediump_float_t              float_t;\r
+#endif//GLM_PRECISION\r
+\r
+       }//namespace scalar\r
+       }//namespace type\r
+       }//namespace core\r
+}//namespace glm\r
+\r
+#endif//glm_core_type_float\r
diff --git a/glm/core/type_gentype.hpp b/glm/core/type_gentype.hpp
new file mode 100644 (file)
index 0000000..c71092c
--- /dev/null
@@ -0,0 +1,94 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-05\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_gentype.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_gentype\r
+#define glm_core_type_gentype\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm{\r
+\r
+enum profile\r
+{\r
+       nice,\r
+       fast,\r
+       simd\r
+};\r
+\r
+namespace detail{\r
+\r
+template <typename valTypeT, uint colT, uint rowT, profile proT = nice>\r
+class genType\r
+{\r
+public:\r
+       //////////////////////////////////////\r
+       // Traits\r
+\r
+       typedef sizeType                                                        size_type;\r
+       typedef valTypeT                                                        value_type;\r
+\r
+       typedef genType<value_type, colT, rowT>         class_type;\r
+\r
+       typedef genType<bool, colT, rowT>                       bool_type;\r
+       typedef genType<value_type, rowT, 1>            col_type;\r
+       typedef genType<value_type, colT, 1>            row_type;\r
+       typedef genType<value_type, rowT, colT>         transpose_type;\r
+\r
+       static size_type                                                        col_size();\r
+       static size_type                                                        row_size();\r
+       static size_type                                                        value_size();\r
+       static bool                                                                     is_scalar();\r
+       static bool                                                                     is_vector();\r
+       static bool                                                                     is_matrix();\r
+\r
+private:\r
+       // Data \r
+       col_type value[colT];           \r
+\r
+public:\r
+       //////////////////////////////////////\r
+       // Constructors\r
+       genType();\r
+       genType(class_type const & m);\r
+\r
+       explicit genType(value_type const & x);\r
+       explicit genType(value_type const * const x);\r
+       explicit genType(col_type const * const x);\r
+\r
+       //////////////////////////////////////\r
+       // Conversions\r
+       template <typename vU, uint cU, uint rU, profile pU>\r
+       explicit genType(genType<vU, cU, rU, pU> const & m);\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+       col_type& operator[](size_type i);\r
+       col_type const & operator[](size_type i) const;\r
+\r
+       //////////////////////////////////////\r
+       // Unary updatable operators\r
+       class_type& operator=  (class_type const & x);\r
+       class_type& operator+= (value_type const & x);\r
+       class_type& operator+= (class_type const & x);\r
+       class_type& operator-= (value_type const & x);\r
+       class_type& operator-= (class_type const & x);\r
+       class_type& operator*= (value_type const & x);\r
+       class_type& operator*= (class_type const & x);\r
+       class_type& operator/= (value_type const & x);\r
+       class_type& operator/= (class_type const & x);\r
+       class_type& operator++ ();\r
+       class_type& operator-- ();\r
+};\r
+\r
+}//namespace detail\r
+}//namespace glm\r
+\r
+#include "type_gentype.inl"\r
+\r
+#endif//glm_core_type_gentype\r
diff --git a/glm/core/type_gentype.inl b/glm/core/type_gentype.inl
new file mode 100644 (file)
index 0000000..57f3423
--- /dev/null
@@ -0,0 +1,347 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-05\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_gentype.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+/////////////////////////////////\r
+// Static functions\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::size_type genType<vT, cT, rT, pT>::col_size()\r
+{\r
+       return cT;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::size_type genType<vT, cT, rT, pT>::row_size()\r
+{\r
+       return rT;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::size_type genType<vT, cT, rT, pT>::value_size()\r
+{\r
+       return rT * cT;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+bool genType<vT, cT, rT, pT>::is_scalar()\r
+{\r
+       return rT == 1 && cT == 1;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+bool genType<vT, cT, rT, pT>::is_vector()\r
+{\r
+       return rT == 1;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+bool genType<vT, cT, rT, pT>::is_matrix()\r
+{\r
+       return rT != 1;\r
+}\r
+\r
+/////////////////////////////////\r
+// Constructor\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+genType<vT, cT, rT, pT>::genType()\r
+{\r
+       memset(&this->value, 0, cT * rT * sizeof(vT));\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+genType<vT, cT, rT, pT>::genType\r
+(\r
+       typename genType<vT, cT, rT, pT>::class_type const & m\r
+)\r
+{\r
+       for\r
+       (\r
+               typename genType<vT, cT, rT, pT>::size_type i = typename genType<vT, cT, rT, pT>::size_type(0);\r
+               i < genType<vT, cT, rT, pT>::col_size();\r
+               ++i\r
+       )\r
+       {\r
+               this->value[i] = m[i];\r
+       }\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+genType<vT, cT, rT, pT>::genType\r
+(\r
+       typename genType<vT, cT, rT, pT>::value_type const & x\r
+)\r
+{\r
+       if(rT == 1) // vector\r
+       {\r
+               for\r
+               (\r
+                       typename genType<vT, cT, rT, pT>::size_type i = typename genType<vT, cT, rT, pT>::size_type(0);\r
+                       i < genType<vT, cT, rT, pT>::col_size();\r
+                       ++i\r
+               )\r
+               {\r
+                       this->value[i][rT] = x;\r
+               }\r
+       }\r
+       else // matrix\r
+       {\r
+               memset(&this->value, 0, cT * rT * sizeof(vT));\r
+\r
+               typename genType<vT, cT, rT, pT>::size_type stop = cT < rT ? cT : rT;\r
+\r
+               for\r
+               (\r
+                       typename genType<vT, cT, rT, pT>::size_type i = typename genType<vT, cT, rT, pT>::size_type(0);\r
+                       i < stop;\r
+                       ++i\r
+               )\r
+               {\r
+                       this->value[i][i] = x;\r
+               }\r
+       }\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+genType<vT, cT, rT, pT>::genType\r
+(\r
+       typename genType<vT, cT, rT, pT>::value_type const * const x\r
+)\r
+{\r
+       memcpy(&this->value, &x.value, cT * rT * sizeof(vT));\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+genType<vT, cT, rT, pT>::genType\r
+(\r
+       typename genType<vT, cT, rT, pT>::col_type const * const x\r
+)\r
+{\r
+       for\r
+       (\r
+               typename genType<vT, cT, rT, pT>::size_type i = typename genType<vT, cT, rT, pT>::size_type(0);\r
+               i < genType<vT, cT, rT, pT>::col_size();\r
+               ++i\r
+       )\r
+       {\r
+               this->value[i] = x[i];\r
+       }\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+template <typename vU, uint cU, uint rU, profile pU>\r
+genType<vT, cT, rT, pT>::genType\r
+(\r
+       genType<vU, cU, rU, pU> const & m\r
+)\r
+{\r
+       for\r
+       (\r
+               typename genType<vT, cT, rT, pT>::size_type i = typename genType<vT, cT, rT, pT>::size_type(0);\r
+               i < genType<vT, cT, rT, pT>::col_size();\r
+               ++i\r
+       )\r
+       {\r
+               this->value[i] = genType<vT, cT, rT, pT>(m[i]);\r
+       }\r
+}\r
+\r
+//////////////////////////////////////\r
+// Accesses\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::col_type& genType<vT, cT, rT, pT>::operator[]\r
+(\r
+       typename genType<vT, cT, rT, pT>::size_type i\r
+)\r
+{\r
+       return this->value[i];\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::col_type const & genType<vT, cT, rT, pT>::operator[]\r
+(\r
+       typename genType<vT, cT, rT, pT>::size_type i\r
+) const\r
+{\r
+       return this->value[i];\r
+}\r
+\r
+//////////////////////////////////////\r
+// Unary updatable operators\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator= \r
+(\r
+       typename genType<vT, cT, rT, pT>::class_type const & x\r
+)\r
+{\r
+       memcpy(&this->value, &x.value, cT * rT * sizeof(vT));\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator+= \r
+(\r
+       typename genType<vT, cT, rT, pT>::value_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] += x;\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator+= \r
+(\r
+       typename genType<vT, cT, rT, pT>::class_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] += x[j][i];\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator-= \r
+(\r
+       typename genType<vT, cT, rT, pT>::value_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] -= x;\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator-= \r
+(\r
+       typename genType<vT, cT, rT, pT>::class_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] -= x[j][i];\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator*= \r
+(\r
+       typename genType<vT, cT, rT, pT>::value_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] *= x;\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator*= \r
+(\r
+       typename genType<vT, cT, rT, pT>::class_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] *= x[j][i];\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator/= \r
+(\r
+       typename genType<vT, cT, rT, pT>::value_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] /= x;\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator/= \r
+(\r
+       typename genType<vT, cT, rT, pT>::class_type const & x\r
+)\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = x.col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = x.row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               this->value[j][i] /= x[j][i];\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator++ ()\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               ++this->value[j][i];\r
+\r
+       return *this;\r
+}\r
+\r
+template <typename vT, uint cT, uint rT, profile pT>\r
+typename genType<vT, cT, rT, pT>::class_type& genType<vT, cT, rT, pT>::operator-- ()\r
+{\r
+       typename genType<vT, cT, rT, pT>::size_type stop_col = col_size();\r
+       typename genType<vT, cT, rT, pT>::size_type stop_row = row_size();\r
+\r
+       for(typename genType<vT, cT, rT, pT>::size_type j = 0; j < stop_col; ++j)\r
+       for(typename genType<vT, cT, rT, pT>::size_type i = 0; i < stop_row; ++i)\r
+               --this->value[j][i];\r
+\r
+       return *this;\r
+}\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_half.hpp b/glm/core/type_half.hpp
new file mode 100644 (file)
index 0000000..c2d7883
--- /dev/null
@@ -0,0 +1,85 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-17\r
+// Updated : 2009-11-12\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_half.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_half\r
+#define glm_core_type_half\r
+\r
+#include <cstdlib>\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               bool main_type_half();\r
+\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               typedef short hdata;\r
+\r
+               float toFloat32(hdata value);\r
+               hdata toFloat16(float const & value);\r
+\r
+               class thalf\r
+               {\r
+               public: \r
+                       // Constructors\r
+                       thalf();\r
+                       thalf(thalf const & s);\r
+                       \r
+                       template <typename U>\r
+                       thalf(U const & s);\r
+\r
+                       // Cast\r
+                       //operator float();\r
+                       operator float() const;\r
+                       //operator double();\r
+                       //operator double() const;\r
+\r
+                       // Unary updatable operators\r
+                       thalf& operator= (thalf const & s);\r
+                       thalf& operator+=(thalf const & s);\r
+                       thalf& operator-=(thalf const & s);\r
+                       thalf& operator*=(thalf const & s);\r
+                       thalf& operator/=(thalf const & s);\r
+                       thalf& operator++();\r
+                       thalf& operator--();\r
+       \r
+                       float toFloat() const{return toFloat32(data);}\r
+\r
+                       hdata _data() const{return data;}\r
+\r
+               private:\r
+                       hdata data;\r
+               };\r
+\r
+               thalf operator+ (thalf const & s1, thalf const & s2);\r
+\r
+               thalf operator- (thalf const & s1, thalf const & s2);\r
+\r
+               thalf operator* (thalf const & s1, thalf const & s2);\r
+\r
+               thalf operator/ (thalf const & s1, thalf const & s2);\r
+\r
+               // Unary constant operators\r
+               thalf operator- (thalf const & s);\r
+\r
+               thalf operator-- (thalf const & s, int);\r
+\r
+               thalf operator++ (thalf const & s, int);\r
+\r
+       }//namespace detail\r
+\r
+\r
+}//namespace glm\r
+\r
+#include "type_half.inl"\r
+\r
+#endif//glm_core_type_half\r
diff --git a/glm/core/type_half.inl b/glm/core/type_half.inl
new file mode 100644 (file)
index 0000000..6045293
--- /dev/null
@@ -0,0 +1,357 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-17\r
+// Updated : 2009-11-12\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_half.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Copyright:\r
+// This half implementation is based on OpenEXR which is Copyright (c) 2002, \r
+// Industrial Light & Magic, a division of Lucas Digital Ltd. LLC\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include "_detail.hpp"\r
+\r
+namespace glm{\r
+namespace detail\r
+{\r
+       inline float overflow()\r
+       {\r
+               volatile float f = 1e10;\r
+\r
+               for(int i = 0; i < 10; ++i)     \r
+                       f *= f;             // this will overflow before\r
+                                                               // the for­loop terminates\r
+               return f;\r
+       }\r
+\r
+       inline float toFloat32(hdata value)\r
+       {\r
+               int s = (value >> 15) & 0x00000001;\r
+               int e = (value >> 10) & 0x0000001f;\r
+               int m =  value        & 0x000003ff;\r
+\r
+               if(e == 0)\r
+               {\r
+                       if(m == 0)\r
+                       {\r
+                               //\r
+                               // Plus or minus zero\r
+                               //\r
+\r
+                               detail::uif result;\r
+                               result.i = s << 31;\r
+                               return result.f;\r
+                       }\r
+                       else\r
+                       {\r
+                               //\r
+                               // Denormalized number -- renormalize it\r
+                               //\r
+\r
+                               while(!(m & 0x00000400))\r
+                               {\r
+                                       m <<= 1;\r
+                                       e -=  1;\r
+                               }\r
+\r
+                               e += 1;\r
+                               m &= ~0x00000400;\r
+                       }\r
+               }\r
+               else if(e == 31)\r
+               {\r
+                       if(m == 0)\r
+                       {\r
+                               //\r
+                               // Positive or negative infinity\r
+                               //\r
+\r
+                               uif result;\r
+                               result.i = (s << 31) | 0x7f800000;\r
+                               return result.f;\r
+                       }\r
+                       else\r
+                       {\r
+                               //\r
+                               // Nan -- preserve sign and significand bits\r
+                               //\r
+\r
+                               uif result;\r
+                               result.i = (s << 31) | 0x7f800000 | (m << 13);\r
+                               return result.f;\r
+                       }\r
+               }\r
+\r
+               //\r
+               // Normalized number\r
+               //\r
+\r
+               e = e + (127 - 15);\r
+               m = m << 13;\r
+\r
+               //\r
+               // Assemble s, e and m.\r
+               //\r
+\r
+               uif Result;\r
+               Result.i = (s << 31) | (e << 23) | m;\r
+               return Result.f;\r
+       }\r
+\r
+       inline hdata toFloat16(float const & f)\r
+       {\r
+               uif Entry;\r
+               Entry.f = f;\r
+               int i = Entry.i;\r
+\r
+               //\r
+               // Our floating point number, f, is represented by the bit\r
+               // pattern in integer i.  Disassemble that bit pattern into\r
+               // the sign, s, the exponent, e, and the significand, m.\r
+               // Shift s into the position where it will go in in the\r
+               // resulting half number.\r
+               // Adjust e, accounting for the different exponent bias\r
+               // of float and half (127 versus 15).\r
+               //\r
+\r
+               register int s =  (i >> 16) & 0x00008000;\r
+               register int e = ((i >> 23) & 0x000000ff) - (127 - 15);\r
+               register int m =   i        & 0x007fffff;\r
+\r
+               //\r
+               // Now reassemble s, e and m into a half:\r
+               //\r
+\r
+               if(e <= 0)\r
+               {\r
+                       if(e < -10)\r
+                       {\r
+                               //\r
+                               // E is less than -10.  The absolute value of f is\r
+                               // less than half_MIN (f may be a small normalized\r
+                               // float, a denormalized float or a zero).\r
+                               //\r
+                               // We convert f to a _halfGTX zero.\r
+                               //\r
+\r
+                               return 0;\r
+                       }\r
+\r
+                       //\r
+                       // E is between -10 and 0.  F is a normalized float,\r
+                       // whose magnitude is less than __half_NRM_MIN.\r
+                       //\r
+                       // We convert f to a denormalized _halfGTX.\r
+                       // \r
+\r
+                       m = (m | 0x00800000) >> (1 - e);\r
+\r
+                       //\r
+                       // Round to nearest, round "0.5" up.\r
+                       //\r
+                       // Rounding may cause the significand to overflow and make\r
+                       // our number normalized.  Because of the way a half's bits\r
+                       // are laid out, we don't have to treat this case separately;\r
+                       // the code below will handle it correctly.\r
+                       // \r
+\r
+                       if(m & 0x00001000) \r
+                               m += 0x00002000;\r
+\r
+                       //\r
+                       // Assemble the _halfGTX from s, e (zero) and m.\r
+                       //\r
+\r
+                       return hdata(s | (m >> 13));\r
+               }\r
+               else if(e == 0xff - (127 - 15))\r
+               {\r
+                       if(m == 0)\r
+                       {\r
+                               //\r
+                               // F is an infinity; convert f to a half\r
+                               // infinity with the same sign as f.\r
+                               //\r
+\r
+                               return hdata(s | 0x7c00);\r
+                       }\r
+                       else\r
+                       {\r
+                               //\r
+                               // F is a NAN; we produce a half NAN that preserves\r
+                               // the sign bit and the 10 leftmost bits of the\r
+                               // significand of f, with one exception: If the 10\r
+                               // leftmost bits are all zero, the NAN would turn \r
+                               // into an infinity, so we have to set at least one\r
+                               // bit in the significand.\r
+                               //\r
+\r
+                               m >>= 13;\r
+\r
+                               return hdata(s | 0x7c00 | m | (m == 0));\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       //\r
+                       // E is greater than zero.  F is a normalized float.\r
+                       // We try to convert f to a normalized half.\r
+                       //\r
+\r
+                       //\r
+                       // Round to nearest, round "0.5" up\r
+                       //\r
+\r
+                       if(m &  0x00001000)\r
+                       {\r
+                               m += 0x00002000;\r
+\r
+                               if(m & 0x00800000)\r
+                               {\r
+                                       m =  0;     // overflow in significand,\r
+                                       e += 1;     // adjust exponent\r
+                               }\r
+                       }\r
+\r
+                       //\r
+                       // Handle exponent overflow\r
+                       //\r
+\r
+                       if (e > 30)\r
+                       {\r
+                               overflow();        // Cause a hardware floating point overflow;\r
+\r
+                               return hdata(s | 0x7c00);\r
+                               // if this returns, the half becomes an\r
+                       }   // infinity with the same sign as f.\r
+\r
+                       //\r
+                       // Assemble the half from s, e and m.\r
+                       //\r
+\r
+                       return hdata(s | (e << 10) | (m >> 13));\r
+               }\r
+       }\r
+\r
+       inline thalf::thalf() :\r
+               data(0)\r
+       {}\r
+\r
+       inline thalf::thalf(thalf const & s) :\r
+               data(s.data)\r
+       {}\r
+\r
+       template <typename U>\r
+       inline thalf::thalf(U const & s) :\r
+               data(toFloat16(float(s)))\r
+       {}\r
+\r
+       // Cast\r
+       //inline half::operator float()\r
+       //{\r
+       //      return toFloat();\r
+       //}\r
+\r
+       inline thalf::operator float() const \r
+       {\r
+               return toFloat();\r
+       }\r
+\r
+       //inline half::operator double()\r
+       //{\r
+       //      return double(toFloat());\r
+       //}\r
+\r
+       //inline half::operator double() const\r
+       //{\r
+       //      return double(toFloat());\r
+       //}\r
+\r
+       // Unary updatable operators\r
+       inline thalf& thalf::operator= (thalf const & s)\r
+       {\r
+               data = s.data;\r
+               return *this;\r
+       }\r
+\r
+       inline thalf& thalf::operator+=(thalf const & s)\r
+       {\r
+               data = toFloat16(toFloat32(data) + toFloat32(s.data));\r
+               return *this;\r
+       }\r
+\r
+       inline thalf& thalf::operator-=(thalf const & s)\r
+       {\r
+               data = toFloat16(toFloat32(data) - toFloat32(s.data));\r
+               return *this;\r
+       }\r
+\r
+       inline thalf& thalf::operator*=(thalf const & s)\r
+       {\r
+               data = toFloat16(toFloat32(data) * toFloat32(s.data));          \r
+               return *this;\r
+       }\r
+\r
+       inline thalf& thalf::operator/=(thalf const & s)\r
+       {\r
+               data = toFloat16(toFloat32(data) / toFloat32(s.data));\r
+               return *this;\r
+       }\r
+\r
+       inline thalf& thalf::operator++()\r
+       {\r
+               float Casted = toFloat32(data);\r
+               data = toFloat16(++Casted);\r
+               return *this;\r
+       }\r
+\r
+       inline thalf& thalf::operator--()\r
+       {\r
+               float Casted = toFloat32(data);\r
+               data = toFloat16(--Casted);\r
+               return *this;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Binary arithmetic operators\r
+\r
+       inline detail::thalf operator+ (detail::thalf const & s1, detail::thalf const & s2)\r
+       {\r
+               return detail::thalf(float(s1) + float(s2));\r
+       }\r
+\r
+       inline detail::thalf operator- (detail::thalf const & s1, detail::thalf const & s2)\r
+       {\r
+               return detail::thalf(float(s1) - float(s2));\r
+       }\r
+\r
+       inline detail::thalf operator* (detail::thalf const & s1, detail::thalf const & s2)\r
+       {\r
+               return detail::thalf(float(s1) * float(s2));\r
+       }\r
+\r
+       inline detail::thalf operator/ (detail::thalf const & s1, detail::thalf const & s2)\r
+       {\r
+               return detail::thalf(float(s1) / float(s2));\r
+       }\r
+\r
+       // Unary constant operators\r
+       inline detail::thalf operator- (detail::thalf const & s)\r
+       {\r
+               return detail::thalf(-float(s));\r
+       }\r
+\r
+       inline detail::thalf operator-- (detail::thalf const & s, int)\r
+       {\r
+               return detail::thalf(float(s) - 1.0f);\r
+       }\r
+\r
+       inline detail::thalf operator++ (detail::thalf const & s, int)\r
+       {\r
+               return detail::thalf(float(s) + 1.0f);\r
+       }\r
+\r
+}//namespace detail\r
+}//namespace glm\r
diff --git a/glm/core/type_int.hpp b/glm/core/type_int.hpp
new file mode 100644 (file)
index 0000000..98f0e34
--- /dev/null
@@ -0,0 +1,129 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-22\r
+// Updated : 2008-09-17\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_int.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_int\r
+#define glm_core_type_int\r
+\r
+#include "../setup.hpp"\r
+#include "_detail.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+#if defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC)\r
+               typedef signed __int64                                          highp_int_t;\r
+               typedef unsigned __int64                                        highp_uint_t;\r
+#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC))\r
+               __extension__ typedef signed long long          highp_int_t;\r
+               __extension__ typedef unsigned long long        highp_uint_t;\r
+//#    if GLM_MODEL == GLM_MODEL_64\r
+//             typedef signed long                                                     highp_int_t;\r
+//             typedef unsigned long                                           highp_uint_t;\r
+//#   elif GLM_MODEL == GLM_MODEL_32\r
+//             __extension__ typedef signed long long          highp_int_t;\r
+//             __extension__ typedef unsigned long long        highp_uint_t;\r
+//#    endif//GLM_MODEL\r
+#else\r
+               typedef signed long                                                     highp_int_t;\r
+               typedef unsigned long                                           highp_uint_t;\r
+#endif//GLM_COMPILER\r
+\r
+               GLM_DETAIL_IS_INT(signed char);\r
+               GLM_DETAIL_IS_INT(signed short);\r
+               GLM_DETAIL_IS_INT(signed int);\r
+               GLM_DETAIL_IS_INT(signed long);\r
+               GLM_DETAIL_IS_INT(highp_int_t);\r
+\r
+               GLM_DETAIL_IS_UINT(unsigned char);\r
+               GLM_DETAIL_IS_UINT(unsigned short);\r
+               GLM_DETAIL_IS_UINT(unsigned int);\r
+               GLM_DETAIL_IS_UINT(unsigned long);\r
+               GLM_DETAIL_IS_UINT(highp_uint_t);\r
+       }\r
+       //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace scalar{\r
+\r
+       namespace precision\r
+       {\r
+               typedef signed short                    lowp_int_t;\r
+               typedef signed int                              mediump_int_t;\r
+               typedef detail::highp_int_t             highp_int_t;\r
+\r
+               typedef unsigned short                  lowp_uint_t;\r
+               typedef unsigned int                    mediump_uint_t;\r
+               typedef detail::highp_uint_t    highp_uint_t;\r
+\r
+               //! Low precision signed integer. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification.\r
+               typedef lowp_int_t                              lowp_int;\r
+               //! Medium precision signed integer. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification.\r
+               typedef mediump_int_t                   mediump_int;\r
+               //! High precision signed integer.\r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification.\r
+               typedef highp_int_t                             highp_int;\r
+\r
+               //! Low precision unsigned integer. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification.\r
+               typedef lowp_uint_t                             lowp_uint;\r
+               //! Medium precision unsigned integer. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification.\r
+               typedef mediump_uint_t                  mediump_uint;\r
+               //! High precision unsigned integer. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification.\r
+               typedef highp_uint_t                    highp_uint;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION \r
+       typedef precision::mediump_int_t                        int_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT)\r
+       typedef precision::highp_int_t                          int_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)\r
+       typedef precision::mediump_int_t                        int_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT)\r
+       typedef precision::lowp_int_t                           int_t;\r
+#else\r
+       typedef mediump_int_t                   int_t;\r
+#      pragma message("GLM message: Precisson undefined for signed integer number.");\r
+#endif//GLM_PRECISION\r
+\r
+#ifndef GLM_PRECISION \r
+       typedef precision::mediump_uint_t                       uint_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)\r
+       typedef precision::highp_uint_t                         uint_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)\r
+       typedef precision::mediump_uint_t                       uint_t;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT)\r
+       typedef precision::lowp_uint_t                          uint_t;\r
+#else\r
+       typedef precision::mediump_uint_t                       uint_t;\r
+#      pragma message("GLM message: Precisson undefined for unsigned integer number.");\r
+#endif//GLM_PRECISION\r
+\r
+       //! Unsigned integer. \r
+       //! From GLSL 1.30.8 specification section 4.1.3 Integers.\r
+       typedef uint_t                                                          uint;\r
+\r
+       }//namespace scalar\r
+       }//namespace type\r
+       }//namespace core\r
+}\r
+\r
+#endif//glm_core_type_int\r
diff --git a/glm/core/type_mat2x2.hpp b/glm/core/type_mat2x2.hpp
new file mode 100644 (file)
index 0000000..8114ccf
--- /dev/null
@@ -0,0 +1,221 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-01-27\r
+// Updated : 2008-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat2x2.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat2x2\r
+#define glm_core_type_mat2x2\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat2x2();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 2 * 2 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat2x2\r
+               {\r
+               public:\r
+                       typedef tmat2x2<T>* pointer;\r
+                       typedef const tmat2x2<T>* const_pointer;\r
+                       typedef const tmat2x2<T>*const const_pointer_const;\r
+                       typedef tmat2x2<T>*const pointer_const;\r
+                       typedef tmat2x2<T>& reference;\r
+                       typedef const tmat2x2<T>& const_reference;\r
+                       typedef const tmat2x2<T>& param_type;\r
+                       typedef tmat2x2<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec2<T> col_type;\r
+                       typedef detail::tvec2<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat2x2<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data \r
+                       detail::tvec2<T> value[2];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat2x2();\r
+                       tmat2x2(tmat2x2<T> const & m);\r
+\r
+                       explicit tmat2x2(const T x);\r
+                       explicit tmat2x2(\r
+                               const T x1, const T y1, \r
+                               const T x2, const T y2);\r
+                       explicit tmat2x2(\r
+                               const detail::tvec2<T> & v1, \r
+                               const detail::tvec2<T> & v2);\r
+\r
+                       // Conversions\r
+                       template <typename U> \r
+                       explicit tmat2x2(const tmat2x2<U>& m);\r
+\r
+                       explicit tmat2x2(const tmat3x3<T>& x);\r
+                       explicit tmat2x2(const tmat4x4<T>& x);\r
+                       explicit tmat2x2(const tmat2x3<T>& x);\r
+                       explicit tmat2x2(const tmat3x2<T>& x);\r
+                       explicit tmat2x2(const tmat2x4<T>& x);\r
+                       explicit tmat2x2(const tmat4x2<T>& x);\r
+                       explicit tmat2x2(const tmat3x4<T>& x);\r
+                       explicit tmat2x2(const tmat4x3<T>& x);\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       detail::tvec2<T>& operator[](size_type i);\r
+                       detail::tvec2<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat2x2<T>& operator=(tmat2x2<T> const & m);\r
+                       tmat2x2<T>& operator+=(const T & s);\r
+                       tmat2x2<T>& operator+=(tmat2x2<T> const & m);\r
+                       tmat2x2<T>& operator-=(const T & s);\r
+                       tmat2x2<T>& operator-=(tmat2x2<T> const & m);\r
+                       tmat2x2<T>& operator*=(const T & s);\r
+                       tmat2x2<T>& operator*= (tmat2x2<T> const & m);\r
+                       tmat2x2<T>& operator/= (const T & s);\r
+                       tmat2x2<T>& operator/= (tmat2x2<T> const & m);\r
+                       tmat2x2<T>& operator++ ();\r
+                       tmat2x2<T>& operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat2x2<T> operator+ (tmat2x2<T> const & m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator+ (const T & s, tmat2x2<T> const & m);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator+ (tmat2x2<T> const & m1, tmat2x2<T> const & m2);\r
+           \r
+               template <typename T> \r
+               tmat2x2<T> operator- (tmat2x2<T> const & m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator- (const T & s, tmat2x2<T> const & m);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator- (tmat2x2<T> const & m1, tmat2x2<T> const & m2);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator* (tmat2x2<T> const & m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator* (const T & s, tmat2x2<T> const & m);\r
+\r
+               template <typename T> \r
+               tvec2<T> operator* (tmat2x2<T> const & m, const tvec2<T>& v);\r
+\r
+               template <typename T> \r
+               tvec2<T> operator* (const tvec2<T>& v, tmat2x2<T> const & m);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator* (tmat2x2<T> const & m1, tmat2x2<T> const & m2);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator/ (tmat2x2<T> const & m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator/ (const T & s, tmat2x2<T> const & m);\r
+\r
+               template <typename T> \r
+               tvec2<T> operator/ (tmat2x2<T> const & m, const tvec2<T>& v);\r
+\r
+               template <typename T> \r
+               tvec2<T> operator/ (const tvec2<T>& v, tmat2x2<T> const & m);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator/ (tmat2x2<T> const & m1, tmat2x2<T> const & m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat2x2<valType> const operator-  (tmat2x2<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat2x2<valType> const operator-- (tmat2x2<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat2x2<valType> const operator++ (tmat2x2<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 2 columns of 2 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x2<lowp_float>             lowp_mat2x2;\r
+               //! 2 columns of 2 components matrix of medium precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x2<mediump_float>  mediump_mat2x2;\r
+               //! 2 columns of 2 components matrix of high precision floating-point numbers. \r
+               //! There is no garanty on the actual precision. \r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x2<highp_float>    highp_mat2x2;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION\r
+       //! 2 columns of 2 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat2x2<mediump_float>  mat2x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat2x2<highp_float>    mat2x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat2x2<mediump_float>  mat2x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat2x2<lowp_float>             mat2x2;\r
+#else\r
+       typedef detail::tmat2x2<mediump_float>  mat2x2;\r
+#endif//GLM_PRECISION\r
+\r
+       //! 2 columns of 2 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef mat2x2                                                  mat2;\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat2x2.inl"\r
+\r
+#endif //glm_core_type_mat2x2\r
diff --git a/glm/core/type_mat2x2.inl b/glm/core/type_mat2x2.inl
new file mode 100644 (file)
index 0000000..8476c41
--- /dev/null
@@ -0,0 +1,463 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-01-16\r
+// Updated : 2007-03-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat2x2.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat2x2<valType>::size_type tmat2x2<valType>::value_size()\r
+       {\r
+               return typename tmat2x2<valType>::size_type(2);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat2x2<valType>::size_type tmat2x2<valType>::col_size()\r
+       {\r
+               return typename tmat2x2<valType>::size_type(2);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat2x2<valType>::size_type tmat2x2<valType>::row_size()\r
+       {\r
+               return typename tmat2x2<valType>::size_type(2);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat2x2<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec2<valType>& tmat2x2<valType>::operator[](typename tmat2x2<valType>::size_type i)\r
+       {\r
+               assert(\r
+                       i >= typename tmat2x2<valType>::size_type(0) && \r
+                       i < tmat2x2<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec2<valType>& tmat2x2<valType>::operator[](typename tmat2x2<valType>::size_type i) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat2x2<valType>::size_type(0) && \r
+                       i < tmat2x2<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // mat2 constructors\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2()\r
+    {\r
+        this->value[0] = detail::tvec2<T>(1, 0);\r
+        this->value[1] = detail::tvec2<T>(0, 1);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat2x2<T> & m)\r
+    {\r
+        this->value[0] = m.value[0];\r
+        this->value[1] = m.value[1];\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const T f)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(f, 0);\r
+        this->value[1] = detail::tvec2<T>(0, f);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const T x0, const T y0, const T x1, const T y1)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(x0, y0);\r
+        this->value[1] = detail::tvec2<T>(x1, y1);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const detail::tvec2<T>& v0, const detail::tvec2<T>& v1)\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // mat2 conversions\r
+\r
+    template <typename T> \r
+    template <typename U> \r
+    inline tmat2x2<T>::tmat2x2(const tmat2x2<U>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+       }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat3x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat4x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+    }\r
+\r
+       template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat4x2<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const tmat4x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+    }\r
+\r
+/*\r
+    template <typename T> \r
+    inline tmat2x2<T>::tmat2x2(const T* a)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(a[0], a[1]);\r
+        this->value[1] = detail::tvec2<T>(a[2], a[3]);\r
+    }\r
+*/\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> tmat2x2<T>::_inverse() const\r
+    {\r
+        T Determinant = value[0][0] * value[1][1] - value[1][0] * value[0][1];\r
+\r
+        tmat2x2<T> Inverse(\r
+            + value[1][1] / Determinant,\r
+            - value[1][0] / Determinant,\r
+            - value[0][1] / Determinant, \r
+            + value[0][0] / Determinant);\r
+        return Inverse;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // mat3 operators\r
+\r
+    // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator=(tmat2x2<T> const & m)\r
+    {\r
+           this->value[0] = m[0];\r
+           this->value[1] = m[1];\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator+= (const T & s)\r
+    {\r
+           this->value[0] += s;\r
+           this->value[1] += s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator+= (tmat2x2<T> const & m)\r
+    {\r
+           this->value[0] += m[0];\r
+           this->value[1] += m[1];\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator-= (const T & s)\r
+    {\r
+           this->value[0] -= s;\r
+           this->value[1] -= s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator-= (tmat2x2<T> const & m)\r
+    {\r
+           this->value[0] -= m[0];\r
+           this->value[1] -= m[1];\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator*= (const T & s)\r
+    {\r
+           this->value[0] *= s;\r
+           this->value[1] *= s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator*= (tmat2x2<T> const & m)\r
+    {\r
+        return (*this = *this * m);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator/= (const T & s)\r
+    {\r
+           this->value[0] /= s;\r
+           this->value[1] /= s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator/= (tmat2x2<T> const & m)\r
+    {\r
+        return (*this = *this / m);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator++ ()\r
+    {\r
+           ++this->value[0];\r
+           ++this->value[1];\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T>& tmat2x2<T>::operator-- ()\r
+    {\r
+           --this->value[0];\r
+           --this->value[1];\r
+           return *this;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+       // Binary operators\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator+ (tmat2x2<T> const & m, const T & s)\r
+    {\r
+        return tmat2x2<T>(\r
+            m[0] + s,\r
+            m[1] + s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator+ (const T & s, tmat2x2<T> const & m)\r
+    {\r
+        return tmat2x2<T>(\r
+            m[0] + s,\r
+            m[1] + s);\r
+    }\r
+\r
+    //template <typename T> \r
+    //inline detail::tvec2<T> operator+ (tmat2x2<T> const & m, const detail::tvec2<T>& v)\r
+    //{\r
+\r
+    //}\r
+\r
+    //template <typename T> \r
+    //inline detail::tvec2<T> operator+ (const detail::tvec2<T>& v, tmat2x2<T> const & m)\r
+    //{\r
+\r
+    //}\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator+ (tmat2x2<T> const & m1, tmat2x2<T> const & m2)\r
+    {\r
+        return tmat2x2<T>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator- (tmat2x2<T> const & m, const T & s)\r
+    {\r
+        return tmat2x2<T>(\r
+            m[0] - s,\r
+            m[1] - s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator- (const T & s, tmat2x2<T> const & m)\r
+    {\r
+        return tmat2x2<T>(\r
+            s - m[0],\r
+            s - m[1]);\r
+    }\r
+\r
+    //template <typename T> \r
+    //inline tmat2x2<T> operator- (tmat2x2<T> const & m, const detail::tvec2<T>& v)\r
+    //{\r
+\r
+    //}\r
+\r
+    //template <typename T> \r
+    //inline tmat2x2<T> operator- (const detail::tvec2<T>& v, tmat2x2<T> const & m)\r
+    //{\r
+\r
+    //}\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator- (tmat2x2<T> const & m1, tmat2x2<T> const & m2)\r
+    {\r
+        return tmat2x2<T>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator* (tmat2x2<T> const & m, const T & s)\r
+    {\r
+        return tmat2x2<T>(\r
+            m[0] * s,\r
+            m[1] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator* (const T & s, tmat2x2<T> const & m)\r
+    {\r
+        return tmat2x2<T>(\r
+            m[0] * s,\r
+            m[1] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> operator* (tmat2x2<T> const & m, const detail::tvec2<T>& v)\r
+    {\r
+        return detail::tvec2<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y,\r
+            m[0][1] * v.x + m[1][1] * v.y);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> operator* (const detail::tvec2<T>& v, tmat2x2<T> const & m)\r
+    {\r
+        return detail::tvec2<T>(\r
+            m[0][0] * v.x + m[0][1] * v.y,\r
+            m[1][0] * v.x + m[1][1] * v.y);\r
+    }\r
+\r
+       template <typename T>\r
+       inline tmat2x2<T> operator* (tmat2x2<T> const & m1, tmat2x2<T> const & m2)\r
+       {\r
+               return tmat2x2<T>(\r
+                       m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],\r
+                       m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],\r
+                       m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],\r
+                       m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]);\r
+       }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator/ (tmat2x2<T> const & m, const T & s)\r
+    {\r
+        return tmat2x2<T>(\r
+            m[0] / s,\r
+            m[1] / s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator/ (const T & s, tmat2x2<T> const & m)\r
+    {\r
+        return tmat2x2<T>(\r
+            s / m[0],\r
+            s / m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> operator/ (tmat2x2<T> const & m, const detail::tvec2<T>& v)\r
+    {\r
+        return m._inverse() * v;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> operator/ (const detail::tvec2<T>& v, tmat2x2<T> const & m)\r
+    {\r
+        return v * m._inverse();\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator/ (tmat2x2<T> const & m1, tmat2x2<T> const & m2)\r
+    {\r
+        return m1 * m2._inverse();\r
+    }\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat2x2<valType> const operator- \r
+       (\r
+               tmat2x2<valType> const & m\r
+       )\r
+    {\r
+        return tmat2x2<valType>(\r
+            -m[0], \r
+            -m[1]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat2x2<valType> const operator++ \r
+       (\r
+               tmat2x2<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat2x2<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat2x2<valType> const operator-- \r
+       (\r
+               tmat2x2<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat2x2<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_mat2x3.hpp b/glm/core/type_mat2x3.hpp
new file mode 100644 (file)
index 0000000..caec93e
--- /dev/null
@@ -0,0 +1,212 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-10-01\r
+// Updated : 2008-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat2x3.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat2x3\r
+#define glm_core_type_mat2x3\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat2x3();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 2 * 3 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat2x3\r
+               {\r
+               public:\r
+                       typedef tmat2x3<T>* pointer;\r
+                       typedef const tmat2x3<T>* const_pointer;\r
+                       typedef const tmat2x3<T>*const const_pointer_const;\r
+                       typedef tmat2x3<T>*const pointer_const;\r
+                       typedef tmat2x3<T>& reference;\r
+                       typedef const tmat2x3<T>& const_reference;\r
+                       typedef const tmat2x3<T>& param_type;\r
+                       typedef tmat3x2<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec3<T> col_type;\r
+                       typedef detail::tvec2<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat3x2<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data \r
+                       detail::tvec3<T> value[2];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat2x3();\r
+                       explicit tmat2x3(const T x);\r
+                       explicit tmat2x3(\r
+                               const T x0, const T y0, const T z0,\r
+                               const T x1, const T y1, const T z1);\r
+                       explicit tmat2x3(\r
+                               const detail::tvec3<T>& v0, \r
+                               const detail::tvec3<T>& v1);\r
+\r
+                       // Conversion\r
+                       template <typename U> \r
+                       explicit tmat2x3(const tmat2x3<U>& m);\r
+\r
+                       explicit tmat2x3(const tmat2x2<T>& x);\r
+                       explicit tmat2x3(const tmat3x3<T>& x);\r
+                       explicit tmat2x3(const tmat4x4<T>& x);\r
+                       explicit tmat2x3(const tmat2x4<T>& x);\r
+                       explicit tmat2x3(const tmat3x2<T>& x);\r
+                       explicit tmat2x3(const tmat3x4<T>& x);\r
+                       explicit tmat2x3(const tmat4x2<T>& x);\r
+                       explicit tmat2x3(const tmat4x3<T>& x);\r
+\r
+                       // Accesses\r
+                       detail::tvec3<T>& operator[](size_type i);\r
+                       detail::tvec3<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat2x3<T>& operator=  (const tmat2x3<T>& m);\r
+                       tmat2x3<T>& operator+= (const T & s);\r
+                       tmat2x3<T>& operator+= (const tmat2x3<T>& m);\r
+                       tmat2x3<T>& operator-= (const T & s);\r
+                       tmat2x3<T>& operator-= (const tmat2x3<T>& m);\r
+                       tmat2x3<T>& operator*= (const T & s);\r
+                       tmat2x3<T>& operator*= (const tmat3x2<T>& m);\r
+                       tmat2x3<T>& operator/= (const T & s);\r
+                       // tmat2x3<T>& operator/= (const tmat3x2<T>& m);\r
+\r
+                       tmat2x3<T>& operator++ ();\r
+                       tmat2x3<T>& operator-- ();\r
+\r
+                       // Unary constant operators\r
+                       const tmat2x3<T> operator- () const;\r
+                       const tmat2x3<T> operator++ (int n) const;\r
+                       const tmat2x3<T> operator-- (int n) const;\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat2x3<T> operator+ (const tmat2x3<T>& m, const T & s);\r
+           \r
+               template <typename T> \r
+               tmat2x3<T> operator+ (const tmat2x3<T>& m1, const tmat2x3<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat2x3<T> operator- (const tmat2x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x3<T> operator- (const tmat2x3<T>& m1, const tmat2x3<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat2x3<T> operator* (const tmat2x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x3<T> operator* (const T & s, const tmat2x3<T>& m);\r
+\r
+               template <typename T>\r
+               detail::tvec3<T> operator* (const tmat2x3<T>& m, const detail::tvec2<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec3<T> operator* (const detail::tvec3<T>& v, const tmat2x3<T>& m);\r
+\r
+               template <typename T>\r
+               tmat3x3<T> operator* (const tmat2x3<T>& m1, const tmat3x2<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat3x2<T> operator/ (const tmat2x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x2<T> operator/ (const T & s, const tmat2x3<T>& m);\r
+\r
+               //template <typename T> \r
+               //detail::tvec3<T> operator/ (const tmat2x3<T>& m, const detail::tvec2<T>& v);\r
+\r
+               //template <typename T> \r
+               //detail::tvec2<T> operator/ (const detail::tvec3<T>& v, const tmat2x3<T>& m);\r
+\r
+               //template <typename T> \r
+               //tmat3x3<T> operator/ (const tmat3x2<T>& m1, const tmat2x3<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat2x3<valType> const operator-  (tmat2x3<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat2x3<valType> const operator-- (tmat2x3<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat2x3<valType> const operator++ (tmat2x3<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 2 columns of 3 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x3<lowp_float>             lowp_mat2x3;\r
+               //! 2 columns of 3 components matrix of medium precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x3<mediump_float>  mediump_mat2x3;\r
+               //! 2 columns of 3 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x3<highp_float>    highp_mat2x3;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 2 columns of 3 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat2x3<mediump_float>  mat2x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)\r
+       typedef detail::tmat2x3<highp_float>    mat2x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)\r
+       typedef detail::tmat2x3<mediump_float>  mat2x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)\r
+       typedef detail::tmat2x3<lowp_float>             mat2x3;\r
+#else\r
+       typedef detail::tmat2x3<mediump_float>  mat2x3;\r
+#endif//GLM_PRECISION\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat2x3.inl"\r
+\r
+#endif //glm_core_type_mat2x3\r
diff --git a/glm/core/type_mat2x3.inl b/glm/core/type_mat2x3.inl
new file mode 100644 (file)
index 0000000..5ec438c
--- /dev/null
@@ -0,0 +1,457 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-05\r
+// Updated : 2006-10-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat2x3.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat2x3<valType>::size_type tmat2x3<valType>::col_size()\r
+       {\r
+               return typename tmat2x3<valType>::size_type(2);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat2x3<valType>::size_type tmat2x3<valType>::row_size()\r
+       {\r
+               return typename tmat2x3<valType>::size_type(3);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat2x3<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec3<valType>& tmat2x3<valType>::operator[](typename tmat2x3<valType>::size_type i)\r
+       {\r
+               assert(\r
+                       i >= typename tmat2x3<valType>::size_type(0) && \r
+                       i < tmat2x3<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec3<valType>& tmat2x3<valType>::operator[](typename tmat2x3<valType>::size_type i) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat2x3<valType>::size_type(0) && \r
+                       i < tmat2x3<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Constructors\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3()\r
+    {\r
+        this->value[0] = detail::tvec3<T>(T(1), T(0), T(0));\r
+        this->value[1] = detail::tvec3<T>(T(0), T(1), T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const T f)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(f, T(0), T(0));\r
+        this->value[1] = detail::tvec3<T>(T(0), f, T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3\r
+    (\r
+        const T x0, const T y0, const T z0,\r
+        const T x1, const T y1, const T z1\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec3<T>(x0, y0, z0);\r
+        this->value[1] = detail::tvec3<T>(x1, y1, z1);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3\r
+    (\r
+        const detail::tvec3<T> & v0, \r
+        const detail::tvec3<T> & v1\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+    }\r
+\r
+    // Conversion\r
+    template <typename T> \r
+    template <typename U> \r
+    inline tmat2x3<T>::tmat2x3(const tmat2x3<U>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+       }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(tmat2x2<T> const & m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec3<T>(m[1], T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const tmat3x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const tmat4x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec3<T>(m[1], T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const tmat4x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec3<T>(m[1], T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>::tmat2x3(const tmat4x3<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Unary updatable operators\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator= (const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator+= (const T & s)\r
+    {\r
+        this->value[0] += s;\r
+        this->value[1] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator+= (const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] += m[0];\r
+        this->value[1] += m[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator-= (const T & s)\r
+    {\r
+        this->value[0] -= s;\r
+        this->value[1] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator-= (const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] -= m[0];\r
+        this->value[1] -= m[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator*= (const T & s)\r
+    {\r
+        this->value[0] *= s;\r
+        this->value[1] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator*= (const tmat3x2<T>& m)\r
+    {\r
+        return (*this = tmat2x3<T>(*this * m));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> & tmat2x3<T>::operator/= (const T & s)\r
+    {\r
+        this->value[0] /= s;\r
+        this->value[1] /= s;\r
+        return *this;\r
+    }\r
+/* ToDo\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator/= (const tmat3x2<T>& m)\r
+    {\r
+        return (*this = tmat2x3<T>(*this / m));\r
+    }\r
+*/\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator++ ()\r
+    {\r
+        ++this->value[0];\r
+        ++this->value[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T>& tmat2x3<T>::operator-- ()\r
+    {\r
+        --this->value[0];\r
+        --this->value[1];\r
+        return *this;\r
+    }\r
+    \r
+    //////////////////////////////////////////////////////////////\r
+    // Unary constant operators\r
+    template <typename T> \r
+    inline const tmat2x3<T> tmat2x3<T>::operator- () const\r
+    {\r
+        return tmat2x3<T>(\r
+            -this->value[0], \r
+            -this->value[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline const tmat2x3<T> tmat2x3<T>::operator-- (int n) const \r
+    {\r
+        tmat2x3<T> m = *this;\r
+        --m[0];\r
+        --m[1];\r
+        return m;\r
+    }\r
+\r
+    template <typename T> \r
+    inline const tmat2x3<T> tmat2x3<T>::operator++ (int n) const\r
+    {\r
+        tmat2x3<T> m = *this;\r
+        ++m[0];\r
+        ++m[1];\r
+        return m;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Binary operators\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator+ (const tmat2x3<T>& m, const T & s)\r
+    {\r
+        return tmat2x3<T>(\r
+            m[0] + s,\r
+            m[1] + s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator+ (const tmat2x3<T>& m1, const tmat2x3<T>& m2)\r
+    {\r
+        return tmat2x3<T>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator- (const tmat2x3<T>& m, const T & s)\r
+    {\r
+        return tmat2x3<T>(\r
+            m[0] - s,\r
+            m[1] - s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator- (const tmat2x3<T>& m1, const tmat2x3<T>& m2)\r
+    {\r
+        return tmat2x3<T>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator* (const tmat2x3<T>& m, const T & s)\r
+    {\r
+        return tmat2x3<T>(\r
+            m[0] * s,\r
+            m[1] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator* (const T & s, const tmat2x3<T> & m)\r
+    {\r
+        return tmat2x3<T>(\r
+            m[0] * s,\r
+            m[1] * s);\r
+    }\r
+   \r
+    template <typename T>\r
+    inline detail::tvec3<T> operator* (const tmat2x3<T>& m, const detail::tvec2<T>& v)\r
+    {\r
+        return detail::tvec3<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y,\r
+            m[0][1] * v.x + m[1][1] * v.y,\r
+            m[0][2] * v.x + m[1][2] * v.y,\r
+            m[0][3] * v.x + m[1][3] * v.y);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> operator* (const detail::tvec3<T>& v, const tmat2x3<T>& m) \r
+    {\r
+        return detail::tvec2<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator* (const tmat2x3<T>& m1, const tmat3x2<T>& m2)\r
+    {\r
+        const T SrcA00 = m1[0][0];\r
+        const T SrcA01 = m1[0][1];\r
+        const T SrcA02 = m1[0][2];\r
+        const T SrcA10 = m1[1][0];\r
+        const T SrcA11 = m1[1][1];\r
+        const T SrcA12 = m1[1][2];\r
+\r
+        const T SrcB00 = m2[0][0];\r
+        const T SrcB01 = m2[0][1];\r
+        const T SrcB10 = m2[1][0];\r
+        const T SrcB11 = m2[1][1];\r
+        const T SrcB20 = m2[2][0];\r
+        const T SrcB21 = m2[2][1];\r
+\r
+        tmat3x3<T> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;\r
+        Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11;\r
+        Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11;\r
+        Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21;\r
+        Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21;\r
+        Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator/ (const tmat2x3<T>& m, const T & s)\r
+    {\r
+        return tmat2x3<T>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s);        \r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x3<T> operator/ (const T & s, const tmat2x3<T>& m)\r
+    {\r
+        return tmat2x3<T>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2]);        \r
+    }\r
+\r
+       //template <typename valType> \r
+       //tvec3<valType> operator/ \r
+       //(\r
+       //      tmat3x2<valType> const & m, \r
+       //      tvec2<valType> const & v\r
+       //)\r
+       //{\r
+       //      return m._inverse() * v;\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //tvec3<valType> operator/ \r
+       //(\r
+       //      tvec2<valType> const & v, \r
+       //      tmat3x2<valType> const & m\r
+       //)\r
+       //{\r
+       //      return v * m._inverse();\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tmat2x2<valType> operator/ \r
+       //(\r
+       //      tmat3x2<valType> const & m1, \r
+       //      tmat2x3<valType> const & m2\r
+       //)\r
+       //{\r
+       //      return m1 * m2._inverse();\r
+       //}\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat2x3<valType> const operator- \r
+       (\r
+               tmat2x3<valType> const & m\r
+       )\r
+    {\r
+        return tmat2x3<valType>(\r
+            -m[0], \r
+            -m[1]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat2x3<valType> const operator++ \r
+       (\r
+               tmat2x3<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat2x3<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat2x3<valType> const operator-- \r
+       (\r
+               tmat2x3<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat2x3<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_mat2x4.hpp b/glm/core/type_mat2x4.hpp
new file mode 100644 (file)
index 0000000..03ad7ce
--- /dev/null
@@ -0,0 +1,208 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-05\r
+// Updated : 2008-08-25\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat2x4.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat2x4\r
+#define glm_core_type_mat2x4\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat2x4();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 2 * 4 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat2x4\r
+               {\r
+               public:\r
+                       typedef tmat2x4<T>* pointer;\r
+                       typedef const tmat2x4<T>* const_pointer;\r
+                       typedef const tmat2x4<T>*const const_pointer_const;\r
+                       typedef tmat2x4<T>*const pointer_const;\r
+                       typedef tmat2x4<T>& reference;\r
+                       typedef const tmat2x4<T>& const_reference;\r
+                       typedef const tmat2x4<T>& param_type;\r
+                       typedef tmat4x2<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec2<T> col_type;\r
+                       typedef detail::tvec4<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat4x2<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data \r
+                       detail::tvec4<T> value[2];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat2x4();\r
+                       explicit tmat2x4(const T x);\r
+                       explicit tmat2x4(\r
+                               const T x0, const T y0, const T z0, const T w0,\r
+                               const T x1, const T y1, const T z1, const T w1);\r
+                       explicit tmat2x4(\r
+                               const detail::tvec4<T>& v0, \r
+                               const detail::tvec4<T>& v1);\r
+\r
+                       // Conversion\r
+                       template <typename U> \r
+                       explicit tmat2x4(const tmat2x4<U>& m);\r
+\r
+                       explicit tmat2x4(const tmat2x2<T>& x);\r
+                       explicit tmat2x4(const tmat3x3<T>& x);\r
+                       explicit tmat2x4(const tmat4x4<T>& x);\r
+                       explicit tmat2x4(const tmat2x3<T>& x);\r
+                       //explicit tmat2x4(const tmat2x4<T>& x);\r
+                       explicit tmat2x4(const tmat3x2<T>& x);\r
+                       explicit tmat2x4(const tmat3x4<T>& x);\r
+                       explicit tmat2x4(const tmat4x2<T>& x);\r
+                       explicit tmat2x4(const tmat4x3<T>& x);\r
+\r
+                       // Accesses\r
+                       detail::tvec4<T>& operator[](size_type i);\r
+                       detail::tvec4<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat2x4<T>& operator=  (const tmat2x4<T>& m);\r
+                       tmat2x4<T>& operator+= (const T & s);\r
+                       tmat2x4<T>& operator+= (const tmat2x4<T>& m);\r
+                       tmat2x4<T>& operator-= (const T & s);\r
+                       tmat2x4<T>& operator-= (const tmat2x4<T>& m);\r
+                       tmat2x4<T>& operator*= (const T & s);\r
+                       tmat2x4<T>& operator*= (const tmat4x2<T>& m);\r
+                       tmat2x4<T>& operator/= (const T & s);\r
+                       //tmat2x4<T>& operator/= (const tmat4x2<T>& m);\r
+\r
+                       tmat2x4<T>& operator++ ();\r
+                       tmat2x4<T>& operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat2x4<T> operator+ (const tmat2x4<T>& m, const T & s);\r
+           \r
+               template <typename T> \r
+               tmat2x4<T> operator+ (const tmat2x4<T>& m1, const tmat2x4<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat2x4<T> operator- (const tmat2x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x4<T> operator- (const tmat2x4<T>& m1, const tmat2x4<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat2x4<T> operator* (const tmat2x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x4<T> operator* (const T & s, const tmat2x4<T>& m);\r
+\r
+               template <typename T>\r
+               detail::tvec4<T> operator* (const tmat2x4<T>& m, const detail::tvec2<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec2<T> operator* (const detail::tvec4<T>& v, const tmat2x4<T>& m);\r
+\r
+               template <typename T>\r
+               tmat4x4<T> operator* (const tmat2x4<T>& m1, const tmat4x2<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x2<T> operator/ (const tmat2x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x2<T> operator/ (const T & s, const tmat2x4<T>& m);\r
+\r
+               //template <typename T> \r
+               //detail::tvec4<T> operator/ (const tmat2x4<T>& m, const detail::tvec2<T>& v);\r
+\r
+               //template <typename T> \r
+               //detail::tvec2<T> operator/ (const detail::tvec4<T>& v, const tmat2x4<T>& m);\r
+\r
+               //template <typename T> \r
+               //tmat4x4<T> operator/ (const tmat4x2<T>& m1, const tmat2x4<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat2x4<valType> const operator-  (tmat2x4<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat2x4<valType> const operator-- (tmat2x4<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat2x4<valType> const operator++ (tmat2x4<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 2 columns of 4 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x4<lowp_float>             lowp_mat2x4;\r
+               //! 2 columns of 4 components matrix of medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x4<mediump_float>  mediump_mat2x4;\r
+               //! 2 columns of 4 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat2x4<highp_float>    highp_mat2x4;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION\r
+       //! 2 columns of 4 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat2x4<mediump_float>  mat2x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat2x4<highp_float>    mat2x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat2x4<mediump_float>  mat2x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat2x4<lowp_float>             mat2x4;\r
+#else\r
+       typedef detail::tmat2x4<mediump_float>  mat2x4;\r
+#endif//GLM_PRECISION\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat2x4.inl"\r
+\r
+#endif //glm_core_type_mat2x4\r
diff --git a/glm/core/type_mat2x4.inl b/glm/core/type_mat2x4.inl
new file mode 100644 (file)
index 0000000..026aa15
--- /dev/null
@@ -0,0 +1,450 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-05\r
+// Updated : 2006-10-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat2x4.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat2x4<valType>::size_type tmat2x4<valType>::col_size()\r
+       {\r
+               return typename tmat2x4<valType>::size_type(2);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat2x4<valType>::size_type tmat2x4<valType>::row_size()\r
+       {\r
+               return typename tmat2x4<valType>::size_type(4);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat2x4<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec4<valType>& tmat2x4<valType>::operator[](typename tmat2x4<valType>::size_type i)\r
+       {\r
+               assert(\r
+                       i >= typename tmat2x4<valType>::size_type(0) && \r
+                       i < tmat2x4<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec4<valType>& tmat2x4<valType>::operator[](typename tmat2x4<valType>::size_type i) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat2x4<valType>::size_type(0) && \r
+                       i < tmat2x4<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Constructors\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4()\r
+    {\r
+        this->value[0] = detail::tvec4<T>(1, 0, 0, 0);\r
+        this->value[1] = detail::tvec4<T>(0, 1, 0, 0);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const T f)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(f, 0, 0, 0);\r
+        this->value[1] = detail::tvec4<T>(0, f, 0, 0);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4\r
+    (\r
+        const T x0, const T y0, const T z0, const T w0,\r
+        const T x1, const T y1, const T z1, const T w1\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec4<T>(x0, y0, z0, w0);\r
+        this->value[1] = detail::tvec4<T>(x1, y1, z1, w1);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4\r
+    (\r
+        const detail::tvec4<T> & v0, \r
+        const detail::tvec4<T> & v1\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+    }\r
+\r
+    // Conversion\r
+    template <typename T> \r
+    template <typename U> \r
+    inline tmat2x4<T>::tmat2x4(const tmat2x4<U>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0]);\r
+        this->value[1] = detail::tvec4<T>(m[1]);\r
+       }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(tmat2x2<T> const & m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], detail::tvec2<T>(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], detail::tvec2<T>(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const tmat3x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const tmat4x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0]);\r
+        this->value[1] = detail::tvec4<T>(m[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], detail::tvec2<T>(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], detail::tvec2<T>(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const tmat4x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], detail::tvec2<T>(T(0)));\r
+        this->value[1] = detail::tvec4<T>(m[1], detail::tvec2<T>(T(0)));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>::tmat2x4(const tmat4x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], T(0));\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Unary updatable operators\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator= (const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator+= (const T & s)\r
+    {\r
+        this->value[0] += s;\r
+        this->value[1] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator+= (const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] += m[0];\r
+        this->value[1] += m[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator-= (const T & s)\r
+    {\r
+        this->value[0] -= s;\r
+        this->value[1] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator-= (const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] -= m[0];\r
+        this->value[1] -= m[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator*= (const T & s)\r
+    {\r
+        this->value[0] *= s;\r
+        this->value[1] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator*= (const tmat4x2<T>& m)\r
+    {\r
+        return (*this = tmat2x4<T>(*this * m));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> & tmat2x4<T>::operator/= (const T & s)\r
+    {\r
+        this->value[0] /= s;\r
+        this->value[1] /= s;\r
+        return *this;\r
+    }\r
+/* ToDo\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator/= (const tmat4x2<T>& m)\r
+    {\r
+        return (*this = tmat2x4<T>(*this / m));\r
+    }\r
+*/\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator++ ()\r
+    {\r
+        ++this->value[0];\r
+        ++this->value[1];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T>& tmat2x4<T>::operator-- ()\r
+    {\r
+        --this->value[0];\r
+        --this->value[1];\r
+        return *this;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // inverse\r
+    template <typename valType> \r
+    inline tmat4x2<valType> tmat2x4<valType>::_inverse() const\r
+    {\r
+               assert(0); //g.truc.creation[at]gmail.com\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Binary operators\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator+ (const tmat2x4<T>& m, const T & s)\r
+    {\r
+        return tmat2x4<T>(\r
+            m[0] + s,\r
+            m[1] + s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator+ (const tmat2x4<T>& m1, const tmat2x4<T>& m2)\r
+    {\r
+        return tmat2x4<T>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator- (const tmat2x4<T>& m, const T & s)\r
+    {\r
+        return tmat2x4<T>(\r
+            m[0] - s,\r
+            m[1] - s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator- (const tmat2x4<T>& m1, const tmat2x4<T>& m2)\r
+    {\r
+        return tmat2x4<T>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator* (const tmat2x4<T>& m, const T & s)\r
+    {\r
+        return tmat2x4<T>(\r
+            m[0] * s,\r
+            m[1] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator* (const T & s, const tmat2x4<T> & m)\r
+    {\r
+        return tmat2x4<T>(\r
+            m[0] * s,\r
+            m[1] * s);\r
+    }\r
+   \r
+    template <typename T>\r
+    inline detail::tvec4<T> operator* (const tmat2x4<T>& m, const detail::tvec2<T>& v)\r
+    {\r
+        return detail::tvec4<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y,\r
+            m[0][1] * v.x + m[1][1] * v.y,\r
+            m[0][2] * v.x + m[1][2] * v.y,\r
+            m[0][3] * v.x + m[1][3] * v.y);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> operator* (const detail::tvec4<T>& v, const tmat2x4<T>& m) \r
+    {\r
+        return detail::tvec4<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat4x4<T> operator* (const tmat2x4<T>& m1, const tmat4x2<T>& m2)\r
+    {\r
+        const T SrcA00 = m1[0][0];\r
+        const T SrcA01 = m1[0][1];\r
+        const T SrcA02 = m1[0][2];\r
+        const T SrcA03 = m1[0][3];\r
+        const T SrcA10 = m1[1][0];\r
+        const T SrcA11 = m1[1][1];\r
+        const T SrcA12 = m1[1][2];\r
+        const T SrcA13 = m1[1][3];\r
+\r
+        const T SrcB00 = m2[0][0];\r
+        const T SrcB01 = m2[0][1];\r
+        const T SrcB10 = m2[1][0];\r
+        const T SrcB11 = m2[1][1];\r
+        const T SrcB20 = m2[2][0];\r
+        const T SrcB21 = m2[2][1];\r
+        const T SrcB30 = m2[3][0];\r
+        const T SrcB31 = m2[3][1];\r
+\r
+        tmat4x4<T> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;\r
+        Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;\r
+        Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11;\r
+        Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11;\r
+        Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11;\r
+        Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21;\r
+        Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21;\r
+        Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21;\r
+        Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21;\r
+        Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31;\r
+        Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31;\r
+        Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31;\r
+        Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator/ (const tmat2x4<T>& m, const T & s)\r
+    {\r
+        return tmat2x4<T>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s,\r
+            m[3] / s);        \r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x4<T> operator/ (const T & s, const tmat2x4<T>& m)\r
+    {\r
+        return tmat2x4<T>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2],\r
+            s / m[3]);        \r
+    }\r
+\r
+       //template <typename valType> \r
+       //tvec4<valType> operator/ \r
+       //(\r
+       //      tmat4x2<valType> const & m, \r
+       //      tvec2<valType> const & v\r
+       //)\r
+       //{\r
+       //      return m._inverse() * v;\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //tvec4<valType> operator/ \r
+       //(\r
+       //      tvec2<valType> const & v, \r
+       //      tmat4x2<valType> const & m\r
+       //)\r
+       //{\r
+       //      return v * m._inverse();\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tmat2x2<valType> operator/ \r
+       //(\r
+       //      tmat4x2<valType> const & m1, \r
+       //      tmat2x4<valType> const & m2\r
+       //)\r
+       //{\r
+       //      return m1 * m2._inverse();\r
+       //}\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat2x4<valType> const operator- \r
+       (\r
+               tmat2x4<valType> const & m\r
+       )\r
+    {\r
+        return tmat2x4<valType>(\r
+            -m[0], \r
+            -m[1]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat2x4<valType> const operator++ \r
+       (\r
+               tmat2x4<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat2x4<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat2x4<valType> const operator-- \r
+       (\r
+               tmat2x4<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat2x4<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_mat3x2.hpp b/glm/core/type_mat3x2.hpp
new file mode 100644 (file)
index 0000000..b9efeaa
--- /dev/null
@@ -0,0 +1,209 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-05\r
+// Updated : 2008-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat3x2.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat3x2\r
+#define glm_core_type_mat3x2\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat3x2();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 3 * 2 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat3x2\r
+               {\r
+               public:\r
+                       typedef tmat3x2<T>* pointer;\r
+                       typedef const tmat3x2<T>* const_pointer;\r
+                       typedef const tmat3x2<T>*const const_pointer_const;\r
+                       typedef tmat3x2<T>*const pointer_const;\r
+                       typedef tmat3x2<T>& reference;\r
+                       typedef const tmat3x2<T>& const_reference;\r
+                       typedef const tmat3x2<T>& param_type;\r
+                       typedef tmat2x3<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec3<T> col_type;\r
+                       typedef detail::tvec2<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat2x3<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data\r
+                       detail::tvec2<T> value[3];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat3x2();\r
+                       explicit tmat3x2(const T x);\r
+                       explicit tmat3x2(\r
+                               const T x0, const T y0,\r
+                               const T x1, const T y1,\r
+                               const T x2, const T y2);\r
+                       explicit tmat3x2(\r
+                               const detail::tvec2<T>& v0, \r
+                               const detail::tvec2<T>& v1,\r
+                               const detail::tvec2<T>& v2);\r
+\r
+                       // Conversion\r
+                       template <typename U> \r
+                       explicit tmat3x2(const tmat3x2<U>& m);\r
+\r
+                       explicit tmat3x2(const tmat2x2<T>& x);\r
+                       explicit tmat3x2(const tmat3x3<T>& x);\r
+                       explicit tmat3x2(const tmat4x4<T>& x);\r
+                       explicit tmat3x2(const tmat2x3<T>& x);\r
+                       explicit tmat3x2(const tmat2x4<T>& x);\r
+                       explicit tmat3x2(const tmat3x4<T>& x);\r
+                       explicit tmat3x2(const tmat4x2<T>& x);\r
+                       explicit tmat3x2(const tmat4x3<T>& x);\r
+\r
+                       // Accesses\r
+                       detail::tvec2<T>& operator[](size_type i);\r
+                       const detail::tvec2<T>& operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat3x2<T>& operator=  (const tmat3x2<T>& m);\r
+                       tmat3x2<T>& operator+= (const T & s);\r
+                       tmat3x2<T>& operator+= (const tmat3x2<T>& m);\r
+                       tmat3x2<T>& operator-= (const T & s);\r
+                       tmat3x2<T>& operator-= (const tmat3x2<T>& m);\r
+                       tmat3x2<T>& operator*= (const T & s);\r
+                       tmat3x2<T>& operator*= (const tmat2x3<T>& m);\r
+                       tmat3x2<T>& operator/= (const T & s);\r
+                       //tmat3x2<T>& operator/= (const tmat2x3<T>& m);\r
+\r
+                       tmat3x2<T>& operator++ ();\r
+                       tmat3x2<T>& operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat3x2<T> operator+ (const tmat3x2<T>& m, const T & s);\r
+           \r
+               template <typename T> \r
+               tmat3x2<T> operator+ (const tmat3x2<T>& m1, const tmat3x2<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat3x2<T> operator- (const tmat3x2<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x2<T> operator- (const tmat3x2<T>& m1, const tmat3x2<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat3x2<T> operator* (const tmat3x2<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x2<T> operator* (const T & s, const tmat3x4<T>& m);\r
+\r
+               template <typename T>\r
+               detail::tvec2<T> operator* (const tmat3x2<T>& m, const detail::tvec3<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec3<T> operator* (const detail::tvec2<T>& v, const tmat3x2<T>& m);\r
+\r
+               template <typename T>\r
+               tmat2x2<T> operator* (const tmat3x2<T>& m1, const tmat2x3<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat2x3<T> operator/ (const tmat2x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat2x3<T> operator/ (const T s, const tmat2x3<T>& m);\r
+\r
+               //template <typename T> \r
+               //detail::tvec2<T> operator/ (const tmat3x2<T>& m, const detail::tvec3<T>& v);\r
+\r
+               //template <typename T> \r
+               //detail::tvec3<T> operator/ (const detail::tvec2<T>& v, const tmat3x2<T>& m);\r
+\r
+               //template <typename T> \r
+               //tmat2x2<T> operator/ (const tmat2x3<T>& m1, const tmat3x2<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat3x2<valType> const operator-  (tmat3x2<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat3x2<valType> const operator-- (tmat3x2<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat3x2<valType> const operator++ (tmat3x2<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 3 columns of 2 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x2<lowp_float>             lowp_mat3x2;\r
+               //! 3 columns of 2 components matrix of medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x2<mediump_float>  mediump_mat3x2;\r
+               //! 3 columns of 2 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x2<highp_float>    highp_mat3x2;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 3 columns of 2 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat3x2<mediump_float>  mat3x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat3x2<highp_float>    mat3x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat3x2<mediump_float>  mat3x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat3x2<lowp_float>             mat3x2;\r
+#else\r
+       typedef detail::tmat3x2<mediump_float>  mat3x2;\r
+#endif//GLM_PRECISION\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat3x2.inl"\r
+\r
+#endif //glm_core_type_mat3x2\r
diff --git a/glm/core/type_mat3x2.inl b/glm/core/type_mat3x2.inl
new file mode 100644 (file)
index 0000000..5106517
--- /dev/null
@@ -0,0 +1,465 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-05\r
+// Updated : 2006-10-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat3x2.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat3x2<valType>::size_type tmat3x2<valType>::col_size()\r
+       {\r
+               return typename tmat3x2<valType>::size_type(3);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat3x2<valType>::size_type tmat3x2<valType>::row_size()\r
+       {\r
+               return typename tmat3x2<valType>::size_type(2);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat3x2<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec2<valType>& tmat3x2<valType>::operator[](typename tmat3x2<valType>::size_type i)\r
+       {\r
+               assert(\r
+                       i >= typename tmat3x2<valType>::size_type(0) && \r
+                       i < tmat3x2<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec2<valType>& tmat3x2<valType>::operator[](typename tmat3x2<valType>::size_type i) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat3x2<valType>::size_type(0) && \r
+                       i < tmat3x2<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Constructors\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2()\r
+    {\r
+        this->value[0] = detail::tvec2<T>(1, 0);\r
+        this->value[1] = detail::tvec2<T>(0, 1);\r
+        this->value[2] = detail::tvec2<T>(0, 0);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const T f)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(f, 0);\r
+        this->value[1] = detail::tvec2<T>(0, f);\r
+        this->value[2] = detail::tvec2<T>(0, 0);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2\r
+    (\r
+        const T x0, const T y0,\r
+        const T x1, const T y1,\r
+        const T x2, const T y2\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec2<T>(x0, y0);\r
+        this->value[1] = detail::tvec2<T>(x1, y1);\r
+        this->value[2] = detail::tvec2<T>(x2, y2);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2\r
+    (\r
+        const detail::tvec2<T> & v0, \r
+        const detail::tvec2<T> & v1, \r
+        const detail::tvec2<T> & v2\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+        this->value[2] = v2;\r
+    }\r
+\r
+    // Conversion\r
+    template <typename T> \r
+    template <typename U> \r
+    inline tmat3x2<T>::tmat3x2(const tmat3x2<U>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+        this->value[2] = detail::tvec2<T>(m[2]);\r
+       }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(tmat2x2<T> const & m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = detail::tvec2<T>(T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const tmat3x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+        this->value[2] = detail::tvec2<T>(m[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const tmat4x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+        this->value[2] = detail::tvec2<T>(m[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+        this->value[2] = detail::tvec2<T>(T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+        this->value[2] = detail::tvec2<T>(T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+        this->value[2] = detail::tvec2<T>(m[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const tmat4x2<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>::tmat3x2(const tmat4x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<T>(m[0]);\r
+        this->value[1] = detail::tvec2<T>(m[1]);\r
+        this->value[2] = detail::tvec2<T>(m[2]);\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Unary updatable operators\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator= (const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator+= (const T & s)\r
+    {\r
+        this->value[0] += s;\r
+        this->value[1] += s;\r
+        this->value[2] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator+= (const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] += m[0];\r
+        this->value[1] += m[1];\r
+        this->value[2] += m[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator-= (const T & s)\r
+    {\r
+        this->value[0] -= s;\r
+        this->value[1] -= s;\r
+        this->value[2] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator-= (const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] -= m[0];\r
+        this->value[1] -= m[1];\r
+        this->value[2] -= m[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator*= (const T & s)\r
+    {\r
+        this->value[0] *= s;\r
+        this->value[1] *= s;\r
+        this->value[2] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator*= (const tmat2x3<T>& m)\r
+    {\r
+        return (*this = tmat3x2<T>(*this * m));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> & tmat3x2<T>::operator/= (const T & s)\r
+    {\r
+        this->value[0] /= s;\r
+        this->value[1] /= s;\r
+        this->value[2] /= s;\r
+        return *this;\r
+    }\r
+\r
+    //template <typename T> \r
+    //inline tmat3x2<T>& tmat3x2<T>::operator/= (const tmat3x2<T>& m)\r
+    //{\r
+    //    return (*this = tmat3x2<T>(*this / m));\r
+    //}\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator++ ()\r
+    {\r
+        ++this->value[0];\r
+        ++this->value[1];\r
+        ++this->value[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T>& tmat3x2<T>::operator-- ()\r
+    {\r
+        --this->value[0];\r
+        --this->value[1];\r
+        --this->value[2];\r
+        return *this;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // inverse\r
+    template <typename valType> \r
+    inline tmat2x3<valType> tmat3x2<valType>::_inverse() const\r
+    {\r
+               assert(0); //g.truc.creation[at]gmail.com\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Binary operators\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator+ (const tmat3x2<T>& m, const T & s)\r
+    {\r
+        return tmat3x2<T>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator+ (const tmat3x2<T>& m1, const tmat3x2<T>& m2)\r
+    {\r
+        return tmat3x2<T>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1],\r
+            m1[2] + m2[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator- (const tmat3x2<T>& m, const T & s)\r
+    {\r
+        return tmat3x4<T>(\r
+            m[0] - s,\r
+            m[1] - s,\r
+            m[2] - s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator- (const tmat3x2<T>& m1, const tmat3x2<T>& m2)\r
+    {\r
+        return tmat3x2<T>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1],\r
+            m1[2] - m2[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator* (const tmat3x2<T>& m, const T & s)\r
+    {\r
+        return tmat3x2<T>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator* (const T & s, const tmat3x2<T> & m)\r
+    {\r
+        return tmat3x2<T>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s);\r
+    }\r
+   \r
+    template <typename T>\r
+    inline detail::tvec2<T> operator* (const tmat3x2<T>& m, const detail::tvec3<T>& v)\r
+    {\r
+        return detail::tvec2<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> operator* (const detail::tvec2<T>& v, const tmat3x2<T>& m) \r
+    {\r
+        return detail::tvec3<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat2x2<T> operator* (const tmat3x2<T>& m1, const tmat2x3<T>& m2)\r
+    {\r
+        const T SrcA00 = m1[0][0];\r
+        const T SrcA01 = m1[0][1];\r
+        const T SrcA10 = m1[1][0];\r
+        const T SrcA11 = m1[1][1];\r
+        const T SrcA20 = m1[2][0];\r
+        const T SrcA21 = m1[2][1];\r
+\r
+        const T SrcB00 = m2[0][0];\r
+        const T SrcB01 = m2[0][1];\r
+        const T SrcB02 = m2[0][2];\r
+        const T SrcB10 = m2[1][0];\r
+        const T SrcB11 = m2[1][1];\r
+        const T SrcB12 = m2[1][2];\r
+\r
+        tmat2x2<T> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator/ (const tmat3x2<T>& m, const T & s)\r
+    {\r
+        return tmat3x2<T>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s,\r
+            m[3] / s);        \r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x2<T> operator/ (const T & s, const tmat3x2<T>& m)\r
+    {\r
+        return tmat3x2<T>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2],\r
+            s / m[3]);        \r
+    }\r
+\r
+       //template <typename valType> \r
+       //inline tvec2<valType> operator/ \r
+       //(\r
+       //      tmat3x2<valType> const & m, \r
+       //      tvec2<valType> const & v\r
+       //)\r
+       //{\r
+       //      return m._inverse() * v;\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tvec3<valType> operator/ \r
+       //(\r
+       //      tvec2<valType> const & v, \r
+       //      tmat3x2<valType> const & m\r
+       //)\r
+       //{\r
+       //      return v * m._inverse();\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tmat3x3<valType> operator/ \r
+       //(\r
+       //      tmat3x2<valType> const & m1, \r
+       //      tmat2x3<valType> const & m2\r
+       //)\r
+       //{\r
+       //      return m1 * m2._inverse();\r
+       //}\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat3x2<valType> const operator- \r
+       (\r
+               tmat3x2<valType> const & m\r
+       )\r
+    {\r
+        return tmat3x2<valType>(\r
+            -m[0], \r
+            -m[1],\r
+            -m[2]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat3x2<valType> const operator++ \r
+       (\r
+               tmat3x2<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat3x2<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1),\r
+            m[2] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat3x2<valType> const operator-- \r
+       (\r
+               tmat3x2<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat3x2<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1),\r
+            m[2] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_mat3x3.hpp b/glm/core/type_mat3x3.hpp
new file mode 100644 (file)
index 0000000..032d960
--- /dev/null
@@ -0,0 +1,219 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-01-27\r
+// Updated : 2008-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat3x3.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat3x3\r
+#define glm_core_type_mat3x3\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat3x3();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 3 * 3 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat3x3\r
+               {\r
+               public:\r
+                       typedef tmat3x3<T>* pointer;\r
+                       typedef const tmat3x3<T>* const_pointer;\r
+                       typedef const tmat3x3<T>*const const_pointer_const;\r
+                       typedef tmat3x3<T>*const pointer_const;\r
+                       typedef tmat3x3<T>& reference;\r
+                       typedef const tmat3x3<T>& const_reference;\r
+                       typedef const tmat3x3<T>& param_type;\r
+                       typedef tmat3x3<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec3<T> col_type;\r
+                       typedef detail::tvec3<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat3x3<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data\r
+                       tvec3<T> value[3];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat3x3();\r
+                       explicit tmat3x3(const T x);\r
+                       explicit tmat3x3(\r
+                               const T x0, const T y0, const T z0,\r
+                               const T x1, const T y1, const T z1,\r
+                               const T x2, const T y2, const T z2);\r
+                       explicit tmat3x3(\r
+                               const detail::tvec3<T> & v0, \r
+                               const detail::tvec3<T> & v1,\r
+                               const detail::tvec3<T> & v2);\r
+\r
+                       // Conversions\r
+                       template <typename U> \r
+                       explicit tmat3x3(const tmat3x3<U>& m);\r
+\r
+                       explicit tmat3x3(const tmat2x2<T>& x);\r
+                       explicit tmat3x3(const tmat4x4<T>& x);\r
+                       explicit tmat3x3(const tmat2x3<T>& x);\r
+                       explicit tmat3x3(const tmat3x2<T>& x);\r
+                       explicit tmat3x3(const tmat2x4<T>& x);\r
+                       explicit tmat3x3(const tmat4x2<T>& x);\r
+                       explicit tmat3x3(const tmat3x4<T>& x);\r
+                       explicit tmat3x3(const tmat4x3<T>& x);\r
+\r
+                       // Accesses\r
+                       detail::tvec3<T>& operator[](size_type i);\r
+                       detail::tvec3<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat3x3<T>& operator=(const tmat3x3<T>& m);\r
+                       tmat3x3<T>& operator+= (const T & s);\r
+                       tmat3x3<T>& operator+= (const tmat3x3<T>& m);\r
+                       tmat3x3<T>& operator-= (const T & s);\r
+                       tmat3x3<T>& operator-= (const tmat3x3<T>& m);\r
+                       tmat3x3<T>& operator*= (const T & s);\r
+                       tmat3x3<T>& operator*= (const tmat3x3<T>& m);\r
+                       tmat3x3<T>& operator/= (const T & s);\r
+                       tmat3x3<T>& operator/= (const tmat3x3<T>& m);\r
+                       tmat3x3<T>& operator++ ();\r
+                       tmat3x3<T>& operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat3x3<T> operator+ (const tmat3x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator+ (const T & s, const tmat3x3<T>& m);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator+ (const tmat3x3<T>& m1, const tmat3x3<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat3x3<T> operator- (const tmat3x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator- (const T & s, const tmat3x3<T>& m);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator- (const tmat3x3<T>& m1, const tmat3x3<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator* (const tmat3x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator* (const T & s, const tmat3x3<T>& m);\r
+\r
+               template <typename T> \r
+               detail::tvec3<T> operator* (const tmat3x3<T>& m, const detail::tvec3<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec3<T> operator* (const detail::tvec3<T>& v, const tmat3x3<T>& m);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator* (const tmat3x3<T>& m1, const tmat3x3<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator/ (const tmat3x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator/ (const T & s, const tmat3x3<T>& m);\r
+\r
+               template <typename T> \r
+               detail::tvec3<T> operator/ (const tmat3x3<T>& m, const detail::tvec3<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec3<T> operator/ (const detail::tvec3<T>& v, const tmat3x3<T>& m);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator/ (const tmat3x3<T>& m1, const tmat3x3<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat3x3<valType> const operator-  (tmat3x3<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat3x3<valType> const operator-- (tmat3x3<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat3x3<valType> const operator++ (tmat3x3<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 3 columns of 3 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x3<lowp_float>             lowp_mat3x3;\r
+               //! 3 columns of 3 components matrix of medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x3<mediump_float>  mediump_mat3x3;\r
+               //! 3 columns of 3 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x3<highp_float>    highp_mat3x3;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION\r
+       //! 3 columns of 3 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat3x3<mediump_float>  mat3x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat3x3<highp_float>    mat3x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat3x3<mediump_float>  mat3x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat3x3<lowp_float>             mat3x3;\r
+#else\r
+       typedef detail::tmat3x3<mediump_float>  mat3x3;\r
+#endif//GLM_PRECISION\r
+\r
+       //! 3 columns of 3 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef mat3x3                                                  mat3;\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat3x3.inl"\r
+\r
+#endif //glm_core_type_mat3x3\r
diff --git a/glm/core/type_mat3x3.inl b/glm/core/type_mat3x3.inl
new file mode 100644 (file)
index 0000000..f12d10f
--- /dev/null
@@ -0,0 +1,604 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-01-27\r
+// Updated : 2008-08-25\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat3x3.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat3x3<valType>::size_type tmat3x3<valType>::value_size()\r
+       {\r
+               return typename tmat3x3<valType>::size_type(3);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat3x3<valType>::size_type tmat3x3<valType>::col_size()\r
+       {\r
+               return typename tmat3x3<valType>::size_type(3);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat3x3<valType>::size_type tmat3x3<valType>::row_size()\r
+       {\r
+               return typename tmat3x3<valType>::size_type(3);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat3x3<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec3<valType>& tmat3x3<valType>::operator[](typename tmat3x3<valType>::size_type i)\r
+       {\r
+               assert(\r
+                       i >= typename tmat3x3<valType>::size_type(0) && \r
+                       i < tmat3x3<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec3<valType>& tmat3x3<valType>::operator[](typename tmat3x3<valType>::size_type i) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat3x3<valType>::size_type(0) &&\r
+                       i < tmat3x3<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // mat3 constructors\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3()\r
+    {\r
+        this->value[0] = detail::tvec3<T>(1, 0, 0);\r
+        this->value[1] = detail::tvec3<T>(0, 1, 0);\r
+        this->value[2] = detail::tvec3<T>(0, 0, 1);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const T f)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(f, 0, 0);\r
+        this->value[1] = detail::tvec3<T>(0, f, 0);\r
+        this->value[2] = detail::tvec3<T>(0, 0, f);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3\r
+    (\r
+        const T x0, const T y0, const T z0, \r
+        const T x1, const T y1, const T z1,\r
+        const T x2, const T y2, const T z2\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec3<T>(x0, y0, z0);\r
+        this->value[1] = detail::tvec3<T>(x1, y1, z1);\r
+        this->value[2] = detail::tvec3<T>(x2, y2, z2);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3\r
+    (\r
+        const detail::tvec3<T>& v0, \r
+        const detail::tvec3<T>& v1, \r
+        const detail::tvec3<T>& v2\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+        this->value[2] = v2;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // mat3 conversions\r
+\r
+    template <typename T> \r
+    template <typename U> \r
+    inline tmat3x3<T>::tmat3x3(const tmat3x3<U>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+        this->value[2] = detail::tvec3<T>(m[2]);\r
+       }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(tmat2x2<T> const & m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec3<T>(m[1], T(0));\r
+        this->value[2] = detail::tvec3<T>(detail::tvec2<T>(0), T(1));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tmat4x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+        this->value[2] = detail::tvec3<T>(m[2]);\r
+    }\r
+\r
+       template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = detail::tvec3<T>(detail::tvec2<T>(0), T(1));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec3<T>(m[1], T(0));\r
+        this->value[2] = detail::tvec3<T>(m[2], T(1));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+        this->value[2] = detail::tvec3<T>(detail::tvec2<T>(0), T(1));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tmat4x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec3<T>(m[1], T(0));\r
+        this->value[2] = detail::tvec3<T>(m[2], T(1));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(m[0]);\r
+        this->value[1] = detail::tvec3<T>(m[1]);\r
+        this->value[2] = detail::tvec3<T>(m[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tmat4x3<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+    }\r
+\r
+/*\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const T* a)\r
+    {\r
+        this->value[0] = detail::tvec3<T>(a[0], a[1], a[2]);\r
+        this->value[1] = detail::tvec3<T>(a[3], a[4], a[5]);\r
+        this->value[2] = detail::tvec3<T>(a[6], a[7], a[8]);\r
+    }\r
+*/\r
+    /*\r
+    // GL_GTX_euler_angles\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const detail::tvec3<T> & angles)\r
+    {\r
+        T ch = cos(angles.x);\r
+        T sh = sin(angles.x);\r
+        T cp = cos(angles.y);\r
+        T sp = sin(angles.y);\r
+        T cb = cos(angles.z);\r
+        T sb = sin(angles.z);\r
+\r
+        value[0][0] = ch * cb + sh * sp * sb;\r
+        value[0][1] = sb * cp;\r
+        value[0][2] = -sh * cb + ch * sp * sb;\r
+        value[1][0] = -ch * sb + sh * sp * cb;\r
+        value[1][1] = cb * cp;\r
+        value[1][2] = sb * sh + ch * sp * cb;\r
+        value[2][0] = sh * cp;\r
+        value[2][1] = -sp;\r
+        value[2][2] = ch * cp;\r
+    }\r
+    */\r
+    //////////////////////////////////////////////////////////////\r
+    // mat3 conversions\r
+    /*\r
+    template <typename T> \r
+    inline tmat3x3<T>::tmat3x3(const tquat<T> & q)\r
+    {\r
+        this->value[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z;\r
+        this->value[0][1] = 2 * q.x * q.y + 2 * q.w * q.z;\r
+        this->value[0][2] = 2 * q.x * q.z - 2 * q.w * q.y;\r
+\r
+        this->value[1][0] = 2 * q.x * q.y - 2 * q.w * q.z;\r
+        this->value[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z;\r
+        this->value[1][2] = 2 * q.y * q.z + 2 * q.w * q.x;\r
+\r
+        this->value[2][0] = 2 * q.x * q.z + 2 * q.w * q.y;\r
+        this->value[2][1] = 2 * q.y * q.z - 2 * q.w * q.x;\r
+        this->value[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y;\r
+    }\r
+    */\r
+    //////////////////////////////////////////////////////////////\r
+    // mat3 operators\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator=(const tmat3x3<T>& m)\r
+    {\r
+           this->value[0] = m[0];\r
+           this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator+= (const T & s)\r
+    {\r
+           this->value[0] += s;\r
+           this->value[1] += s;\r
+        this->value[2] += s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator+= (const tmat3x3<T>& m)\r
+    {\r
+           this->value[0] += m[0];\r
+           this->value[1] += m[1];\r
+        this->value[2] += m[2];\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator-= (const T & s)\r
+    {\r
+           this->value[0] -= s;\r
+           this->value[1] -= s;\r
+        this->value[2] -= s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator-= (const tmat3x3<T>& m)\r
+    {\r
+           this->value[0] -= m[0];\r
+           this->value[1] -= m[1];\r
+        this->value[2] -= m[2];\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator*= (const T & s)\r
+    {\r
+           this->value[0] *= s;\r
+           this->value[1] *= s;\r
+        this->value[2] *= s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator*= (const tmat3x3<T>& m)\r
+    {\r
+        return (*this = *this * m);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator/= (const T & s)\r
+    {\r
+           this->value[0] /= s;\r
+           this->value[1] /= s;\r
+        this->value[2] /= s;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator/= (const tmat3x3<T>& m)\r
+    {\r
+        return (*this = *this / m);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator++ ()\r
+    {\r
+           this->value[0]++;\r
+           this->value[1]++;\r
+        this->value[2]++;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T>& tmat3x3<T>::operator-- ()\r
+    {\r
+           this->value[0]--;\r
+           this->value[1]--;\r
+        this->value[2]--;\r
+           return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> tmat3x3<T>::_inverse() const\r
+    {\r
+        T S00 = value[0][0];\r
+        T S01 = value[0][1];\r
+        T S02 = value[0][2];\r
+\r
+        T S10 = value[1][0];\r
+        T S11 = value[1][1];\r
+        T S12 = value[1][2];\r
+\r
+        T S20 = value[2][0];\r
+        T S21 = value[2][1];\r
+        T S22 = value[2][2];\r
+\r
+        tmat3x3<T> Inverse(\r
+            + (S11 * S22 - S21 * S12),\r
+            - (S10 * S22 - S20 * S12),\r
+            + (S10 * S21 - S20 * S11),\r
+            - (S01 * S22 - S21 * S02),\r
+            + (S00 * S22 - S20 * S02),\r
+            - (S00 * S21 - S20 * S01),\r
+            + (S01 * S12 - S11 * S02),\r
+            - (S00 * S12 - S10 * S02),\r
+            + (S00 * S11 - S10 * S01));\r
+\r
+        T Determinant = S00 * (S11 * S22 - S21 * S12)\r
+                      - S10 * (S01 * S22 - S21 * S02)\r
+                      + S20 * (S01 * S12 - S11 * S02);\r
+\r
+        Inverse /= Determinant;\r
+        return Inverse;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+       // Binary operators\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator+ (const tmat3x3<T>& m, const T & s)\r
+    {\r
+        return tmat3x3<T>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator+ (const T & s, const tmat3x3<T>& m)\r
+    {\r
+        return tmat3x3<T>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s);\r
+    }\r
+\r
+    //template <typename T> \r
+    //inline tvec3<T> operator+ (const tmat3x3<T>& m, const tvec3<T>& v)\r
+    //{\r
+\r
+    //}\r
+\r
+    //template <typename T> \r
+    //inline tvec3<T> operator+ (const tvec3<T>& v, const tmat3x3<T>& m)\r
+    //{\r
+\r
+    //}\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator+ (const tmat3x3<T>& m1, const tmat3x3<T>& m2)\r
+    {\r
+        return tmat3x3<T>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1],\r
+            m1[2] + m2[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator- (const tmat3x3<T>& m, const T & s)\r
+    {\r
+        return tmat3x3<T>(\r
+            m[0] - s,\r
+            m[1] - s,\r
+            m[2] - s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator- (const T & s, const tmat3x3<T>& m)\r
+    {\r
+        return tmat3x3<T>(\r
+            s - m[0],\r
+            s - m[1],\r
+            s - m[2]);\r
+    }\r
+\r
+    //template <typename T> \r
+    //inline detail::tvec3<T> operator- (const tmat3x3<T>& m, const detail::tvec3<T>& v)\r
+    //{\r
+\r
+    //}\r
+\r
+    //template <typename T> \r
+    //inline detail::tvec3<T> operator- (const detail::tvec3<T>& v, const tmat3x3<T>& m)\r
+    //{\r
+\r
+    //}\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator- (const tmat3x3<T>& m1, const tmat3x3<T>& m2)\r
+    {\r
+        return tmat3x3<T>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1],\r
+            m1[2] - m2[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator* (const tmat3x3<T>& m, const T & s)\r
+    {\r
+        return tmat3x3<T>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator* (const T & s, const tmat3x3<T>& m)\r
+    {\r
+        return tmat3x3<T>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> operator* (const tmat3x3<T>& m, const detail::tvec3<T>& v)\r
+    {\r
+        return detail::tvec3<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,\r
+            m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> operator* (const detail::tvec3<T>& v, const tmat3x3<T>& m)\r
+    {\r
+        return detail::tvec3<T>(\r
+            m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z,\r
+            m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z,\r
+            m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator* (const tmat3x3<T>& m1, const tmat3x3<T>& m2)\r
+    {\r
+        const T SrcA00 = m1[0][0];\r
+        const T SrcA01 = m1[0][1];\r
+        const T SrcA02 = m1[0][2];\r
+        const T SrcA10 = m1[1][0];\r
+        const T SrcA11 = m1[1][1];\r
+        const T SrcA12 = m1[1][2];\r
+        const T SrcA20 = m1[2][0];\r
+        const T SrcA21 = m1[2][1];\r
+        const T SrcA22 = m1[2][2];\r
+\r
+        const T SrcB00 = m2[0][0];\r
+        const T SrcB01 = m2[0][1];\r
+        const T SrcB02 = m2[0][2];\r
+        const T SrcB10 = m2[1][0];\r
+        const T SrcB11 = m2[1][1];\r
+        const T SrcB12 = m2[1][2];\r
+        const T SrcB20 = m2[2][0];\r
+        const T SrcB21 = m2[2][1];\r
+        const T SrcB22 = m2[2][2];\r
+\r
+        tmat3x3<T> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;\r
+        Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;\r
+        Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12;\r
+        Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22;\r
+        Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22;\r
+        Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22;\r
+        return Result;\r
+    }\r
+\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator/ (const tmat3x3<T>& m, const T & s)\r
+    {\r
+        return tmat3x3<T>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x3<T> operator/ (const T & s, const tmat3x3<T>& m)\r
+    {\r
+        return tmat3x3<T>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2]);\r
+    }\r
+\r
+       template <typename T> \r
+       inline detail::tvec3<T> operator/ \r
+       (\r
+               tmat3x3<T> const & m, \r
+               tvec3<T> const & v\r
+       )\r
+       {\r
+               return m._inverse() * v;\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tvec3<T> operator/ \r
+       (\r
+               tvec3<T> const & v, \r
+               tmat3x3<T> const & m\r
+       )\r
+       {\r
+               return v * m._inverse();\r
+       }\r
+\r
+       template <typename T> \r
+       inline tmat3x3<T> operator/ \r
+       (\r
+               tmat3x3<T> const & m1, \r
+               tmat3x3<T> const & m2\r
+       )\r
+       {\r
+               return m1 * m2._inverse();\r
+       }\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat3x3<valType> const operator- \r
+       (\r
+               tmat3x3<valType> const & m\r
+       )\r
+    {\r
+        return tmat3x3<valType>(\r
+            -m[0], \r
+            -m[1],\r
+            -m[2]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat3x3<valType> const operator++ \r
+       (\r
+               tmat3x3<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat3x3<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1),\r
+            m[2] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat3x3<valType> const operator-- \r
+       (\r
+               tmat3x3<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat3x3<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1),\r
+            m[2] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_mat3x4.hpp b/glm/core/type_mat3x4.hpp
new file mode 100644 (file)
index 0000000..256073a
--- /dev/null
@@ -0,0 +1,209 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-05\r
+// Updated : 2008-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat3x4.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat3x4\r
+#define glm_core_type_mat3x4\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat3x4();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 3 * 4 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat3x4\r
+               {\r
+               public:\r
+                       typedef tmat3x4<T>* pointer;\r
+                       typedef const tmat3x4<T>* const_pointer;\r
+                       typedef const tmat3x4<T>*const const_pointer_const;\r
+                       typedef tmat3x4<T>*const pointer_const;\r
+                       typedef tmat3x4<T>& reference;\r
+                       typedef const tmat3x4<T>& const_reference;\r
+                       typedef const tmat3x4<T>& param_type;\r
+                       typedef tmat4x3<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec3<T> col_type;\r
+                       typedef detail::tvec4<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat4x3<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data \r
+                       detail::tvec4<T> value[3];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat3x4();\r
+                       explicit tmat3x4(const T x);\r
+                       explicit tmat3x4(\r
+                               const T x0, const T y0, const T z0, const T w0,\r
+                               const T x1, const T y1, const T z1, const T w1,\r
+                               const T x2, const T y2, const T z2, const T w2);\r
+                       explicit tmat3x4(\r
+                               const detail::tvec4<T>& v0, \r
+                               const detail::tvec4<T>& v1,\r
+                               const detail::tvec4<T>& v2);\r
+\r
+                       // Conversion\r
+                       template <typename U> \r
+                       explicit tmat3x4(const tmat3x4<U>& m);\r
+\r
+                       explicit tmat3x4(const tmat2x2<T>& x);\r
+                       explicit tmat3x4(const tmat3x3<T>& x);\r
+                       explicit tmat3x4(const tmat4x4<T>& x);\r
+                       explicit tmat3x4(const tmat2x3<T>& x);\r
+                       explicit tmat3x4(const tmat3x2<T>& x);\r
+                       explicit tmat3x4(const tmat2x4<T>& x);\r
+                       explicit tmat3x4(const tmat4x2<T>& x);\r
+                       explicit tmat3x4(const tmat4x3<T>& x);\r
+\r
+                       // Accesses\r
+                       detail::tvec4<T>& operator[](size_type i);\r
+                       detail::tvec4<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat3x4<T>& operator=  (const tmat3x4<T>& m);\r
+                       tmat3x4<T>& operator+= (const T & s);\r
+                       tmat3x4<T>& operator+= (const tmat3x4<T>& m);\r
+                       tmat3x4<T>& operator-= (const T & s);\r
+                       tmat3x4<T>& operator-= (const tmat3x4<T>& m);\r
+                       tmat3x4<T>& operator*= (const T & s);\r
+                       tmat3x4<T>& operator*= (const tmat4x3<T>& m);\r
+                       tmat3x4<T>& operator/= (const T & s);\r
+                       //tmat3x4<T>& operator/= (const tmat4x3<T>& m);\r
+\r
+                       tmat3x4<T>& operator++ ();\r
+                       tmat3x4<T>& operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat3x4<T> operator+ (const tmat3x4<T>& m, const T & s);\r
+           \r
+               template <typename T> \r
+               tmat3x4<T> operator+ (const tmat3x4<T>& m1, const tmat3x4<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat3x4<T> operator- (const tmat3x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x4<T> operator- (const tmat3x4<T>& m1, const tmat3x4<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat3x4<T> operator* (const tmat3x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat3x4<T> operator* (const T & s, const tmat3x4<T>& m);\r
+\r
+               template <typename T>\r
+               detail::tvec4<T> operator* (const tmat3x4<T>& m, const detail::tvec3<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec3<T> operator* (const detail::tvec4<T>& v, const tmat3x4<T>& m);\r
+\r
+               template <typename T>\r
+               tmat4x4<T> operator* (const tmat3x4<T>& m1, const tmat4x3<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x3<T> operator/ (const tmat4x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x3<T> operator/ (const T & s, const tmat4x3<T>& m);\r
+\r
+               //template <typename T> \r
+               //detail::tvec4<T> operator/ (const tmat3x4<T>& m, const detail::tvec3<T>& v);\r
+\r
+               //template <typename T> \r
+               //detail::tvec3<T> operator/ (const detail::tvec4<T>& v, const tmat3x4<T>& m);\r
+\r
+               //template <typename T> \r
+               //tmat4x4<T> operator/ (const tmat4x3<T>& m1, const tmat3x4<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat3x4<valType> const operator-  (tmat3x4<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat3x4<valType> const operator-- (tmat3x4<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat3x4<valType> const operator++ (tmat3x4<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 3 columns of 4 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x4<lowp_float>             lowp_mat3x4;\r
+               //! 3 columns of 4 components matrix of medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x4<mediump_float>  mediump_mat3x4;\r
+               //! 3 columns of 4 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat3x4<highp_float>    highp_mat3x4;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 3 columns of 4 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat3x4<mediump_float>  mat3x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat3x4<highp_float>    mat3x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat3x4<mediump_float>  mat3x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat3x4<lowp_float>             mat3x4;\r
+#else\r
+       typedef detail::tmat3x4<mediump_float>  mat3x4;\r
+#endif//GLM_PRECISION\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat3x4.inl"\r
+\r
+#endif //glm_core_type_mat3x4\r
diff --git a/glm/core/type_mat3x4.inl b/glm/core/type_mat3x4.inl
new file mode 100644 (file)
index 0000000..24ca60d
--- /dev/null
@@ -0,0 +1,484 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-05\r
+// Updated : 2006-10-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat3x4.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat3x4<valType>::size_type tmat3x4<valType>::col_size()\r
+       {\r
+               return typename tmat3x4<valType>::size_type(3);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat3x4<valType>::size_type tmat3x4<valType>::row_size()\r
+       {\r
+               return typename tmat3x4<valType>::size_type(4);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat3x4<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec4<valType>& tmat3x4<valType>::operator[](typename tmat3x4<valType>::size_type i)\r
+       {\r
+               assert(\r
+                       i >= typename tmat3x4<valType>::size_type(0) && \r
+                       i < tmat3x4<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec4<valType>& tmat3x4<valType>::operator[](typename tmat3x4<valType>::size_type i) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat3x4<valType>::size_type(0) && \r
+                       i < tmat3x4<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Constructors\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4()\r
+    {\r
+        this->value[0] = detail::tvec4<T>(1, 0, 0, 0);\r
+        this->value[1] = detail::tvec4<T>(0, 1, 0, 0);\r
+        this->value[2] = detail::tvec4<T>(0, 0, 1, 0);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const T f)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(f, 0, 0, 0);\r
+        this->value[1] = detail::tvec4<T>(0, f, 0, 0);\r
+        this->value[2] = detail::tvec4<T>(0, 0, f, 0);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4\r
+    (\r
+        const T x0, const T y0, const T z0, const T w0,\r
+        const T x1, const T y1, const T z1, const T w1,\r
+        const T x2, const T y2, const T z2, const T w2\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec4<T>(x0, y0, z0, w0);\r
+        this->value[1] = detail::tvec4<T>(x1, y1, z1, w1);\r
+        this->value[2] = detail::tvec4<T>(x2, y2, z2, w2);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4\r
+    (\r
+        const detail::tvec4<T> & v0, \r
+        const detail::tvec4<T> & v1, \r
+        const detail::tvec4<T> & v2\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+        this->value[2] = v2;\r
+    }\r
+\r
+    // Conversion\r
+    template <typename T> \r
+    template <typename U> \r
+    inline tmat3x4<T>::tmat3x4(const tmat3x4<U>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0]);\r
+        this->value[1] = detail::tvec4<T>(m[1]);\r
+        this->value[2] = detail::tvec4<T>(m[2]);\r
+       }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(tmat2x2<T> const & m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], detail::tvec2<T>(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], detail::tvec2<T>(0));\r
+        this->value[2] = detail::tvec4<T>(T(0), T(0), T(1), T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const tmat3x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], T(0));\r
+        this->value[2] = detail::tvec4<T>(m[2], T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const tmat4x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0]);\r
+        this->value[1] = detail::tvec4<T>(m[1]);\r
+        this->value[2] = detail::tvec4<T>(m[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const tmat2x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], T(0));\r
+        this->value[2] = detail::tvec4<T>(T(0), T(0), T(1), T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const tmat3x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], detail::tvec2<T>(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], detail::tvec2<T>(0));\r
+        this->value[2] = detail::tvec4<T>(m[2], T(0), T(1));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const tmat2x4<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0]);\r
+        this->value[1] = detail::tvec4<T>(m[1]);\r
+        this->value[2] = detail::tvec4<T>(T(0), T(0), T(1), T(0));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const tmat4x2<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], detail::tvec2<T>(T(0)));\r
+        this->value[1] = detail::tvec4<T>(m[1], detail::tvec2<T>(T(0)));\r
+        this->value[2] = detail::tvec4<T>(m[2], detail::tvec2<T>(T(1), T(0)));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>::tmat3x4(const tmat4x3<T>& m)\r
+    {\r
+        this->value[0] = detail::tvec4<T>(m[0], T(0));\r
+        this->value[1] = detail::tvec4<T>(m[1], T(0));\r
+        this->value[2] = detail::tvec4<T>(m[2], T(0));\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Unary updatable operators\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator= (const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator+= (const T & s)\r
+    {\r
+        this->value[0] += s;\r
+        this->value[1] += s;\r
+        this->value[2] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator+= (const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] += m[0];\r
+        this->value[1] += m[1];\r
+        this->value[2] += m[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator-= (const T & s)\r
+    {\r
+        this->value[0] -= s;\r
+        this->value[1] -= s;\r
+        this->value[2] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator-= (const tmat3x4<T>& m)\r
+    {\r
+        this->value[0] -= m[0];\r
+        this->value[1] -= m[1];\r
+        this->value[2] -= m[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator*= (const T & s)\r
+    {\r
+        this->value[0] *= s;\r
+        this->value[1] *= s;\r
+        this->value[2] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator*= (const tmat4x3<T>& m)\r
+    {\r
+        return (*this = tmat3x4<T>(*this * m));\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> & tmat3x4<T>::operator/= (const T & s)\r
+    {\r
+        this->value[0] /= s;\r
+        this->value[1] /= s;\r
+        this->value[2] /= s;\r
+        return *this;\r
+    }\r
+/* ToDo\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator/= (const tmat4x3<T>& m)\r
+    {\r
+        return (*this = tmat3x4<T>(*this / m));\r
+    }\r
+*/\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator++ ()\r
+    {\r
+        ++this->value[0];\r
+        ++this->value[1];\r
+        ++this->value[2];\r
+        return *this;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T>& tmat3x4<T>::operator-- ()\r
+    {\r
+        --this->value[0];\r
+        --this->value[1];\r
+        --this->value[2];\r
+        return *this;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Binary operators\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator+ (const tmat3x4<T>& m, const T & s)\r
+    {\r
+        return tmat3x4<T>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator+ (const tmat3x4<T>& m1, const tmat3x4<T>& m2)\r
+    {\r
+        return tmat3x4<T>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1],\r
+            m1[2] + m2[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator- (const tmat3x4<T>& m, const T & s)\r
+    {\r
+        return tmat3x4<T>(\r
+            m[0] - s,\r
+            m[1] - s,\r
+            m[2] - s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator- (const tmat3x4<T>& m1, const tmat3x4<T>& m2)\r
+    {\r
+        return tmat3x4<T>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1],\r
+            m1[2] - m2[2]);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator* (const tmat3x4<T>& m, const T & s)\r
+    {\r
+        return tmat3x4<T>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator* (const T & s, const tmat3x4<T> & m)\r
+    {\r
+        return tmat3x4<T>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s);\r
+    }\r
+   \r
+    template <typename T>\r
+    inline detail::tvec4<T> operator* (const tmat3x4<T>& m, const detail::tvec3<T>& v)\r
+    {\r
+        return detail::tvec4<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,\r
+            m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z,\r
+            m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> operator* (const detail::tvec4<T>& v, const tmat3x4<T>& m) \r
+    {\r
+        return detail::tvec3<T>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,\r
+            m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w);\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat4x4<T> operator* (const tmat3x4<T>& m1, const tmat4x3<T>& m2)\r
+    {\r
+        const T SrcA00 = m1[0][0];\r
+        const T SrcA01 = m1[0][1];\r
+        const T SrcA02 = m1[0][2];\r
+        const T SrcA03 = m1[0][3];\r
+        const T SrcA10 = m1[1][0];\r
+        const T SrcA11 = m1[1][1];\r
+        const T SrcA12 = m1[1][2];\r
+        const T SrcA13 = m1[1][3];\r
+        const T SrcA20 = m1[2][0];\r
+        const T SrcA21 = m1[2][1];\r
+        const T SrcA22 = m1[2][2];\r
+        const T SrcA23 = m1[2][3];\r
+\r
+        const T SrcB00 = m2[0][0];\r
+        const T SrcB01 = m2[0][1];\r
+        const T SrcB02 = m2[0][2];\r
+        const T SrcB10 = m2[1][0];\r
+        const T SrcB11 = m2[1][1];\r
+        const T SrcB12 = m2[1][2];\r
+        const T SrcB20 = m2[2][0];\r
+        const T SrcB21 = m2[2][1];\r
+        const T SrcB22 = m2[2][2];\r
+        const T SrcB30 = m2[3][0];\r
+        const T SrcB31 = m2[3][1];\r
+        const T SrcB32 = m2[3][2];\r
+\r
+        tmat4x4<T> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;\r
+        Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;\r
+        Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12;\r
+        Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12;\r
+        Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12;\r
+        Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22;\r
+        Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22;\r
+        Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22;\r
+        Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22;\r
+        Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32;\r
+        Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32;\r
+        Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32;\r
+        Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator/ (const tmat3x4<T>& m, const T & s)\r
+    {\r
+        return tmat3x4<T>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s,\r
+            m[3] / s);        \r
+    }\r
+\r
+    template <typename T> \r
+    inline tmat3x4<T> operator/ (const T & s, const tmat3x4<T>& m)\r
+    {\r
+        return tmat3x4<T>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2],\r
+            s / m[3]);        \r
+    }\r
+\r
+       //template <typename valType> \r
+       //inline tvec4<valType> operator/ \r
+       //(\r
+       //      tmat3x4<valType> const & m, \r
+       //      tvec4<valType> const & v\r
+       //)\r
+       //{\r
+       //      return m._inverse() * v;\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tvec3<valType> operator/ \r
+       //(\r
+       //      tvec4<valType> const & v, \r
+       //      tmat3x4<valType> const & m\r
+       //)\r
+       //{\r
+       //      return v * m._inverse();\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tmat4x4<valType> operator/ \r
+       //(\r
+       //      tmat3x4<valType> const & m1, \r
+       //      tmat4x3<valType> const & m2\r
+       //)\r
+       //{\r
+       //      return m1 * m2._inverse();\r
+       //}\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat3x4<valType> const operator- \r
+       (\r
+               tmat3x4<valType> const & m\r
+       )\r
+    {\r
+        return tmat3x4<valType>(\r
+            -m[0], \r
+            -m[1],\r
+            -m[2]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat3x4<valType> const operator++ \r
+       (\r
+               tmat3x4<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat3x4<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1),\r
+            m[2] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat3x4<valType> const operator-- \r
+       (\r
+               tmat3x4<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat3x4<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1),\r
+            m[2] - valType(1));\r
+       }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_mat4x2.hpp b/glm/core/type_mat4x2.hpp
new file mode 100644 (file)
index 0000000..03102ab
--- /dev/null
@@ -0,0 +1,211 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-10-01\r
+// Updated : 2008-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat4x2.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat4x2\r
+#define glm_core_type_mat4x2\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat4x2();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 4 * 2 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat4x2\r
+               {\r
+               public:\r
+                       typedef tmat4x2<T>* pointer;\r
+                       typedef const tmat4x2<T>* const_pointer;\r
+                       typedef const tmat4x2<T>*const const_pointer_const;\r
+                       typedef tmat4x2<T>*const pointer_const;\r
+                       typedef tmat4x2<T>& reference;\r
+                       typedef const tmat4x2<T>& const_reference;\r
+                       typedef const tmat4x2<T>& param_type;\r
+                       typedef tmat2x4<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec4<T> col_type;\r
+                       typedef detail::tvec2<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat2x4<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data \r
+                       detail::tvec2<T> value[4];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat4x2();\r
+                       explicit tmat4x2(T const & x);\r
+                       explicit tmat4x2(\r
+                               T const & x0, T const & y0,\r
+                               T const & x1, T const & y1,\r
+                               T const & x2, T const & y2,\r
+                               T const & x3, T const & y3);\r
+                       explicit tmat4x2(\r
+                               detail::tvec2<T> const & v0, \r
+                               detail::tvec2<T> const & v1,\r
+                               detail::tvec2<T> const & v2,\r
+                               detail::tvec2<T> const & v3);\r
+\r
+                       // Conversions\r
+                       template <typename U> \r
+                       explicit tmat4x2(const tmat4x2<U>& m);\r
+                       \r
+                       explicit tmat4x2(const tmat2x2<T>& x);\r
+                       explicit tmat4x2(const tmat3x3<T>& x);\r
+                       explicit tmat4x2(const tmat4x4<T>& x);\r
+                       explicit tmat4x2(const tmat2x3<T>& x);\r
+                       explicit tmat4x2(const tmat3x2<T>& x);\r
+                       explicit tmat4x2(const tmat2x4<T>& x);\r
+                       explicit tmat4x2(const tmat4x3<T>& x);\r
+                       explicit tmat4x2(const tmat3x4<T>& x);\r
+\r
+                       // Accesses\r
+                       detail::tvec2<T>& operator[](size_type i);\r
+                       detail::tvec2<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat4x2<T>& operator= (const tmat4x2<T>& m);\r
+                       tmat4x2<T>& operator+= (const T & s);\r
+                       tmat4x2<T>& operator+= (const tmat4x2<T>& m);\r
+                       tmat4x2<T>& operator-= (const T & s);\r
+                       tmat4x2<T>& operator-= (const tmat4x2<T>& m);\r
+                       tmat4x2<T>& operator*= (const T & s);\r
+                       tmat4x2<T>& operator*= (const tmat2x4<T>& m);\r
+                       tmat4x2<T>& operator/= (const T & s);\r
+                       tmat4x2<T>& operator/= (const tmat2x4<T>& m);\r
+\r
+                       tmat4x2<T>& operator++ ();\r
+                       tmat4x2<T>& operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat4x2<T> operator+ (const tmat4x2<T>& m, const T & s);\r
+           \r
+               template <typename T> \r
+               tmat4x2<T> operator+ (const tmat4x2<T>& m1, const tmat4x2<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat4x2<T> operator- (const tmat4x2<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x2<T> operator- (const tmat4x2<T>& m1, const tmat4x2<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x2<T> operator* (const tmat4x2<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x2<T> operator* (const T & s, const tmat4x2<T>& m);\r
+\r
+               template <typename T>\r
+               detail::tvec2<T> operator* (const tmat4x2<T>& m, const detail::tvec4<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec4<T> operator* (const detail::tvec2<T>& v, const tmat4x2<T>& m);\r
+\r
+               template <typename T> \r
+               tmat2x2<T> operator* (const tmat4x2<T>& m1, const tmat2x4<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x2<T> operator/ (const tmat4x2<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x2<T> operator/ (const T & s, const tmat4x2<T>& m);\r
+\r
+               //template <typename T> \r
+               //detail::tvec2<T> operator/ (const tmat4x2<T>& m, const detail::tvec4<T>& v);\r
+\r
+               //template <typename T> \r
+               //detail::tvec4<T> operator/ (const detail::tvec2<T>& v, const tmat4x2<T>& m);\r
+\r
+               //template <typename T> \r
+               //tmat2x2<T> operator/ (const tmat4x2<T>& m1, const tmat2x4<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat4x2<valType> const operator-  (tmat4x2<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat4x2<valType> const operator-- (tmat4x2<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat4x2<valType> const operator++ (tmat4x2<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 4 columns of 2 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x2<lowp_float>             lowp_mat4x2;\r
+               //! 4 columns of 2 components matrix of medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x2<mediump_float>  mediump_mat4x2;\r
+               //! 4 columns of 2 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x2<highp_float>    highp_mat4x2;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION\r
+       //! 4 columns of 2 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat4x2<mediump_float>  mat4x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat4x2<highp_float>    mat4x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat4x2<mediump_float>  mat4x2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat4x2<lowp_float>             mat4x2;\r
+#else\r
+       typedef detail::tmat4x2<mediump_float>  mat4x2;\r
+#endif//GLM_PRECISION\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat4x2.inl"\r
+\r
+#endif //glm_core_type_mat4x2\r
diff --git a/glm/core/type_mat4x2.inl b/glm/core/type_mat4x2.inl
new file mode 100644 (file)
index 0000000..e1363e1
--- /dev/null
@@ -0,0 +1,513 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-10-01\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat4x2.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat4x2<valType>::size_type tmat4x2<valType>::col_size()\r
+       {\r
+               return typename tmat4x2<valType>::size_type(4);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat4x2<valType>::size_type tmat4x2<valType>::row_size()\r
+       {\r
+               return typename tmat4x2<valType>::size_type(2);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat4x2<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec2<valType>& tmat4x2<valType>::operator[]\r
+       (\r
+               typename tmat4x2<valType>::size_type i\r
+       )\r
+       {\r
+               assert(\r
+                       i >= typename tmat4x2<valType>::size_type(0) && \r
+                       i < tmat4x2<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec2<valType>& tmat4x2<valType>::operator[]\r
+       (\r
+               typename tmat4x2<valType>::size_type i\r
+       ) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat4x2<valType>::size_type(0) && \r
+                       i < tmat4x2<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Constructors\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2()\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(1, 0);\r
+        this->value[1] = detail::tvec2<valType>(0, 1);\r
+        this->value[2] = detail::tvec2<valType>(0, 0);\r
+        this->value[3] = detail::tvec2<valType>(0, 0);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2\r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(s, 0);\r
+        this->value[1] = detail::tvec2<valType>(0, s);\r
+        this->value[2] = detail::tvec2<valType>(0, 0);\r
+        this->value[3] = detail::tvec2<valType>(0, 0);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2\r
+    (\r
+        valType const & x0, valType const & y0,\r
+        valType const & x1, valType const & y1,\r
+        valType const & x2, valType const & y2,\r
+        valType const & x3, valType const & y3\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(x0, y0);\r
+        this->value[1] = detail::tvec2<valType>(x1, y1);\r
+        this->value[2] = detail::tvec2<valType>(x2, y2);\r
+        this->value[3] = detail::tvec2<valType>(x3, y3);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2\r
+    (\r
+        const detail::tvec2<valType> & v0, \r
+        const detail::tvec2<valType> & v1, \r
+        const detail::tvec2<valType> & v2,\r
+        const detail::tvec2<valType> & v3\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+        this->value[2] = v2;\r
+        this->value[3] = v3;\r
+    }\r
+\r
+    // Conversion\r
+    template <typename valType> \r
+    template <typename U> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat4x2<U>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(m[2]);\r
+        this->value[3] = detail::tvec2<valType>(m[3]);\r
+       }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(tmat2x2<valType> const & m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(valType(0));\r
+        this->value[3] = detail::tvec2<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat3x3<valType>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(m[2]);\r
+        this->value[3] = detail::tvec2<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat4x4<valType>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(m[2]);\r
+        this->value[3] = detail::tvec2<valType>(m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat2x3<valType>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(valType(0));\r
+        this->value[3] = detail::tvec2<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat3x2<valType>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(m[2]);\r
+        this->value[3] = detail::tvec2<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat2x4<valType>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(valType(0));\r
+        this->value[3] = detail::tvec2<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat4x3<valType>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(m[2]);\r
+        this->value[3] = detail::tvec2<valType>(m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>::tmat4x2(const tmat3x4<valType>& m)\r
+    {\r
+        this->value[0] = detail::tvec2<valType>(m[0]);\r
+        this->value[1] = detail::tvec2<valType>(m[1]);\r
+        this->value[2] = detail::tvec2<valType>(m[2]);\r
+        this->value[3] = detail::tvec2<valType>(valType(0));\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Unary updatable operators\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator= (const tmat4x2<valType>& m)\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+        this->value[3] = m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator+= (const valType & s)\r
+    {\r
+        this->value[0] += s;\r
+        this->value[1] += s;\r
+        this->value[2] += s;\r
+        this->value[3] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator+= (const tmat4x2<valType>& m)\r
+    {\r
+        this->value[0] += m[0];\r
+        this->value[1] += m[1];\r
+        this->value[2] += m[2];\r
+        this->value[3] += m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator-= (const valType & s)\r
+    {\r
+        this->value[0] -= s;\r
+        this->value[1] -= s;\r
+        this->value[2] -= s;\r
+        this->value[3] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator-= (const tmat4x2<valType>& m)\r
+    {\r
+        this->value[0] -= m[0];\r
+        this->value[1] -= m[1];\r
+        this->value[2] -= m[2];\r
+        this->value[3] -= m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator*= (const valType & s)\r
+    {\r
+        this->value[0] *= s;\r
+        this->value[1] *= s;\r
+        this->value[2] *= s;\r
+        this->value[3] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator*= (const tmat2x4<valType>& m)\r
+    {\r
+        return (*this = tmat4x2<valType>(*this * m));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> & tmat4x2<valType>::operator/= (const valType & s)\r
+    {\r
+        this->value[0] /= s;\r
+        this->value[1] /= s;\r
+        this->value[2] /= s;\r
+        this->value[3] /= s;\r
+        return *this;\r
+    }\r
+\r
+    //template <typename valType> \r
+    //inline tmat2x2<valType>& tmat4x2<valType>::operator/= (const tmat2x4<valType>& m)\r
+    //{\r
+    //    return (*this = *this / m);\r
+    //}\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator++ ()\r
+    {\r
+        ++this->value[0];\r
+        ++this->value[1];\r
+        ++this->value[2];\r
+        ++this->value[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType>& tmat4x2<valType>::operator-- ()\r
+    {\r
+        --this->value[0];\r
+        --this->value[1];\r
+        --this->value[2];\r
+        --this->value[3];\r
+        return *this;\r
+    }\r
+    \r
+    //////////////////////////////////////////////////////////////\r
+    // inverse\r
+       template <typename valType> \r
+    inline tmat2x4<valType> tmat4x2<valType>::_inverse() const\r
+    {\r
+               assert(0); //g.truc.creation[at]gmail.com\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Binary operators\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator+ (const tmat4x2<valType>& m, const valType & s)\r
+    {\r
+        return tmat4x2<valType>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s,\r
+            m[3] + s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator+ (const tmat4x2<valType>& m1, const tmat4x2<valType>& m2)\r
+    {\r
+        return tmat4x2<valType>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1],\r
+            m1[2] + m2[2],\r
+            m1[3] + m2[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator- (const tmat4x2<valType>& m, const valType & s)\r
+    {\r
+        return tmat4x2<valType>(\r
+            m[0] - s,\r
+            m[1] - s,\r
+            m[2] - s,\r
+            m[3] - s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator- (const tmat4x2<valType>& m1, const tmat4x2<valType>& m2)\r
+    {\r
+        return tmat4x2<valType>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1],\r
+            m1[2] - m2[2],\r
+            m1[3] - m2[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator* (const tmat4x2<valType>& m, const valType & s)\r
+    {\r
+        return tmat4x2<valType>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s,\r
+            m[3] * s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator* (const valType & s, const tmat4x2<valType> & m)\r
+    {\r
+        return tmat4x2<valType>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s,\r
+            m[3] * s);\r
+    }\r
+   \r
+    template <typename valType>\r
+    inline detail::tvec2<valType> operator* (const tmat4x2<valType>& m, const tvec4<valType>& v)\r
+    {\r
+        return detail::tvec2<valType>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tvec4<valType> operator* (const detail::tvec2<valType>& v, const tmat4x2<valType>& m) \r
+    {\r
+        return tvec4<valType>(\r
+            v.x * m[0][0] + v.y * m[0][1],\r
+            v.x * m[1][0] + v.y * m[1][1],\r
+            v.x * m[2][0] + v.y * m[2][1],\r
+            v.x * m[3][0] + v.y * m[3][1]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat2x2<valType> operator* (const tmat4x2<valType>& m1, const tmat2x4<valType>& m2)\r
+    {\r
+        const valType SrcA00 = m1[0][0];\r
+        const valType SrcA01 = m1[0][1];\r
+        const valType SrcA10 = m1[1][0];\r
+        const valType SrcA11 = m1[1][1];\r
+        const valType SrcA20 = m1[2][0];\r
+        const valType SrcA21 = m1[2][1];\r
+        const valType SrcA30 = m1[3][0];\r
+        const valType SrcA31 = m1[3][1];\r
+\r
+        const valType SrcB00 = m2[0][0];\r
+        const valType SrcB01 = m2[0][1];\r
+        const valType SrcB02 = m2[0][2];\r
+        const valType SrcB03 = m2[0][3];\r
+        const valType SrcB10 = m2[1][0];\r
+        const valType SrcB11 = m2[1][1];\r
+        const valType SrcB12 = m2[1][2];\r
+        const valType SrcB13 = m2[1][3];\r
+\r
+        tmat2x2<valType> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA01 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;\r
+        return Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator/ (const tmat4x2<valType>& m, const valType & s)\r
+    {\r
+        return tmat4x2<valType>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s,\r
+            m[3] / s);        \r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> operator/ (const valType & s, const tmat4x2<valType>& m)\r
+    {\r
+        return tmat4x2<valType>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2],\r
+            s / m[3]);        \r
+    }\r
+\r
+       //template <typename valType> \r
+       //tvec2<valType> operator/ \r
+       //(\r
+       //      tmat4x2<valType> const & m, \r
+       //      tvec4<valType> const & v\r
+       //)\r
+       //{\r
+       //      return m._inverse() * v;\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //tvec4<valType> operator/ \r
+       //(\r
+       //      tvec2<valType> const & v, \r
+       //      tmat4x2<valType> const & m\r
+       //)\r
+       //{\r
+       //      return v * m._inverse();\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tmat2x2<valType> operator/ \r
+       //(\r
+       //      tmat4x2<valType> const & m1, \r
+       //      tmat2x4<valType> const & m2\r
+       //)\r
+       //{\r
+       //      return m1 * m2._inverse();\r
+       //}\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat4x2<valType> const operator- \r
+       (\r
+               tmat4x2<valType> const & m\r
+       )\r
+    {\r
+        return tmat4x2<valType>(\r
+            -m[0], \r
+            -m[1], \r
+            -m[2], \r
+            -m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> const operator++ \r
+       (\r
+               tmat4x2<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat4x2<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1),\r
+            m[2] + valType(1),\r
+            m[3] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x2<valType> const operator-- \r
+       (\r
+               tmat4x2<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat4x2<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1),\r
+            m[2] - valType(1),\r
+            m[3] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_mat4x3.hpp b/glm/core/type_mat4x3.hpp
new file mode 100644 (file)
index 0000000..e513a14
--- /dev/null
@@ -0,0 +1,216 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-08-04\r
+// Updated : 2006-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_type_mat4x3.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat4x3\r
+#define glm_core_type_mat4x3\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat4x3();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 4 * 3 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat4x3\r
+               {\r
+               public:\r
+                       typedef tmat4x3<T>* pointer;\r
+                       typedef const tmat4x3<T>* const_pointer;\r
+                       typedef const tmat4x3<T>*const const_pointer_const;\r
+                       typedef tmat4x3<T>*const pointer_const;\r
+                       typedef tmat4x3<T>& reference;\r
+                       typedef const tmat4x3<T>& const_reference;\r
+                       typedef const tmat4x3<T>& param_type;\r
+                       typedef tmat3x4<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef detail::tvec4<T> col_type;\r
+                       typedef detail::tvec3<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat3x4<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data \r
+                       detail::tvec3<T> value[4];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat4x3();\r
+                       explicit tmat4x3(T const & x);\r
+                       explicit tmat4x3(\r
+                               const T x0, const T y0, const T z0,\r
+                               const T x1, const T y1, const T z1,\r
+                               const T x2, const T y2, const T z2,\r
+                               const T x3, const T y3, const T z3);\r
+                       explicit tmat4x3(\r
+                               const detail::tvec3<T>& v0, \r
+                               const detail::tvec3<T>& v1,\r
+                               const detail::tvec3<T>& v2,\r
+                               const detail::tvec3<T>& v3);\r
+\r
+                       // Conversion\r
+                       template <typename U> \r
+                       explicit tmat4x3(const tmat4x3<U>& m);\r
+                       \r
+                       explicit tmat4x3(const tmat2x2<T>& x);\r
+                       explicit tmat4x3(const tmat3x3<T>& x);\r
+                       explicit tmat4x3(const tmat4x4<T>& x);\r
+                       explicit tmat4x3(const tmat2x3<T>& x);\r
+                       explicit tmat4x3(const tmat3x2<T>& x);\r
+                       explicit tmat4x3(const tmat2x4<T>& x);\r
+                       explicit tmat4x3(const tmat4x2<T>& x);\r
+                       explicit tmat4x3(const tmat3x4<T>& x);\r
+\r
+                       // Accesses\r
+                       detail::tvec3<T>& operator[](size_type i);\r
+                       detail::tvec3<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat4x3<T>& operator=  (tmat4x3<T> const & m);\r
+                       tmat4x3<T>& operator+= (T const & s);\r
+                       tmat4x3<T>& operator+= (tmat4x3<T> const & m);\r
+                       tmat4x3<T>& operator-= (T const & s);\r
+                       tmat4x3<T>& operator-= (tmat4x3<T> const & m);\r
+                       tmat4x3<T>& operator*= (T const & s);\r
+                       tmat4x3<T>& operator*= (tmat3x4<T> const & m);\r
+                       tmat4x3<T>& operator/= (T const & s);\r
+                       //tmat4x3<T>& operator/= (tmat3x4<T> const & m);\r
+\r
+                       tmat4x3<T>& operator++ ();\r
+                       tmat4x3<T>& operator-- ();\r
+\r
+                       // Unary constant operators\r
+                       const tmat4x3<T> operator- () const;\r
+                       const tmat4x3<T> operator++ (int) const;\r
+                       const tmat4x3<T> operator-- (int) const;\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename T> \r
+               tmat4x3<T> operator+ (const tmat4x3<T>& m, const T & s);\r
+           \r
+               template <typename T> \r
+               tmat4x3<T> operator+ (const tmat4x3<T>& m1, const tmat4x3<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat4x3<T> operator- (const tmat4x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x3<T> operator- (const tmat4x3<T>& m1, const tmat4x3<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x3<T> operator* (const tmat4x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x3<T> operator* (const T & s, const tmat4x3<T>& m);\r
+\r
+               template <typename T>\r
+               detail::tvec3<T> operator* (const tmat4x3<T>& m, const detail::tvec4<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec4<T> operator* (const detail::tvec3<T>& v, const tmat4x3<T>& m);\r
+\r
+               template <typename T> \r
+               tmat3x3<T> operator* (const tmat4x3<T>& m1, const tmat3x4<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x3<T> operator/ (const tmat4x3<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x3<T> operator/ (const T & s, const tmat4x3<T> & m);\r
+\r
+               //template <typename T> \r
+               //detail::tvec3<T> operator/ (const tmat4x3<T>& m, const detail::tvec4<T>& v);\r
+\r
+               //template <typename T> \r
+               //detail::tvec4<T> operator/ (const detail::tvec3<T>& v, const tmat4x3<T>& m);\r
+\r
+               //template <typename T> \r
+               //tmat3x3<T> operator/ (const tmat4x3<T>& m1, const tmat3x4<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat4x3<valType> const operator- (tmat4x3<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat4x3<valType> const operator-- (tmat4x3<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat4x3<valType> const operator++ (tmat4x3<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 4 columns of 3 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x3<lowp_float>             lowp_mat4x3;\r
+               //! 4 columns of 3 components matrix of medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x3<mediump_float>  mediump_mat4x3;\r
+               //! 4 columns of 3 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x3<highp_float>    highp_mat4x3;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION\r
+       //! 4 columns of 3 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat4x3<mediump_float>  mat4x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat4x3<highp_float>    mat4x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat4x3<mediump_float>  mat4x3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat4x3<lowp_float>             mat4x3;\r
+#else\r
+       typedef detail::tmat4x3<mediump_float>  mat4x3;\r
+#endif//GLM_PRECISION\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat4x3.inl"\r
+\r
+#endif//glm_core_type_mat4x3\r
diff --git a/glm/core/type_mat4x3.inl b/glm/core/type_mat4x3.inl
new file mode 100644 (file)
index 0000000..e8b4e94
--- /dev/null
@@ -0,0 +1,613 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-17\r
+// Updated : 2006-04-17\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat4x3.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat4x3<valType>::size_type tmat4x3<valType>::col_size()\r
+       {\r
+               return typename tmat4x3<valType>::size_type(4);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat4x3<valType>::size_type tmat4x3<valType>::row_size()\r
+       {\r
+               return typename tmat4x3<valType>::size_type(3);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat4x3<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec3<valType>& tmat4x3<valType>::operator[]\r
+       (\r
+               typename tmat4x3<valType>::size_type i\r
+       )\r
+       {\r
+               assert(\r
+                       i >= typename tmat4x3<valType>::size_type(0) && \r
+                       i < tmat4x3<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec3<valType>& tmat4x3<valType>::operator[]\r
+       (\r
+               typename tmat4x3<valType>::size_type i\r
+       ) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat4x3<valType>::size_type(0) && \r
+                       i < tmat4x3<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Constructors\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3()\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(1, 0, 0);\r
+        this->value[1] = detail::tvec3<valType>(0, 1, 0);\r
+        this->value[2] = detail::tvec3<valType>(0, 0, 1);\r
+        this->value[3] = detail::tvec3<valType>(0, 0, 0);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3(valType const & s)\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(s, 0, 0);\r
+        this->value[1] = detail::tvec3<valType>(0, s, 0);\r
+        this->value[2] = detail::tvec3<valType>(0, 0, s);\r
+        this->value[3] = detail::tvec3<valType>(0, 0, 0);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+    (\r
+        const valType x0, const valType y0, const valType z0,\r
+        const valType x1, const valType y1, const valType z1,\r
+        const valType x2, const valType y2, const valType z2,\r
+        const valType x3, const valType y3, const valType z3\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(x0, y0, z0);\r
+        this->value[1] = detail::tvec3<valType>(x1, y1, z1);\r
+        this->value[2] = detail::tvec3<valType>(x2, y2, z2);\r
+        this->value[3] = detail::tvec3<valType>(x3, y3, z3);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+    (\r
+        const detail::tvec3<valType> & v0, \r
+        const detail::tvec3<valType> & v1, \r
+        const detail::tvec3<valType> & v2,\r
+        const detail::tvec3<valType> & v3\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+        this->value[2] = v2;\r
+        this->value[3] = v3;\r
+    }\r
+\r
+    // Conversion\r
+    template <typename valType> \r
+    template <typename U> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat4x3<U> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0]);\r
+        this->value[1] = detail::tvec3<valType>(m[1]);\r
+        this->value[2] = detail::tvec3<valType>(m[2]);\r
+        this->value[3] = detail::tvec3<valType>(m[3]);\r
+       }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat2x2<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0], valType(0));\r
+        this->value[1] = detail::tvec3<valType>(m[1], valType(0));\r
+        this->value[2] = detail::tvec3<valType>(m[2], valType(1));\r
+        this->value[3] = detail::tvec3<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat3x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0]);\r
+        this->value[1] = detail::tvec3<valType>(m[1]);\r
+        this->value[2] = detail::tvec3<valType>(m[2]);\r
+        this->value[3] = detail::tvec3<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0]);\r
+        this->value[1] = detail::tvec3<valType>(m[1]);\r
+        this->value[2] = detail::tvec3<valType>(m[2]);\r
+        this->value[3] = detail::tvec3<valType>(m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat2x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0]);\r
+        this->value[1] = detail::tvec3<valType>(m[1]);\r
+        this->value[2] = detail::tvec3<valType>(valType(0), valType(0), valType(1));\r
+        this->value[3] = detail::tvec3<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat3x2<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0], valType(0));\r
+        this->value[1] = detail::tvec3<valType>(m[1], valType(0));\r
+        this->value[2] = detail::tvec3<valType>(m[2], valType(1));\r
+        this->value[3] = detail::tvec3<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat2x4<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0]);\r
+        this->value[1] = detail::tvec3<valType>(m[1]);\r
+        this->value[2] = detail::tvec3<valType>(valType(0), valType(0), valType(1));\r
+        this->value[3] = detail::tvec3<valType>(valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat4x2<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0], valType(0));\r
+        this->value[1] = detail::tvec3<valType>(m[1], valType(0));\r
+        this->value[2] = detail::tvec3<valType>(m[2], valType(1));\r
+        this->value[3] = detail::tvec3<valType>(m[3], valType(0));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>::tmat4x3\r
+       (\r
+               tmat3x4<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec3<valType>(m[0]);\r
+        this->value[1] = detail::tvec3<valType>(m[1]);\r
+        this->value[2] = detail::tvec3<valType>(m[2]);\r
+        this->value[3] = detail::tvec3<valType>(valType(0));\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Unary updatable operators\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator= \r
+       (\r
+               tmat4x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+        this->value[3] = m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator+= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] += s;\r
+        this->value[1] += s;\r
+        this->value[2] += s;\r
+        this->value[3] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator+= \r
+       (\r
+               tmat4x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] += m[0];\r
+        this->value[1] += m[1];\r
+        this->value[2] += m[2];\r
+        this->value[3] += m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator-= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] -= s;\r
+        this->value[1] -= s;\r
+        this->value[2] -= s;\r
+        this->value[3] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator-= \r
+       (\r
+               tmat4x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] -= m[0];\r
+        this->value[1] -= m[1];\r
+        this->value[2] -= m[2];\r
+        this->value[3] -= m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator*= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] *= s;\r
+        this->value[1] *= s;\r
+        this->value[2] *= s;\r
+        this->value[3] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator*= \r
+       (\r
+               tmat3x4<valType> const & m\r
+       )\r
+    {\r
+        return (*this = tmat4x3<valType>(*this * m));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> & tmat4x3<valType>::operator/= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] /= s;\r
+        this->value[1] /= s;\r
+        this->value[2] /= s;\r
+        this->value[3] /= s;\r
+        return *this;\r
+    }\r
+\r
+       //template <typename valType> \r
+       //inline tmat4x3<valType>& tmat4x3<valType>::operator/= \r
+       //(\r
+       //      tmat3x4<valType> const & m\r
+       //)\r
+       //{\r
+       //      return (*this = *this / m);\r
+       //}\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator++ ()\r
+    {\r
+        ++this->value[0];\r
+        ++this->value[1];\r
+        ++this->value[2];\r
+        ++this->value[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType>& tmat4x3<valType>::operator-- ()\r
+    {\r
+        --this->value[0];\r
+        --this->value[1];\r
+        --this->value[2];\r
+        --this->value[3];\r
+        return *this;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // inverse\r
+    template <typename valType> \r
+    inline tmat3x4<valType> tmat4x3<valType>::_inverse() const\r
+    {\r
+               assert(0); //g.truc.creation[at]gmail.com\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Unary constant operators\r
+    template <typename valType> \r
+    inline const tmat4x3<valType> tmat4x3<valType>::operator- () const\r
+    {\r
+        return tmat4x3<valType>(\r
+            -this->value[0], \r
+            -this->value[1],\r
+            -this->value[2],\r
+            -this->value[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline const tmat4x3<valType> tmat4x3<valType>::operator-- (int) const \r
+    {\r
+        tmat4x3<valType> m = *this;\r
+        --m.value[0];\r
+        --m.value[1];\r
+        --m.value[2];\r
+        --m.value[3];\r
+        return m;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline const tmat4x3<valType> tmat4x3<valType>::operator++ (int) const\r
+    {\r
+        tmat4x4<valType> m = *this;\r
+        ++m.value[0];\r
+        ++m.value[1];\r
+        ++m.value[2];\r
+        ++m.value[3];\r
+        return m;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // Binary operators\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator+ (const tmat4x3<valType>& m, valType const & s)\r
+    {\r
+        return tmat4x3<valType>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s,\r
+            m[3] + s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator+ (const tmat4x3<valType>& m1, const tmat4x3<valType>& m2)\r
+    {\r
+        return tmat4x3<valType>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1],\r
+            m1[2] + m2[2],\r
+            m1[3] + m2[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator- (const tmat4x3<valType>& m, valType const & s)\r
+    {\r
+        return tmat4x3<valType>(\r
+            m[0] - s,\r
+            m[1] - s,\r
+            m[2] - s,\r
+            m[3] - s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator- (const tmat4x3<valType>& m1, const tmat4x3<valType>& m2)\r
+    {\r
+        return tmat4x3<valType>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1],\r
+            m1[2] - m2[2],\r
+            m1[3] - m2[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator* (const tmat4x3<valType>& m, valType const & s)\r
+    {\r
+        return tmat4x3<valType>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s,\r
+            m[3] * s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator* (valType const & s, const tmat4x3<valType> & m)\r
+    {\r
+        return tmat4x3<valType>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s,\r
+            m[3] * s);\r
+    }\r
+   \r
+    template <typename valType>\r
+    inline detail::tvec3<valType> operator* (const tmat4x3<valType>& m, const detail::tvec4<valType>& v)\r
+    {\r
+        return detail::tvec3<valType>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,\r
+            m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> operator* (const detail::tvec3<valType>& v, const tmat4x3<valType>& m) \r
+    {\r
+        return detail::tvec4<valType>(\r
+            v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],\r
+            v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2],\r
+            v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2],\r
+            v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat3x3<valType> operator* (const tmat4x3<valType>& m1, const tmat3x4<valType>& m2)\r
+    {\r
+        const valType SrcA00 = m1[0][0];\r
+        const valType SrcA01 = m1[0][1];\r
+        const valType SrcA02 = m1[0][2];\r
+        const valType SrcA10 = m1[1][0];\r
+        const valType SrcA11 = m1[1][1];\r
+        const valType SrcA12 = m1[1][2];\r
+        const valType SrcA20 = m1[2][0];\r
+        const valType SrcA21 = m1[2][1];\r
+        const valType SrcA22 = m1[2][2];\r
+        const valType SrcA30 = m1[3][0];\r
+        const valType SrcA31 = m1[3][1];\r
+        const valType SrcA32 = m1[3][2];\r
+\r
+        const valType SrcB00 = m2[0][0];\r
+        const valType SrcB01 = m2[0][1];\r
+        const valType SrcB02 = m2[0][2];\r
+        const valType SrcB03 = m2[0][3];\r
+        const valType SrcB10 = m2[1][0];\r
+        const valType SrcB11 = m2[1][1];\r
+        const valType SrcB12 = m2[1][2];\r
+        const valType SrcB13 = m2[1][3];\r
+        const valType SrcB20 = m2[2][0];\r
+        const valType SrcB21 = m2[2][1];\r
+        const valType SrcB22 = m2[2][2];\r
+        const valType SrcB23 = m2[2][3];\r
+\r
+        tmat3x3<valType> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;\r
+        Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;\r
+        Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13;\r
+        Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23;\r
+        Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23;\r
+        Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23;\r
+        return Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator/ (const tmat4x3<valType>& m, valType const & s)\r
+    {\r
+        return tmat4x3<valType>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s,\r
+            m[3] / s);        \r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> operator/ (valType const & s, const tmat4x3<valType>& m)\r
+    {\r
+        return tmat4x3<valType>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2],\r
+            s / m[3]);        \r
+    }\r
+\r
+       //template <typename valType> \r
+       //inline tvec3<valType> operator/ \r
+       //(\r
+       //      tmat4x3<valType> const & m, \r
+       //      tvec3<valType> const & v\r
+       //)\r
+       //{\r
+       //      return m._inverse() * v;\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tvec4<valType> operator/ \r
+       //(\r
+       //      tvec3<valType> const & v, \r
+       //      tmat4x3<valType> const & m\r
+       //)\r
+       //{\r
+       //      return v * m._inverse();\r
+       //}\r
+\r
+       //template <typename valType> \r
+       //inline tmat3x3<valType> operator/ \r
+       //(\r
+       //      tmat4x3<valType> const & m1, \r
+       //      tmat3x4<valType> const & m2\r
+       //)\r
+       //{\r
+       //      return m1 * m2._inverse();\r
+       //}\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat4x3<valType> const operator- \r
+       (\r
+               tmat4x3<valType> const & m\r
+       )\r
+    {\r
+        return tmat4x3<valType>(\r
+            -m[0], \r
+            -m[1],\r
+            -m[2],\r
+            -m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> const operator++ \r
+       (\r
+               tmat4x3<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat4x3<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1),\r
+            m[2] + valType(1),\r
+            m[3] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x3<valType> const operator-- \r
+       (\r
+               tmat4x3<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat4x3<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1),\r
+            m[2] - valType(1),\r
+            m[3] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
+\r
diff --git a/glm/core/type_mat4x4.hpp b/glm/core/type_mat4x4.hpp
new file mode 100644 (file)
index 0000000..25884ad
--- /dev/null
@@ -0,0 +1,224 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-01-27\r
+// Updated : 2008-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat4x4.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_mat4x4\r
+#define glm_core_type_mat4x4\r
+\r
+#include "type_size.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_mat4x4();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+               template <typename T> struct tmat2x2;\r
+               template <typename T> struct tmat2x3;\r
+               template <typename T> struct tmat2x4;\r
+               template <typename T> struct tmat3x2;\r
+               template <typename T> struct tmat3x3;\r
+               template <typename T> struct tmat3x4;\r
+               template <typename T> struct tmat4x2;\r
+               template <typename T> struct tmat4x3;\r
+               template <typename T> struct tmat4x4;\r
+\r
+               //!< \brief Template for 4 * 4 matrix of floating-point numbers.\r
+               template <typename T> \r
+               struct tmat4x4\r
+               {\r
+               public:\r
+                       enum ctor{null};\r
+\r
+                       typedef tmat4x4<T>* pointer;\r
+                       typedef const tmat4x4<T>* const_pointer;\r
+                       typedef const tmat4x4<T>*const const_pointer_const;\r
+                       typedef tmat4x4<T>*const pointer_const;\r
+                       typedef tmat4x4<T>& reference;\r
+                       typedef const tmat4x4<T>& const_reference;\r
+                       typedef const tmat4x4<T>& param_type;\r
+                       typedef tmat4x4<T> transpose_type;\r
+\r
+                       typedef T value_type;\r
+                       typedef tvec4<T> col_type;\r
+                       typedef tvec4<T> row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+               public:\r
+                       tmat4x4<T> _inverse() const;\r
+\r
+               private:\r
+                       // Data \r
+                       detail::tvec4<T> value[4];\r
+\r
+               public:\r
+                       // Constructors\r
+                       tmat4x4();\r
+                       explicit tmat4x4(ctor Null);\r
+                       explicit tmat4x4(T const & x);\r
+                       explicit tmat4x4(\r
+                               const T x0, const T y0, const T z0, const T w0,\r
+                               const T x1, const T y1, const T z1, const T w1,\r
+                               const T x2, const T y2, const T z2, const T w2,\r
+                               const T x3, const T y3, const T z3, const T w3);\r
+                       explicit tmat4x4(\r
+                               detail::tvec4<T> const & v0, \r
+                               detail::tvec4<T> const & v1,\r
+                               detail::tvec4<T> const & v2,\r
+                               detail::tvec4<T> const & v3);\r
+\r
+                       // Conversions\r
+                       template <typename U> \r
+                       explicit tmat4x4(tmat4x4<U> const & m);\r
+\r
+                       explicit tmat4x4(tmat2x2<T> const & x);\r
+                       explicit tmat4x4(tmat3x3<T> const & x);\r
+                       explicit tmat4x4(tmat2x3<T> const & x);\r
+                       explicit tmat4x4(tmat3x2<T> const & x);\r
+                       explicit tmat4x4(tmat2x4<T> const & x);\r
+                       explicit tmat4x4(tmat4x2<T> const & x);\r
+                       explicit tmat4x4(tmat3x4<T> const & x);\r
+                       explicit tmat4x4(tmat4x3<T> const & x);\r
+\r
+                       // Accesses\r
+                       detail::tvec4<T>& operator[](size_type i);\r
+                       detail::tvec4<T> const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       tmat4x4<T>& operator= (tmat4x4<T> const & m);\r
+                       tmat4x4<T>& operator+= (T const & s);\r
+                       tmat4x4<T>& operator+= (tmat4x4<T> const & m);\r
+                       tmat4x4<T>& operator-= (T const & s);\r
+                       tmat4x4<T>& operator-= (tmat4x4<T> const & m);\r
+                       tmat4x4<T>& operator*= (T const & s);\r
+                       tmat4x4<T>& operator*= (tmat4x4<T> const & m);\r
+                       tmat4x4<T>& operator/= (T const & s);\r
+                       tmat4x4<T>& operator/= (tmat4x4<T> const & m);\r
+                       tmat4x4<T>& operator++ ();\r
+                       tmat4x4<T>& operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               template <typename valType> \r
+               tmat4x4<valType> operator+ (const tmat4x4<valType>& m, valType const & s);\r
+\r
+               template <typename valType> \r
+               tmat4x4<valType> operator+ (valType const & s, const tmat4x4<valType>& m);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator+ (const tmat4x4<T>& m1, const tmat4x4<T>& m2);\r
+           \r
+               template <typename T> \r
+               tmat4x4<T> operator- (const tmat4x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator- (const T & s, const tmat4x4<T>& m);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator- (const tmat4x4<T>& m1, const tmat4x4<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator* (const tmat4x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator* (const T & s, const tmat4x4<T>& m);\r
+\r
+               template <typename T> \r
+               detail::tvec4<T> operator* (const tmat4x4<T>& m, const detail::tvec4<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec4<T> operator* (const detail::tvec4<T>& v, const tmat4x4<T>& m);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator* (const tmat4x4<T>& m1, const tmat4x4<T>& m2);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator/ (const tmat4x4<T>& m, const T & s);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator/ (const T & s, const tmat4x4<T>& m);\r
+\r
+               template <typename T> \r
+               detail::tvec4<T> operator/ (const tmat4x4<T>& m, const detail::tvec4<T>& v);\r
+\r
+               template <typename T> \r
+               detail::tvec4<T> operator/ (const detail::tvec4<T>& v, const tmat4x4<T>& m);\r
+\r
+               template <typename T> \r
+               tmat4x4<T> operator/ (const tmat4x4<T>& m1, const tmat4x4<T>& m2);\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               tmat4x4<valType> const operator-  (tmat4x4<valType> const & m);\r
+\r
+               template <typename valType> \r
+               tmat4x4<valType> const operator-- (tmat4x4<valType> const & m, int);\r
+\r
+               template <typename valType> \r
+               tmat4x4<valType> const operator++ (tmat4x4<valType> const & m, int);\r
+\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace matrix{\r
+\r
+       namespace precision\r
+       {\r
+               //! 4 columns of 4 components matrix of low precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x4<lowp_float>             lowp_mat4x4;\r
+               //! 4 columns of 4 components matrix of medium precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x4<mediump_float>  mediump_mat4x4;\r
+               //! 4 columns of 4 components matrix of high precision floating-point numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices and section 4.5 Precision and Precision Qualifiers)\r
+               typedef detail::tmat4x4<highp_float>    highp_mat4x4;\r
+       }\r
+       //namespace precision\r
+\r
+#ifndef GLM_PRECISION\r
+       //! 4 columns of 4 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef detail::tmat4x4<mediump_float>  mat4x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGH)\r
+       typedef detail::tmat4x4<highp_float>    mat4x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUM)\r
+       typedef detail::tmat4x4<mediump_float>  mat4x4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOW)\r
+       typedef detail::tmat4x4<lowp_float>             mat4x4;\r
+#else\r
+       typedef detail::tmat4x4<mediump_float>  mat4x4;\r
+#endif//GLM_PRECISION\r
+\r
+       //! 4 columns of 4 components matrix of floating-point numbers. \r
+       //! (From GLSL 1.30.8 specification, section 4.1.6 Matrices)\r
+       typedef mat4x4                                                  mat4;\r
+\r
+       }//namespace matrix\r
+       }//namespace type\r
+       }//namespace core\r
+} //namespace glm\r
+\r
+#include "type_mat4x4.inl"\r
+\r
+#endif //glm_core_type_mat4x4\r
diff --git a/glm/core/type_mat4x4.inl b/glm/core/type_mat4x4.inl
new file mode 100644 (file)
index 0000000..00f69ea
--- /dev/null
@@ -0,0 +1,802 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-01-27\r
+// Updated : 2008-09-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_mat4x4.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <typename valType> \r
+       typename tmat4x4<valType>::size_type tmat4x4<valType>::value_size()\r
+       {\r
+               return typename tmat4x4<valType>::size_type(4);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat4x4<valType>::size_type tmat4x4<valType>::col_size()\r
+       {\r
+               return typename tmat4x4<valType>::size_type(4);\r
+       }\r
+\r
+       template <typename valType> \r
+       typename tmat4x4<valType>::size_type tmat4x4<valType>::row_size()\r
+       {\r
+               return typename tmat4x4<valType>::size_type(4);\r
+       }\r
+\r
+       template <typename valType> \r
+       bool tmat4x4<valType>::is_matrix()\r
+       {\r
+               return true;\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       template <typename valType>\r
+       detail::tvec4<valType>& tmat4x4<valType>::operator[]\r
+       (\r
+               typename tmat4x4<valType>::size_type i\r
+       )\r
+       {\r
+               assert(\r
+                       i >= typename tmat4x4<valType>::size_type(0) && \r
+                       i < tmat4x4<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       template <typename valType>\r
+       const detail::tvec4<valType>& tmat4x4<valType>::operator[]\r
+       (\r
+               typename tmat4x4<valType>::size_type i\r
+       ) const\r
+       {\r
+               assert(\r
+                       i >= typename tmat4x4<valType>::size_type(0) && \r
+                       i < tmat4x4<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // mat4 constructors\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4()\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(1, 0, 0, 0);\r
+        this->value[1] = detail::tvec4<valType>(0, 1, 0, 0);\r
+        this->value[2] = detail::tvec4<valType>(0, 0, 1, 0);\r
+        this->value[3] = detail::tvec4<valType>(0, 0, 0, 1);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4(typename tmat4x4<valType>::ctor)\r
+    {}\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4(valType const & f)\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(f, 0, 0, 0);\r
+        this->value[1] = detail::tvec4<valType>(0, f, 0, 0);\r
+        this->value[2] = detail::tvec4<valType>(0, 0, f, 0);\r
+        this->value[3] = detail::tvec4<valType>(0, 0, 0, f);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+    (\r
+        const valType x0, const valType y0, const valType z0, const valType w0,\r
+        const valType x1, const valType y1, const valType z1, const valType w1,\r
+        const valType x2, const valType y2, const valType z2, const valType w2,\r
+        const valType x3, const valType y3, const valType z3, const valType w3\r
+    )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(x0, y0, z0, w0);\r
+        this->value[1] = detail::tvec4<valType>(x1, y1, z1, w1);\r
+        this->value[2] = detail::tvec4<valType>(x2, y2, z2, w2);\r
+        this->value[3] = detail::tvec4<valType>(x3, y3, z3, w3);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+    (\r
+        detail::tvec4<valType> const & v0, \r
+        detail::tvec4<valType> const & v1, \r
+        detail::tvec4<valType> const & v2,\r
+        detail::tvec4<valType> const & v3\r
+    )\r
+    {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+        this->value[2] = v2;\r
+        this->value[3] = v3;\r
+    }\r
+\r
+    template <typename valType> \r
+    template <typename U> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat4x4<U> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(m[0]);\r
+        this->value[1] = detail::tvec4<valType>(m[1]);\r
+        this->value[2] = detail::tvec4<valType>(m[2]);\r
+        this->value[3] = detail::tvec4<valType>(m[3]);\r
+       }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat2x2<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(m[0], detail::tvec2<valType>(0));\r
+        this->value[1] = detail::tvec4<valType>(m[1], detail::tvec2<valType>(0));\r
+        this->value[2] = detail::tvec4<valType>(valType(0));\r
+        this->value[3] = detail::tvec4<valType>(valType(0), valType(0), valType(0), valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat3x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(m[0], valType(0));\r
+        this->value[1] = detail::tvec4<valType>(m[1], valType(0));\r
+        this->value[2] = detail::tvec4<valType>(m[2], valType(0));\r
+        this->value[3] = detail::tvec4<valType>(valType(0), valType(0), valType(0), valType(1));\r
+    }\r
+\r
+       template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat2x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(m[0], valType(0));\r
+        this->value[1] = detail::tvec4<valType>(m[1], valType(0));\r
+        this->value[2] = detail::tvec4<valType>(valType(0));\r
+        this->value[3] = detail::tvec4<valType>(valType(0), valType(0), valType(0), valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat3x2<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(m[0], detail::tvec2<valType>(0));\r
+        this->value[1] = detail::tvec4<valType>(m[1], detail::tvec2<valType>(0));\r
+        this->value[2] = detail::tvec4<valType>(m[2], detail::tvec2<valType>(0));\r
+        this->value[3] = detail::tvec4<valType>(valType(0), valType(0), valType(0), valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat2x4<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = detail::tvec4<valType>(valType(0));\r
+        this->value[3] = detail::tvec4<valType>(valType(0), valType(0), valType(0), valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat4x2<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(m[0], detail::tvec2<valType>(0));\r
+        this->value[1] = detail::tvec4<valType>(m[1], detail::tvec2<valType>(0));\r
+        this->value[2] = detail::tvec4<valType>(valType(0));\r
+        this->value[3] = detail::tvec4<valType>(valType(0), valType(0), valType(0), valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat3x4<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+        this->value[3] = detail::tvec4<valType>(valType(0), valType(0), valType(0), valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4\r
+       (\r
+               tmat4x3<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(m[0], valType(0));\r
+        this->value[1] = detail::tvec4<valType>(m[1], valType(0));\r
+        this->value[2] = detail::tvec4<valType>(m[2], valType(0));\r
+        this->value[3] = detail::tvec4<valType>(m[3], valType(1));\r
+    }\r
+\r
+/*\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4(const valType* a)\r
+    {\r
+        this->value[0] = detail::tvec4<valType>(a[0], a[1], a[2], a[3]);\r
+        this->value[1] = detail::tvec4<valType>(a[4], a[5], a[6], a[7]);\r
+        this->value[2] = detail::tvec4<valType>(a[8], a[9], a[10], a[11]);\r
+        this->value[4] = detail::tvec4<valType>(a[12], a[13], a[14], a[15]);\r
+    }\r
+*/\r
+    /*\r
+    // GL_GTX_euler_angles\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4(const tvec3<valType> & angles)\r
+    {\r
+        valType ch = cos(angles.x);\r
+        valType sh = sin(angles.x);\r
+        valType cp = cos(angles.y);\r
+        valType sp = sin(angles.y);\r
+        valType cb = cos(angles.z);\r
+        valType sb = sin(angles.z);\r
+\r
+        value[0][0] = ch * cb + sh * sp * sb;\r
+        value[0][1] = sb * cp;\r
+        value[0][2] = -sh * cb + ch * sp * sb;\r
+        value[0][3] = 0.0f;\r
+        value[1][0] = -ch * sb + sh * sp * cb;\r
+        value[1][1] = cb * cp;\r
+        value[1][2] = sb * sh + ch * sp * cb;\r
+        value[1][3] = 0.0f;\r
+        value[2][0] = sh * cp;\r
+        value[2][1] = -sp;\r
+        value[2][2] = ch * cp;\r
+        value[2][3] = 0.0f;\r
+        value[3][0] = 0.0f;\r
+        value[3][1] = 0.0f;\r
+        value[3][2] = 0.0f;\r
+        value[3][3] = 1.0f;\r
+    }\r
+    */\r
+    //////////////////////////////////////////////////////////////\r
+    // mat4 conversion\r
+    /*\r
+    template <typename valType> \r
+    inline tmat4x4<valType>::tmat4x4(const tquat<valType> & q)\r
+    {\r
+        *this = tmat4x4<valType>(1);\r
+        this->value[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z;\r
+        this->value[0][1] = 2 * q.x * q.y + 2 * q.w * q.z;\r
+        this->value[0][2] = 2 * q.x * q.z - 2 * q.w * q.y;\r
+\r
+        this->value[1][0] = 2 * q.x * q.y - 2 * q.w * q.z;\r
+        this->value[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z;\r
+        this->value[1][2] = 2 * q.y * q.z + 2 * q.w * q.x;\r
+\r
+        this->value[2][0] = 2 * q.x * q.z + 2 * q.w * q.y;\r
+        this->value[2][1] = 2 * q.y * q.z - 2 * q.w * q.x;\r
+        this->value[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y;\r
+    }\r
+    */\r
+    //////////////////////////////////////////////////////////////\r
+    // mat4 operators\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator= \r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        //memcpy could be faster\r
+        //memcpy(&this->value, &m.value, 16 * sizeof(valType));\r
+        this->value[0] = m[0];\r
+        this->value[1] = m[1];\r
+        this->value[2] = m[2];\r
+        this->value[3] = m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator+= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] += s;\r
+        this->value[1] += s;\r
+        this->value[2] += s;\r
+        this->value[3] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator+= \r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] += m[0];\r
+        this->value[1] += m[1];\r
+        this->value[2] += m[2];\r
+        this->value[3] += m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator-= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] -= s;\r
+        this->value[1] -= s;\r
+        this->value[2] -= s;\r
+        this->value[3] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator-= \r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        this->value[0] -= m[0];\r
+        this->value[1] -= m[1];\r
+        this->value[2] -= m[2];\r
+        this->value[3] -= m[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator*= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] *= s;\r
+        this->value[1] *= s;\r
+        this->value[2] *= s;\r
+        this->value[3] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator*= \r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return (*this = *this * m);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> & tmat4x4<valType>::operator/= \r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->value[0] /= s;\r
+        this->value[1] /= s;\r
+        this->value[2] /= s;\r
+        this->value[3] /= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator/= \r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return (*this = *this / m);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator++ ()\r
+    {\r
+        ++this->value[0];\r
+        ++this->value[1];\r
+        ++this->value[2];\r
+        ++this->value[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType>& tmat4x4<valType>::operator-- ()\r
+    {\r
+        --this->value[0];\r
+        --this->value[1];\r
+        --this->value[2];\r
+        --this->value[3];\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> tmat4x4<valType>::_inverse() const\r
+    {\r
+        // Calculate all mat2 determinants\r
+        valType SubFactor00 = this->value[2][2] * this->value[3][3] - this->value[3][2] * this->value[2][3];\r
+        valType SubFactor01 = this->value[2][1] * this->value[3][3] - this->value[3][1] * this->value[2][3];\r
+        valType SubFactor02 = this->value[2][1] * this->value[3][2] - this->value[3][1] * this->value[2][2];\r
+        valType SubFactor03 = this->value[2][0] * this->value[3][3] - this->value[3][0] * this->value[2][3];\r
+        valType SubFactor04 = this->value[2][0] * this->value[3][2] - this->value[3][0] * this->value[2][2];\r
+        valType SubFactor05 = this->value[2][0] * this->value[3][1] - this->value[3][0] * this->value[2][1];\r
+        valType SubFactor06 = this->value[1][2] * this->value[3][3] - this->value[3][2] * this->value[1][3];\r
+        valType SubFactor07 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3];\r
+        valType SubFactor08 = this->value[1][1] * this->value[3][2] - this->value[3][1] * this->value[1][2];\r
+        valType SubFactor09 = this->value[1][0] * this->value[3][3] - this->value[3][0] * this->value[1][3];\r
+        valType SubFactor10 = this->value[1][0] * this->value[3][2] - this->value[3][0] * this->value[1][2];\r
+        valType SubFactor11 = this->value[1][1] * this->value[3][3] - this->value[3][1] * this->value[1][3];\r
+        valType SubFactor12 = this->value[1][0] * this->value[3][1] - this->value[3][0] * this->value[1][1];\r
+        valType SubFactor13 = this->value[1][2] * this->value[2][3] - this->value[2][2] * this->value[1][3];\r
+        valType SubFactor14 = this->value[1][1] * this->value[2][3] - this->value[2][1] * this->value[1][3];\r
+        valType SubFactor15 = this->value[1][1] * this->value[2][2] - this->value[2][1] * this->value[1][2];\r
+        valType SubFactor16 = this->value[1][0] * this->value[2][3] - this->value[2][0] * this->value[1][3];\r
+        valType SubFactor17 = this->value[1][0] * this->value[2][2] - this->value[2][0] * this->value[1][2];\r
+        valType SubFactor18 = this->value[1][0] * this->value[2][1] - this->value[2][0] * this->value[1][1];\r
+\r
+        tmat4x4<valType> Inverse(\r
+            + (this->value[1][1] * SubFactor00 - this->value[1][2] * SubFactor01 + this->value[1][3] * SubFactor02),\r
+            - (this->value[1][0] * SubFactor00 - this->value[1][2] * SubFactor03 + this->value[1][3] * SubFactor04),\r
+            + (this->value[1][0] * SubFactor01 - this->value[1][1] * SubFactor03 + this->value[1][3] * SubFactor05),\r
+            - (this->value[1][0] * SubFactor02 - this->value[1][1] * SubFactor04 + this->value[1][2] * SubFactor05),\r
+\r
+            - (this->value[0][1] * SubFactor00 - this->value[0][2] * SubFactor01 + this->value[0][3] * SubFactor02),\r
+            + (this->value[0][0] * SubFactor00 - this->value[0][2] * SubFactor03 + this->value[0][3] * SubFactor04),\r
+            - (this->value[0][0] * SubFactor01 - this->value[0][1] * SubFactor03 + this->value[0][3] * SubFactor05),\r
+            + (this->value[0][0] * SubFactor02 - this->value[0][1] * SubFactor04 + this->value[0][2] * SubFactor05),\r
+\r
+            + (this->value[0][1] * SubFactor06 - this->value[0][2] * SubFactor07 + this->value[0][3] * SubFactor08),\r
+            - (this->value[0][0] * SubFactor06 - this->value[0][2] * SubFactor09 + this->value[0][3] * SubFactor10),\r
+            + (this->value[0][0] * SubFactor11 - this->value[0][1] * SubFactor09 + this->value[0][3] * SubFactor12),\r
+            - (this->value[0][0] * SubFactor08 - this->value[0][1] * SubFactor10 + this->value[0][2] * SubFactor12),\r
+\r
+            - (this->value[0][1] * SubFactor13 - this->value[0][2] * SubFactor14 + this->value[0][3] * SubFactor15),\r
+            + (this->value[0][0] * SubFactor13 - this->value[0][2] * SubFactor16 + this->value[0][3] * SubFactor17),\r
+            - (this->value[0][0] * SubFactor14 - this->value[0][1] * SubFactor16 + this->value[0][3] * SubFactor18),\r
+            + (this->value[0][0] * SubFactor15 - this->value[0][1] * SubFactor17 + this->value[0][2] * SubFactor18));\r
+\r
+        valType Determinant = this->value[0][0] * Inverse[0][0] \r
+                      + this->value[0][1] * Inverse[1][0] \r
+                      + this->value[0][2] * Inverse[2][0] \r
+                      + this->value[0][3] * Inverse[3][0];\r
+\r
+        Inverse /= Determinant;\r
+        return Inverse;\r
+    }\r
+\r
+       // Binary operators\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator+ \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               valType const & s\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s,\r
+            m[3] + s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator+ \r
+       (\r
+               valType const & s, \r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] + s,\r
+            m[1] + s,\r
+            m[2] + s,\r
+            m[3] + s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator+ \r
+       (\r
+               tmat4x4<valType> const & m1, \r
+               tmat4x4<valType> const & m2\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m1[0] + m2[0],\r
+            m1[1] + m2[1],\r
+            m1[2] + m2[2],\r
+            m1[3] + m2[3]);\r
+    }\r
+    \r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator- \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               valType const & s\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] - s,\r
+            m[1] - s,\r
+            m[2] - s,\r
+            m[3] - s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator- \r
+       (\r
+               valType const & s, \r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            s - m[0],\r
+            s - m[1],\r
+            s - m[2],\r
+            s - m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator- \r
+       (\r
+               tmat4x4<valType> const & m1, \r
+               tmat4x4<valType> const & m2\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m1[0] - m2[0],\r
+            m1[1] - m2[1],\r
+            m1[2] - m2[2],\r
+            m1[3] - m2[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator* \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               valType const  & s\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s,\r
+            m[3] * s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator* \r
+       (\r
+               valType const & s, \r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] * s,\r
+            m[1] * s,\r
+            m[2] * s,\r
+            m[3] * s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> operator* \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               detail::tvec4<valType> const & v\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,\r
+            m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,\r
+            m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w,\r
+            m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z + m[3][3] * v.w);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec4<valType> operator* \r
+       (\r
+               detail::tvec4<valType> const & v, \r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return detail::tvec4<valType>(\r
+            m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z + m[0][3] * v.w,\r
+            m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z + m[1][3] * v.w,\r
+            m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z + m[2][3] * v.w,\r
+            m[3][0] * v.x + m[3][1] * v.y + m[3][2] * v.z + m[3][3] * v.w);\r
+    }\r
+/*\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator* \r
+       (\r
+               tmat4x4<valType> const & m1, \r
+               tmat4x4<valType> const & m2\r
+       )\r
+    {\r
+        const valType SrcA00 = m1[0][0];\r
+        const valType SrcA01 = m1[0][1];\r
+        const valType SrcA02 = m1[0][2];\r
+        const valType SrcA03 = m1[0][3];\r
+        const valType SrcA10 = m1[1][0];\r
+        const valType SrcA11 = m1[1][1];\r
+        const valType SrcA12 = m1[1][2];\r
+        const valType SrcA13 = m1[1][3];\r
+        const valType SrcA20 = m1[2][0];\r
+        const valType SrcA21 = m1[2][1];\r
+        const valType SrcA22 = m1[2][2];\r
+        const valType SrcA23 = m1[2][3];\r
+        const valType SrcA30 = m1[3][0];\r
+        const valType SrcA31 = m1[3][1];\r
+        const valType SrcA32 = m1[3][2];\r
+        const valType SrcA33 = m1[3][3];\r
+\r
+        const valType SrcB00 = m2[0][0];\r
+        const valType SrcB01 = m2[0][1];\r
+        const valType SrcB02 = m2[0][2];\r
+        const valType SrcB03 = m2[0][3];\r
+        const valType SrcB10 = m2[1][0];\r
+        const valType SrcB11 = m2[1][1];\r
+        const valType SrcB12 = m2[1][2];\r
+        const valType SrcB13 = m2[1][3];\r
+        const valType SrcB20 = m2[2][0];\r
+        const valType SrcB21 = m2[2][1];\r
+        const valType SrcB22 = m2[2][2];\r
+        const valType SrcB23 = m2[2][3];\r
+        const valType SrcB30 = m2[3][0];\r
+        const valType SrcB31 = m2[3][1];\r
+        const valType SrcB32 = m2[3][2];\r
+        const valType SrcB33 = m2[3][3];\r
+\r
+        tmat4x4<valType> Result;\r
+        Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;\r
+        Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;\r
+        Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03;\r
+        Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02 + SrcA33 * SrcB03;\r
+        Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;\r
+        Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13;\r
+        Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13;\r
+        Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12 + SrcA33 * SrcB13;\r
+        Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23;\r
+        Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23;\r
+        Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23;\r
+        Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22 + SrcA33 * SrcB23;\r
+        Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32 + SrcA30 * SrcB33;\r
+        Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32 + SrcA31 * SrcB33;\r
+        Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32 + SrcA32 * SrcB33;\r
+        Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32 + SrcA33 * SrcB33;\r
+        return Result;\r
+    }\r
+*/\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator* \r
+       (\r
+               tmat4x4<valType> const & m1, \r
+               tmat4x4<valType> const & m2\r
+       )\r
+    {\r
+               detail::tvec4<valType> const SrcA0 = m1[0];\r
+               detail::tvec4<valType> const SrcA1 = m1[1];\r
+               detail::tvec4<valType> const SrcA2 = m1[2];\r
+               detail::tvec4<valType> const SrcA3 = m1[3];\r
+\r
+               detail::tvec4<valType> const SrcB0 = m2[0];\r
+               detail::tvec4<valType> const SrcB1 = m2[1];\r
+               detail::tvec4<valType> const SrcB2 = m2[2];\r
+               detail::tvec4<valType> const SrcB3 = m2[3];\r
+\r
+        tmat4x4<valType> Result;\r
+               Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3];\r
+               Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3];\r
+               Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3];\r
+               Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3];\r
+        return Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator/ \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               valType const & s\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] / s,\r
+            m[1] / s,\r
+            m[2] / s,\r
+            m[3] / s);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator/ (const valType s, const tmat4x4<valType>& m)\r
+    {\r
+        return tmat4x4<valType>(\r
+            s / m[0],\r
+            s / m[1],\r
+            s / m[2],\r
+            s / m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tvec4<valType> operator/ \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               tvec4<valType> const & v\r
+       )\r
+    {\r
+        return m._inverse() * v;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tvec4<valType> operator/ \r
+       (\r
+               tvec4<valType> const & v, \r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return v * m._inverse();\r
+    }\r
\r
+    template <typename valType> \r
+    inline tmat4x4<valType> operator/ \r
+       (\r
+               tmat4x4<valType> const & m1, \r
+               tmat4x4<valType> const & m2\r
+       )\r
+    {\r
+        return m1 * m2._inverse();\r
+    }\r
+\r
+       // Unary constant operators\r
+    template <typename valType> \r
+    inline tmat4x4<valType> const operator- \r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+        return tmat4x4<valType>(\r
+            -m[0], \r
+            -m[1],\r
+            -m[2],\r
+            -m[3]);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> const operator++ \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] + valType(1),\r
+            m[1] + valType(1),\r
+            m[2] + valType(1),\r
+            m[3] + valType(1));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tmat4x4<valType> const operator-- \r
+       (\r
+               tmat4x4<valType> const & m, \r
+               int\r
+       ) \r
+    {\r
+        return tmat4x4<valType>(\r
+            m[0] - valType(1),\r
+            m[1] - valType(1),\r
+            m[2] - valType(1),\r
+            m[3] - valType(1));\r
+    }\r
+\r
+} //namespace detail\r
+} //namespace glm\r
diff --git a/glm/core/type_size.hpp b/glm/core/type_size.hpp
new file mode 100644 (file)
index 0000000..cca4c59
--- /dev/null
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-05\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_size.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_size\r
+#define glm_core_type_size\r
+\r
+#include <cstdlib>\r
+\r
+namespace glm\r
+{\r
+       namespace core{\r
+       namespace type{\r
+       namespace scalar{\r
+\r
+       //typedef std::size_t size_t;\r
+       typedef int sizeType;\r
+\r
+       }//namespace scalar\r
+       }//namespace type\r
+       }//namespace core\r
+}//namespace glm\r
+\r
+#endif//glm_core_type_size\r
diff --git a/glm/core/type_vec1.hpp b/glm/core/type_vec1.hpp
new file mode 100644 (file)
index 0000000..95eff92
--- /dev/null
@@ -0,0 +1,254 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-25\r
+// Updated : 2008-08-31\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_vec1.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_gentype1\r
+#define glm_core_type_gentype1\r
+\r
+#include "type_float.hpp"\r
+#include "type_int.hpp"\r
+#include "type_size.hpp"\r
+#include "_swizzle.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_vec1();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tref1;\r
+               template <typename T> struct tref2;\r
+               template <typename T> struct tref3;\r
+               template <typename T> struct tref4;\r
+               template <typename T> struct tvec1;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+\r
+               template <typename valType>\r
+               struct tvec1\r
+               {\r
+                       //////////////////////////////////////\r
+                       // Typedef (Implementation details)\r
+\r
+                       typedef valType value_type;\r
+                       typedef valType& value_reference;\r
+                       typedef valType* value_pointer;\r
+                       typedef tvec1<bool> bool_type;\r
+\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static bool is_vector();\r
+\r
+                       typedef tvec1<valType> type;\r
+                       typedef tvec1<valType>* pointer;\r
+                       typedef const tvec1<valType>* const_pointer;\r
+                       typedef const tvec1<valType>*const const_pointer_const;\r
+                       typedef tvec1<valType>*const pointer_const;\r
+                       typedef tvec1<valType>& reference;\r
+                       typedef const tvec1<valType>& const_reference;\r
+                       typedef const tvec1<valType>& param_type;\r
+\r
+                       //////////////////////////////////////\r
+                       // Data\r
+\r
+#      if defined(GLM_USE_ONLY_XYZW)\r
+                       value_type x, y;\r
+#      else//GLM_USE_ONLY_XYZW\r
+                       union {value_type x, r, s;};\r
+#      endif//GLM_USE_ONLY_XYZW\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       valType& operator[](size_type i);\r
+                       valType const & operator[](size_type i) const;\r
+\r
+                       //////////////////////////////////////\r
+                       // Address (Implementation details)\r
+\r
+                       const value_type* _address() const{return (value_type*)(this);}\r
+                       value_type* _address(){return (value_type*)(this);}\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       tvec1();\r
+                       tvec1(const tvec1<valType>& v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       tvec1(valType s);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle constructors\r
+\r
+                       tvec1(const tref1<valType>& r);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion scalar constructors\r
+\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec1(U x);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion vector constructors\r
+\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec1(const tvec2<U>& v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec1(const tvec3<U>& v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec1(const tvec4<U>& v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       tvec1<valType>& operator= (const tvec1<valType>& v);\r
+\r
+                       tvec1<valType>& operator+=(valType const & s);\r
+                       tvec1<valType>& operator+=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator-=(valType const & s);\r
+                       tvec1<valType>& operator-=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator*=(valType const & s);\r
+                       tvec1<valType>& operator*=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator/=(valType const & s);\r
+                       tvec1<valType>& operator/=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator++();\r
+                       tvec1<valType>& operator--();\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary bit operators\r
+\r
+                       tvec1<valType>& operator%=(valType const & s);\r
+                       tvec1<valType>& operator%=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator&=(valType const & s);\r
+                       tvec1<valType>& operator&=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator|=(valType const & s);\r
+                       tvec1<valType>& operator|=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator^=(valType const & s);\r
+                       tvec1<valType>& operator^=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator<<=(valType const & s);\r
+                       tvec1<valType>& operator<<=(const tvec1<valType>& v);\r
+                       tvec1<valType>& operator>>=(valType const & s);\r
+                       tvec1<valType>& operator>>=(const tvec1<valType>& v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       valType swizzle(comp X) const;\r
+                       tvec2<valType> swizzle(comp X, comp Y) const;\r
+                       tvec3<valType> swizzle(comp X, comp Y, comp Z) const;\r
+                       tvec4<valType> swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       tref1<valType> swizzle(comp X);\r
+               };\r
+\r
+               template <typename T>\r
+               struct tref1\r
+               {\r
+                       tref1(T& x);\r
+                       tref1(const tref1<T>& r);\r
+                       tref1(const tvec1<T>& v);\r
+\r
+                       tref1<T>& operator= (const tref1<T>& r);\r
+                       tref1<T>& operator= (const tvec1<T>& v);\r
+\r
+                       T& x;\r
+               };\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace vector{\r
+\r
+       //////////////////////////\r
+       // Boolean definition\r
+\r
+       typedef detail::tvec1<bool>                             bvec1;\r
+\r
+       //////////////////////////\r
+       // Float definition\r
+\r
+#ifndef GLM_PRECISION \r
+       typedef detail::tvec1<mediump_float>    vec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)\r
+       typedef detail::tvec1<highp_float>              vec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)\r
+       typedef detail::tvec1<mediump_float>    vec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)\r
+       typedef detail::tvec1<lowp_float>               vec1;\r
+#else\r
+       typedef detail::tvec1<mediump_float>    vec1;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               typedef detail::tvec1<highp_float>              highp_vec1;\r
+               typedef detail::tvec1<mediump_float>    mediump_vec1;\r
+               typedef detail::tvec1<lowp_float>               lowp_vec1;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Signed integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       typedef detail::tvec1<mediump_int>              ivec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT)\r
+       typedef detail::tvec1<highp_int>                ivec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)\r
+       typedef detail::tvec1<mediump_int>              ivec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT)\r
+       typedef detail::tvec1<lowp_int>                 ivec1;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               typedef detail::tvec1<highp_int>                highp_ivec1;\r
+               typedef detail::tvec1<mediump_int>              mediump_ivec1;\r
+               typedef detail::tvec1<lowp_int>                 lowp_ivec1;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Unsigned integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       typedef detail::tvec1<mediump_uint>             uvec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)\r
+       typedef detail::tvec1<highp_uint>               uvec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)\r
+       typedef detail::tvec1<mediump_uint>             uvec1;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT)\r
+       typedef detail::tvec1<lowp_uint>                uvec1;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               typedef detail::tvec1<highp_uint>               highp_uvec1;\r
+               typedef detail::tvec1<mediump_uint>             mediump_uvec1;\r
+               typedef detail::tvec1<lowp_uint>                lowp_uvec1;\r
+       }\r
+       //namespace precision\r
+\r
+       }//namespace vector\r
+       }//namespace type\r
+       }//namespace core\r
+}//namespace glm\r
+\r
+#include "type_vec1.inl"\r
+\r
+#endif//glm_core_type_gentype1\r
diff --git a/glm/core/type_vec1.inl b/glm/core/type_vec1.inl
new file mode 100644 (file)
index 0000000..33eed0c
--- /dev/null
@@ -0,0 +1,595 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-25\r
+// Updated : 2008-09-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_vec1.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               template <typename valType>\r
+               typename tvec1<valType>::size_type tvec1<valType>::value_size()\r
+               {\r
+                       return typename tvec1<valType>::size_type(1);\r
+               }\r
+\r
+               template <typename valType> \r
+               bool tvec1<valType>::is_vector()\r
+               {\r
+                       return true;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Accesses\r
+\r
+               template <typename valType>\r
+               valType& tvec1<valType>::operator[](typename tvec1<valType>::size_type i)\r
+               {\r
+                       assert( i >= typename tvec1<valType>::size_type(0) && \r
+                                       i < tvec1<valType>::value_size());\r
+                       return (&x)[i];\r
+               }\r
+\r
+               template <typename valType>\r
+               valType const & tvec1<valType>::operator[](typename tvec1<valType>::size_type i) const\r
+               {\r
+                       assert( i >= typename tvec1<valType>::size_type(0) && \r
+                                       i < tvec1<valType>::value_size());\r
+                       return (&x)[i];\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Implicit basic constructors\r
+\r
+               template <typename valType>\r
+               tvec1<valType>::tvec1() :\r
+                       x(valType(0))\r
+               {}\r
+\r
+               template <typename valType>\r
+               tvec1<valType>::tvec1(const tvec1<valType>& v) :\r
+                       x(v.x)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Explicit basic constructors\r
+\r
+               template <typename valType>\r
+               tvec1<valType>::tvec1(valType s) :\r
+                       x(s)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle constructors\r
+\r
+               template <typename valType>\r
+               tvec1<valType>::tvec1(const tref1<valType>& r) :\r
+                       x(r.x)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion scalar constructors\r
+               \r
+               template <typename valType>\r
+               template <typename U> \r
+               tvec1<valType>::tvec1(U x) :\r
+                       x(valType(x))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion vector constructors\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               tvec1<valType>::tvec1(const tvec2<U>& v) :\r
+                       x(valType(v.x))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               tvec1<valType>::tvec1(const tvec3<U>& v) :\r
+                       x(valType(v.x))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               tvec1<valType>::tvec1(const tvec4<U>& v) :\r
+                       x(valType(v.x))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Unary arithmetic operators\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator= (const tvec1<valType>& v)\r
+               {\r
+                       this->x = v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator+=(valType const & s)\r
+               {\r
+                       this->x += s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator+=(const tvec1<valType>& v)\r
+               {\r
+                       this->x += v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator-=(valType const & s)\r
+               {\r
+                       this->x -= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator-=(const tvec1<valType>& v)\r
+               {\r
+                       this->x -= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator*=(valType const & s)\r
+               {\r
+                       this->x *= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator*=(const tvec1<valType>& v)\r
+               {\r
+                       this->x *= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator/=(valType const & s)\r
+               {\r
+                       this->x /= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator/=(const tvec1<valType>& v)\r
+               {\r
+                       this->x /= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator++()\r
+               {\r
+                       ++this->x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator--()\r
+               {\r
+                       --this->x;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Unary bit operators\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator%=(valType const & s)\r
+               {\r
+                       this->x %= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator%=(const tvec1<valType>& v)\r
+               {\r
+                       this->x %= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator&=(valType const & s)\r
+               {\r
+                       this->x &= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator&=(const tvec1<valType>& v)\r
+               {\r
+                       this->x &= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator|=(valType const & s)\r
+               {\r
+                       this->x |= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator|=(const tvec1<valType>& v)\r
+               {\r
+                       this->x |= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator^=(valType const & s)\r
+               {\r
+                       this->x ^= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator^=(const tvec1<valType>& v)\r
+               {\r
+                       this->x ^= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator<<=(valType const & s)\r
+               {\r
+                       this->x <<= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator<<=(const tvec1<valType>& v)\r
+               {\r
+                       this->x <<= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator>>=(valType const & s)\r
+               {\r
+                       this->x >>= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec1<valType>& tvec1<valType>::operator>>=(const tvec1<valType>& v)\r
+               {\r
+                       this->x >>= v.x;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle operators\r
+\r
+               template <typename valType>\r
+               valType tvec1<valType>::swizzle(comp x) const\r
+               {\r
+                       return (*this)[x];\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec2<valType> tvec1<valType>::swizzle(comp x, comp y) const\r
+               {\r
+                       return tvec2<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y]);\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec3<valType> tvec1<valType>::swizzle(comp x, comp y, comp z) const\r
+               {\r
+                       return tvec3<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z]);\r
+               }\r
+\r
+               template <typename valType>\r
+               tvec4<valType> tvec1<valType>::swizzle(comp x, comp y, comp z, comp w) const\r
+               {\r
+                       return tvec4<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z],\r
+                               (*this)[w]);\r
+               }\r
+\r
+               template <typename valType>\r
+               tref1<valType> tvec1<valType>::swizzle(comp x)\r
+               {\r
+                       return tref1<valType>(\r
+                               (*this)[x]);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary arithmetic operators\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator+ (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x + s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator+ (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s + v.x);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator+ (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x + v2.x);\r
+               }\r
+\r
+               //operator-\r
+               template <typename T> \r
+               inline tvec1<T> operator- (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x - s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator- (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s - v.x);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator- (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x - v2.x);\r
+               }\r
+\r
+               //operator*\r
+               template <typename T> \r
+               inline tvec1<T> operator* (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x * s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator* (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s * v.x);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator* (const tvec1<T>& v1, const tvec1<T> & v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x * v2.x);\r
+               }\r
+\r
+               //operator/\r
+               template <typename T> \r
+               inline tvec1<T> operator/ (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x / s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator/ (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s / v.x);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator/ (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x / v2.x);\r
+               }\r
+\r
+               // Unary constant operators\r
+               template <typename T> \r
+               inline tvec1<T> operator- (const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               -v.x);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator++ (const tvec1<T>& v, int)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x + T(1));\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator-- (const tvec1<T>& v, int)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x - T(1));\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary bit operators\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator% (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x % s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator% (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s % v.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator% (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x % v2.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator& (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x & s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator& (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s & v.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator& (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x & v2.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator| (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x | s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator| (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s | v.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator| (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x | v2.x);\r
+               }\r
+               \r
+               template <typename T>\r
+               inline tvec1<T> operator^ (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x ^ s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator^ (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s ^ v.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator^ (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x ^ v2.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator<< (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x << s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator<< (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s << v.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator<< (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x << v2.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator>> (const tvec1<T>& v, T const & s)\r
+               {\r
+                       return tvec1<T>(\r
+                               v.x >> s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator>> (T const & s, const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               s >> v.x);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec1<T> operator>> (const tvec1<T>& v1, const tvec1<T>& v2)\r
+               {\r
+                       return tvec1<T>(\r
+                               v1.x >> v2.x);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec1<T> operator~ (const tvec1<T>& v)\r
+               {\r
+                       return tvec1<T>(\r
+                               ~v.x);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // tref definition\r
+\r
+               template <typename T> \r
+               tref1<T>::tref1(T& x) :\r
+                       x(x)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref1<T>::tref1(const tref1<T>& r) :\r
+                       x(r.x)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref1<T>::tref1(const tvec1<T>& v) :\r
+                       x(v.x)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref1<T>& tref1<T>::operator= (const tref1<T>& r)\r
+               {\r
+                       x = r.x;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename T> \r
+               tref1<T>& tref1<T>::operator= (const tvec1<T>& v)\r
+               {\r
+                       x = v.x;\r
+                       return *this;\r
+               }\r
+\r
+       }//namespace detail\r
+}//namespace glm\r
diff --git a/glm/core/type_vec2.hpp b/glm/core/type_vec2.hpp
new file mode 100644 (file)
index 0000000..f6d3815
--- /dev/null
@@ -0,0 +1,311 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-18\r
+// Updated : 2008-08-31\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_tvec2.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_gentype2\r
+#define glm_core_type_gentype2\r
+\r
+#include "type_float.hpp"\r
+#include "type_int.hpp"\r
+#include "type_size.hpp"\r
+#include "_swizzle.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_vec2();\r
+       }\r
+       //namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tref2;\r
+               template <typename T> struct tref3;\r
+               template <typename T> struct tref4;\r
+               template <typename T> struct tvec3;\r
+               template <typename T> struct tvec4;\r
+\r
+               template <typename valType>\r
+               struct tvec2\r
+               {\r
+                       //////////////////////////////////////\r
+                       // Typedef (Implementation details)\r
+\r
+                       typedef valType value_type;\r
+                       typedef valType& value_reference;\r
+                       typedef valType* value_pointer;\r
+                       typedef tvec2<bool> bool_type;\r
+\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static bool is_vector();\r
+\r
+                       typedef tvec2<valType> type;\r
+                       typedef tvec2<valType>* pointer;\r
+                       typedef const tvec2<valType>* const_pointer;\r
+                       typedef const tvec2<valType>*const const_pointer_const;\r
+                       typedef tvec2<valType>*const pointer_const;\r
+                       typedef tvec2<valType>& reference;\r
+                       typedef const tvec2<valType>& const_reference;\r
+                       typedef const tvec2<valType>& param_type;\r
+\r
+                       //////////////////////////////////////\r
+                       // Data\r
+\r
+#      if defined(GLM_USE_ONLY_XYZW)\r
+                       value_type x, y;\r
+#      else//GLM_USE_ONLY_XYZW\r
+#              ifdef GLM_USE_ANONYMOUS_UNION\r
+                       union \r
+                       {\r
+                               struct{value_type x, y;};\r
+                               struct{value_type r, g;};\r
+                               struct{value_type s, t;};\r
+                       };\r
+#              else//GLM_USE_ANONYMOUS_UNION\r
+                       union {value_type x, r, s;};\r
+                       union {value_type y, g, t;};\r
+#              endif//GLM_USE_ANONYMOUS_UNION\r
+#      endif//GLM_USE_ONLY_XYZW\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       valType & operator[](size_type i);\r
+                       valType const & operator[](size_type i) const;\r
+\r
+                       //////////////////////////////////////\r
+                       // Address (Implementation details)\r
+\r
+                       value_type const * const _address() const{return (value_type*)(this);}\r
+                       value_type * _address(){return (value_type*)(this);}\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       tvec2();\r
+                       tvec2(tvec2<valType> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       explicit tvec2(valType s);\r
+                       explicit tvec2(valType s1, valType s2);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle constructors\r
+\r
+                       tvec2(tref2<valType> const & r);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion scalar constructors\r
+\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(U x);\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U, typename V> \r
+                       explicit tvec2(U x, V y);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion vector constructors\r
+\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(tvec2<U> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(tvec3<U> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(tvec4<U> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       tvec2<valType>& operator= (tvec2<valType> const & v);\r
+\r
+                       tvec2<valType>& operator+=(valType const & s);\r
+                       tvec2<valType>& operator+=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator-=(valType const & s);\r
+                       tvec2<valType>& operator-=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator*=(valType const & s);\r
+                       tvec2<valType>& operator*=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator/=(valType const & s);\r
+                       tvec2<valType>& operator/=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator++();\r
+                       tvec2<valType>& operator--();\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary bit operators\r
+\r
+                       tvec2<valType>& operator%=(valType const & s);\r
+                       tvec2<valType>& operator%=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator&=(valType const & s);\r
+                       tvec2<valType>& operator&=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator|=(valType const & s);\r
+                       tvec2<valType>& operator|=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator^=(valType const & s);\r
+                       tvec2<valType>& operator^=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator<<=(valType const & s);\r
+                       tvec2<valType>& operator<<=(tvec2<valType> const & v);\r
+                       tvec2<valType>& operator>>=(valType const & s);\r
+                       tvec2<valType>& operator>>=(tvec2<valType> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       valType swizzle(comp X) const;\r
+                       tvec2<valType> swizzle(comp X, comp Y) const;\r
+                       tvec3<valType> swizzle(comp X, comp Y, comp Z) const;\r
+                       tvec4<valType> swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       tref2<valType> swizzle(comp X, comp Y);\r
+               };\r
+\r
+//             tvec2<glm::detail::thalf>::tvec2<glm::detail::thalf><float,float>(float x, float y) :\r
+//                     x(detail::thalf(x)),\r
+//                     y(detail::thalf(y))\r
+//             {}\r
+\r
+               template <typename T>\r
+               struct tref2\r
+               {\r
+                       tref2(T& x, T& y);\r
+                       tref2(tref2<T> const & r);\r
+                       tref2(tvec2<T> const & v);\r
+\r
+                       tref2<T>& operator= (tref2<T> const & r);\r
+                       tref2<T>& operator= (tvec2<T> const & v);\r
+\r
+                       T& x;\r
+                       T& y;\r
+               };\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace vector{\r
+\r
+       //////////////////////////\r
+       // Boolean definition\r
+\r
+       //! 2 components vector of boolean. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec2<bool>                             bvec2;\r
+\r
+       //////////////////////////\r
+       // Float definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 2 components vector of floating-point numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec2<mediump_float>    vec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)\r
+       typedef detail::tvec2<highp_float>              vec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)\r
+       typedef detail::tvec2<mediump_float>    vec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)\r
+       typedef detail::tvec2<lowp_float>               vec2;\r
+#else\r
+       typedef detail::tvec2<mediump_float>    vec2;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 2 components vector of high precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec2<highp_float>              highp_vec2;\r
+               //! 2 components vector of medium precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec2<mediump_float>    mediump_vec2;\r
+               //! 2 components vector of low precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec2<lowp_float>               lowp_vec2;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Signed integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! \brief 2 components vector of signed integer numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec2<mediump_int>              ivec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT)\r
+       typedef detail::tvec2<highp_int>                ivec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)\r
+       typedef detail::tvec2<mediump_int>              ivec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT)\r
+       typedef detail::tvec2<lowp_int>                 ivec2;\r
+#else\r
+       typedef detail::tvec2<mediump_int>              ivec2;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 2 components vector of high precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec2<highp_int>                highp_ivec2;\r
+               //! 2 components vector of medium precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec2<mediump_int>              mediump_ivec2;\r
+               //! 2 components vector of low precision signed integer numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec2<lowp_int>                 lowp_ivec2;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Unsigned integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 2 components vector of unsigned integer numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec2<mediump_uint>             uvec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)\r
+       typedef detail::tvec2<highp_uint>               uvec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)\r
+       typedef detail::tvec2<mediump_uint>             uvec2;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT)\r
+       typedef detail::tvec2<lowp_uint>                uvec2;\r
+#else\r
+       typedef detail::tvec2<mediump_uint>             uvec2;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 2 components vector of high precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec2<highp_uint>               highp_uvec2;\r
+               //! 2 components vector of medium precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec2<mediump_uint>             mediump_uvec2;\r
+               //! 2 components vector of low precision unsigned integer numbers.\r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec2<lowp_uint>                lowp_uvec2;\r
+       }\r
+       //namespace precision\r
+\r
+       }//namespace vector\r
+       }//namespace type\r
+       }//namespace core\r
+}//namespace glm\r
+\r
+#include "type_vec2.inl"\r
+\r
+#endif//glm_core_type_gentype2\r
diff --git a/glm/core/type_vec2.inl b/glm/core/type_vec2.inl
new file mode 100644 (file)
index 0000000..ade2c03
--- /dev/null
@@ -0,0 +1,679 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-18\r
+// Updated : 2008-09-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_tvec2.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               template <typename valType>\r
+               typename tvec2<valType>::size_type tvec2<valType>::value_size()\r
+               {\r
+                       return typename tvec2<valType>::size_type(2);\r
+               }\r
+\r
+               template <typename valType> \r
+               bool tvec2<valType>::is_vector()\r
+               {\r
+                       return true;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Accesses\r
+\r
+               template <typename valType>\r
+               inline valType& tvec2<valType>::operator[](typename tvec2<valType>::size_type i)\r
+               {\r
+                       assert( i >= typename tvec2<valType>::size_type(0) && \r
+                                       i < tvec2<valType>::value_size());\r
+                       return (&x)[i];\r
+               }\r
+\r
+               template <typename valType>\r
+               inline valType const & tvec2<valType>::operator[](typename tvec2<valType>::size_type i) const\r
+               {\r
+                       assert( i >= typename tvec2<valType>::size_type(0) && \r
+                                       i < tvec2<valType>::value_size());\r
+                       return (&x)[i];\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Implicit basic constructors\r
+\r
+               template <typename Type>\r
+               inline tvec2<Type>::tvec2() :\r
+                       x(Type(0)),\r
+                       y(Type(0))\r
+               {}\r
+\r
+               template <typename Type>\r
+               inline tvec2<Type>::tvec2(tvec2<Type> const & v) :\r
+                       x(v.x),\r
+                       y(v.y)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Explicit basic constructors\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>::tvec2(valType s) :\r
+                       x(s),\r
+                       y(s)\r
+               {}\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>::tvec2(valType s1, valType s2) :\r
+                       x(s1),\r
+                       y(s2)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle constructors\r
+\r
+               template <typename Type>\r
+               inline tvec2<Type>::tvec2(tref2<Type> const & r) :\r
+                       x(r.x),\r
+                       y(r.y)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion scalar constructors\r
+               \r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec2<valType>::tvec2(U x) :\r
+                       x(valType(x)),\r
+                       y(valType(x))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U, typename V> \r
+               inline tvec2<valType>::tvec2(U x, V y) :\r
+                       x(valType(x)),\r
+                       y(valType(y))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion vector constructors\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec2<valType>::tvec2(tvec2<U> const & v) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec2<valType>::tvec2(tvec3<U> const & v) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec2<valType>::tvec2(tvec4<U> const & v) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Unary arithmetic operators\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator= (tvec2<valType> const & v)\r
+               {\r
+                       this->x = v.x;\r
+                       this->y = v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator+=(valType const & s)\r
+               {\r
+                       this->x += s;\r
+                       this->y += s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator+=(tvec2<valType> const & v)\r
+               {\r
+                       this->x += v.x;\r
+                       this->y += v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator-=(valType const & s)\r
+               {\r
+                       this->x -= s;\r
+                       this->y -= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator-=(tvec2<valType> const & v)\r
+               {\r
+                       this->x -= v.x;\r
+                       this->y -= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator*=(valType const & s)\r
+               {\r
+                       this->x *= s;\r
+                       this->y *= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator*=(tvec2<valType> const & v)\r
+               {\r
+                       this->x *= v.x;\r
+                       this->y *= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator/=(valType const & s)\r
+               {\r
+                       this->x /= s;\r
+                       this->y /= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator/=(tvec2<valType> const & v)\r
+               {\r
+                       this->x /= v.x;\r
+                       this->y /= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator++()\r
+               {\r
+                       ++this->x;\r
+                       ++this->y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator--()\r
+               {\r
+                       --this->x;\r
+                       --this->y;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Unary bit operators\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator%=(valType const & s)\r
+               {\r
+                       this->x %= s;\r
+                       this->y %= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator%=(tvec2<valType> const & v)\r
+               {\r
+                       this->x %= v.x;\r
+                       this->y %= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator&=(valType const & s)\r
+               {\r
+                       this->x &= s;\r
+                       this->y &= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator&=(tvec2<valType> const & v)\r
+               {\r
+                       this->x &= v.x;\r
+                       this->y &= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator|=(valType const & s)\r
+               {\r
+                       this->x |= s;\r
+                       this->y |= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator|=(tvec2<valType> const & v)\r
+               {\r
+                       this->x |= v.x;\r
+                       this->y |= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator^=(valType const & s)\r
+               {\r
+                       this->x ^= s;\r
+                       this->y ^= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator^=(tvec2<valType> const & v)\r
+               {\r
+                       this->x ^= v.x;\r
+                       this->y ^= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator<<=(valType const & s)\r
+               {\r
+                       this->x <<= s;\r
+                       this->y <<= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator<<=(tvec2<valType> const & v)\r
+               {\r
+                       this->x <<= v.x;\r
+                       this->y <<= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator>>=(valType const & s)\r
+               {\r
+                       this->x >>= s;\r
+                       this->y >>= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType>& tvec2<valType>::operator>>=(tvec2<valType> const & v)\r
+               {\r
+                       this->x >>= v.x;\r
+                       this->y >>= v.y;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle operators\r
+\r
+               template <typename valType>\r
+               inline valType tvec2<valType>::swizzle(comp x) const\r
+               {\r
+                       return (*this)[x];\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType> tvec2<valType>::swizzle(comp x, comp y) const\r
+               {\r
+                       return tvec2<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType> tvec2<valType>::swizzle(comp x, comp y, comp z) const\r
+               {\r
+                       return tvec3<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType> tvec2<valType>::swizzle(comp x, comp y, comp z, comp w) const\r
+               {\r
+                       return tvec4<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z],\r
+                               (*this)[w]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tref2<valType> tvec2<valType>::swizzle(comp x, comp y)\r
+               {\r
+                       return tref2<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y]);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary arithmetic operators\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator+ (tvec2<T> const & v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x + s,\r
+                               v.y + s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator+ (T const & s, tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s + v.x,\r
+                               s + v.y);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator+ (tvec2<T> const & v1, tvec2<T> const & v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x + v2.x,\r
+                               v1.y + v2.y);\r
+               }\r
+\r
+               //operator-\r
+               template <typename T> \r
+               inline tvec2<T> operator- (tvec2<T> const & v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x - s,\r
+                               v.y - s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator- (T const & s, tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s - v.x,\r
+                               s - v.y);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator- (tvec2<T> const & v1, tvec2<T> const & v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x - v2.x,\r
+                               v1.y - v2.y);\r
+               }\r
+\r
+               //operator*\r
+               template <typename T> \r
+               inline tvec2<T> operator* (tvec2<T> const & v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x * s,\r
+                               v.y * s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator* (T const & s, tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s * v.x,\r
+                               s * v.y);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator* (tvec2<T> const & v1, tvec2<T> const & v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x * v2.x,\r
+                               v1.y * v2.y);\r
+               }\r
+\r
+               //operator/\r
+               template <typename T> \r
+               inline tvec2<T> operator/ (tvec2<T> const & v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x / s,\r
+                               v.y / s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator/ (T const & s, tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s / v.x,\r
+                               s / v.y);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator/ (tvec2<T> const & v1, tvec2<T> const & v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x / v2.x,\r
+                               v1.y / v2.y);\r
+               }\r
+\r
+               // Unary constant operators\r
+               template <typename T> \r
+               inline tvec2<T> operator- (tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               -v.x, \r
+                               -v.y);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator++ (tvec2<T> const & v, int)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x + T(1), \r
+                               v.y + T(1));\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator-- (tvec2<T> const & v, int)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x - T(1), \r
+                               v.y - T(1));\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary bit operators\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator% (tvec2<T> const & v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x % s,\r
+                               v.y % s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator% (T const & s, tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s % v.x,\r
+                               s % v.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator% (tvec2<T> const & v1, tvec2<T> const & v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x % v2.x,\r
+                               v1.y % v2.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator& (tvec2<T> const & v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x & s,\r
+                               v.y & s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator& (T const & s, tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s & v.x,\r
+                               s & v.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator& (tvec2<T> const & v1, tvec2<T> const & v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x & v2.x,\r
+                               v1.y & v2.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator| (tvec2<T> const & v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x | s,\r
+                               v.y | s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator| (T const & s, tvec2<T> const & v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s | v.x,\r
+                               s | v.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator| (const tvec2<T>& v1, const tvec2<T>& v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x | v2.x,\r
+                               v1.y | v2.y);\r
+               }\r
+               \r
+               template <typename T>\r
+               inline tvec2<T> operator^ (const tvec2<T>& v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x ^ s,\r
+                               v.y ^ s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator^ (T const & s, const tvec2<T>& v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s ^ v.x,\r
+                               s ^ v.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator^ (const tvec2<T>& v1, const tvec2<T>& v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x ^ v2.x,\r
+                               v1.y ^ v2.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator<< (const tvec2<T>& v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x << s,\r
+                               v.y << s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator<< (T const & s, const tvec2<T>& v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s << v.x,\r
+                               s << v.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator<< (const tvec2<T>& v1, const tvec2<T>& v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x << v2.x,\r
+                               v1.y << v2.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator>> (const tvec2<T>& v, T const & s)\r
+               {\r
+                       return tvec2<T>(\r
+                               v.x >> s,\r
+                               v.y >> s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator>> (T const & s, const tvec2<T>& v)\r
+               {\r
+                       return tvec2<T>(\r
+                               s >> v.x,\r
+                               s >> v.y);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec2<T> operator>> (const tvec2<T>& v1, const tvec2<T>& v2)\r
+               {\r
+                       return tvec2<T>(\r
+                               v1.x >> v2.x,\r
+                               v1.y >> v2.y);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec2<T> operator~ (const tvec2<T>& v)\r
+               {\r
+                       return tvec2<T>(\r
+                               ~v.x,\r
+                               ~v.y);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // tref definition\r
+\r
+               template <typename T> \r
+               tref2<T>::tref2(T& x, T& y) :\r
+                       x(x),\r
+                       y(y)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref2<T>::tref2(const tref2<T>& r) :\r
+                       x(r.x),\r
+                       y(r.y)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref2<T>::tref2(const tvec2<T>& v) :\r
+                       x(v.x),\r
+                       y(v.y)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref2<T>& tref2<T>::operator= (const tref2<T>& r)\r
+               {\r
+                       x = r.x;\r
+                       y = r.y;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename T> \r
+               tref2<T>& tref2<T>::operator= (const tvec2<T>& v)\r
+               {\r
+                       x = v.x;\r
+                       y = v.y;\r
+                       return *this;\r
+               }\r
+\r
+       }//namespace detail\r
+}//namespace glm\r
diff --git a/glm/core/type_vec3.hpp b/glm/core/type_vec3.hpp
new file mode 100644 (file)
index 0000000..e81d751
--- /dev/null
@@ -0,0 +1,310 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-22\r
+// Updated : 2008-08-31\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_tvec3.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_gentype3\r
+#define glm_core_type_gentype3\r
+\r
+#include "type_float.hpp"\r
+#include "type_int.hpp"\r
+#include "type_size.hpp"\r
+#include "_swizzle.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_vec3();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tref2;\r
+               template <typename T> struct tref3;\r
+               template <typename T> struct tref4;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec4;\r
+\r
+               template <typename valType>\r
+               struct tvec3\r
+               {\r
+                       //////////////////////////////////////\r
+                       // Typedef (Implementation details)\r
+\r
+                       typedef valType value_type;\r
+                       typedef valType& value_reference;\r
+                       typedef valType* value_pointer;\r
+                       typedef tvec3<bool> bool_type;\r
+\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static bool is_vector();\r
+\r
+                       typedef tvec3<valType> type;\r
+                       typedef tvec3<valType>* pointer;\r
+                       typedef tvec3<valType> const * const_pointer;\r
+                       typedef tvec3<valType> const * const const_pointer_const;\r
+                       typedef tvec3<valType> * const pointer_const;\r
+                       typedef tvec3<valType>& reference;\r
+                       typedef tvec3<valType> const & const_reference;\r
+                       typedef tvec3<valType> const & param_type;\r
+\r
+                       //////////////////////////////////////\r
+                       // Data\r
+\r
+#      if defined(GLM_USE_ONLY_XYZW)\r
+                       value_type x, y, z;\r
+#      else//GLM_USE_ONLY_XYZW\r
+#              ifdef GLM_USE_ANONYMOUS_UNION\r
+                       union \r
+                       {\r
+                               struct{value_type x, y, z;};\r
+                               struct{value_type r, g, b;};\r
+                               struct{value_type s, t, p;};\r
+                       };\r
+#              else//GLM_USE_ANONYMOUS_UNION\r
+                       union {value_type x, r, s;};\r
+                       union {value_type y, g, t;};\r
+                       union {value_type z, b, p;};\r
+#              endif//GLM_USE_ANONYMOUS_UNION\r
+#      endif//GLM_USE_ONLY_XYZW\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       valType & operator[](size_type i);\r
+                       valType const & operator[](size_type i) const;\r
+\r
+                       //////////////////////////////////////\r
+                       // Address (Implementation details)\r
+\r
+                       value_type const * _address() const{return (value_type*)(this);}\r
+                       value_type* _address(){return (value_type*)(this);}\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       tvec3();\r
+                       tvec3(tvec3<valType> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       explicit tvec3(valType s);\r
+                       explicit tvec3(valType s1, valType s2, valType s3);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle constructors\r
+\r
+                       tvec3(tref3<valType> const & r);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion scalar constructors\r
+\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec3(U x);\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U, typename V, typename W> \r
+                       explicit tvec3(U x, V y, W z);                  \r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion vector constructors\r
+\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec3(tvec2<A> const & v, B s);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec3(A s, tvec2<B> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec3(tvec3<U> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec3(tvec4<U> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       tvec3<valType>& operator= (tvec3<valType> const & v);\r
+\r
+                       tvec3<valType>& operator+=(valType const & s);\r
+                       tvec3<valType>& operator+=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator-=(valType const & s);\r
+                       tvec3<valType>& operator-=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator*=(valType const & s);\r
+                       tvec3<valType>& operator*=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator/=(valType const & s);\r
+                       tvec3<valType>& operator/=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator++();\r
+                       tvec3<valType>& operator--();\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary bit operators\r
+\r
+                       tvec3<valType>& operator%=(valType const & s);\r
+                       tvec3<valType>& operator%=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator&=(valType const & s);\r
+                       tvec3<valType>& operator&=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator|=(valType const & s);\r
+                       tvec3<valType>& operator|=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator^=(valType const & s);\r
+                       tvec3<valType>& operator^=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator<<=(valType const & s);\r
+                       tvec3<valType>& operator<<=(tvec3<valType> const & v);\r
+                       tvec3<valType>& operator>>=(valType const & s);\r
+                       tvec3<valType>& operator>>=(tvec3<valType> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       valType swizzle(comp X) const;\r
+                       tvec2<valType> swizzle(comp X, comp Y) const;\r
+                       tvec3<valType> swizzle(comp X, comp Y, comp Z) const;\r
+                       tvec4<valType> swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       tref3<valType> swizzle(comp X, comp Y, comp Z);\r
+               };\r
+\r
+               template <typename T>\r
+               struct tref3\r
+               {\r
+                       tref3(T& x, T& y, T& z);\r
+                       tref3(tref3<T> const & r);\r
+                       tref3(tvec3<T> const & v);\r
+\r
+                       tref3<T>& operator= (tref3<T> const & r);\r
+                       tref3<T>& operator= (tvec3<T> const & v);\r
+\r
+                       T& x;\r
+                       T& y;\r
+                       T& z;\r
+               };\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace vector{\r
+\r
+       //////////////////////////\r
+       // Boolean definition\r
+\r
+       //! 3 components vector of boolean. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec3<bool>                             bvec3;\r
+\r
+       //////////////////////////\r
+       // Float definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 3 components vector of floating-point numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec3<mediump_float>    vec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)\r
+       typedef detail::tvec3<highp_float>              vec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)\r
+       typedef detail::tvec3<mediump_float>    vec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)\r
+       typedef detail::tvec3<lowp_float>               vec3;\r
+#else\r
+       typedef detail::tvec3<mediump_float>    vec3;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 3 components vector of high precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec3<highp_float>              highp_vec3;\r
+               //! 3 components vector of medium precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec3<mediump_float>    mediump_vec3;\r
+               //! 3 components vector of low precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec3<lowp_float>               lowp_vec3;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Signed integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 3 components vector of signed integer numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec3<mediump_int>              ivec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT)\r
+       typedef detail::tvec3<highp_int>                ivec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)\r
+       typedef detail::tvec3<mediump_int>              ivec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT)\r
+       typedef detail::tvec3<lowp_int>                 ivec3;\r
+#else\r
+       typedef detail::tvec3<mediump_int>              ivec3;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 3 components vector of high precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec3<highp_int>                highp_ivec3;\r
+               //! 3 components vector of medium precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec3<mediump_int>              mediump_ivec3;\r
+               //! 3 components vector of low precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec3<lowp_int>                 lowp_ivec3;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Unsigned integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 3 components vector of unsigned integer numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec3<mediump_uint>             uvec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)\r
+       typedef detail::tvec3<highp_uint>               uvec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)\r
+       typedef detail::tvec3<mediump_uint>             uvec3;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT)\r
+       typedef detail::tvec3<lowp_uint>                uvec3;\r
+#else\r
+       typedef detail::tvec3<mediump_uint>             uvec3;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 3 components vector of high precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec3<highp_uint>               highp_uvec3;\r
+               //! 3 components vector of medium precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec3<mediump_uint>             mediump_uvec3;\r
+               //! 3 components vector of low precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec3<lowp_uint>                lowp_uvec3;\r
+       }\r
+       //namespace precision\r
+               \r
+       }//namespace vector\r
+       }//namespace type\r
+       }//namespace core\r
+}//namespace glm\r
+\r
+#include "type_vec3.inl"\r
+\r
+#endif//glm_core_type_gentype3\r
diff --git a/glm/core/type_vec3.inl b/glm/core/type_vec3.inl
new file mode 100644 (file)
index 0000000..d0360e7
--- /dev/null
@@ -0,0 +1,762 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-22\r
+// Updated : 2008-09-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_tvec3.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               template <typename valType>\r
+               typename tvec3<valType>::size_type tvec3<valType>::value_size()\r
+               {\r
+                       return typename tvec3<valType>::size_type(3);\r
+               }\r
+\r
+               template <typename valType> \r
+               bool tvec3<valType>::is_vector()\r
+               {\r
+                       return true;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Accesses\r
+\r
+               template <typename valType>\r
+               inline valType& tvec3<valType>::operator[](typename tvec3<valType>::size_type i)\r
+               {\r
+                       assert( i >= typename tvec3<valType>::size_type(0) && \r
+                                       i < tvec3<valType>::value_size());\r
+\r
+                       return (&x)[i];\r
+               }\r
+\r
+               template <typename valType>\r
+               inline valType const & tvec3<valType>::operator[](typename tvec3<valType>::size_type i) const\r
+               {\r
+                       assert( i >= typename tvec3<valType>::size_type(0) && \r
+                                       i < tvec3<valType>::value_size());\r
+\r
+                       return (&x)[i];\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Implicit basic constructors\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>::tvec3() :\r
+                       x(valType(0)),\r
+                       y(valType(0)),\r
+                       z(valType(0))\r
+               {}\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>::tvec3(const tvec3<valType>& v) :\r
+                       x(v.x),\r
+                       y(v.y),\r
+                       z(v.z)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Explicit basic constructors\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>::tvec3(valType s) :\r
+                       x(s),\r
+                       y(s),\r
+                       z(s)\r
+               {}\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>::tvec3(valType s0, valType s1, valType s2) :\r
+                       x(s0),\r
+                       y(s1),\r
+                       z(s2)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle constructors\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>::tvec3(const tref3<valType>& r) :\r
+                       x(r.x),\r
+                       y(r.y),\r
+                       z(r.z)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion scalar constructors\r
+               \r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec3<valType>::tvec3(U x) :\r
+                       x(valType(x)),\r
+                       y(valType(x)),\r
+                       z(valType(x))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B, typename C> \r
+               inline tvec3<valType>::tvec3(A x, B y, C z) :\r
+                       x(valType(x)),\r
+                       y(valType(y)),\r
+                       z(valType(z))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion vector constructors\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B> \r
+               inline tvec3<valType>::tvec3(const tvec2<A>& v, B s) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y)),\r
+                       z(valType(s))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B> \r
+               inline tvec3<valType>::tvec3(A s, const tvec2<B>& v) :\r
+                       x(valType(s)),\r
+                       y(valType(v.x)),\r
+                       z(valType(v.y))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec3<valType>::tvec3(const tvec3<U>& v) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y)),\r
+                       z(valType(v.z))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec3<valType>::tvec3(const tvec4<U>& v) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y)),\r
+                       z(valType(v.z))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Unary arithmetic operators\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator= (const tvec3<valType>& v)\r
+               {\r
+                       this->x = v.x;\r
+                       this->y = v.y;\r
+                       this->z = v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator+=(valType const & s)\r
+               {\r
+                       this->x += s;\r
+                       this->y += s;\r
+                       this->z += s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator+=(const tvec3<valType>& v)\r
+               {\r
+                       this->x += v.x;\r
+                       this->y += v.y;\r
+                       this->z += v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator-=(valType const & s)\r
+               {\r
+                       this->x -= s;\r
+                       this->y -= s;\r
+                       this->z -= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator-=(const tvec3<valType>& v)\r
+               {\r
+                       this->x -= v.x;\r
+                       this->y -= v.y;\r
+                       this->z -= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator*=(valType const & s)\r
+               {\r
+                       this->x *= s;\r
+                       this->y *= s;\r
+                       this->z *= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator*=(const tvec3<valType>& v)\r
+               {\r
+                       this->x *= v.x;\r
+                       this->y *= v.y;\r
+                       this->z *= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator/=(valType const & s)\r
+               {\r
+                       this->x /= s;\r
+                       this->y /= s;\r
+                       this->z /= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator/=(const tvec3<valType>& v)\r
+               {\r
+                       this->x /= v.x;\r
+                       this->y /= v.y;\r
+                       this->z /= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator++()\r
+               {\r
+                       ++this->x;\r
+                       ++this->y;\r
+                       ++this->z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator--()\r
+               {\r
+                       --this->x;\r
+                       --this->y;\r
+                       --this->z;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Unary bit operators\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator%=(valType const & s)\r
+               {\r
+                       this->x %= s;\r
+                       this->y %= s;\r
+                       this->z %= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator%=(const tvec3<valType>& v)\r
+               {\r
+                       this->x %= v.x;\r
+                       this->y %= v.y;\r
+                       this->z %= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator&=(valType const & s)\r
+               {\r
+                       this->x &= s;\r
+                       this->y &= s;\r
+                       this->z &= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator&=(const tvec3<valType>& v)\r
+               {\r
+                       this->x &= v.x;\r
+                       this->y &= v.y;\r
+                       this->z &= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator|=(valType const & s)\r
+               {\r
+                       this->x |= s;\r
+                       this->y |= s;\r
+                       this->z |= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator|=(const tvec3<valType>& v)\r
+               {\r
+                       this->x |= v.x;\r
+                       this->y |= v.y;\r
+                       this->z |= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator^=(valType const & s)\r
+               {\r
+                       this->x ^= s;\r
+                       this->y ^= s;\r
+                       this->z ^= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator^=(const tvec3<valType>& v)\r
+               {\r
+                       this->x ^= v.x;\r
+                       this->y ^= v.y;\r
+                       this->z ^= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator<<=(valType const & s)\r
+               {\r
+                       this->x <<= s;\r
+                       this->y <<= s;\r
+                       this->z <<= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator<<=(const tvec3<valType>& v)\r
+               {\r
+                       this->x <<= v.x;\r
+                       this->y <<= v.y;\r
+                       this->z <<= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator>>=(valType const & s)\r
+               {\r
+                       this->x >>= s;\r
+                       this->y >>= s;\r
+                       this->z >>= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType>& tvec3<valType>::operator>>=(const tvec3<valType>& v)\r
+               {\r
+                       this->x >>= v.x;\r
+                       this->y >>= v.y;\r
+                       this->z >>= v.z;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle operators\r
+\r
+               template <typename valType>\r
+               inline valType tvec3<valType>::swizzle(comp x) const\r
+               {\r
+                       return (*this)[x];\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType> tvec3<valType>::swizzle(comp x, comp y) const\r
+               {\r
+                       return tvec2<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType> tvec3<valType>::swizzle(comp x, comp y, comp z) const\r
+               {\r
+                       return tvec3<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType> tvec3<valType>::swizzle(comp x, comp y, comp z, comp w) const\r
+               {\r
+                       return tvec4<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z],\r
+                               (*this)[w]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tref3<valType> tvec3<valType>::swizzle(comp x, comp y, comp z)\r
+               {\r
+                       return tref3<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z]);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary arithmetic operators\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator+ (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x + s,\r
+                               v.y + s,\r
+                               v.z + s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator+ (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s + v.x,\r
+                               s + v.y,\r
+                               s + v.z);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator+ (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x + v2.x,\r
+                               v1.y + v2.y,\r
+                               v1.z + v2.z);\r
+               }\r
+\r
+               //operator-\r
+               template <typename T> \r
+               inline tvec3<T> operator- (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x - s,\r
+                               v.y - s,\r
+                               v.z - s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator- (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s - v.x,\r
+                               s - v.y,\r
+                               s - v.z);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator- (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x - v2.x,\r
+                               v1.y - v2.y,\r
+                               v1.z - v2.z);\r
+               }\r
+\r
+               //operator*\r
+               template <typename T> \r
+               inline tvec3<T> operator* (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x * s,\r
+                               v.y * s,\r
+                               v.z * s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator* (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s * v.x,\r
+                               s * v.y,\r
+                               s * v.z);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator* (const tvec3<T>& v1, const tvec3<T> & v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x * v2.x,\r
+                               v1.y * v2.y,\r
+                               v1.z * v2.z);\r
+               }\r
+\r
+               //operator/\r
+               template <typename T> \r
+               inline tvec3<T> operator/ (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x / s,\r
+                               v.y / s,\r
+                               v.z / s);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator/ (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s / v.x,\r
+                               s / v.y,\r
+                               s / v.z);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator/ (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x / v2.x,\r
+                               v1.y / v2.y,\r
+                               v1.z / v2.z);\r
+               }\r
+\r
+               // Unary constant operators\r
+               template <typename T> \r
+               inline tvec3<T> operator- (const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               -v.x, \r
+                               -v.y, \r
+                               -v.z);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator++ (const tvec3<T>& v, int)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x + T(1), \r
+                               v.y + T(1), \r
+                               v.z + T(1));\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator-- (const tvec3<T>& v, int)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x - T(1), \r
+                               v.y - T(1), \r
+                               v.z - T(1));\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary bit operators\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator% (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x % s,\r
+                               v.y % s,\r
+                               v.z % s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator% (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s % v.x,\r
+                               s % v.y,\r
+                               s % v.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator% (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x % v2.x,\r
+                               v1.y % v2.y,\r
+                               v1.z % v2.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator& (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x & s,\r
+                               v.y & s,\r
+                               v.z & s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator& (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s & v.x,\r
+                               s & v.y,\r
+                               s & v.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator& (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x & v2.x,\r
+                               v1.y & v2.y,\r
+                               v1.z & v2.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator| (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x | s,\r
+                               v.y | s,\r
+                               v.z | s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator| (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s | v.x,\r
+                               s | v.y,\r
+                               s | v.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator| (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x | v2.x,\r
+                               v1.y | v2.y,\r
+                               v1.z | v2.z);\r
+               }\r
+               \r
+               template <typename T>\r
+               inline tvec3<T> operator^ (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x ^ s,\r
+                               v.y ^ s,\r
+                               v.z ^ s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator^ (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s ^ v.x,\r
+                               s ^ v.y,\r
+                               s ^ v.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator^ (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x ^ v2.x,\r
+                               v1.y ^ v2.y,\r
+                               v1.z ^ v2.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator<< (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x << s,\r
+                               v.y << s,\r
+                               v.z << s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator<< (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s << v.x,\r
+                               s << v.y,\r
+                               s << v.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator<< (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x << v2.x,\r
+                               v1.y << v2.y,\r
+                               v1.z << v2.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator>> (const tvec3<T>& v, T const & s)\r
+               {\r
+                       return tvec3<T>(\r
+                               v.x >> s,\r
+                               v.y >> s,\r
+                               v.z >> s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator>> (T const & s, const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               s >> v.x,\r
+                               s >> v.y,\r
+                               s >> v.z);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec3<T> operator>> (const tvec3<T>& v1, const tvec3<T>& v2)\r
+               {\r
+                       return tvec3<T>(\r
+                               v1.x >> v2.x,\r
+                               v1.y >> v2.y,\r
+                               v1.z >> v2.z);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec3<T> operator~ (const tvec3<T>& v)\r
+               {\r
+                       return tvec3<T>(\r
+                               ~v.x,\r
+                               ~v.y,\r
+                               ~v.z);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // tref definition\r
+\r
+               template <typename T> \r
+               tref3<T>::tref3(T& x, T& y, T& z) :\r
+                       x(x),\r
+                       y(y),\r
+                       z(z)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref3<T>::tref3(const tref3<T>& r) :\r
+                       x(r.x),\r
+                       y(r.y),\r
+                       z(r.z)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref3<T>::tref3(const tvec3<T>& v) :\r
+                       x(v.x),\r
+                       y(v.y),\r
+                       z(v.z)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref3<T>& tref3<T>::operator= (const tref3<T>& r)\r
+               {\r
+                       x = r.x;\r
+                       y = r.y;\r
+                       z = r.z;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename T> \r
+               tref3<T>& tref3<T>::operator= (const tvec3<T>& v)\r
+               {\r
+                       x = v.x;\r
+                       y = v.y;\r
+                       z = v.z;\r
+                       return *this;\r
+               }\r
+\r
+       }//namespace detail\r
+}//namespace glm\r
diff --git a/glm/core/type_vec4.hpp b/glm/core/type_vec4.hpp
new file mode 100644 (file)
index 0000000..d892886
--- /dev/null
@@ -0,0 +1,323 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-22\r
+// Updated : 2008-08-31\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_tvec4.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_core_type_gentype4\r
+#define glm_core_type_gentype4\r
+\r
+#include "type_float.hpp"\r
+#include "type_int.hpp"\r
+#include "type_size.hpp"\r
+#include "_swizzle.hpp"\r
+#include "_detail.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               void main_vec4();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               template <typename T> struct tref2;\r
+               template <typename T> struct tref3;\r
+               template <typename T> struct tref4;\r
+               template <typename T> struct tvec2;\r
+               template <typename T> struct tvec3;\r
+\r
+               template <typename valType>\r
+               struct tvec4\r
+               {\r
+                       enum ctor{null};\r
+\r
+                       //////////////////////////////////////\r
+                       // Typedef (Implementation details)\r
+\r
+                       typedef valType value_type;\r
+                       typedef valType & value_reference;\r
+                       typedef valType * value_pointer;\r
+                       typedef tvec4<bool> bool_type;\r
+\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static bool is_vector();\r
+\r
+                       typedef tvec4<valType> type;\r
+                       typedef tvec4<valType> * pointer;\r
+                       typedef tvec4<valType> const * const_pointer;\r
+                       typedef tvec4<valType> const * const const_pointer_const;\r
+                       typedef tvec4<valType> * const pointer_const;\r
+                       typedef tvec4<valType> & reference;\r
+                       typedef tvec4<valType> const & const_reference;\r
+                       typedef tvec4<valType> const & param_type;\r
+\r
+                       //////////////////////////////////////\r
+                       // Data\r
+\r
+#      if defined(GLM_USE_ONLY_XYZW)\r
+                       value_type x, y, z, w;\r
+#      else//GLM_USE_ONLY_XYZW\r
+#              ifdef GLM_USE_ANONYMOUS_UNION\r
+                       union \r
+                       {\r
+                               struct{value_type x, y, z, w;};\r
+                               struct{value_type r, g, b, a;};\r
+                               struct{value_type s, t, p, q;};\r
+\r
+                       };\r
+#              else//GLM_USE_ANONYMOUS_UNION\r
+                       union {value_type x, r, s;};\r
+                       union {value_type y, g, t;};\r
+                       union {value_type z, b, p;};\r
+                       union {value_type w, a, q;};\r
+#              endif//GLM_USE_ANONYMOUS_UNION\r
+#      endif//GLM_USE_ONLY_XYZW\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       valType & operator[](size_type i);\r
+                       valType const & operator[](size_type i) const;\r
+\r
+                       //////////////////////////////////////\r
+                       // Address (Implementation details)\r
+\r
+                       value_type * _address(){return (value_type*)(this);}\r
+                       value_type const * const _address() const{return (value_type*)(this);}\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       tvec4();\r
+                       tvec4(typename tvec4<valType>::ctor);\r
+                       tvec4(tvec4<valType> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       explicit tvec4(valType const & s);\r
+                       explicit tvec4(valType const & s0, valType const & s1, valType const & s2, valType const & s3);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle constructors\r
+\r
+                       tvec4(tref4<valType> const & r);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion scalar constructors\r
+\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename valTypeU> \r
+                       explicit tvec4(valTypeU const & x);\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C, typename D> \r
+                       explicit tvec4(A const & x, B const & y, C const & z, D const & w);                     \r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion vector constructors\r
+\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C> \r
+                       explicit tvec4(tvec2<A> const & v, B const & s1, C const & s2);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C> \r
+                       explicit tvec4(A const & s1, tvec2<B> const & v, C const & s2);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C> \r
+                       explicit tvec4(A const & s1, B const & s2, tvec2<C> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec4(tvec3<A> const & v, B const & s);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec4(A const & s, tvec3<B> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec4(tvec2<A> const & v1, tvec2<B> const & v2);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec4(tvec4<U> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       tvec4<valType>& operator= (tvec4<valType> const & v);\r
+\r
+                       tvec4<valType>& operator+=(valType const & s);\r
+                       tvec4<valType>& operator+=(tvec4<valType> const & v);\r
+                       tvec4<valType>& operator-=(valType const & s);\r
+                       tvec4<valType>& operator-=(tvec4<valType> const & v);\r
+                       tvec4<valType>& operator*=(valType const & s);\r
+                       tvec4<valType>& operator*=(tvec4<valType> const & v);\r
+                       tvec4<valType>& operator/=(valType const & s);\r
+                       tvec4<valType>& operator/=(tvec4<valType> const & v);\r
+                       tvec4<valType>& operator++();\r
+                       tvec4<valType>& operator--();\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary bit operators\r
+\r
+                       tvec4<valType>& operator%= (valType const & s);\r
+                       tvec4<valType>& operator%= (tvec4<valType> const & v);\r
+                       tvec4<valType>& operator&= (valType const & s);\r
+                       tvec4<valType>& operator&= (tvec4<valType> const & v);\r
+                       tvec4<valType>& operator|= (valType const & s);\r
+                       tvec4<valType>& operator|= (tvec4<valType> const & v);\r
+                       tvec4<valType>& operator^= (valType const & s);\r
+                       tvec4<valType>& operator^= (tvec4<valType> const & v);\r
+                       tvec4<valType>& operator<<=(valType const & s);\r
+                       tvec4<valType>& operator<<=(tvec4<valType> const & v);\r
+                       tvec4<valType>& operator>>=(valType const & s);\r
+                       tvec4<valType>& operator>>=(tvec4<valType> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       valType swizzle(comp X) const;\r
+                       tvec2<valType> swizzle(comp X, comp Y) const;\r
+                       tvec3<valType> swizzle(comp X, comp Y, comp Z) const;\r
+                       tvec4<valType> swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       tref4<valType> swizzle(comp X, comp Y, comp Z, comp W);\r
+               };\r
+\r
+               template <typename valType>\r
+               struct tref4\r
+               {\r
+                       tref4(valType & x, valType & y, valType & z, valType & w);\r
+                       tref4(tref4<valType> const & r);\r
+                       tref4(tvec4<valType> const & v);\r
+\r
+                       tref4<valType>& operator= (tref4<valType> const & r);\r
+                       tref4<valType>& operator= (tvec4<valType> const & v);\r
+\r
+                       valType & x;\r
+                       valType & y;\r
+                       valType & z;\r
+                       valType & w;\r
+               };\r
+       } //namespace detail\r
+\r
+       namespace core{\r
+       namespace type{\r
+       namespace vector{\r
+\r
+       //////////////////////////\r
+       // Boolean definition\r
+\r
+       //! 4 components vector of boolean. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec4<bool>                             bvec4;\r
+\r
+       //////////////////////////\r
+       // Float definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 4 components vector of floating-point numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec4<mediump_float>    vec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_FLOAT)\r
+       typedef detail::tvec4<highp_float>              vec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_FLOAT)\r
+       typedef detail::tvec4<mediump_float>    vec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_FLOAT)\r
+       typedef detail::tvec4<lowp_float>               vec4;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 4 components vector of high precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec4<highp_float>              highp_vec4;\r
+               //! 4 components vector of medium precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec4<mediump_float>    mediump_vec4;\r
+               //! 4 components vector of low precision floating-point numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.5.2 Precision Qualifiers.\r
+               typedef detail::tvec4<lowp_float>               lowp_vec4;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Signed integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 4 components vector of signed integer numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec4<mediump_int>              ivec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_INT)\r
+       typedef detail::tvec4<highp_int>                ivec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_INT)\r
+       typedef detail::tvec4<mediump_int>              ivec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_INT)\r
+       typedef detail::tvec4<lowp_int>                 ivec4;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 4 components vector of high precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec4<highp_int>                highp_ivec4;\r
+               //! 4 components vector of medium precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec4<mediump_int>              mediump_ivec4;\r
+               //! 4 components vector of low precision signed integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec4<lowp_int>                 lowp_ivec4;\r
+       }\r
+       //namespace precision\r
+\r
+       //////////////////////////\r
+       // Unsigned integer definition\r
+\r
+#ifndef GLM_PRECISION \r
+       //! 4 components vector of unsigned integer numbers. \r
+       //! From GLSL 1.30.8 specification, section 4.1.5 Vectors.\r
+       typedef detail::tvec4<mediump_uint>             uvec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_HIGHP_UINT)\r
+       typedef detail::tvec4<highp_uint>               uvec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_MEDIUMP_UINT)\r
+       typedef detail::tvec4<mediump_uint>             uvec4;\r
+#elif(GLM_PRECISION & GLM_PRECISION_LOWP_UINT)\r
+       typedef detail::tvec4<lowp_uint>                uvec4;\r
+#endif//GLM_PRECISION\r
+\r
+       namespace precision\r
+       {\r
+               //! 4 components vector of high precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec4<highp_uint>               highp_uvec4;\r
+               //! 4 components vector of medium precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec4<mediump_uint>             mediump_uvec4;\r
+               //! 4 components vector of low precision unsigned integer numbers. \r
+               //! There is no garanty on the actual precision.\r
+               //! From GLSL 1.30.8 specification, section 4.1.5 Precision Qualifiers.\r
+               typedef detail::tvec4<lowp_uint>                lowp_uvec4;\r
+       }\r
+       //namespace precision\r
+\r
+       }//namespace vector\r
+       }//namespace type\r
+       }//namespace core\r
+\r
+       using namespace core::type;\r
+\r
+}//namespace glm\r
+\r
+#include "type_vec4.inl"\r
+\r
+#endif//glm_core_type_gentype4\r
diff --git a/glm/core/type_vec4.inl b/glm/core/type_vec4.inl
new file mode 100644 (file)
index 0000000..29094b0
--- /dev/null
@@ -0,0 +1,1115 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-08-23\r
+// Updated : 2008-09-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/core/type_tvec4.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               template <typename valType>\r
+               typename tvec4<valType>::size_type tvec4<valType>::value_size()\r
+               {\r
+                       return typename tvec4<valType>::size_type(4);\r
+               }\r
+\r
+               template <typename valType> \r
+               bool tvec4<valType>::is_vector()\r
+               {\r
+                       return true;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Accesses\r
+\r
+               template <typename valType>\r
+               inline valType& tvec4<valType>::operator[](typename tvec4<valType>::size_type i)\r
+               {\r
+                       assert( i >= typename tvec4<valType>::size_type(0) && \r
+                                       i < tvec4<valType>::value_size());\r
+\r
+                       return (&x)[i];\r
+               }\r
+\r
+               template <typename valType>\r
+               inline valType const & tvec4<valType>::operator[](typename tvec4<valType>::size_type i) const\r
+               {\r
+                       assert( i >= typename tvec4<valType>::size_type(0) && \r
+                                       i < tvec4<valType>::value_size());\r
+\r
+                       return (&x)[i];\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Implicit basic constructors\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>::tvec4() :\r
+                       x(valType(0)),\r
+                       y(valType(0)),\r
+                       z(valType(0)),\r
+                       w(valType(0))\r
+               {}\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType>::tvec4(typename tvec4<valType>::ctor)\r
+               {}\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>::tvec4(tvec4<valType> const & v) :\r
+                       x(v.x),\r
+                       y(v.y),\r
+                       z(v.z),\r
+                       w(v.w)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Explicit basic constructors\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       valType const & s\r
+               ) :\r
+                       x(s),\r
+                       y(s),\r
+                       z(s),\r
+                       w(s)\r
+               {}\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       valType const & s1, \r
+                       valType const & s2, \r
+                       valType const & s3, \r
+                       valType const & s4\r
+               ) :\r
+                       x(s1),\r
+                       y(s2),\r
+                       z(s3),\r
+                       w(s4)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle constructors\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       tref4<valType> const & r\r
+               ) :\r
+                       x(r.x),\r
+                       y(r.y),\r
+                       z(r.z),\r
+                       w(r.w)\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion scalar constructors\r
+               \r
+               template <typename valType>\r
+               template <typename valTypeU> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       valTypeU const & x\r
+               ) :\r
+                       x(valType(x)),\r
+                       y(valType(x)),\r
+                       z(valType(x)),\r
+                       w(valType(x))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B, typename C, typename D> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       A const & x, \r
+                       B const & y, \r
+                       C const & z, \r
+                       D const & w\r
+               ) :\r
+                       x(valType(x)),\r
+                       y(valType(y)),\r
+                       z(valType(z)),\r
+                       w(valType(w))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Convertion vector constructors\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B, typename C> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       tvec2<A> const & v, \r
+                       B const & s1, \r
+                       C const & s2\r
+               ) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y)),\r
+                       z(valType(s1)),\r
+                       w(valType(s2))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B, typename C> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       A const & s1, \r
+                       tvec2<B> const & v, \r
+                       C const & s2\r
+               ) :\r
+                       x(valType(s1)),\r
+                       y(valType(v.x)),\r
+                       z(valType(v.y)),\r
+                       w(valType(s2))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B, typename C> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       A const & s1, \r
+                       B const & s2, \r
+                       tvec2<C> const & v\r
+               ) :\r
+                       x(valType(s1)),\r
+                       y(valType(s2)),\r
+                       z(valType(v.x)),\r
+                       w(valType(v.y))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       tvec3<A> const & v, \r
+                       B const & s\r
+               ) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y)),\r
+                       z(valType(v.z)),\r
+                       w(valType(s))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       A const & s, \r
+                       tvec3<B> const & v\r
+               ) :\r
+                       x(valType(s)),\r
+                       y(valType(v.x)),\r
+                       z(valType(v.y)),\r
+                       w(valType(v.z))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename A, typename B> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       tvec2<A> const & v1, \r
+                       tvec2<B> const & v2\r
+               ) :\r
+                       x(valType(v1.x)),\r
+                       y(valType(v1.y)),\r
+                       z(valType(v2.x)),\r
+                       w(valType(v2.y))\r
+               {}\r
+\r
+               template <typename valType>\r
+               template <typename U> \r
+               inline tvec4<valType>::tvec4\r
+               (\r
+                       tvec4<U> const & v\r
+               ) :\r
+                       x(valType(v.x)),\r
+                       y(valType(v.y)),\r
+                       z(valType(v.z)),\r
+                       w(valType(v.w))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Unary arithmetic operators\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator= \r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x = v.x;\r
+                       this->y = v.y;\r
+                       this->z = v.z;\r
+                       this->w = v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator+=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x += s;\r
+                       this->y += s;\r
+                       this->z += s;\r
+                       this->w += s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator+=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x += v.x;\r
+                       this->y += v.y;\r
+                       this->z += v.z;\r
+                       this->w += v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator-=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x -= s;\r
+                       this->y -= s;\r
+                       this->z -= s;\r
+                       this->w -= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator-=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x -= v.x;\r
+                       this->y -= v.y;\r
+                       this->z -= v.z;\r
+                       this->w -= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator*=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x *= s;\r
+                       this->y *= s;\r
+                       this->z *= s;\r
+                       this->w *= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator*=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x *= v.x;\r
+                       this->y *= v.y;\r
+                       this->z *= v.z;\r
+                       this->w *= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator/=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x /= s;\r
+                       this->y /= s;\r
+                       this->z /= s;\r
+                       this->w /= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator/=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x /= v.x;\r
+                       this->y /= v.y;\r
+                       this->z /= v.z;\r
+                       this->w /= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator++()\r
+               {\r
+                       ++this->x;\r
+                       ++this->y;\r
+                       ++this->z;\r
+                       ++this->w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator--()\r
+               {\r
+                       --this->x;\r
+                       --this->y;\r
+                       --this->z;\r
+                       --this->w;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Unary bit operators\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator%=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x %= s;\r
+                       this->y %= s;\r
+                       this->z %= s;\r
+                       this->w %= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator%=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x %= v.x;\r
+                       this->y %= v.y;\r
+                       this->z %= v.z;\r
+                       this->w %= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator&=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x &= s;\r
+                       this->y &= s;\r
+                       this->z &= s;\r
+                       this->w &= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator&=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x &= v.x;\r
+                       this->y &= v.y;\r
+                       this->z &= v.z;\r
+                       this->w &= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator|=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x |= s;\r
+                       this->y |= s;\r
+                       this->z |= s;\r
+                       this->w |= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator|=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x |= v.x;\r
+                       this->y |= v.y;\r
+                       this->z |= v.z;\r
+                       this->w |= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator^=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x ^= s;\r
+                       this->y ^= s;\r
+                       this->z ^= s;\r
+                       this->w ^= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator^=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x ^= v.x;\r
+                       this->y ^= v.y;\r
+                       this->z ^= v.z;\r
+                       this->w ^= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator<<=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x <<= s;\r
+                       this->y <<= s;\r
+                       this->z <<= s;\r
+                       this->w <<= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator<<=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x <<= v.x;\r
+                       this->y <<= v.y;\r
+                       this->z <<= v.z;\r
+                       this->w <<= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator>>=\r
+               (\r
+                       valType const & s\r
+               )\r
+               {\r
+                       this->x >>= s;\r
+                       this->y >>= s;\r
+                       this->z >>= s;\r
+                       this->w >>= s;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType>& tvec4<valType>::operator>>=\r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       this->x >>= v.x;\r
+                       this->y >>= v.y;\r
+                       this->z >>= v.z;\r
+                       this->w >>= v.w;\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle operators\r
+\r
+               template <typename valType>\r
+               inline valType tvec4<valType>::swizzle(comp x) const\r
+               {\r
+                       return (*this)[x];\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec2<valType> tvec4<valType>::swizzle(comp x, comp y) const\r
+               {\r
+                       return tvec2<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec3<valType> tvec4<valType>::swizzle(comp x, comp y, comp z) const\r
+               {\r
+                       return tvec3<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tvec4<valType> tvec4<valType>::swizzle(comp x, comp y, comp z, comp w) const\r
+               {\r
+                       return tvec4<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z],\r
+                               (*this)[w]);\r
+               }\r
+\r
+               template <typename valType>\r
+               inline tref4<valType> tvec4<valType>::swizzle(comp x, comp y, comp z, comp w)\r
+               {\r
+                       return tref4<valType>(\r
+                               (*this)[x],\r
+                               (*this)[y],\r
+                               (*this)[z],\r
+                               (*this)[w]);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary arithmetic operators\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator+ \r
+               (\r
+                       tvec4<valType> const & v, \r
+                       valType const & s\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v.x + s,\r
+                               v.y + s,\r
+                               v.z + s,\r
+                               v.w + s);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator+ \r
+               (\r
+                       valType const & s, \r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               s + v.x,\r
+                               s + v.y,\r
+                               s + v.z,\r
+                               s + v.w);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator+ \r
+               (\r
+                       tvec4<valType> const & v1, \r
+                       tvec4<valType> const & v2\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v1.x + v2.x,\r
+                               v1.y + v2.y,\r
+                               v1.z + v2.z,\r
+                               v1.w + v2.w);\r
+               }\r
+\r
+               //operator-\r
+               template <typename valType> \r
+               inline tvec4<valType> operator- \r
+               (\r
+                       tvec4<valType> const & v, \r
+                       valType const & s\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v.x - s,\r
+                               v.y - s,\r
+                               v.z - s,\r
+                               v.w - s);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator- \r
+               (\r
+                       valType const & s, \r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               s - v.x,\r
+                               s - v.y,\r
+                               s - v.z,\r
+                               s - v.w);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator- \r
+               (\r
+                       tvec4<valType> const & v1, \r
+                       tvec4<valType> const & v2\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v1.x - v2.x,\r
+                               v1.y - v2.y,\r
+                               v1.z - v2.z,\r
+                               v1.w - v2.w);\r
+               }\r
+\r
+               //operator*\r
+               template <typename valType> \r
+               inline tvec4<valType> operator* \r
+               (\r
+                       tvec4<valType> const & v, \r
+                       valType const & s\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v.x * s,\r
+                               v.y * s,\r
+                               v.z * s,\r
+                               v.w * s);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator* \r
+               (\r
+                       valType const & s, \r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               s * v.x,\r
+                               s * v.y,\r
+                               s * v.z,\r
+                               s * v.w);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator*\r
+               (\r
+                       tvec4<valType> const & v1, \r
+                       tvec4<valType> const & v2\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v1.x * v2.x,\r
+                               v1.y * v2.y,\r
+                               v1.z * v2.z,\r
+                               v1.w * v2.w);\r
+               }\r
+\r
+               //operator/\r
+               template <typename valType> \r
+               inline tvec4<valType> operator/ \r
+               (\r
+                       tvec4<valType> const & v, \r
+                       valType const & s\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v.x / s,\r
+                               v.y / s,\r
+                               v.z / s,\r
+                               v.w / s);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator/ \r
+               (\r
+                       valType const & s, \r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               s / v.x,\r
+                               s / v.y,\r
+                               s / v.z,\r
+                               s / v.w);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator/ \r
+               (\r
+                       tvec4<valType> const & v1, \r
+                       tvec4<valType> const & v2\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v1.x / v2.x,\r
+                               v1.y / v2.y,\r
+                               v1.z / v2.z,\r
+                               v1.w / v2.w);\r
+               }\r
+\r
+               // Unary constant operators\r
+               template <typename valType> \r
+               inline tvec4<valType> operator- \r
+               (\r
+                       tvec4<valType> const & v\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               -v.x, \r
+                               -v.y, \r
+                               -v.z, \r
+                               -v.w);\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator++ \r
+               (\r
+                       tvec4<valType> const & v, \r
+                       int\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v.x + valType(1), \r
+                               v.y + valType(1), \r
+                               v.z + valType(1), \r
+                               v.w + valType(1));\r
+               }\r
+\r
+               template <typename valType> \r
+               inline tvec4<valType> operator-- \r
+               (\r
+                       tvec4<valType> const & v, \r
+                       int\r
+               )\r
+               {\r
+                       return tvec4<valType>(\r
+                               v.x - valType(1), \r
+                               v.y - valType(1), \r
+                               v.z - valType(1), \r
+                               v.w - valType(1));\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Binary bit operators\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator% \r
+               (\r
+                       tvec4<T> const & v, \r
+                       T const & s\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v.x % s,\r
+                               v.y % s,\r
+                               v.z % s,\r
+                               v.w % s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator% \r
+               (\r
+                       T const & s, \r
+                       tvec4<T> const & v\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               s % v.x,\r
+                               s % v.y,\r
+                               s % v.z,\r
+                               s % v.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator%\r
+               (\r
+                       tvec4<T> const & v1, \r
+                       tvec4<T> const & v2\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v1.x % v2.x,\r
+                               v1.y % v2.y,\r
+                               v1.z % v2.z,\r
+                               v1.w % v2.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator& \r
+               (\r
+                       tvec4<T> const & v, \r
+                       T const & s\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v.x & s,\r
+                               v.y & s,\r
+                               v.z & s,\r
+                               v.w & s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator& \r
+               (\r
+                       T const & s, \r
+                       tvec4<T> const & v\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               s & v.x,\r
+                               s & v.y,\r
+                               s & v.z,\r
+                               s & v.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator&\r
+               (\r
+                       tvec4<T> const & v1,\r
+                       tvec4<T> const & v2\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v1.x & v2.x,\r
+                               v1.y & v2.y,\r
+                               v1.z & v2.z,\r
+                               v1.w & v2.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator|\r
+               (\r
+                       tvec4<T> const & v, \r
+                       T const & s\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v.x | s,\r
+                               v.y | s,\r
+                               v.z | s,\r
+                               v.w | s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator|\r
+               (\r
+                       T const & s, \r
+                       tvec4<T> const & v\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               s | v.x,\r
+                               s | v.y,\r
+                               s | v.z,\r
+                               s | v.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator|\r
+               (\r
+                       tvec4<T> const & v1, \r
+                       tvec4<T> const & v2\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v1.x | v2.x,\r
+                               v1.y | v2.y,\r
+                               v1.z | v2.z,\r
+                               v1.w | v2.w);\r
+               }\r
+               \r
+               template <typename T>\r
+               inline tvec4<T> operator^\r
+               (\r
+                       tvec4<T> const & v, \r
+                       T const & s\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v.x ^ s,\r
+                               v.y ^ s,\r
+                               v.z ^ s,\r
+                               v.w ^ s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator^\r
+               (\r
+                       T const & s, \r
+                       tvec4<T> const & v\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               s ^ v.x,\r
+                               s ^ v.y,\r
+                               s ^ v.z,\r
+                               s ^ v.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator^\r
+               (\r
+                       tvec4<T> const & v1,\r
+                       tvec4<T> const & v2\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v1.x ^ v2.x,\r
+                               v1.y ^ v2.y,\r
+                               v1.z ^ v2.z,\r
+                               v1.w ^ v2.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator<<\r
+               (\r
+                       tvec4<T> const & v,\r
+                       T const & s\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v.x << s,\r
+                               v.y << s,\r
+                               v.z << s,\r
+                               v.w << s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator<<\r
+               (\r
+                       T const & s,\r
+                       tvec4<T> const & v\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               s << v.x,\r
+                               s << v.y,\r
+                               s << v.z,\r
+                               s << v.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator<<\r
+               (\r
+                       tvec4<T> const & v1,\r
+                       tvec4<T> const & v2\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v1.x << v2.x,\r
+                               v1.y << v2.y,\r
+                               v1.z << v2.z,\r
+                               v1.w << v2.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator>>\r
+               (\r
+                       tvec4<T> const & v,\r
+                       T const & s\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v.x >> s,\r
+                               v.y >> s,\r
+                               v.z >> s,\r
+                               v.w >> s);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator>>\r
+               (\r
+                       T const & s,\r
+                       tvec4<T> const & v\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               s >> v.x,\r
+                               s >> v.y,\r
+                               s >> v.z,\r
+                               s >> v.w);\r
+               }\r
+\r
+               template <typename T>\r
+               inline tvec4<T> operator>>\r
+               (\r
+                       tvec4<T> const & v1,\r
+                       tvec4<T> const & v2\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               v1.x >> v2.x,\r
+                               v1.y >> v2.y,\r
+                               v1.z >> v2.z,\r
+                               v1.w >> v2.w);\r
+               }\r
+\r
+               template <typename T> \r
+               inline tvec4<T> operator~\r
+               (\r
+                       tvec4<T> const & v\r
+               )\r
+               {\r
+                       return tvec4<T>(\r
+                               ~v.x,\r
+                               ~v.y,\r
+                               ~v.z,\r
+                               ~v.w);\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // tref definition\r
+\r
+               template <typename T> \r
+               tref4<T>::tref4(T& x, T& y, T& z, T& w) :\r
+                       x(x),\r
+                       y(y),\r
+                       z(z),\r
+                       w(w)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref4<T>::tref4(tref4<T> const & r) :\r
+                       x(r.x),\r
+                       y(r.y),\r
+                       z(r.z),\r
+                       w(r.w)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref4<T>::tref4(tvec4<T> const & v) :\r
+                       x(v.x),\r
+                       y(v.y),\r
+                       z(v.z),\r
+                       w(v.w)\r
+               {}\r
+\r
+               template <typename T> \r
+               tref4<T>& tref4<T>::operator= (tref4<T> const & r)\r
+               {\r
+                       x = r.x;\r
+                       y = r.y;\r
+                       z = r.z;\r
+                       w = r.w;\r
+                       return *this;\r
+               }\r
+\r
+               template <typename T> \r
+               tref4<T>& tref4<T>::operator= (tvec4<T> const & v)\r
+               {\r
+                       x = v.x;\r
+                       y = v.y;\r
+                       z = v.z;\r
+                       w = v.w;\r
+                       return *this;\r
+               }\r
+\r
+       }//namespace detail\r
+}//namespace glm\r
diff --git a/glm/ext.hpp b/glm/ext.hpp
new file mode 100644 (file)
index 0000000..59e2086
--- /dev/null
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-01\r
+// Updated : 2009-05-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/ext.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_ext\r
+#define glm_ext\r
+\r
+#include "glm.hpp"\r
+#include "gtc.hpp"\r
+#include "gtx.hpp"\r
+#include "img.hpp"\r
+\r
+//const float goldenRatio = 1.618033988749894848f;\r
+//const float pi = 3.141592653589793238f;\r
+\r
+#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_EXTS | GLM_MESSAGE_NOTIFICATION)))\r
+#      pragma message("GLM message: Extensions library included")\r
+#endif//GLM_MESSAGE\r
+\r
+#define GLM_EXTENSION(extension) namespace glm{using extension;}\r
+\r
+#endif //glm_ext\r
diff --git a/glm/glm.h b/glm/glm.h
new file mode 100644 (file)
index 0000000..b176a34
--- /dev/null
+++ b/glm/glm.h
@@ -0,0 +1,2 @@
+#pragma message("<glm/glm.h> is deprecated, please include <glm/glm.hpp> instead")\r
+#include "glm.hpp"\r
diff --git a/glm/glm.hpp b/glm/glm.hpp
new file mode 100644 (file)
index 0000000..3a9de2f
--- /dev/null
@@ -0,0 +1,173 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-01-14\r
+// Updated : 2009-05-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/glm.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+/*! \mainpage OpenGL Mathematics\r
+ *\r
+ * OpenGL Mathematics (GLM) is a C++ mathematics library for 3D applications based on the OpenGL Shading Language (GLSL) specification. \r
+ *\r
+ * The goal of the project is to provide to 3D programmers math classes and functions that miss in C++ when we use to program with GLSL or any high level GPU language. With GLM, the idea is to have a library that works the same way that GLSL which imply a strict following of GLSL specification for the implementation.\r
+ *\r
+ * However, this project isn't limited by GLSL features. An extension system based on GLSL extensions development conventions allows to extend GLSL capabilities.\r
+ *\r
+ * GLM is release under MIT license and available for all version of GCC from version 3.4 and Visual Studio from version 8.0 as a platform independent library.\r
+ *\r
+ * Any feedback is welcome, please send them to g.truc.creation[NO_SPAM_THANKS]gmail.com.\r
+ *\r
+ */\r
+\r
+#ifndef glm_glm\r
+#define glm_glm\r
+\r
+#ifdef max\r
+#undef max\r
+#endif\r
+\r
+#ifdef min\r
+#undef min\r
+#endif\r
+\r
+#define GLMvalType typename genType::value_type\r
+#define GLMcolType typename genType::col_type\r
+#define GLMrowType typename genType::row_type\r
+\r
+#define GLMsizeType typename genType::size_type\r
+#define GLMrowSize typename genType::row_size\r
+#define GLMcolSize typename genType::col_size\r
+\r
+#include <cmath>\r
+#include <climits>\r
+#include "./setup.hpp"\r
+\r
+//! GLM namespace, it contains all GLSL based features.\r
+namespace glm\r
+{\r
+       namespace test\r
+       {\r
+               bool main_bug();\r
+               bool main_core();\r
+       }//namespace test\r
+\r
+       //! GLM core. Namespace that includes all the feature define by GLSL 1.30.8 specification. This namespace is included in glm namespace.\r
+       namespace core\r
+       {\r
+               //! Scalar, vectors and matrices \r
+               //! from section 4.1.2 Booleans, 4.1.3 Integers section, 4.1.4 Floats section,\r
+               //! 4.1.5 Vectors and section 4.1.6 Matrices of GLSL 1.30.8 specification. \r
+               //! This namespace resolves precision qualifier define in section 4.5 of GLSL 1.30.8 specification.\r
+               namespace type\r
+               {\r
+                       //! Scalar types from section 4.1.2 Booleans, 4.1.3 Integers and 4.1.4 Floats of GLSL 1.30.8 specification. \r
+                       //! This namespace is included in glm namespace.\r
+                       namespace scalar\r
+                       {\r
+                               //! Scalar types with precision qualifier.\r
+                               //! This namespace is included in glm namespace.\r
+                               namespace precision{}\r
+                       }\r
+\r
+                       //! Vector types from section 4.1.5 of GLSL 1.30.8 specification. \r
+                       //! This namespace is included in glm namespace.\r
+                       namespace vector\r
+                       {\r
+                               //! Vector types with precision qualifier.\r
+                               //! This namespace is included in glm namespace.\r
+                               namespace precision{}\r
+                       }\r
+                       \r
+                       //! Matrix types from section 4.1.6 of GLSL 1.30.8 specification. \r
+                       //! This namespace is included in glm namespace.\r
+                       namespace matrix\r
+                       {\r
+                               //! Matrix types with precision qualifier.\r
+                               //! This namespace is included in glm namespace.\r
+                               namespace precision{}\r
+                       }\r
+               }\r
+               //! Some of the functions defined in section 8 Built-in Functions of GLSL 1.30.8 specification.\r
+               //! Angle and trigonometry, exponential, common, geometric, matrix and vector relational functions.\r
+               namespace function{}\r
+       }\r
+       //namespace core\r
+\r
+       using namespace core::type::scalar;\r
+       using namespace core::type::scalar::precision;\r
+       using namespace core::type::vector;\r
+       using namespace core::type::vector::precision;\r
+       using namespace core::type::matrix;\r
+       using namespace core::type::matrix::precision;\r
+\r
+       //! GLM experimental extensions. The interface could change between releases.\r
+       namespace gtx{}\r
+\r
+       //! GLM stable extensions.\r
+       namespace gtc{}\r
+\r
+       //! IMG extensions.\r
+       namespace img{}\r
+\r
+       //! VIRTREV extensions.\r
+       namespace img{}\r
+\r
+} //namespace glm\r
+\r
+#include "./core/_detail.hpp"\r
+#include "./core/type.hpp"\r
+#include "./core/type_half.hpp"\r
+\r
+#include "./core/func_common.hpp"\r
+#include "./core/func_exponential.hpp"\r
+#include "./core/func_geometric.hpp"\r
+#include "./core/func_matrix.hpp"\r
+#include "./core/func_trigonometric.hpp"\r
+#include "./core/func_vector_relational.hpp"\r
+#include "./core/func_noise.hpp"\r
+#include "./core/_swizzle.hpp"\r
+//#include "./core/_xref2.hpp"\r
+//#include "./core/_xref3.hpp"\r
+//#include "./core/_xref4.hpp"\r
+\r
+#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_CORE | GLM_MESSAGE_NOTIFICATION)))\r
+#      pragma message("GLM message: Core library included")\r
+#endif//GLM_MESSAGE\r
+\r
+#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))\r
+\r
+#define GLM_DEPRECATED __declspec(deprecated)\r
+#define GLM_RESTRICT __restrict\r
+#define GLM_ALIGN(x) __declspec(align(x))\r
+\r
+//#define aligned(x) __declspec(align(x)) struct\r
+\r
+#else\r
+\r
+#define GLM_DEPRECATED\r
+#define GLM_RESTRICT\r
+#define GLM_ALIGN(x)\r
+\r
+#endif//GLM_COMPILER\r
+\r
+////////////////////\r
+// check type sizes\r
+#ifndef GLM_STATIC_ASSERT_NULL\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::int8)==1);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::int16)==2);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::int32)==4);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::int64)==8);\r
+\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::uint8)==1);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::uint16)==2);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::uint32)==4);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::uint64)==8);\r
+\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::float16)==2);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::float32)==4);\r
+       GLM_STATIC_ASSERT(sizeof(glm::detail::float64)==8);\r
+#endif//GLM_STATIC_ASSERT_NULL\r
+\r
+#endif //glm_glm\r
diff --git a/glm/glmext.h b/glm/glmext.h
new file mode 100644 (file)
index 0000000..eb3950b
--- /dev/null
@@ -0,0 +1,2 @@
+#pragma message("<glm/glmext.h> is deprecated, please include specific extensions instead")\r
+#include "ext.hpp"\r
diff --git a/glm/glmsetup.h b/glm/glmsetup.h
new file mode 100644 (file)
index 0000000..009f81d
--- /dev/null
@@ -0,0 +1,2 @@
+#pragma message("<glm/glmsetup.h> is deprecated, please include <glm/setup.hpp> instead")\r
+#include "setup.hpp"\r
diff --git a/glm/gtc.hpp b/glm/gtc.hpp
new file mode 100644 (file)
index 0000000..6c7a61a
--- /dev/null
@@ -0,0 +1,26 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-01\r
+// Updated : 2009-05-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Note:\r
+// GTC extensions are stable extensions\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc\r
+#define glm_gtc\r
+\r
+#define GLM_GTC_GLOBAL 1\r
+\r
+#include "gtc/double_float.hpp"\r
+#include "gtc/half_float.hpp"\r
+#include "gtc/matrix_access.hpp"\r
+#include "gtc/matrix_operation.hpp"\r
+#include "gtc/matrix_projection.hpp"\r
+#include "gtc/matrix_transform.hpp"\r
+#include "gtc/quaternion.hpp"\r
+\r
+#endif//glm_gtc\r
diff --git a/glm/gtc/double_float.hpp b/glm/gtc/double_float.hpp
new file mode 100644 (file)
index 0000000..2f79ff5
--- /dev/null
@@ -0,0 +1,92 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/double_float.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Note:\r
+// - This implementation doesn't need to redefine all build-in functions to\r
+// support double based type.\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc_double_float\r
+#define glm_gtc_double_float\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               bool main_gtc_double_float();\r
+       }//namespace test\r
+\r
+       namespace gtc{\r
+       //! GLM_GTC_double_float extension: Add support for double precision floating-point types\r
+       namespace double_float\r
+       {\r
+               //! Vector of 2 single-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tvec2<float>    fvec2;\r
+\r
+               //! Vector of 3 single-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tvec3<float>    fvec3;\r
+               \r
+               //! Vector of 4 single-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tvec4<float>    fvec4;\r
+\r
+               //! 2 * 2 matrix of single-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tmat2x2<float>  fmat2;\r
+\r
+               //! 3 * 3 matrix of single-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tmat3x3<float>  fmat3;\r
+\r
+               //! 4 * 4 matrix of single-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tmat4x4<float>  fmat4;\r
+\r
+               //! Vector of 2 double-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tvec2<double>   dvec2;\r
+\r
+               //! Vector of 3 double-precision floating-point numbers.\r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tvec3<double>   dvec3;\r
+\r
+               //! Vector of 4 double-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tvec4<double>   dvec4;\r
+\r
+               //! 2 * 2 matrix of double-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tmat2x2<double> dmat2;\r
+\r
+               //! 3 * 3 matrix of double-precision floating-point numbers. \r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tmat3x3<double> dmat3;\r
+\r
+               //! 4 * 4 matrix of double-precision floating-point numbers.\r
+               //! From GLM_GTC_double_float extension.\r
+               typedef detail::tmat4x4<double> dmat4;\r
+\r
+       }//namespace double_float\r
+       }//namespace gtc\r
+}//namespace glm\r
+\r
+#define GLM_GTC_double_float namespace gtc::double_float\r
+#ifndef GLM_GTC_GLOBAL\r
+namespace glm {using GLM_GTC_double_float;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "double_float.inl"\r
+\r
+#endif//glm_gtc_double_float\r
diff --git a/glm/gtc/double_float.inl b/glm/gtc/double_float.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtc/half_float.hpp b/glm/gtc/half_float.hpp
new file mode 100644 (file)
index 0000000..0a0fa5d
--- /dev/null
@@ -0,0 +1,407 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/half_float.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc_half_float\r
+#define glm_gtc_half_float\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               bool main_gtc_half_float();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+#ifndef GLM_USE_ANONYMOUS_UNION\r
+               template <>\r
+               struct tvec2<thalf>\r
+               {\r
+                       //////////////////////////////////////\r
+                       // Typedef (Implementation details)\r
+\r
+                       typedef thalf value_type;\r
+                       typedef thalf& value_reference;\r
+                       typedef thalf* value_pointer;\r
+                       typedef tvec2<bool> bool_type;\r
+\r
+                       typedef sizeType size_type;\r
+                       static size_type value_size();\r
+                       static bool is_vector();\r
+\r
+                       typedef tvec2<thalf> type;\r
+                       typedef tvec2<thalf>* pointer;\r
+                       typedef const tvec2<thalf>* const_pointer;\r
+                       typedef const tvec2<thalf>*const const_pointer_const;\r
+                       typedef tvec2<thalf>*const pointer_const;\r
+                       typedef tvec2<thalf>& reference;\r
+                       typedef const tvec2<thalf>& const_reference;\r
+                       typedef const tvec2<thalf>& param_type;\r
+\r
+                       //////////////////////////////////////\r
+                       // Data\r
+\r
+                       thalf x, y;\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       thalf& operator[](size_type i);\r
+                       thalf operator[](size_type i) const;\r
+\r
+                       //////////////////////////////////////\r
+                       // Address (Implementation details)\r
+\r
+                       thalf const * const _address() const{return (value_type*)(this);}\r
+                       thalf * _address(){return (value_type*)(this);}\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       tvec2();\r
+                       tvec2(tvec2<thalf> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       explicit tvec2(thalf s);\r
+                       explicit tvec2(thalf s1, thalf s2);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle constructors\r
+\r
+                       tvec2(tref2<thalf> const & r);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion scalar constructors\r
+\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(U x);\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U, typename V> \r
+                       explicit tvec2(U x, V y);                       \r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion vector constructors\r
+\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(tvec2<U> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(tvec3<U> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec2(tvec4<U> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       tvec2<thalf>& operator= (tvec2<thalf> const & v);\r
+\r
+                       tvec2<thalf>& operator+=(thalf s);\r
+                       tvec2<thalf>& operator+=(tvec2<thalf> const & v);\r
+                       tvec2<thalf>& operator-=(thalf s);\r
+                       tvec2<thalf>& operator-=(tvec2<thalf> const & v);\r
+                       tvec2<thalf>& operator*=(thalf s);\r
+                       tvec2<thalf>& operator*=(tvec2<thalf> const & v);\r
+                       tvec2<thalf>& operator/=(thalf s);\r
+                       tvec2<thalf>& operator/=(tvec2<thalf> const & v);\r
+                       tvec2<thalf>& operator++();\r
+                       tvec2<thalf>& operator--();\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       thalf swizzle(comp X) const;\r
+                       tvec2<thalf> swizzle(comp X, comp Y) const;\r
+                       tvec3<thalf> swizzle(comp X, comp Y, comp Z) const;\r
+                       tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       tref2<thalf> swizzle(comp X, comp Y);\r
+               };\r
+\r
+               template <>\r
+               struct tvec3<thalf>\r
+               {\r
+                       //////////////////////////////////////\r
+                       // Typedef (Implementation details)\r
+\r
+                       typedef thalf value_type;\r
+                       typedef thalf& value_reference;\r
+                       typedef thalf* value_pointer;\r
+                       typedef tvec3<bool> bool_type;\r
+\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static bool is_vector();\r
+\r
+                       typedef tvec3<thalf> type;\r
+                       typedef tvec3<thalf> * pointer;\r
+                       typedef tvec3<thalf> const * const_pointer;\r
+                       typedef tvec3<thalf> const * const const_pointer_const;\r
+                       typedef tvec3<thalf> * const pointer_const;\r
+                       typedef tvec3<thalf> & reference;\r
+                       typedef tvec3<thalf> const & const_reference;\r
+                       typedef tvec3<thalf> const & param_type;\r
+\r
+                       //////////////////////////////////////\r
+                       // Data\r
+\r
+                       thalf x, y, z;\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       thalf& operator[](size_type i);\r
+                       thalf operator[](size_type i) const;\r
+\r
+                       //////////////////////////////////////\r
+                       // Address (Implementation details)\r
+\r
+                       const value_type* _address() const{return (value_type*)(this);}\r
+                       value_type* _address(){return (value_type*)(this);}\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       tvec3();\r
+                       tvec3(tvec3<thalf> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       explicit tvec3(thalf s);\r
+                       explicit tvec3(thalf s1, thalf s2, thalf s3);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle constructors\r
+\r
+                       tvec3(tref3<thalf> const & r);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion scalar constructors\r
+\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec3(U x);\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U, typename V, typename W> \r
+                       explicit tvec3(U x, V y, W z);                  \r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion vector constructors\r
+\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec3(const tvec2<A>& v, B s);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec3(A s, const tvec2<B>& v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec3(tvec3<U> const & v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec3(tvec4<U> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       tvec3<thalf>& operator= (tvec3<thalf> const & v);\r
+\r
+                       tvec3<thalf>& operator+=(thalf s);\r
+                       tvec3<thalf>& operator+=(tvec3<thalf> const & v);\r
+                       tvec3<thalf>& operator-=(thalf s);\r
+                       tvec3<thalf>& operator-=(tvec3<thalf> const & v);\r
+                       tvec3<thalf>& operator*=(thalf s);\r
+                       tvec3<thalf>& operator*=(tvec3<thalf> const & v);\r
+                       tvec3<thalf>& operator/=(thalf s);\r
+                       tvec3<thalf>& operator/=(tvec3<thalf> const & v);\r
+                       tvec3<thalf>& operator++();\r
+                       tvec3<thalf>& operator--();\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       thalf swizzle(comp X) const;\r
+                       tvec2<thalf> swizzle(comp X, comp Y) const;\r
+                       tvec3<thalf> swizzle(comp X, comp Y, comp Z) const;\r
+                       tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       tref3<thalf> swizzle(comp X, comp Y, comp Z);\r
+               };\r
+\r
+               template <>\r
+               struct tvec4<thalf>\r
+               {\r
+                       //////////////////////////////////////\r
+                       // Typedef (Implementation details)\r
+\r
+                       typedef thalf value_type;\r
+                       typedef thalf& value_reference;\r
+                       typedef thalf* value_pointer;\r
+                       typedef tvec4<bool> bool_type;\r
+\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static bool is_vector();\r
+\r
+                       typedef tvec4<thalf> type;\r
+                       typedef tvec4<thalf> * pointer;\r
+                       typedef tvec4<thalf> const * const_pointer;\r
+                       typedef tvec4<thalf> const * const const_pointer_const;\r
+                       typedef tvec4<thalf> * const pointer_const;\r
+                       typedef tvec4<thalf> & reference;\r
+                       typedef tvec4<thalf> const & const_reference;\r
+                       typedef tvec4<thalf> const & param_type;\r
+\r
+                       //////////////////////////////////////\r
+                       // Data\r
+\r
+                       thalf x, y, z, w;\r
+\r
+                       //////////////////////////////////////\r
+                       // Accesses\r
+\r
+                       thalf& operator[](size_type i);\r
+                       thalf operator[](size_type i) const;\r
+\r
+                       //////////////////////////////////////\r
+                       // Address (Implementation details)\r
+\r
+                       const value_type* _address() const{return (value_type*)(this);}\r
+                       value_type* _address(){return (value_type*)(this);}\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       tvec4();\r
+                       tvec4(tvec4<thalf> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       explicit tvec4(thalf s);\r
+                       explicit tvec4(thalf s0, thalf s1, thalf s2, thalf s3);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle constructors\r
+\r
+                       tvec4(tref4<thalf> const & r);\r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion scalar constructors\r
+\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec4(U x);\r
+                       //! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C, typename D> \r
+                       explicit tvec4(A x, B y, C z, D w);                     \r
+\r
+                       //////////////////////////////////////\r
+                       // Convertion vector constructors\r
+\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C> \r
+                       explicit tvec4(const tvec2<A>& v, B s1, C s2);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C> \r
+                       explicit tvec4(A s1, const tvec2<B>& v, C s2);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B, typename C> \r
+                       explicit tvec4(A s1, B s2, const tvec2<C>& v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec4(const tvec3<A>& v, B s);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec4(A s, const tvec3<B>& v);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename A, typename B> \r
+                       explicit tvec4(const tvec2<A>& v1, const tvec2<B>& v2);\r
+                       //! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)\r
+                       template <typename U> \r
+                       explicit tvec4(const tvec4<U>& v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       tvec4<thalf>& operator= (tvec4<thalf> const & v);\r
+\r
+                       tvec4<thalf>& operator+=(thalf s);\r
+                       tvec4<thalf>& operator+=(tvec4<thalf> const & v);\r
+                       tvec4<thalf>& operator-=(thalf s);\r
+                       tvec4<thalf>& operator-=(tvec4<thalf> const & v);\r
+                       tvec4<thalf>& operator*=(thalf s);\r
+                       tvec4<thalf>& operator*=(tvec4<thalf> const & v);\r
+                       tvec4<thalf>& operator/=(thalf s);\r
+                       tvec4<thalf>& operator/=(tvec4<thalf> const & v);\r
+                       tvec4<thalf>& operator++();\r
+                       tvec4<thalf>& operator--();\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       thalf swizzle(comp X) const;\r
+                       tvec2<thalf> swizzle(comp X, comp Y) const;\r
+                       tvec3<thalf> swizzle(comp X, comp Y, comp Z) const;\r
+                       tvec4<thalf> swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       tref4<thalf> swizzle(comp X, comp Y, comp Z, comp W);\r
+               };\r
+#endif//GLM_USE_ANONYMOUS_UNION\r
+       }\r
+       //namespace detail\r
+\r
+       namespace gtc{\r
+       //! GLM_GTC_half_float extension: Add support for half precision floating-point types\r
+       namespace half_float\r
+       {\r
+               //! Type for half-precision floating-point numbers. \r
+               //! From GLM_GTC_half_float extension.\r
+               typedef detail::thalf                                   half;\r
+\r
+               //! Vector of 2 half-precision floating-point numbers. \r
+               //! From GLM_GTC_half_float extension.\r
+               typedef detail::tvec2<detail::thalf>    hvec2;\r
+\r
+               //! Vector of 3 half-precision floating-point numbers.\r
+               //! From GLM_GTC_half_float extension.\r
+               typedef detail::tvec3<detail::thalf>    hvec3;\r
+\r
+               //! Vector of 4 half-precision floating-point numbers. \r
+               //! From GLM_GTC_half_float extension.\r
+               typedef detail::tvec4<detail::thalf>    hvec4;\r
+\r
+               //! 2 * 2 matrix of half-precision floating-point numbers.\r
+               //! From GLM_GTC_half_float extension.\r
+               typedef detail::tmat2x2<detail::thalf>  hmat2;\r
+\r
+               //! 3 * 3 matrix of half-precision floating-point numbers.\r
+               //! From GLM_GTC_half_float extension.\r
+               typedef detail::tmat3x3<detail::thalf>  hmat3;\r
+\r
+               //! 4 * 4 matrix of half-precision floating-point numbers.\r
+               //! From GLM_GTC_half_float extension.\r
+               typedef detail::tmat4x4<detail::thalf>  hmat4;\r
+\r
+       }//namespace half_float\r
+       }//namespace gtc\r
+}//namespace glm\r
+\r
+#define GLM_GTC_half_float namespace gtc::half_float\r
+#ifndef GLM_GTC_GLOBAL\r
+namespace glm {using GLM_GTC_half_float;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "half_float.inl"\r
+\r
+#endif//glm_gtc_half_float\r
diff --git a/glm/gtc/half_float.inl b/glm/gtc/half_float.inl
new file mode 100644 (file)
index 0000000..55719d0
--- /dev/null
@@ -0,0 +1,784 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-08-24\r
+// Licence : This source is under MIT licence\r
+// File    : glm/gtx/half_float.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+#ifndef GLM_USE_ANONYMOUS_UNION\r
+\r
+//////////////////////////////////////\r
+// hvec2\r
+\r
+inline tvec2<thalf>::size_type tvec2<thalf>::value_size()\r
+{\r
+       return tvec2<thalf>::size_type(2);\r
+}\r
+\r
+inline bool tvec2<thalf>::is_vector()\r
+{\r
+       return true;\r
+}\r
+\r
+//////////////////////////////////////\r
+// Accesses\r
+\r
+inline thalf& tvec2<thalf>::operator[](tvec2<thalf>::size_type i)\r
+{\r
+       assert( i >= tvec2<thalf>::size_type(0) && \r
+                       i < tvec2<thalf>::value_size());\r
+       return (&x)[i];\r
+}\r
+\r
+inline thalf tvec2<thalf>::operator[](tvec2<thalf>::size_type i) const\r
+{\r
+       assert( i >= tvec2<thalf>::size_type(0) && \r
+                       i < tvec2<thalf>::value_size());\r
+       return (&x)[i];\r
+}\r
+\r
+//////////////////////////////////////\r
+// Implicit basic constructors\r
+\r
+inline tvec2<thalf>::tvec2() :\r
+       x(thalf(0.f)),\r
+       y(thalf(0.f))\r
+{}\r
+\r
+inline tvec2<thalf>::tvec2(tvec2<thalf> const & v) :\r
+       x(v.x),\r
+       y(v.y)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Explicit basic constructors\r
+\r
+inline tvec2<thalf>::tvec2(thalf s) :\r
+       x(s),\r
+       y(s)\r
+{}\r
+\r
+inline tvec2<thalf>::tvec2(thalf s1, thalf s2) :\r
+       x(s1),\r
+       y(s2)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Swizzle constructors\r
+\r
+inline tvec2<thalf>::tvec2(tref2<thalf> const & r) :\r
+       x(r.x),\r
+       y(r.y)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Convertion scalar constructors\r
+\r
+template <typename U> \r
+inline tvec2<thalf>::tvec2(U x) :\r
+       x(thalf(x)),\r
+       y(thalf(x))\r
+{}\r
+\r
+template <typename U, typename V> \r
+inline tvec2<thalf>::tvec2(U x, V y) :\r
+       x(thalf(x)),\r
+       y(thalf(y))\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Convertion vector constructors\r
+\r
+template <typename U> \r
+inline tvec2<thalf>::tvec2(tvec2<U> const & v) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y))\r
+{}\r
+\r
+template <typename U> \r
+inline tvec2<thalf>::tvec2(tvec3<U> const & v) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y))\r
+{}\r
+\r
+template <typename U> \r
+inline tvec2<thalf>::tvec2(tvec4<U> const & v) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y))\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Unary arithmetic operators\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator= (tvec2<thalf> const & v)\r
+{\r
+       this->x = v.x;\r
+       this->y = v.y;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator+=(thalf s)\r
+{\r
+       this->x += s;\r
+       this->y += s;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator+=(tvec2<thalf> const & v)\r
+{\r
+       this->x += v.x;\r
+       this->y += v.y;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator-=(thalf s)\r
+{\r
+       this->x -= s;\r
+       this->y -= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator-=(tvec2<thalf> const & v)\r
+{\r
+       this->x -= v.x;\r
+       this->y -= v.y;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator*=(thalf s)\r
+{\r
+       this->x *= s;\r
+       this->y *= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator*=(tvec2<thalf> const & v)\r
+{\r
+       this->x *= v.x;\r
+       this->y *= v.y;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator/=(thalf s)\r
+{\r
+       this->x /= s;\r
+       this->y /= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator/=(tvec2<thalf> const & v)\r
+{\r
+       this->x /= v.x;\r
+       this->y /= v.y;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator++()\r
+{\r
+       ++this->x;\r
+       ++this->y;\r
+       return *this;\r
+}\r
+\r
+inline tvec2<thalf>& tvec2<thalf>::operator--()\r
+{\r
+       --this->x;\r
+       --this->y;\r
+       return *this;\r
+}\r
+\r
+//////////////////////////////////////\r
+// Swizzle operators\r
+\r
+inline thalf tvec2<thalf>::swizzle(comp x) const\r
+{\r
+       return (*this)[x];\r
+}\r
+\r
+inline tvec2<thalf> tvec2<thalf>::swizzle(comp x, comp y) const\r
+{\r
+       return tvec2<thalf>(\r
+               (*this)[x],\r
+               (*this)[y]);\r
+}\r
+\r
+inline tvec3<thalf> tvec2<thalf>::swizzle(comp x, comp y, comp z) const\r
+{\r
+       return tvec3<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z]);\r
+}\r
+\r
+inline tvec4<thalf> tvec2<thalf>::swizzle(comp x, comp y, comp z, comp w) const\r
+{\r
+       return tvec4<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z],\r
+               (*this)[w]);\r
+}\r
+\r
+inline tref2<thalf> tvec2<thalf>::swizzle(comp x, comp y)\r
+{\r
+       return tref2<thalf>(\r
+               (*this)[x],\r
+               (*this)[y]);\r
+}\r
+\r
+//////////////////////////////////////\r
+// hvec3\r
+\r
+inline tvec3<thalf>::size_type tvec3<thalf>::value_size()\r
+{\r
+       return tvec3<thalf>::size_type(3);\r
+}\r
+\r
+inline bool tvec3<thalf>::is_vector()\r
+{\r
+       return true;\r
+}\r
+\r
+//////////////////////////////////////\r
+// Accesses\r
+\r
+inline thalf& tvec3<thalf>::operator[](tvec3<thalf>::size_type i)\r
+{\r
+       assert( i >= tvec3<thalf>::size_type(0) && \r
+                       i < tvec3<thalf>::value_size());\r
+\r
+       return (&x)[i];\r
+}\r
+\r
+inline thalf tvec3<thalf>::operator[](tvec3<thalf>::size_type i) const\r
+{\r
+       assert( i >= tvec3<thalf>::size_type(0) && \r
+                       i < tvec3<thalf>::value_size());\r
+\r
+       return (&x)[i];\r
+}\r
+\r
+//////////////////////////////////////\r
+// Implicit basic constructors\r
+\r
+inline tvec3<thalf>::tvec3() :\r
+       x(thalf(0)),\r
+       y(thalf(0)),\r
+       z(thalf(0))\r
+{}\r
+\r
+inline tvec3<thalf>::tvec3(tvec3<thalf> const & v) :\r
+       x(v.x),\r
+       y(v.y),\r
+       z(v.z)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Explicit basic constructors\r
+\r
+inline tvec3<thalf>::tvec3(thalf s) :\r
+       x(s),\r
+       y(s),\r
+       z(s)\r
+{}\r
+\r
+inline tvec3<thalf>::tvec3(thalf s0, thalf s1, thalf s2) :\r
+       x(s0),\r
+       y(s1),\r
+       z(s2)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Swizzle constructors\r
+\r
+inline tvec3<thalf>::tvec3(tref3<thalf> const & r) :\r
+       x(r.x),\r
+       y(r.y),\r
+       z(r.z)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Convertion scalar constructors\r
+\r
+template <typename U> \r
+inline tvec3<thalf>::tvec3(U x) :\r
+       x(thalf(x)),\r
+       y(thalf(x)),\r
+       z(thalf(x))\r
+{}\r
+\r
+template <typename A, typename B, typename C> \r
+inline tvec3<thalf>::tvec3(A x, B y, C z) :\r
+       x(thalf(x)),\r
+       y(thalf(y)),\r
+       z(thalf(z))\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Convertion vector constructors\r
+\r
+template <typename A, typename B> \r
+inline tvec3<thalf>::tvec3(tvec2<A> const & v, B s) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y)),\r
+       z(thalf(s))\r
+{}\r
+\r
+template <typename A, typename B> \r
+inline tvec3<thalf>::tvec3(A s, tvec2<B> const & v) :\r
+       x(thalf(s)),\r
+       y(thalf(v.x)),\r
+       z(thalf(v.y))\r
+{}\r
+\r
+template <typename U> \r
+inline tvec3<thalf>::tvec3(tvec3<U> const & v) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y)),\r
+       z(thalf(v.z))\r
+{}\r
+\r
+template <typename U> \r
+inline tvec3<thalf>::tvec3(tvec4<U> const & v) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y)),\r
+       z(thalf(v.z))\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Unary arithmetic operators\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator= (tvec3<thalf> const & v)\r
+{\r
+       this->x = v.x;\r
+       this->y = v.y;\r
+       this->z = v.z;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator+=(thalf s)\r
+{\r
+       this->x += s;\r
+       this->y += s;\r
+       this->z += s;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator+=(tvec3<thalf> const & v)\r
+{\r
+       this->x += v.x;\r
+       this->y += v.y;\r
+       this->z += v.z;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator-=(thalf s)\r
+{\r
+       this->x -= s;\r
+       this->y -= s;\r
+       this->z -= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator-=(tvec3<thalf> const & v)\r
+{\r
+       this->x -= v.x;\r
+       this->y -= v.y;\r
+       this->z -= v.z;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator*=(thalf s)\r
+{\r
+       this->x *= s;\r
+       this->y *= s;\r
+       this->z *= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator*=(tvec3<thalf> const & v)\r
+{\r
+       this->x *= v.x;\r
+       this->y *= v.y;\r
+       this->z *= v.z;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator/=(thalf s)\r
+{\r
+       this->x /= s;\r
+       this->y /= s;\r
+       this->z /= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator/=(tvec3<thalf> const & v)\r
+{\r
+       this->x /= v.x;\r
+       this->y /= v.y;\r
+       this->z /= v.z;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator++()\r
+{\r
+       ++this->x;\r
+       ++this->y;\r
+       ++this->z;\r
+       return *this;\r
+}\r
+\r
+inline tvec3<thalf>& tvec3<thalf>::operator--()\r
+{\r
+       --this->x;\r
+       --this->y;\r
+       --this->z;\r
+       return *this;\r
+}\r
+\r
+//////////////////////////////////////\r
+// Swizzle operators\r
+\r
+inline thalf tvec3<thalf>::swizzle(comp x) const\r
+{\r
+       return (*this)[x];\r
+}\r
+\r
+inline tvec2<thalf> tvec3<thalf>::swizzle(comp x, comp y) const\r
+{\r
+       return tvec2<thalf>(\r
+               (*this)[x],\r
+               (*this)[y]);\r
+}\r
+\r
+inline tvec3<thalf> tvec3<thalf>::swizzle(comp x, comp y, comp z) const\r
+{\r
+       return tvec3<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z]);\r
+}\r
+\r
+inline tvec4<thalf> tvec3<thalf>::swizzle(comp x, comp y, comp z, comp w) const\r
+{\r
+       return tvec4<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z],\r
+               (*this)[w]);\r
+}\r
+\r
+inline tref3<thalf> tvec3<thalf>::swizzle(comp x, comp y, comp z)\r
+{\r
+       return tref3<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z]);\r
+}\r
+\r
+//////////////////////////////////////\r
+// hvec4\r
+\r
+inline tvec4<thalf>::size_type tvec4<thalf>::value_size()\r
+{\r
+       return tvec4<thalf>::size_type(4);\r
+}\r
+\r
+inline bool tvec4<thalf>::is_vector()\r
+{\r
+       return true;\r
+}\r
+\r
+//////////////////////////////////////\r
+// Accesses\r
+\r
+inline thalf& tvec4<thalf>::operator[](tvec4<thalf>::size_type i)\r
+{\r
+       assert( i >= tvec4<thalf>::size_type(0) && \r
+                       i < tvec4<thalf>::value_size());\r
+\r
+       return (&x)[i];\r
+}\r
+\r
+inline thalf tvec4<thalf>::operator[](tvec4<thalf>::size_type i) const\r
+{\r
+       assert( i >= tvec4<thalf>::size_type(0) && \r
+                       i < tvec4<thalf>::value_size());\r
+\r
+       return (&x)[i];\r
+}\r
+\r
+//////////////////////////////////////\r
+// Implicit basic constructors\r
+\r
+inline tvec4<thalf>::tvec4() :\r
+       x(thalf(0)),\r
+       y(thalf(0)),\r
+       z(thalf(0)),\r
+       w(thalf(0))\r
+{}\r
+\r
+inline tvec4<thalf>::tvec4(tvec4<thalf> const & v) :\r
+       x(v.x),\r
+       y(v.y),\r
+       z(v.z),\r
+       w(v.w)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Explicit basic constructors\r
+\r
+inline tvec4<thalf>::tvec4(thalf s) :\r
+       x(s),\r
+       y(s),\r
+       z(s),\r
+       w(s)\r
+{}\r
+\r
+inline tvec4<thalf>::tvec4(thalf s1, thalf s2, thalf s3, thalf s4) :\r
+       x(s1),\r
+       y(s2),\r
+       z(s3),\r
+       w(s4)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Swizzle constructors\r
+\r
+inline tvec4<thalf>::tvec4(tref4<thalf> const & r) :\r
+       x(r.x),\r
+       y(r.y),\r
+       z(r.z),\r
+       w(r.w)\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Convertion scalar constructors\r
+\r
+template <typename U> \r
+inline tvec4<thalf>::tvec4(U x) :\r
+       x(thalf(x)),\r
+       y(thalf(x)),\r
+       z(thalf(x)),\r
+       w(thalf(x))\r
+{}\r
+\r
+template <typename A, typename B, typename C, typename D> \r
+inline tvec4<thalf>::tvec4(A x, B y, C z, D w) :\r
+       x(thalf(x)),\r
+       y(thalf(y)),\r
+       z(thalf(z)),\r
+       w(thalf(w))\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Convertion vector constructors\r
+\r
+template <typename A, typename B, typename C> \r
+inline tvec4<thalf>::tvec4(const tvec2<A>& v, B s1, C s2) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y)),\r
+       z(thalf(s1)),\r
+       w(thalf(s2))\r
+{}\r
+\r
+template <typename A, typename B, typename C> \r
+inline tvec4<thalf>::tvec4(A s1, const tvec2<B>& v, C s2) :\r
+       x(thalf(s1)),\r
+       y(thalf(v.x)),\r
+       z(thalf(v.y)),\r
+       w(thalf(s2))\r
+{}\r
+\r
+template <typename A, typename B, typename C> \r
+inline tvec4<thalf>::tvec4(A s1, B s2, const tvec2<C>& v) :\r
+       x(thalf(s1)),\r
+       y(thalf(s2)),\r
+       z(thalf(v.x)),\r
+       w(thalf(v.y))\r
+{}\r
+\r
+template <typename A, typename B> \r
+inline tvec4<thalf>::tvec4(const tvec3<A>& v, B s) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y)),\r
+       z(thalf(v.z)),\r
+       w(thalf(s))\r
+{}\r
+\r
+template <typename A, typename B> \r
+inline tvec4<thalf>::tvec4(A s, const tvec3<B>& v) :\r
+       x(thalf(s)),\r
+       y(thalf(v.x)),\r
+       z(thalf(v.y)),\r
+       w(thalf(v.z))\r
+{}\r
+\r
+template <typename A, typename B> \r
+inline tvec4<thalf>::tvec4(const tvec2<A>& v1, const tvec2<B>& v2) :\r
+       x(thalf(v1.x)),\r
+       y(thalf(v1.y)),\r
+       z(thalf(v2.x)),\r
+       w(thalf(v2.y))\r
+{}\r
+\r
+template <typename U> \r
+inline tvec4<thalf>::tvec4(const tvec4<U>& v) :\r
+       x(thalf(v.x)),\r
+       y(thalf(v.y)),\r
+       z(thalf(v.z)),\r
+       w(thalf(v.w))\r
+{}\r
+\r
+//////////////////////////////////////\r
+// Unary arithmetic operators\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator= (tvec4<thalf> const & v)\r
+{\r
+       this->x = v.x;\r
+       this->y = v.y;\r
+       this->z = v.z;\r
+       this->w = v.w;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator+=(thalf s)\r
+{\r
+       this->x += s;\r
+       this->y += s;\r
+       this->z += s;\r
+       this->w += s;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator+=(tvec4<thalf> const & v)\r
+{\r
+       this->x += v.x;\r
+       this->y += v.y;\r
+       this->z += v.z;\r
+       this->w += v.w;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator-=(thalf s)\r
+{\r
+       this->x -= s;\r
+       this->y -= s;\r
+       this->z -= s;\r
+       this->w -= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator-=(tvec4<thalf> const & v)\r
+{\r
+       this->x -= v.x;\r
+       this->y -= v.y;\r
+       this->z -= v.z;\r
+       this->w -= v.w;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator*=(thalf s)\r
+{\r
+       this->x *= s;\r
+       this->y *= s;\r
+       this->z *= s;\r
+       this->w *= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator*=(tvec4<thalf> const & v)\r
+{\r
+       this->x *= v.x;\r
+       this->y *= v.y;\r
+       this->z *= v.z;\r
+       this->w *= v.w;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator/=(thalf s)\r
+{\r
+       this->x /= s;\r
+       this->y /= s;\r
+       this->z /= s;\r
+       this->w /= s;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator/=(tvec4<thalf> const & v)\r
+{\r
+       this->x /= v.x;\r
+       this->y /= v.y;\r
+       this->z /= v.z;\r
+       this->w /= v.w;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator++()\r
+{\r
+       ++this->x;\r
+       ++this->y;\r
+       ++this->z;\r
+       ++this->w;\r
+       return *this;\r
+}\r
+\r
+inline tvec4<thalf>& tvec4<thalf>::operator--()\r
+{\r
+       --this->x;\r
+       --this->y;\r
+       --this->z;\r
+       --this->w;\r
+       return *this;\r
+}\r
+\r
+//////////////////////////////////////\r
+// Swizzle operators\r
+\r
+inline thalf tvec4<thalf>::swizzle(comp x) const\r
+{\r
+       return (*this)[x];\r
+}\r
+\r
+inline tvec2<thalf> tvec4<thalf>::swizzle(comp x, comp y) const\r
+{\r
+       return tvec2<thalf>(\r
+               (*this)[x],\r
+               (*this)[y]);\r
+}\r
+\r
+inline tvec3<thalf> tvec4<thalf>::swizzle(comp x, comp y, comp z) const\r
+{\r
+       return tvec3<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z]);\r
+}\r
+\r
+inline tvec4<thalf> tvec4<thalf>::swizzle(comp x, comp y, comp z, comp w) const\r
+{\r
+       return tvec4<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z],\r
+               (*this)[w]);\r
+}\r
+\r
+inline tref4<thalf> tvec4<thalf>::swizzle(comp x, comp y, comp z, comp w)\r
+{\r
+       return tref4<thalf>(\r
+               (*this)[x],\r
+               (*this)[y],\r
+               (*this)[z],\r
+               (*this)[w]);\r
+}\r
+\r
+#endif//GLM_USE_ANONYMOUS_UNION\r
+\r
+}//namespace detail\r
+}//namespace glm\r
diff --git a/glm/gtc/matrix_access.hpp b/glm/gtc/matrix_access.hpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtc/matrix_access.inl b/glm/gtc/matrix_access.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtc/matrix_operation.hpp b/glm/gtc/matrix_operation.hpp
new file mode 100644 (file)
index 0000000..72d9e70
--- /dev/null
@@ -0,0 +1,36 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/matrix_operation.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc_matrix_operation\r
+#define glm_gtc_matrix_operation\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm{\r
+namespace gtc{\r
+//! GLM_GTC_matrix_operation extension: Matrix operation functions\r
+namespace matrix_operation\r
+{\r
+\r
+}//namespace matrix_operation\r
+}//namespace gtc\r
+}//namespace glm\r
+\r
+#define GLM_GTC_matrix_operation namespace gtc::matrix_operation\r
+#ifndef GLM_GTC_GLOBAL\r
+namespace glm {using GLM_GTC_matrix_operation;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "matrix_operation.inl"\r
+\r
+#endif//glm_gtc_matrix_operation\r
diff --git a/glm/gtc/matrix_operation.inl b/glm/gtc/matrix_operation.inl
new file mode 100644 (file)
index 0000000..83222d0
--- /dev/null
@@ -0,0 +1,17 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/matrix_operation.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtc{\r
+namespace matrix_operation\r
+{\r
+\r
+}//namespace matrix_operation\r
+}//namespace gtc\r
+}//namespace glm\r
diff --git a/glm/gtc/matrix_projection.hpp b/glm/gtc/matrix_projection.hpp
new file mode 100644 (file)
index 0000000..588c970
--- /dev/null
@@ -0,0 +1,102 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/matrix_projection.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_matrix_operation\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc_matrix_projection\r
+#define glm_gtc_matrix_projection\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/matrix_operation.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               bool main_gtc_matrix_projection();\r
+       }//namespace test\r
+\r
+    namespace gtc{\r
+       //! GLM_GTC_matrix_projection: Varius ways to build and operate on projection matrices\r
+    namespace matrix_projection\r
+    {\r
+               using namespace gtc::matrix_operation;\r
+\r
+               //! Creates a matrix for projecting two-dimensional coordinates onto the screen.\r
+               //! From GLM_GTC_matrix_projection extension.\r
+        template <typename valType> \r
+               detail::tmat4x4<valType> ortho(\r
+                       valType const & left, \r
+                       valType const & right, \r
+                       valType const & bottom, \r
+                       valType const & top);\r
+\r
+               //! Creates a matrix for an orthographic parallel viewing volume.\r
+               //! From GLM_GTC_matrix_projection extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> ortho(\r
+                       valType const & left, \r
+                       valType const & right, \r
+                       valType const & bottom, \r
+                       valType const & top, \r
+                       valType const & zNear, \r
+                       valType const & zFar);\r
+\r
+               //! Creates a frustum matrix.\r
+               //! From GLM_GTC_matrix_projection extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> frustum(\r
+                       valType const & left, \r
+                       valType const & right, \r
+                       valType const & bottom, \r
+                       valType const & top, \r
+                       valType const & nearVal, \r
+                       valType const & farVal);\r
+\r
+               //! Creates a matrix for a symetric perspective-view frustum.\r
+               //! From GLM_GTC_matrix_projection extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> perspective(\r
+                       valType const & fovy, \r
+                       valType const & aspect, \r
+                       valType const & zNear, \r
+                       valType const & zFar);\r
+\r
+               //! Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.\r
+               //! From GLM_GTC_matrix_projection extension.\r
+               template <typename valTypeT, typename valTypeU> \r
+               detail::tvec3<valTypeT> project(\r
+                       detail::tvec3<valTypeT> const & obj, \r
+                       detail::tmat4x4<valTypeT> const & model, \r
+                       detail::tmat4x4<valTypeT> const & proj, \r
+                       detail::tvec4<valTypeU> const & viewport);\r
+\r
+               //! Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.\r
+               //! From GLM_GTC_matrix_projection extension.\r
+               template <typename valTypeT, typename valTypeU> \r
+               detail::tvec3<valTypeT> unProject(\r
+                       detail::tvec3<valTypeT> const & win, \r
+                       detail::tmat4x4<valTypeT> const & model, \r
+                       detail::tmat4x4<valTypeT> const & proj, \r
+                       detail::tvec4<valTypeU> const & viewport);\r
+\r
+    }//namespace matrix_projection\r
+    }//namespace gtc\r
+}//namespace glm\r
+\r
+#define GLM_GTC_matrix_projection  namespace gtc::matrix_projection\r
+#ifndef GLM_GTC_GLOBAL\r
+namespace glm {using GLM_GTC_matrix_projection;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "matrix_projection.inl"\r
+\r
+#endif//glm_gtc_matrix_projection\r
diff --git a/glm/gtc/matrix_projection.inl b/glm/gtc/matrix_projection.inl
new file mode 100644 (file)
index 0000000..7bae2f9
--- /dev/null
@@ -0,0 +1,132 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/matrix_projection.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtc{\r
+namespace matrix_projection\r
+{\r
+       template <typename valType> \r
+       inline detail::tmat4x4<valType> ortho(\r
+               valType const & left, \r
+               valType const & right, \r
+               valType const & bottom, \r
+               valType const & top)\r
+       {\r
+               detail::tmat4x4<valType> Result(1);\r
+               Result[0][0] = valType(2) / (right - left);\r
+               Result[1][1] = valType(2) / (top - bottom);\r
+               Result[2][2] = - valType(1);\r
+               Result[3][0] = - (right + left) / (right - left);\r
+               Result[3][1] = - (top + bottom) / (top - bottom);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat4x4<valType> ortho(\r
+               valType const & left, \r
+               valType const & right, \r
+               valType const & bottom, \r
+               valType const & top, \r
+               valType const & zNear, \r
+               valType const & zFar)\r
+       {\r
+               detail::tmat4x4<valType> Result(1);\r
+               Result[0][0] = valType(2) / (right - left);\r
+               Result[1][1] = valType(2) / (top - bottom);\r
+               Result[2][2] = - valType(2) / (zFar - zNear);\r
+               Result[3][0] = - (right + left) / (right - left);\r
+               Result[3][1] = - (top + bottom) / (top - bottom);\r
+               Result[3][2] = - (zFar + zNear) / (zFar - zNear);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat4x4<valType> frustum(\r
+               valType const & left, \r
+               valType const & right, \r
+               valType const & bottom, \r
+               valType const & top, \r
+               valType const & nearVal, \r
+               valType const & farVal)\r
+       {\r
+               detail::tmat4x4<valType> Result(0);\r
+               Result[0][0] = (valType(2) * nearVal) / (right - left);\r
+               Result[1][1] = (valType(2) * nearVal) / (top - bottom);\r
+               Result[2][0] = (right + left) / (right - left);\r
+               Result[2][1] = (top + bottom) / (top - bottom);\r
+               Result[2][2] = -(farVal + nearVal) / (farVal - nearVal);\r
+               Result[2][3] = valType(-1);\r
+               Result[3][2] = -(valType(2) * farVal * nearVal) / (farVal - nearVal);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat4x4<valType> perspective(\r
+               valType const & fovy, \r
+               valType const & aspect, \r
+               valType const & zNear, \r
+               valType const & zFar)\r
+       {\r
+               valType range = tan(radians(fovy / valType(2))) * zNear;        \r
+               valType left = -range * aspect;\r
+               valType right = range * aspect;\r
+               valType bottom = -range;\r
+               valType top = range;\r
+\r
+               detail::tmat4x4<valType> Result(valType(0));\r
+               Result[0][0] = (valType(2) * zNear) / (right - left);\r
+               Result[1][1] = (valType(2) * zNear) / (top - bottom);\r
+               Result[2][2] = - (zFar + zNear) / (zFar - zNear);\r
+               Result[2][3] = - valType(1);\r
+               Result[3][2] = - (valType(2) * zFar * zNear) / (zFar - zNear);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valTypeT, typename valTypeU>\r
+       inline detail::tvec3<valTypeT> project(\r
+               detail::tvec3<valTypeT> const & obj, \r
+               detail::tmat4x4<valTypeT> const & model, \r
+               detail::tmat4x4<valTypeT> const & proj, \r
+               detail::tvec4<valTypeU> const & viewport)\r
+       {\r
+               detail::tvec4<valTypeT> tmp = detail::tvec4<valTypeT>(obj, valTypeT(1));\r
+               tmp = model * tmp;\r
+               tmp = proj * tmp;\r
+\r
+               tmp /= tmp.w;\r
+               tmp = tmp * valTypeT(0.5) + valTypeT(0.5);\r
+               tmp[0] = tmp[0] * valTypeT(viewport[2]) + valTypeT(viewport[0]);\r
+               tmp[1] = tmp[1] * valTypeT(viewport[3]) + valTypeT(viewport[1]);\r
+\r
+               return detail::tvec3<valTypeT>(tmp);\r
+       }\r
+\r
+       template <typename valTypeT, typename valTypeU>\r
+       inline detail::tvec3<valTypeT> unProject(\r
+               detail::tvec3<valTypeT> const & win, \r
+               detail::tmat4x4<valTypeT> const & model, \r
+               detail::tmat4x4<valTypeT> const & proj, \r
+               detail::tvec4<valTypeU> const & viewport)\r
+       {\r
+               detail::tmat4x4<valTypeT> inverse = glm::inverse(proj * model);\r
+\r
+               detail::tvec4<valTypeT> tmp = detail::tvec4<valTypeT>(win, valTypeT(1));\r
+               tmp.x = (tmp.x - valTypeT(viewport[0])) / valTypeT(viewport[2]);\r
+               tmp.y = (tmp.y - valTypeT(viewport[1])) / valTypeT(viewport[3]);\r
+               tmp = tmp * valTypeT(2) - valTypeT(1);\r
+\r
+               detail::tvec4<valTypeT> obj = inverse * tmp;\r
+               obj /= obj.w;\r
+\r
+               return detail::tvec3<valTypeT>(obj);\r
+       }\r
+\r
+}//namespace matrix_projection\r
+}//namespace gtc\r
+}//namespace glm\r
diff --git a/glm/gtc/matrix_transform.hpp b/glm/gtc/matrix_transform.hpp
new file mode 100644 (file)
index 0000000..3faa5e1
--- /dev/null
@@ -0,0 +1,66 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/matrix_transform.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_matrix_operation\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc_matrix_transform\r
+#define glm_gtc_matrix_transform\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/matrix_operation.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               bool main_gtc_matrix_transform();\r
+       }//namespace test\r
+\r
+       namespace gtc{\r
+       //! GLM_GTC_matrix_transform extension: Add transformation matrices\r
+       namespace matrix_transform\r
+       {\r
+               using namespace gtc::matrix_operation;\r
+\r
+               //! Builds a translation 4 * 4 matrix created from a vector of 3 components.\r
+               //! From GLM_GTC_matrix_transform extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> translate(\r
+                       detail::tmat4x4<valType> const & m,\r
+                       detail::tvec3<valType> const & v);\r
+               \r
+               //! Builds a rotation 4 * 4 matrix created from an axis vector and an angle expressed in degrees. \r
+               //! From GLM_GTC_matrix_transform extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> rotate(\r
+                       detail::tmat4x4<valType> const & m,\r
+                       valType const & angle, \r
+                       detail::tvec3<valType> const & v);\r
+\r
+               //! Builds a scale 4 * 4 matrix created from 3 scalars. \r
+               //! From GLM_GTC_matrix_transform extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> scale(\r
+                       detail::tmat4x4<valType> const & m,\r
+                       detail::tvec3<valType> const & v);\r
+\r
+       }//namespace matrix_transform\r
+       }//namespace gtc\r
+}//namespace glm\r
+\r
+#define GLM_GTC_matrix_transform namespace gtc::matrix_transform\r
+#ifndef GLM_GTC_GLOBAL\r
+namespace glm {using GLM_GTC_matrix_transform;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "matrix_transform.inl"\r
+\r
+#endif//glm_gtc_matrix_transform\r
diff --git a/glm/gtc/matrix_transform.inl b/glm/gtc/matrix_transform.inl
new file mode 100644 (file)
index 0000000..389ac79
--- /dev/null
@@ -0,0 +1,136 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/matrix_transform.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtc{\r
+namespace matrix_transform\r
+{\r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> translate(\r
+               detail::tmat4x4<valType> const & m,\r
+               detail::tvec3<valType> const & v)\r
+    {\r
+               detail::tmat4x4<valType> Result(m);\r
+               Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];\r
+               return Result;\r
+    }\r
+               \r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> rotate(\r
+               detail::tmat4x4<valType> const & m,\r
+               valType const & angle, \r
+               detail::tvec3<valType> const & v)\r
+    {\r
+        valType a = radians(angle);\r
+        valType c = cos(a);\r
+        valType s = sin(a);\r
+\r
+        detail::tvec3<valType> axis = normalize(v);\r
+\r
+               detail::tvec3<valType> temp = (valType(1) - c) * axis;\r
+\r
+        detail::tmat4x4<valType> Rotate(detail::tmat4x4<valType>::null);\r
+               Rotate[0][0] = c + temp[0] * axis[0];\r
+           Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2];\r
+           Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1];\r
+\r
+           Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2];\r
+           Rotate[1][1] = c + temp[1] * axis[1];\r
+           Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0];\r
+\r
+           Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1];\r
+           Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0];\r
+           Rotate[2][2] = c + temp[2] * axis[2];\r
+\r
+               detail::tmat4x4<valType> Result(detail::tmat4x4<valType>::null);\r
+               Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2];\r
+               Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2];\r
+               Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2];\r
+               Result[3] = m[3];\r
+               return Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> scale(\r
+               detail::tmat4x4<valType> const & m,\r
+               detail::tvec3<valType> const & v)\r
+    {\r
+        detail::tmat4x4<valType> Result(detail::tmat4x4<valType>::null);\r
+               Result[0] = m[0] * v[0];\r
+               Result[1] = m[1] * v[1];\r
+               Result[2] = m[2] * v[2];\r
+               Result[3] = m[3];\r
+               return Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> translate_slow(\r
+               detail::tmat4x4<valType> const & m,\r
+               detail::tvec3<valType> const & v)\r
+    {\r
+        detail::tmat4x4<valType> Result(valType(1));\r
+        Result[3] = detail::tvec4<valType>(v, valType(1));\r
+        return m * Result;\r
+\r
+               //detail::tmat4x4<valType> Result(m);\r
+               Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];\r
+               //Result[3][0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0];\r
+               //Result[3][1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1];\r
+               //Result[3][2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2];\r
+               //Result[3][3] = m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3];\r
+               //return Result;\r
+    }\r
+               \r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> rotate_slow(\r
+               detail::tmat4x4<valType> const & m,\r
+               valType const & angle, \r
+               detail::tvec3<valType> const & v)\r
+    {\r
+        valType a = radians(angle);\r
+        valType c = cos(a);\r
+        valType s = sin(a);\r
+        detail::tmat4x4<valType> Result;\r
+\r
+        detail::tvec3<valType> axis = normalize(v);\r
+\r
+        Result[0][0] = c + (1 - c)      * axis.x     * axis.x;\r
+           Result[0][1] = (1 - c) * axis.x * axis.y + s * axis.z;\r
+           Result[0][2] = (1 - c) * axis.x * axis.z - s * axis.y;\r
+           Result[0][3] = 0;\r
+\r
+           Result[1][0] = (1 - c) * axis.y * axis.x - s * axis.z;\r
+           Result[1][1] = c + (1 - c) * axis.y * axis.y;\r
+           Result[1][2] = (1 - c) * axis.y * axis.z + s * axis.x;\r
+           Result[1][3] = 0;\r
+\r
+           Result[2][0] = (1 - c) * axis.z * axis.x + s * axis.y;\r
+           Result[2][1] = (1 - c) * axis.z * axis.y - s * axis.x;\r
+           Result[2][2] = c + (1 - c) * axis.z * axis.z;\r
+           Result[2][3] = 0;\r
+\r
+        Result[3] = detail::tvec4<valType>(0, 0, 0, 1);\r
+        return m * Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> scale_slow(\r
+               detail::tmat4x4<valType> const & m,\r
+               detail::tvec3<valType> const & v)\r
+    {\r
+        detail::tmat4x4<valType> Result(valType(1));\r
+        Result[0][0] = v.x;\r
+        Result[1][1] = v.y;\r
+        Result[2][2] = v.z;\r
+        return m * Result;\r
+    }\r
+\r
+}//namespace matrix_transform\r
+}//namespace gtc\r
+}//namespace glm\r
diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp
new file mode 100644 (file)
index 0000000..bcf8877
--- /dev/null
@@ -0,0 +1,198 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-21\r
+// Updated : 2009-06-04\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/quaternion.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// ToDo:\r
+// - Study constructors with angles and axis\r
+// - Study constructors with vec3 that are the imaginary component of quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc_quaternion\r
+#define glm_gtc_quaternion\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               bool main_gtc_quaternion();\r
+       }//namespace test\r
+\r
+       namespace detail\r
+       {\r
+               //! \brief Template for quaternion. \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               class tquat\r
+               {\r
+               public:\r
+                       valType x, y, z, w;\r
+\r
+                       // Constructors\r
+                       tquat();\r
+                       explicit tquat(valType const & s, tvec3<valType> const & v);\r
+                       explicit tquat(valType const & w, valType const & x, valType const & y, valType const & z);\r
+\r
+                       // Convertions\r
+                       //explicit tquat(valType const & pitch, valType const & yaw, valType const & roll);\r
+                       //! pitch, yaw, roll\r
+                       explicit tquat(tvec3<valType> const & eulerAngles);\r
+                       explicit tquat(tmat3x3<valType> const & m);\r
+                       explicit tquat(tmat4x4<valType> const & m);\r
+\r
+                       // Accesses\r
+                       valType& operator[](int i);\r
+                       valType operator[](int i) const;\r
+\r
+                       // Operators\r
+                       tquat<valType>& operator*=(valType const & s);\r
+                       tquat<valType>& operator/=(valType const & s);\r
+               };\r
+\r
+               template <typename valType> \r
+               detail::tquat<valType> operator- (\r
+                       detail::tquat<valType> const & q);\r
+\r
+               template <typename valType> \r
+               detail::tvec3<valType> operator* (\r
+                       detail::tquat<valType> const & q, \r
+                       detail::tvec3<valType> const & v);\r
+\r
+               template <typename valType> \r
+               detail::tvec3<valType> operator* (\r
+                       detail::tvec3<valType> const & v,\r
+                       detail::tquat<valType> const & q);\r
+\r
+               template <typename valType> \r
+               detail::tvec4<valType> operator* (\r
+                       detail::tquat<valType> const & q, \r
+                       detail::tvec4<valType> const & v);\r
+\r
+               template <typename valType> \r
+               detail::tvec4<valType> operator* (\r
+                       detail::tvec4<valType> const & v,\r
+                       detail::tquat<valType> const & q);\r
+\r
+               template <typename valType> \r
+               detail::tquat<valType> operator* (\r
+                       detail::tquat<valType> const & q, \r
+                       valType const & s);\r
+\r
+               template <typename valType> \r
+               detail::tquat<valType> operator* (\r
+                       valType const & s,\r
+                       detail::tquat<valType> const & q);\r
+\r
+               template <typename valType> \r
+               detail::tquat<valType> operator/ (\r
+                       detail::tquat<valType> const & q, \r
+                       valType const & s);\r
+\r
+       } //namespace detail\r
+\r
+       namespace gtc{\r
+       //! GLM_GTC_quaternion extension: Quaternion types and functions\r
+    namespace quaternion\r
+    {\r
+               //! Returns the length of the quaternion x. \r
+               //! From GLM_GTC_quaternion extension.\r
+        template <typename valType> \r
+               valType length(\r
+                       detail::tquat<valType> const & q);\r
+\r
+        //! Returns the normalized quaternion of from x. \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> normalize(\r
+                       detail::tquat<valType> const & q);\r
+               \r
+        //! Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               valType dot(\r
+                       detail::tquat<valType> const & q1, \r
+                       detail::tquat<valType> const & q2);\r
+\r
+        //! Returns the cross product of q1 and q2. \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> cross(\r
+                       detail::tquat<valType> const & q1, \r
+                       detail::tquat<valType> const & q2);\r
+               \r
+               //! Returns a LERP interpolated quaternion of x and y according a. \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> mix(\r
+                       detail::tquat<valType> const & x, \r
+                       detail::tquat<valType> const & y, \r
+                       valType const & a);\r
+               \r
+               //! Returns the q conjugate. \r
+               //! From GLM_GTC_quaternion extension.\r
+        template <typename valType> \r
+               detail::tquat<valType> conjugate(\r
+                       detail::tquat<valType> const & q);\r
+\r
+               //! Returns the q inverse. \r
+               //! From GLM_GTC_quaternion extension.\r
+        template <typename valType> \r
+               detail::tquat<valType> inverse(\r
+                       detail::tquat<valType> const & q);\r
+\r
+               //! Rotates a quaternion from an vector of 3 components axis and an angle expressed in degrees.\r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> rotate(\r
+                       detail::tquat<valType> const & q, \r
+                       valType const & angle, \r
+                       detail::tvec3<valType> const & v);\r
+\r
+               //! Converts a quaternion to a 3 * 3 matrix. \r
+               //! From GLM_GTC_quaternion extension.\r
+        template <typename valType> \r
+               detail::tmat3x3<valType> mat3_cast(\r
+                       detail::tquat<valType> const & x);\r
+\r
+               //! Converts a quaternion to a 4 * 4 matrix. \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> mat4_cast(\r
+                       detail::tquat<valType> const & x);\r
+\r
+               //! Converts a 3 * 3 matrix to a quaternion. \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> quat_cast(\r
+                       detail::tmat3x3<valType> const & x);\r
+\r
+               //! Converts a 4 * 4 matrix to a quaternion. \r
+               //! From GLM_GTC_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> quat_cast(\r
+                       detail::tmat4x4<valType> const & x);\r
+\r
+               //! Quaternion of floating-point numbers. \r
+               //! From GLM_GTC_quaternion extension.\r
+        typedef detail::tquat<float> quat;\r
+\r
+    }//namespace quaternion\r
+    }//namespace gtc\r
+} //namespace glm\r
+\r
+#define GLM_GTC_quaternion namespace gtc::quaternion\r
+#ifndef GLM_GTC_GLOBAL\r
+namespace glm {using GLM_GTC_quaternion;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "quaternion.inl"\r
+\r
+#endif//glm_gtc_quaternion\r
diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl
new file mode 100644 (file)
index 0000000..5b05a07
--- /dev/null
@@ -0,0 +1,481 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-21\r
+// Updated : 2009-06-04\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/quaternion.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <limits>\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+    template <typename valType> \r
+    inline tquat<valType>::tquat() : \r
+        x(0),\r
+        y(0),\r
+        z(0),\r
+        w(1)\r
+    {}\r
+\r
+    template <typename valType> \r
+    inline tquat<valType>::tquat\r
+       (\r
+               valType const & s, \r
+               tvec3<valType> const & v\r
+       ) : \r
+        x(v.x),\r
+        y(v.y),\r
+        z(v.z),\r
+        w(s)\r
+    {}\r
+\r
+    template <typename valType> \r
+    inline tquat<valType>::tquat\r
+       (\r
+               valType const & w, \r
+               valType const & x, \r
+               valType const & y, \r
+               valType const & z\r
+       ) :\r
+        x(x),\r
+        y(y),\r
+        z(z),\r
+        w(w)\r
+    {}\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // tquat conversions\r
+\r
+       //template <typename valType> \r
+       //inline tquat<valType>::tquat\r
+       //(\r
+       //      valType const & pitch, \r
+       //      valType const & yaw, \r
+       //      valType const & roll\r
+       //)\r
+       //{\r
+       //      tvec3<valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5));\r
+       //      tvec3<valType> c = glm::cos(eulerAngle * valType(0.5));\r
+       //      tvec3<valType> s = glm::sin(eulerAngle * valType(0.5));\r
+       //      \r
+       //      this->w = c.x * c.y * c.z + s.x * s.y * s.z;\r
+       //      this->x = s.x * c.y * c.z - c.x * s.y * s.z;\r
+       //      this->y = c.x * s.y * c.z + s.x * c.y * s.z;\r
+       //      this->z = c.x * c.y * s.z - s.x * s.y * c.z;\r
+       //}\r
+\r
+       template <typename valType> \r
+       inline tquat<valType>::tquat\r
+       (\r
+               tvec3<valType> const & eulerAngle\r
+       )\r
+       {\r
+               tvec3<valType> c = glm::cos(eulerAngle * valType(0.5));\r
+               tvec3<valType> s = glm::sin(eulerAngle * valType(0.5));\r
+               \r
+               this->w = c.x * c.y * c.z + s.x * s.y * s.z;\r
+               this->x = s.x * c.y * c.z - c.x * s.y * s.z;\r
+               this->y = c.x * s.y * c.z + s.x * c.y * s.z;\r
+               this->z = c.x * c.y * s.z - s.x * s.y * c.z;            \r
+       }\r
+\r
+    template <typename valType> \r
+    inline tquat<valType>::tquat\r
+       (\r
+               tmat3x3<valType> const & m\r
+       )\r
+    {\r
+               *this = toQuat(m);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tquat<valType>::tquat\r
+       (\r
+               tmat4x4<valType> const & m\r
+       )\r
+    {\r
+               *this = toQuat(m);\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // tquat<T> accesses\r
+\r
+    template <typename valType> \r
+    inline valType& tquat<valType>::operator [] (int i)\r
+    {\r
+        return (&x)[i];\r
+    }\r
+\r
+    template <typename valType> \r
+    inline valType tquat<valType>::operator [] (int i) const\r
+    {\r
+        return (&x)[i];\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // tquat<valType> operators\r
+\r
+    template <typename valType> \r
+    inline tquat<valType>& tquat<valType>::operator *=\r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->w *= s;\r
+        this->x *= s;\r
+        this->y *= s;\r
+        this->z *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline tquat<valType>& tquat<valType>::operator /=\r
+       (\r
+               valType const & s\r
+       )\r
+    {\r
+        this->w /= s;\r
+        this->x /= s;\r
+        this->y /= s;\r
+        this->z /= s;\r
+        return *this;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // tquat<valType> external operators\r
+\r
+       template <typename valType>\r
+       inline detail::tquat<valType> operator- \r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+       {\r
+               return detail::tquat<valType>(-q.w, -q.x, -q.y, -q.z);\r
+       }\r
+\r
+       // Transformation\r
+       template <typename valType>\r
+       inline detail::tvec3<valType> operator* \r
+       (\r
+               detail::tquat<valType> const & q, \r
+               detail::tvec3<valType> const & v\r
+       )\r
+       {\r
+               detail::tvec3<valType> uv, uuv;\r
+               detail::tvec3<valType> QuatVector(q.x, q.y, q.z);\r
+               uv = glm::cross(QuatVector, v);\r
+               uuv = glm::cross(QuatVector, uv);\r
+               uv *= (valType(2) * q.w); \r
+               uuv *= valType(2); \r
+\r
+               return v + uv + uuv;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec3<valType> operator* \r
+       (\r
+               detail::tvec3<valType> const & v,\r
+               detail::tquat<valType> const & q \r
+       )\r
+       {\r
+               return gtc::quaternion::inverse(q) * v;\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec4<valType> operator* \r
+       (\r
+               detail::tquat<valType> const & q, \r
+               detail::tvec4<valType> const & v\r
+       )\r
+       {\r
+               return detail::tvec4<valType>(q * detail::tvec3<valType>(v), v.w);\r
+       }\r
+\r
+       template <typename valType>\r
+       inline detail::tvec4<valType> operator* \r
+       (\r
+               detail::tvec4<valType> const & v,\r
+               detail::tquat<valType> const & q \r
+       )\r
+       {\r
+               return gtc::quaternion::inverse(q) * v;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tquat<valType> operator* \r
+       (\r
+               detail::tquat<valType> const & q, \r
+               valType const & s\r
+       )\r
+       {\r
+               return detail::tquat<valType>(\r
+                       q.w * s, q.x * s, q.y * s, q.z * s);\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tquat<valType> operator* \r
+       (\r
+               valType const & s,\r
+               detail::tquat<valType> const & q\r
+       )\r
+       {\r
+               return q * s;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tquat<valType> operator/ \r
+       (\r
+               detail::tquat<valType> const & q, \r
+               valType const & s\r
+       )\r
+       {\r
+               return detail::tquat<valType>(\r
+                       q.w / s, q.x / s, q.y / s, q.z / s);\r
+       }\r
+\r
+}//namespace detail\r
+\r
+namespace gtc{\r
+namespace quaternion{\r
+\r
+       ////////////////////////////////////////////////////////\r
+    template <typename valType> \r
+       inline valType length\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+    {\r
+               return static_cast<valType>(glm::sqrt(dot(q, q)));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tquat<T> normalize\r
+       (\r
+               detail::tquat<T> const & q\r
+       )\r
+    {\r
+        T len = static_cast<T>(length(q));\r
+        if(len <= 0) // Problem\r
+            return detail::tquat<T>(1, 0, 0, 0);\r
+        T oneOverLen = 1 / len;\r
+        return detail::tquat<T>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline valType dot\r
+       (\r
+               detail::tquat<valType> const & q1, \r
+               detail::tquat<valType> const & q2\r
+       )\r
+    {\r
+        return q1.x * q2.x + q1.y * q2.y + q1.z * q2.z + q1.w * q2.w;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tquat<valType> cross\r
+       (\r
+               detail::tquat<valType> const & q1, \r
+               detail::tquat<valType> const & q2\r
+       )\r
+    {\r
+        return detail::tquat<valType>(\r
+            q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z,\r
+               q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y,\r
+               q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z,\r
+               q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tquat<T> mix\r
+       (\r
+               detail::tquat<T> const & x, \r
+               detail::tquat<T> const & y, \r
+               T const & a\r
+       )\r
+    {\r
+        if(a <= T(0)) return x;\r
+        if(a >= T(1)) return y;\r
+\r
+        float fCos = dot(x, y);\r
+        detail::tquat<T> y2(y); //BUG!!! tquat<T> y2;\r
+        if(fCos < T(0))\r
+        {\r
+            y2 = -y;\r
+            fCos = -fCos;\r
+        }\r
+\r
+        //if(fCos > 1.0f) // problem\r
+        float k0, k1;\r
+        if(fCos > T(0.9999))\r
+        {\r
+            k0 = T(1) - a;\r
+            k1 = T(0) + a; //BUG!!! 1.0f + a;\r
+        }\r
+        else\r
+        {\r
+            T fSin = sqrt(T(1) - fCos * fCos);\r
+            T fAngle = atan(fSin, fCos);\r
+            T fOneOverSin = T(1) / fSin;\r
+            k0 = sin((T(1) - a) * fAngle) * fOneOverSin;\r
+            k1 = sin((T(0) + a) * fAngle) * fOneOverSin;\r
+        }\r
+\r
+        return detail::tquat<T>(\r
+            k0 * x.w + k1 * y2.w,\r
+            k0 * x.x + k1 * y2.x,\r
+            k0 * x.y + k1 * y2.y,\r
+            k0 * x.z + k1 * y2.z);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tquat<valType> conjugate\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+    {\r
+        return detail::tquat<valType>(q.w, -q.x, -q.y, -q.z);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tquat<valType> inverse\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+    {\r
+        return gtc::quaternion::conjugate(q) / gtc::quaternion::length(q);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tquat<valType> rotate\r
+       (\r
+               detail::tquat<valType> const & q, \r
+               valType const & angle, \r
+               detail::tvec3<valType> const & v\r
+       )\r
+    {\r
+               detail::tvec3<valType> Tmp = v;\r
+\r
+        // Axis of rotation must be normalised\r
+        valType len = glm::core::function::geometric::length(Tmp);\r
+        if(abs(len - valType(1)) > valType(0.001))\r
+        {\r
+            valType oneOverLen = valType(1) / len;\r
+            Tmp.x *= oneOverLen;\r
+            Tmp.y *= oneOverLen;\r
+            Tmp.z *= oneOverLen;\r
+        }\r
+\r
+        valType AngleRad = radians(angle);\r
+        valType fSin = sin(AngleRad * valType(0.5));\r
+\r
+        return gtc::quaternion::cross(q, detail::tquat<valType>(cos(AngleRad * valType(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin));\r
+       }\r
+\r
+    template <typename valType> \r
+    inline detail::tmat3x3<valType> mat3_cast\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+    {\r
+        detail::tmat3x3<valType> Result(valType(1));\r
+        Result[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z;\r
+        Result[0][1] = 2 * q.x * q.y + 2 * q.w * q.z;\r
+        Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y;\r
+\r
+        Result[1][0] = 2 * q.x * q.y - 2 * q.w * q.z;\r
+        Result[1][1] = 1 - 2 * q.x * q.x - 2 * q.z * q.z;\r
+        Result[1][2] = 2 * q.y * q.z + 2 * q.w * q.x;\r
+\r
+        Result[2][0] = 2 * q.x * q.z + 2 * q.w * q.y;\r
+        Result[2][1] = 2 * q.y * q.z - 2 * q.w * q.x;\r
+        Result[2][2] = 1 - 2 * q.x * q.x - 2 * q.y * q.y;\r
+        return Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tmat4x4<valType> mat4_cast\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+    {\r
+        return detail::tmat4x4<valType>(mat3_cast(q));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tquat<T> quat_cast\r
+       (\r
+               detail::tmat3x3<T> const & m\r
+       )\r
+    {\r
+        T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];\r
+        T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2];\r
+        T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1];\r
+        T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2];\r
+        \r
+        int biggestIndex = 0;\r
+        T fourBiggestSquaredMinus1 = fourWSquaredMinus1;\r
+        if(fourXSquaredMinus1 > fourBiggestSquaredMinus1)\r
+        {\r
+            fourBiggestSquaredMinus1 = fourXSquaredMinus1;\r
+            biggestIndex = 1;\r
+        }\r
+        if(fourYSquaredMinus1 > fourBiggestSquaredMinus1)\r
+        {\r
+            fourBiggestSquaredMinus1 = fourYSquaredMinus1;\r
+            biggestIndex = 2;\r
+        }\r
+        if(fourZSquaredMinus1 > fourBiggestSquaredMinus1)\r
+        {\r
+            fourBiggestSquaredMinus1 = fourZSquaredMinus1;\r
+            biggestIndex = 3;\r
+        }\r
+\r
+        T biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5);\r
+        T mult = T(0.25) / biggestVal;\r
+\r
+        detail::tquat<T> Result;\r
+        switch(biggestIndex)\r
+        {\r
+        case 0:\r
+            Result.w = biggestVal; \r
+            Result.x = (m[1][2] - m[2][1]) * mult;\r
+            Result.y = (m[2][0] - m[0][2]) * mult;\r
+            Result.z = (m[0][1] - m[1][0]) * mult;\r
+            break;\r
+        case 1:\r
+            Result.w = (m[1][2] - m[2][1]) * mult;\r
+            Result.x = biggestVal;\r
+            Result.y = (m[0][1] + m[1][0]) * mult;\r
+            Result.z = (m[2][1] + m[1][2]) * mult;\r
+            break;\r
+        case 2:\r
+            Result.w = (m[2][0] - m[0][2]) * mult;\r
+            Result.x = (m[0][1] + m[1][0]) * mult;\r
+            Result.y = biggestVal;\r
+            Result.z = (m[1][2] + m[2][1]) * mult;\r
+            break;\r
+        case 3:\r
+            Result.w = (m[0][1] - m[1][0]) * mult;\r
+            Result.x = (m[2][0] + m[0][2]) * mult;\r
+            Result.y = (m[1][2] + m[2][1]) * mult;\r
+            Result.z = biggestVal;\r
+            break;\r
+        }\r
+        return Result;\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tquat<valType> quat_cast\r
+       (\r
+               detail::tmat4x4<valType> const & m4\r
+       )\r
+    {\r
+               return quat_cast(detail::tmat3x3<valType>(m4));\r
+    }\r
+\r
+}//namespace quaternion\r
+}//namespace gtc\r
+}//namespace glm\r
diff --git a/glm/gtc/type_precision.hpp b/glm/gtc/type_precision.hpp
new file mode 100644 (file)
index 0000000..8cde665
--- /dev/null
@@ -0,0 +1,204 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-06-04\r
+// Updated : 2009-06-04\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/type_precision.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_half\r
+// - GLM_GTC_double\r
+// - GLM_GTC_quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtc_type_precision\r
+#define glm_gtc_type_precision\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/half_float.hpp"\r
+#include "../gtc/double_float.hpp"\r
+#include "../gtc/quaternion.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               bool main_gtc_type_precision();\r
+       }//namespace test\r
+\r
+       namespace gtc{\r
+       //! GLM_GTC_type_precision extension: Defined types with specific size.\r
+       namespace type_precision\r
+       {\r
+               ///////////////////////////\r
+               // Dependences\r
+\r
+               using namespace gtc::half_float;\r
+               using namespace gtc::double_float;\r
+               using namespace gtc::quaternion;\r
+\r
+               ///////////////////////////\r
+               // Signed int vector types \r
+\r
+               typedef detail::int8                                            int8;         //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension)\r
+               typedef detail::int16                                           int16;        //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension)\r
+               typedef detail::int32                                           int32;        //!< \brief 32bit signed integer. (from GLM_GTC_type_precision extension)\r
+               typedef detail::int64                                           int64;        //!< \brief 64bit signed integer. (from GLM_GTC_type_precision extension)\r
+\r
+               typedef int8                                                            i8;         //!< \brief 8bit signed integer. (from GLM_GTC_type_precision extension)\r
+               typedef int16                                                           i16;        //!< \brief 16bit signed integer. (from GLM_GTC_type_precision extension)\r
+               typedef int32                                                           i32;        //!< \brief 32bit signed integer. (from GLM_GTC_type_precision extension)\r
+               typedef int64                                                           i64;        //!< \brief 64bit signed integer. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef i8                                                                    i8vec1;         //!< \brief 8bit signed integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<i8>                                       i8vec2;     //!< \brief 8bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<i8>                                       i8vec3;     //!< \brief 8bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<i8>                                       i8vec4;     //!< \brief 8bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef i16                                                                   i16vec1;        //!< \brief 16bit signed integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<i16>                                      i16vec2;    //!< \brief 16bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<i16>                                      i16vec3;    //!< \brief 16bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<i16>                                      i16vec4;    //!< \brief 16bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef i32                                                                   i32vec1;        //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<i32>                                      i32vec2;    //!< \brief 32bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<i32>                                      i32vec3;    //!< \brief 32bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<i32>                                      i32vec4;    //!< \brief 32bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef i64                                                                   i64vec1;        //!< \brief 32bit signed integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<i64>                                      i64vec2;    //!< \brief 64bit signed integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<i64>                                      i64vec3;    //!< \brief 64bit signed integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<i64>                                      i64vec4;    //!< \brief 64bit signed integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               /////////////////////////////\r
+               // Unsigned int vector types \r
+\r
+               typedef detail::uint8                                           uint8;         //!< \brief 8bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+               typedef detail::uint16                                          uint16;        //!< \brief 16bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+               typedef detail::uint32                                          uint32;        //!< \brief 32bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+               typedef detail::uint64                                          uint64;        //!< \brief 64bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+\r
+               typedef uint8                                                           u8;         //!< \brief 8bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+               typedef uint16                                                          u16;        //!< \brief 16bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+               typedef uint32                                                          u32;        //!< \brief 32bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+               typedef uint64                                                          u64;        //!< \brief 64bit unsigned integer. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef u8                                                                    u8vec1;         //!< \brief 8bit unsigned integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<u8>                                       u8vec2;     //!< \brief 8bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<u8>                                       u8vec3;     //!< \brief 8bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<u8>                                       u8vec4;     //!< \brief 8bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef u16                                                                   u16vec1;    //!< \brief 16bit unsigned integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<u16>                                      u16vec2;    //!< \brief 16bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<u16>                                      u16vec3;    //!< \brief 16bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<u16>                                      u16vec4;    //!< \brief 16bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef u32                                                                   u32vec1;    //!< \brief 32bit unsigned integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<u32>                                      u32vec2;    //!< \brief 32bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<u32>                                      u32vec3;    //!< \brief 32bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<u32>                                      u32vec4;    //!< \brief 32bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef u64                                                                   u64vec1;    //!< \brief 64bit unsigned integer scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<u64>                                      u64vec2;    //!< \brief 64bit unsigned integer vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<u64>                                      u64vec3;    //!< \brief 64bit unsigned integer vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<u64>                                      u64vec4;    //!< \brief 64bit unsigned integer vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //////////////////////\r
+               // Float vector types \r
+\r
+               typedef detail::float16                                         float16;        //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::float32                                         float32;        //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::float64                                         float64;        //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+\r
+               typedef float16                                                         f16;        //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef float32                                                         f32;        //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef float64                                                         f64;        //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f16                                                                   f16vec1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<f16>                                      f16vec2;    //!< \brief Half-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<f16>                                      f16vec3;    //!< \brief Half-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<f16>                                      f16vec4;    //!< \brief Half-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f32                                                                   f32vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<f32>                                      f32vec2;    //!< \brief Single-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<f32>                                      f32vec3;    //!< \brief Single-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<f32>                                      f32vec4;    //!< \brief Single-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f64                                                                   f64vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec2<f64>                                      f64vec2;    //!< \brief Double-precision floating-point vector of 2 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec3<f64>                                      f64vec3;    //!< \brief Double-precision floating-point vector of 3 components. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tvec4<f64>                                      f64vec4;    //!< \brief Double-precision floating-point vector of 4 components. (from GLM_GTC_type_precision extension)\r
+\r
+               //////////////////////\r
+               // Float matrix types \r
+\r
+               //typedef f16                                                                   f16mat1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x2<f16>                            f16mat2;        //!< \brief Half-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x3<f16>                            f16mat3;        //!< \brief Half-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x4<f16>                            f16mat4;        //!< \brief Half-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f16                                                                   f16mat1x1;      //!< \brief Half-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x2<f16>                            f16mat2x2;      //!< \brief Half-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x3<f16>                            f16mat2x3;      //!< \brief Half-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x4<f16>                            f16mat2x4;      //!< \brief Half-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x2<f16>                            f16mat3x2;      //!< \brief Half-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x3<f16>                            f16mat3x3;      //!< \brief Half-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x4<f16>                            f16mat3x4;      //!< \brief Half-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x2<f16>                            f16mat4x2;      //!< \brief Half-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x3<f16>                            f16mat4x3;      //!< \brief Half-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x4<f16>                            f16mat4x4;      //!< \brief Half-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f32                                                                   f32mat1;        //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x2<f32>                            f32mat2;        //!< \brief Single-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x3<f32>                            f32mat3;        //!< \brief Single-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x4<f32>                            f32mat4;        //!< \brief Single-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f32                                                                   f32mat1x1;      //!< \brief Single-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x2<f32>                            f32mat2x2;  //!< \brief Single-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x3<f32>                            f32mat2x3;      //!< \brief Single-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x4<f32>                            f32mat2x4;      //!< \brief Single-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x2<f32>                            f32mat3x2;      //!< \brief Single-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x3<f32>                            f32mat3x3;      //!< \brief Single-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x4<f32>                            f32mat3x4;      //!< \brief Single-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x2<f32>                            f32mat4x2;      //!< \brief Single-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x3<f32>                            f32mat4x3;      //!< \brief Single-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x4<f32>                            f32mat4x4;      //!< \brief Single-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f64                                                                   f64mat1;        //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x2<f64>                            f64mat2;        //!< \brief Double-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x3<f64>                            f64mat3;        //!< \brief Double-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x4<f64>                            f64mat4;        //!< \brief Double-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension)\r
+\r
+               //typedef f64                                                                   f64mat1x1;      //!< \brief Double-precision floating-point scalar. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x2<f64>                            f64mat2x2;      //!< \brief Double-precision floating-point 2x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x3<f64>                            f64mat2x3;      //!< \brief Double-precision floating-point 2x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat2x4<f64>                            f64mat2x4;      //!< \brief Double-precision floating-point 2x4 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x2<f64>                            f64mat3x2;      //!< \brief Double-precision floating-point 3x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x3<f64>                            f64mat3x3;      //!< \brief Double-precision floating-point 3x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat3x4<f64>                            f64mat3x4;      //!< \brief Double-precision floating-point 3x4 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x2<f64>                            f64mat4x2;      //!< \brief Double-precision floating-point 4x2 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x3<f64>                            f64mat4x3;      //!< \brief Double-precision floating-point 4x3 matrix. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tmat4x4<f64>                            f64mat4x4;      //!< \brief Double-precision floating-point 4x4 matrix. (from GLM_GTC_type_precision extension)\r
+\r
+               //////////////////////////\r
+               // Float quaternion types \r
+\r
+               typedef detail::tquat<f16>                                      f16quat;    //!< \brief Half-precision floating-point quaternion. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tquat<f32>                                      f32quat;    //!< \brief Single-precision floating-point quaternion. (from GLM_GTC_type_precision extension)\r
+               typedef detail::tquat<f64>                                      f64quat;    //!< \brief Double-precision floating-point quaternion. (from GLM_GTC_type_precision extension)\r
+\r
+       }//namespace type_precision\r
+       }//namespace gtc\r
+}//namespace glm\r
+\r
+#define GLM_GTC_type_precision namespace gtc::type_precision   \r
+\r
+#ifndef GLM_GTC_GLOBAL\r
+namespace glm {using GLM_GTC_type_precision;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "type_precision.inl"\r
+\r
+#endif//glm_gtc_type_precision\r
diff --git a/glm/gtc/type_precision.inl b/glm/gtc/type_precision.inl
new file mode 100644 (file)
index 0000000..0437c95
--- /dev/null
@@ -0,0 +1,13 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-06-14\r
+// Updated : 2009-06-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/type_precision.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+\r
+}\r
diff --git a/glm/gtx.hpp b/glm/gtx.hpp
new file mode 100644 (file)
index 0000000..1f4f637
--- /dev/null
@@ -0,0 +1,83 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-04-03\r
+// Updated : 2009-05-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Note:\r
+// GTX extensions are experimental extensions\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx\r
+#define glm_gtx\r
+\r
+#define GLM_GTX_GLOBAL 1\r
+\r
+//#include "./gtx/array_range.hpp"\r
+#include "./gtx/associated_min_max.hpp"\r
+#include "./gtx/bit.hpp"\r
+#include "./gtx/closest_point.hpp"\r
+#include "./gtx/color_cast.hpp"\r
+#include "./gtx/color_space.hpp"\r
+#include "./gtx/color_space_YCoCg.hpp"\r
+#include "./gtx/compatibility.hpp"\r
+#include "./gtx/component_wise.hpp"\r
+//#include "./gtx/complex.hpp"\r
+#include "./gtx/determinant.hpp"\r
+#include "./gtx/double_float.hpp"\r
+#include "./gtx/epsilon.hpp"\r
+#include "./gtx/euler_angles.hpp"\r
+#include "./gtx/extend.hpp"\r
+#include "./gtx/extented_min_max.hpp"\r
+#include "./gtx/fast_exponential.hpp"\r
+#include "./gtx/fast_square_root.hpp"\r
+#include "./gtx/fast_trigonometry.hpp"\r
+//#include "./gtx/flexible_mix.hpp"\r
+//#include "./gtx/gpu_shader4.hpp"\r
+#include "./gtx/gradient_paint.hpp"\r
+#include "./gtx/half_float.hpp"\r
+#include "./gtx/handed_coordinate_space.hpp"\r
+#include "./gtx/inertia.hpp"\r
+#include "./gtx/integer.hpp"\r
+#include "./gtx/intersect.hpp"\r
+#include "./gtx/inverse.hpp"\r
+#include "./gtx/inverse_transpose.hpp"\r
+//#include "./gtx/mat_mn.hpp"\r
+#include "./gtx/log_base.hpp"\r
+#include "./gtx/matrix_access.hpp"\r
+#include "./gtx/matrix_cross_product.hpp"\r
+#include "./gtx/matrix_major_storage.hpp"\r
+#include "./gtx/matrix_projection.hpp"\r
+#include "./gtx/matrix_query.hpp"\r
+#include "./gtx/matrix_selection.hpp"\r
+//#include "./gtx/matx.hpp"\r
+#include "./gtx/mixed_product.hpp"\r
+#include "./gtx/norm.hpp"\r
+#include "./gtx/normal.hpp"\r
+#include "./gtx/normalize_dot.hpp"\r
+#include "./gtx/number_precision.hpp"\r
+#include "./gtx/optimum_pow.hpp"\r
+#include "./gtx/orthonormalize.hpp"\r
+#include "./gtx/perpendicular.hpp"\r
+#include "./gtx/polar_coordinates.hpp"\r
+#include "./gtx/projection.hpp"\r
+#include "./gtx/quaternion.hpp"\r
+#include "./gtx/random.hpp"\r
+#include "./gtx/raw_data.hpp"\r
+#include "./gtx/reciprocal.hpp"\r
+#include "./gtx/rotate_vector.hpp"\r
+#include "./gtx/spline.hpp"\r
+#include "./gtx/std_based_type.hpp"\r
+#include "./gtx/string_cast.hpp"\r
+#include "./gtx/transform.hpp"\r
+#include "./gtx/transform2.hpp"\r
+#include "./gtx/unsigned_int.hpp"\r
+#include "./gtx/vector_access.hpp"\r
+#include "./gtx/vector_angle.hpp"\r
+#include "./gtx/vector_query.hpp"\r
+//#include "./gtx/vecx.hpp"\r
+#include "./gtx/verbose_operator.hpp"\r
+\r
+#endif//glm_gtx\r
diff --git a/glm/gtx/associated_min_max.hpp b/glm/gtx/associated_min_max.hpp
new file mode 100644 (file)
index 0000000..82a7957
--- /dev/null
@@ -0,0 +1,86 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-03-10\r
+// Updated : 2008-03-15\r
+// Licence : This source is under MIT License\r
+// File    : gtx_associated_min_max.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_extented_min_max\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_associated_min_max\r
+#define glm_gtx_associated_min_max\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_associated_min_max();\r
+       }//namespace test\r
+\r
+       namespace gtx\r
+       {\r
+               //! GLM_GTX_associated_min_max extension: Min and max functions that return associated values not the compared onces.\r
+               namespace associated_min_max\r
+               {\r
+                       //! \brief Min comparison between 2 variables\r
+                       template<typename genTypeT, typename genTypeU>\r
+                       genTypeU associatedMin(\r
+                               const genTypeT& x, const genTypeU& a, \r
+                               const genTypeT& y, const genTypeU& b);\r
+\r
+                       //! \brief Min comparison between 3 variables\r
+                       template<typename genTypeT, typename genTypeU>\r
+                       genTypeU associatedMin(\r
+                               const genTypeT& x, const genTypeU& a, \r
+                               const genTypeT& y, const genTypeU& b, \r
+                               const genTypeT& z, const genTypeU& c);\r
+\r
+                       //! \brief Min comparison between 4 variables\r
+                       template<typename genTypeT, typename genTypeU>\r
+                       genTypeU associatedMin(\r
+                               const genTypeT& x, const genTypeU& a, \r
+                               const genTypeT& y, const genTypeU& b, \r
+                               const genTypeT& z, const genTypeU& c, \r
+                               const genTypeT& w, const genTypeU& d);\r
+\r
+                       //! \brief Max comparison between 2 variables\r
+                       template<typename genTypeT, typename genTypeU>\r
+                       genTypeU associatedMax(\r
+                               const genTypeT& x, const genTypeU& a, \r
+                               const genTypeT& y, const genTypeU& b);\r
+\r
+                       //! \brief Max comparison between 3 variables\r
+                       template<typename genTypeT, typename genTypeU>\r
+                       genTypeU associatedMax(\r
+                               const genTypeT& x, const genTypeU& a, \r
+                               const genTypeT& y, const genTypeU& b, \r
+                               const genTypeT& z, const genTypeU& c);\r
+\r
+                       //! \brief Max comparison between 4 variables\r
+                       template<typename genTypeT, typename genTypeU>\r
+                       genTypeU associatedMax(\r
+                               const genTypeT& x, const genTypeU& a, \r
+                               const genTypeT& y, const genTypeU& b, \r
+                               const genTypeT& z, const genTypeU& c, \r
+                               const genTypeT& w, const genTypeU& d);\r
+\r
+               }//namespace associated_min_max\r
+\r
+               bool test();\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_associated_min_max namespace gtx::associated_min_max\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_associated_min_max;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "associated_min_max.inl"\r
+\r
+#endif//glm_gtx_associated_min_max\r
diff --git a/glm/gtx/associated_min_max.inl b/glm/gtx/associated_min_max.inl
new file mode 100644 (file)
index 0000000..05d4100
--- /dev/null
@@ -0,0 +1,916 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-03-10\r
+// Updated : 2008-03-15\r
+// Licence : This source is under MIT License\r
+// File    : gtx_associated_min_max.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace associated_min_max{\r
+\r
+       // Min comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline U associatedMin(T x, U a, T y, U b)\r
+       {\r
+               return x < y ? a : b;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMin\r
+       (\r
+               const detail::tvec2<T>& x, const detail::tvec2<U>& a,\r
+               const detail::tvec2<T>& y, const detail::tvec2<U>& b\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               //Result.x = x[0] < y[0] ? a[0] : b[0];\r
+               //Result.y = x[1] < y[1] ? a[1] : b[1];\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMin\r
+       (\r
+               const detail::tvec3<T>& x, const detail::tvec3<U>& a,\r
+               const detail::tvec3<T>& y, const detail::tvec3<U>& b\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMin\r
+       (\r
+               const detail::tvec4<T>& x, const detail::tvec4<U>& a,\r
+               const detail::tvec4<T>& y, const detail::tvec4<U>& b\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMin\r
+       (\r
+               T x, const detail::tvec2<U>& a,\r
+               T y, const detail::tvec2<U>& b\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+                       Result[i] = x < y ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMin\r
+       (\r
+               T x, const detail::tvec3<U>& a,\r
+               T y, const detail::tvec3<U>& b\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+                       Result[i] = x < y ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMin\r
+       (\r
+               T x, const detail::tvec4<U>& a,\r
+               T y, const detail::tvec4<U>& b\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+                       Result[i] = x < y ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMin\r
+       (\r
+               const detail::tvec2<T>& x, U a,\r
+               const detail::tvec2<T>& y, U b\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<T>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? a : b;\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMin\r
+       (\r
+               const detail::tvec3<T>& x, U a,\r
+               const detail::tvec3<T>& y, U b\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<T>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? a : b;\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMin\r
+       (\r
+               const detail::tvec4<T>& x, U a,\r
+               const detail::tvec4<T>& y, U b\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<T>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? a : b;\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline U associatedMin\r
+       (\r
+               T x, U a,\r
+               T y, U b,\r
+               T z, U c\r
+       )\r
+       {\r
+               U Result = x < y ? (x < z ? a : c) : (y < z ? b : c);\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMin\r
+       (\r
+               const detail::tvec2<T>& x, const detail::tvec2<U>& a,\r
+               const detail::tvec2<T>& y, const detail::tvec2<U>& b,\r
+               const detail::tvec2<T>& z, const detail::tvec2<U>& c\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMin\r
+       (\r
+               const detail::tvec3<T>& x, const detail::tvec3<U>& a,\r
+               const detail::tvec3<T>& y, const detail::tvec3<U>& b,\r
+               const detail::tvec3<T>& z, const detail::tvec3<U>& c\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMin\r
+       (\r
+               const detail::tvec4<T>& x, const detail::tvec4<U>& a,\r
+               const detail::tvec4<T>& y, const detail::tvec4<U>& b,\r
+               const detail::tvec4<T>& z, const detail::tvec4<U>& c\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+                       Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline U associatedMin\r
+       (\r
+               T x, U a,\r
+               T y, U b,\r
+               T z, U c,\r
+               T w, U d\r
+       )\r
+       {\r
+               T Test1 = min(x, y);\r
+               T Test2 = min(z, w);;\r
+               U Result1 = x < y ? a : b;\r
+               U Result2 = z < w ? c : d;\r
+               U Result = Test1 < Test2 ? Result1 : Result2;\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMin\r
+       (\r
+               const detail::tvec2<T>& x, const detail::tvec2<U>& a,\r
+               const detail::tvec2<T>& y, const detail::tvec2<U>& b,\r
+               const detail::tvec2<T>& z, const detail::tvec2<U>& c,\r
+               const detail::tvec2<T>& w, const detail::tvec2<U>& d\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+               {\r
+                       T Test1 = min(x[i], y[i]);\r
+                       T Test2 = min(z[i], w[i]);\r
+                       U Result1 = x[i] < y[i] ? a[i] : b[i];\r
+                       U Result2 = z[i] < w[i] ? c[i] : d[i];\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMin\r
+       (\r
+               const detail::tvec3<T>& x, const detail::tvec3<U>& a,\r
+               const detail::tvec3<T>& y, const detail::tvec3<U>& b,\r
+               const detail::tvec3<T>& z, const detail::tvec3<U>& c,\r
+               const detail::tvec3<T>& w, const detail::tvec3<U>& d\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+               {\r
+                       T Test1 = min(x[i], y[i]);\r
+                       T Test2 = min(z[i], w[i]);\r
+                       U Result1 = x[i] < y[i] ? a[i] : b[i];\r
+                       U Result2 = z[i] < w[i] ? c[i] : d[i];\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMin\r
+       (\r
+               const detail::tvec4<T>& x, const detail::tvec4<U>& a,\r
+               const detail::tvec4<T>& y, const detail::tvec4<U>& b,\r
+               const detail::tvec4<T>& z, const detail::tvec4<U>& c,\r
+               const detail::tvec4<T>& w, const detail::tvec4<U>& d\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+               {\r
+                       T Test1 = min(x[i], y[i]);\r
+                       T Test2 = min(z[i], w[i]);\r
+                       U Result1 = x[i] < y[i] ? a[i] : b[i];\r
+                       U Result2 = z[i] < w[i] ? c[i] : d[i];\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMin\r
+       (\r
+               T x, const detail::tvec2<U>& a,\r
+               T y, const detail::tvec2<U>& b,\r
+               T z, const detail::tvec2<U>& c,\r
+               T w, const detail::tvec2<U>& d\r
+       )\r
+       {\r
+               T Test1 = min(x, y);\r
+               T Test2 = min(z, w);\r
+\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+               {\r
+                       U Result1 = x < y ? a[i] : b[i];\r
+                       U Result2 = z < w ? c[i] : d[i];\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMin\r
+       (\r
+               T x, const detail::tvec3<U>& a,\r
+               T y, const detail::tvec3<U>& b,\r
+               T z, const detail::tvec3<U>& c,\r
+               T w, const detail::tvec3<U>& d\r
+       )\r
+       {\r
+               T Test1 = min(x, y);\r
+               T Test2 = min(z, w);\r
+\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+               {\r
+                       U Result1 = x < y ? a[i] : b[i];\r
+                       U Result2 = z < w ? c[i] : d[i];\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMin\r
+       (\r
+               T x, const detail::tvec4<U>& a,\r
+               T y, const detail::tvec4<U>& b,\r
+               T z, const detail::tvec4<U>& c,\r
+               T w, const detail::tvec4<U>& d\r
+       )\r
+       {\r
+               T Test1 = min(x, y);\r
+               T Test2 = min(z, w);\r
+\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+               {\r
+                       U Result1 = x < y ? a[i] : b[i];\r
+                       U Result2 = z < w ? c[i] : d[i];\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMin\r
+       (\r
+               const detail::tvec2<T>& x, U a,\r
+               const detail::tvec2<T>& y, U b,\r
+               const detail::tvec2<T>& z, U c,\r
+               const detail::tvec2<T>& w, U d\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<T>::size_type i = 0; i < detail::tvec2<T>::value_size(); ++i)\r
+               {\r
+                       T Test1 = min(x[i], y[i]);\r
+                       T Test2 = min(z[i], w[i]);;\r
+                       U Result1 = x[i] < y[i] ? a : b;\r
+                       U Result2 = z[i] < w[i] ? c : d;\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMin\r
+       (\r
+               const detail::tvec3<T>& x, U a,\r
+               const detail::tvec3<T>& y, U b,\r
+               const detail::tvec3<T>& z, U c,\r
+               const detail::tvec3<T>& w, U d\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<T>::size_type i = 0; i < detail::tvec3<T>::value_size(); ++i)\r
+               {\r
+                       T Test1 = min(x[i], y[i]);\r
+                       T Test2 = min(z[i], w[i]);;\r
+                       U Result1 = x[i] < y[i] ? a : b;\r
+                       U Result2 = z[i] < w[i] ? c : d;\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Min comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMin\r
+       (\r
+               const detail::tvec4<T>& x, U a,\r
+               const detail::tvec4<T>& y, U b,\r
+               const detail::tvec4<T>& z, U c,\r
+               const detail::tvec4<T>& w, U d\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<T>::size_type i = 0; i < detail::tvec4<T>::value_size(); ++i)\r
+               {\r
+                       T Test1 = min(x[i], y[i]);\r
+                       T Test2 = min(z[i], w[i]);;\r
+                       U Result1 = x[i] < y[i] ? a : b;\r
+                       U Result2 = z[i] < w[i] ? c : d;\r
+                       Result[i] = Test1 < Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline U associatedMax(T x, U a, T y, U b)\r
+       {\r
+               return x > y ? a : b;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               const detail::tvec2<T>& x, const detail::tvec2<U>& a,\r
+               const detail::tvec2<T>& y, const detail::tvec2<U>& b\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               const detail::tvec3<T>& x, const detail::tvec3<U>& a,\r
+               const detail::tvec3<T>& y, const detail::tvec3<U>& b\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               const detail::tvec4<T>& x, const detail::tvec4<U>& a,\r
+               const detail::tvec4<T>& y, const detail::tvec4<U>& b\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               T x, const detail::tvec2<U>& a,\r
+               T y, const detail::tvec2<U>& b\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+                       Result[i] = x > y ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               T x, const detail::tvec3<U>& a,\r
+               T y, const detail::tvec3<U>& b\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+                       Result[i] = x > y ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               T x, const detail::tvec4<U>& a,\r
+               T y, const detail::tvec4<U>& b\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+                       Result[i] = x > y ? a[i] : b[i];\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               const detail::tvec2<T>& x, U a,\r
+               const detail::tvec2<T>& y, U b\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<T>::size_type i = 0; i < detail::tvec2<T>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? a : b;\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               const detail::tvec3<T>& x, U a,\r
+               const detail::tvec3<T>& y, U b\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<T>::size_type i = 0; i < detail::tvec3<T>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? a : b;\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 2 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               const detail::tvec4<T>& x, U a,\r
+               const detail::tvec4<T>& y, U b\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<T>::size_type i = 0; i < detail::tvec4<T>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? a : b;\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline U associatedMax\r
+       (\r
+               T x, U a,\r
+               T y, U b,\r
+               T z, U c\r
+       )\r
+       {\r
+               U Result = x > y ? (x > z ? a : c) : (y > z ? b : c);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               const detail::tvec2<T>& x, const detail::tvec2<U>& a,\r
+               const detail::tvec2<T>& y, const detail::tvec2<U>& b,\r
+               const detail::tvec2<T>& z, const detail::tvec2<U>& c\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               const detail::tvec3<T>& x, const detail::tvec3<U>& a,\r
+               const detail::tvec3<T>& y, const detail::tvec3<U>& b,\r
+               const detail::tvec3<T>& z, const detail::tvec3<U>& c\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               const detail::tvec4<T>& x, const detail::tvec4<U>& a,\r
+               const detail::tvec4<T>& y, const detail::tvec4<U>& b,\r
+               const detail::tvec4<T>& z, const detail::tvec4<U>& c\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               T x, const detail::tvec2<U>& a,\r
+               T y, const detail::tvec2<U>& b,\r
+               T z, const detail::tvec2<U>& c\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+                       Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               T x, const detail::tvec3<U>& a,\r
+               T y, const detail::tvec3<U>& b,\r
+               T z, const detail::tvec3<U>& c\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+                       Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               T x, const detail::tvec4<U>& a,\r
+               T y, const detail::tvec4<U>& b,\r
+               T z, const detail::tvec4<U>& c\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+                       Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               const detail::tvec2<T>& x, U a,\r
+               const detail::tvec2<T>& y, U b,\r
+               const detail::tvec2<T>& z, U c\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<T>::size_type i = 0; i < detail::tvec2<T>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               const detail::tvec3<T>& x, U a,\r
+               const detail::tvec3<T>& y, U b,\r
+               const detail::tvec3<T>& z, U c\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<T>::size_type i = 0; i < detail::tvec3<T>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 3 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               const detail::tvec4<T>& x, U a,\r
+               const detail::tvec4<T>& y, U b,\r
+               const detail::tvec4<T>& z, U c\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<T>::size_type i = 0; i < detail::tvec4<T>::value_size(); ++i)\r
+                       Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c);\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline U associatedMax\r
+       (\r
+               T x, U a,\r
+               T y, U b,\r
+               T z, U c,\r
+               T w, U d\r
+       )\r
+       {\r
+               T Test1 = max(x, y);\r
+               T Test2 = max(z, w);;\r
+               U Result1 = x > y ? a : b;\r
+               U Result2 = z > w ? c : d;\r
+               U Result = Test1 > Test2 ? Result1 : Result2;\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               const detail::tvec2<T>& x, const detail::tvec2<U>& a,\r
+               const detail::tvec2<T>& y, const detail::tvec2<U>& b,\r
+               const detail::tvec2<T>& z, const detail::tvec2<U>& c,\r
+               const detail::tvec2<T>& w, const detail::tvec2<U>& d\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+               {\r
+                       T Test1 = max(x[i], y[i]);\r
+                       T Test2 = max(z[i], w[i]);\r
+                       U Result1 = x[i] > y[i] ? a[i] : b[i];\r
+                       U Result2 = z[i] > w[i] ? c[i] : d[i];\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               const detail::tvec3<T>& x, const detail::tvec3<U>& a,\r
+               const detail::tvec3<T>& y, const detail::tvec3<U>& b,\r
+               const detail::tvec3<T>& z, const detail::tvec3<U>& c,\r
+               const detail::tvec3<T>& w, const detail::tvec3<U>& d\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+               {\r
+                       T Test1 = max(x[i], y[i]);\r
+                       T Test2 = max(z[i], w[i]);\r
+                       U Result1 = x[i] > y[i] ? a[i] : b[i];\r
+                       U Result2 = z[i] > w[i] ? c[i] : d[i];\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               const detail::tvec4<T>& x, const detail::tvec4<U>& a,\r
+               const detail::tvec4<T>& y, const detail::tvec4<U>& b,\r
+               const detail::tvec4<T>& z, const detail::tvec4<U>& c,\r
+               const detail::tvec4<T>& w, const detail::tvec4<U>& d\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+               {\r
+                       T Test1 = max(x[i], y[i]);\r
+                       T Test2 = max(z[i], w[i]);\r
+                       U Result1 = x[i] > y[i] ? a[i] : b[i];\r
+                       U Result2 = z[i] > w[i] ? c[i] : d[i];\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               T x, const detail::tvec2<U>& a,\r
+               T y, const detail::tvec2<U>& b,\r
+               T z, const detail::tvec2<U>& c,\r
+               T w, const detail::tvec2<U>& d\r
+       )\r
+       {\r
+               T Test1 = max(x, y);\r
+               T Test2 = max(z, w);\r
+\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<U>::size_type i = 0; i < detail::tvec2<U>::value_size(); ++i)\r
+               {\r
+                       U Result1 = x > y ? a[i] : b[i];\r
+                       U Result2 = z > w ? c[i] : d[i];\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               T x, const detail::tvec3<U>& a,\r
+               T y, const detail::tvec3<U>& b,\r
+               T z, const detail::tvec3<U>& c,\r
+               T w, const detail::tvec3<U>& d\r
+       )\r
+       {\r
+               T Test1 = max(x, y);\r
+               T Test2 = max(z, w);\r
+\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<U>::size_type i = 0; i < detail::tvec3<U>::value_size(); ++i)\r
+               {\r
+                       U Result1 = x > y ? a[i] : b[i];\r
+                       U Result2 = z > w ? c[i] : d[i];\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               T x, const detail::tvec4<U>& a,\r
+               T y, const detail::tvec4<U>& b,\r
+               T z, const detail::tvec4<U>& c,\r
+               T w, const detail::tvec4<U>& d\r
+       )\r
+       {\r
+               T Test1 = max(x, y);\r
+               T Test2 = max(z, w);\r
+\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<U>::size_type i = 0; i < detail::tvec4<U>::value_size(); ++i)\r
+               {\r
+                       U Result1 = x > y ? a[i] : b[i];\r
+                       U Result2 = z > w ? c[i] : d[i];\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec2<U> associatedMax\r
+       (\r
+               const detail::tvec2<T>& x, U a,\r
+               const detail::tvec2<T>& y, U b,\r
+               const detail::tvec2<T>& z, U c,\r
+               const detail::tvec2<T>& w, U d\r
+       )\r
+       {\r
+               detail::tvec2<U> Result;\r
+               for(typename detail::tvec2<T>::size_type i = 0; i < detail::tvec2<T>::value_size(); ++i)\r
+               {\r
+                       T Test1 = max(x[i], y[i]);\r
+                       T Test2 = max(z[i], w[i]);;\r
+                       U Result1 = x[i] > y[i] ? a : b;\r
+                       U Result2 = z[i] > w[i] ? c : d;\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec3<U> associatedMax\r
+       (\r
+               const detail::tvec3<T>& x, U a,\r
+               const detail::tvec3<T>& y, U b,\r
+               const detail::tvec3<T>& z, U c,\r
+               const detail::tvec3<T>& w, U d\r
+       )\r
+       {\r
+               detail::tvec3<U> Result;\r
+               for(typename detail::tvec3<T>::size_type i = 0; i < detail::tvec3<T>::value_size(); ++i)\r
+               {\r
+                       T Test1 = max(x[i], y[i]);\r
+                       T Test2 = max(z[i], w[i]);;\r
+                       U Result1 = x[i] > y[i] ? a : b;\r
+                       U Result2 = z[i] > w[i] ? c : d;\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+       // Max comparison between 4 variables\r
+       template<typename T, typename U>\r
+       inline detail::tvec4<U> associatedMax\r
+       (\r
+               const detail::tvec4<T>& x, U a,\r
+               const detail::tvec4<T>& y, U b,\r
+               const detail::tvec4<T>& z, U c,\r
+               const detail::tvec4<T>& w, U d\r
+       )\r
+       {\r
+               detail::tvec4<U> Result;\r
+               for(typename detail::tvec4<T>::size_type i = 0; i < detail::tvec4<T>::value_size(); ++i)\r
+               {\r
+                       T Test1 = max(x[i], y[i]);\r
+                       T Test2 = max(z[i], w[i]);;\r
+                       U Result1 = x[i] > y[i] ? a : b;\r
+                       U Result2 = z[i] > w[i] ? c : d;\r
+                       Result[i] = Test1 > Test2 ? Result1 : Result2;\r
+               }\r
+               return Result;\r
+       }\r
+\r
+}//namespace associated_min_max\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/bit.hpp b/glm/gtx/bit.hpp
new file mode 100644 (file)
index 0000000..71a31d0
--- /dev/null
@@ -0,0 +1,106 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-14\r
+// Updated : 2008-11-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/bit.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_half_float\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_bit\r
+#define glm_gtx_bit\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/half_float.hpp"\r
+#include <limits>\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_bit();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_bit extension: Allow to perform bit operations on integer values\r
+       namespace bit\r
+       {\r
+               using namespace gtc::half_float;\r
+\r
+               //! Build a mask of 'count' bits\r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genIType>\r
+               genIType mask(genIType const & count);\r
+\r
+               //! Component wise extraction of bit fields.\r
+               //! genType and genIType could be a scalar or a vector.\r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType, typename genIType>\r
+               genIType extractField(genType const & v, genIType const & first, genIType const & count);\r
+\r
+               //! Find the lowest bit set to 1 in a integer variable.\r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType> \r
+               int lowestBit(genType const & value);\r
+\r
+               //! Find the highest bit set to 1 in a integer variable.\r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType> \r
+               int highestBit(genType const & value);\r
+\r
+               //! Find the highest bit set to 1 in a integer variable and return its value. \r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType> \r
+               genType highestBitValue(genType const & value);\r
+\r
+               //! Return true if the value is a power of two number. \r
+               //! From GLM_GTX_bit extension. \r
+               template <typename genType> \r
+               bool isPowerOfTwo(genType const & value);\r
+\r
+               //! Return the power of two number which value is just higher the input value.\r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType> \r
+               genType powerOfTwoAbove(genType const & value);\r
+\r
+               //! Return the power of two number which value is just lower the input value. \r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType> \r
+               genType powerOfTwoBelow(genType const & value);\r
+\r
+               //! Return the power of two number which value is the closet to the input value. \r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType> \r
+               genType powerOfTwoNearest(genType const & value);\r
+\r
+               //! Revert all bits of any integer based type. \r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType> \r
+               genType bitRevert(genType const & value);\r
+\r
+               //! Rotate all bits to the right.\r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType>\r
+               genType bitRotateRight(genType const & In, std::size_t Shift);\r
+\r
+               //! Rotate all bits to the left.\r
+               //! From GLM_GTX_bit extension.\r
+               template <typename genType>\r
+               genType bitRotateLeft(genType const & In, std::size_t Shift);\r
+\r
+       }//namespace bit\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_bit namespace gtx::bit\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_bit;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "bit.inl"\r
+\r
+#endif//glm_gtx_bit\r
diff --git a/glm/gtx/bit.inl b/glm/gtx/bit.inl
new file mode 100644 (file)
index 0000000..ffadf16
--- /dev/null
@@ -0,0 +1,733 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-14\r
+// Updated : 2008-11-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/bit.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include "../core/_detail.hpp"\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace bit{\r
+\r
+template <typename genIType>\r
+inline genIType mask\r
+(\r
+       genIType const & count\r
+)\r
+{\r
+       return ((genIType(1) << (count)) - genIType(1));\r
+}\r
+\r
+template <typename valIType>\r
+inline detail::tvec2<valIType> mask\r
+(\r
+       detail::tvec2<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec2<valIType>(\r
+               mask(count[0]),\r
+               mask(count[1]));\r
+}\r
+\r
+template <typename valIType>\r
+inline detail::tvec3<valIType> mask\r
+(\r
+       detail::tvec3<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec3<valIType>(\r
+               mask(count[0]),\r
+               mask(count[1]),\r
+               mask(count[2]));\r
+}\r
+\r
+template <typename valIType>\r
+inline detail::tvec4<valIType> mask\r
+(\r
+       detail::tvec4<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec4<valIType>(\r
+               mask(count[0]),\r
+               mask(count[1]),\r
+               mask(count[2]),\r
+               mask(count[3]));\r
+}\r
+\r
+// extractField\r
+template <typename genIType>\r
+inline genIType extractField\r
+(\r
+       gtc::half_float::half const & value, \r
+       genIType const & first, \r
+       genIType const & count\r
+)\r
+{\r
+       assert(first + count < sizeof(gtc::half_float::half));\r
+       return (value._data() << first) >> ((sizeof(gtc::half_float::half) << 3) - count);\r
+}\r
+\r
+template <typename genIType>\r
+inline genIType extractField\r
+(\r
+       float const & value, \r
+       genIType const & first, \r
+       genIType const & count\r
+)\r
+{\r
+       assert(first + count < sizeof(float));\r
+       return (detail::uif32(value).i << first) >> ((sizeof(float) << 3) - count);\r
+}\r
+\r
+template <typename genIType>\r
+inline genIType extractField\r
+(\r
+       double const & value, \r
+       genIType const & first, \r
+       genIType const & count\r
+)\r
+{\r
+       assert(first + count < sizeof(double));\r
+       return (detail::uif64(value).i << first) >> ((sizeof(double) << 3) - count);\r
+}\r
+\r
+template <typename genType, typename genIType>\r
+inline genIType extractField\r
+(\r
+       genType const & value, \r
+       genIType const & first, \r
+       genIType const & count\r
+)\r
+{\r
+       assert(first + count < sizeof(genType));\r
+       return (value << first) >> ((sizeof(genType) << 3) - count);\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec2<valIType> extractField\r
+(\r
+       detail::tvec2<valType> const & value, \r
+       valIType const & first, \r
+       valIType const & count\r
+)\r
+{\r
+       return detail::tvec2<valIType>(\r
+               extractField(value[0], first, count),\r
+               extractField(value[1], first, count));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec3<valIType> extractField\r
+(\r
+       detail::tvec3<valType> const & value, \r
+       valIType const & first, \r
+       valIType const & count\r
+)\r
+{\r
+       return detail::tvec3<valIType>(\r
+               extractField(value[0], first, count),\r
+               extractField(value[1], first, count),\r
+               extractField(value[2], first, count));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec4<valIType> extractField\r
+(\r
+       detail::tvec4<valType> const & value, \r
+       valIType const & first, \r
+       valIType const & count\r
+)\r
+{\r
+       return detail::tvec4<valIType>(\r
+               extractField(value[0], first, count),\r
+               extractField(value[1], first, count),\r
+               extractField(value[2], first, count),\r
+               extractField(value[3], first, count));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec2<valIType> extractField\r
+(\r
+       detail::tvec2<valType> const & value, \r
+       detail::tvec2<valIType> const & first, \r
+       detail::tvec2<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec2<valIType>(\r
+               extractField(value[0], first[0], count[0]),\r
+               extractField(value[1], first[1], count[1]));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec3<valIType> extractField\r
+(\r
+       detail::tvec3<valType> const & value, \r
+       detail::tvec3<valIType> const & first, \r
+       detail::tvec3<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec3<valIType>(\r
+               extractField(value[0], first[0], count[0]),\r
+               extractField(value[1], first[1], count[1]),\r
+               extractField(value[2], first[2], count[2]));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec4<valIType> extractField\r
+(\r
+       detail::tvec4<valType> const & value, \r
+       detail::tvec4<valIType> const & first, \r
+       detail::tvec4<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec4<valIType>(\r
+               extractField(value[0], first[0], count[0]),\r
+               extractField(value[1], first[1], count[1]),\r
+               extractField(value[2], first[2], count[2]),\r
+               extractField(value[3], first[3], count[3]));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec2<valIType> extractField\r
+(\r
+       valType const & value, \r
+       detail::tvec2<valIType> const & first, \r
+       detail::tvec2<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec2<valIType>(\r
+               extractField(value, first[0], count[0]),\r
+               extractField(value, first[1], count[1]));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec3<valIType> extractField\r
+(\r
+       valType const & value, \r
+       detail::tvec3<valIType> const & first, \r
+       detail::tvec3<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec3<valIType>(\r
+               extractField(value, first[0], count[0]),\r
+               extractField(value, first[1], count[1]),\r
+               extractField(value, first[2], count[2]));\r
+}\r
+\r
+template <typename valType, typename valIType>\r
+inline detail::tvec4<valIType> extractField\r
+(\r
+       valType const & value, \r
+       detail::tvec4<valIType> const & first, \r
+       detail::tvec4<valIType> const & count\r
+)\r
+{\r
+       return detail::tvec4<valIType>(\r
+               extractField(value, first[0], count[0]),\r
+               extractField(value, first[1], count[1]),\r
+               extractField(value, first[2], count[2]),\r
+               extractField(value, first[3], count[3]));\r
+}\r
+\r
+// lowestBit\r
+template <typename genType>\r
+inline int lowestBit\r
+(\r
+       genType const & Value\r
+)\r
+{\r
+       genType Bit;\r
+       for(Bit = genType(0); !(Value & (1 << Bit)); ++Bit);\r
+       return Bit;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<int> lowestBit\r
+(\r
+       detail::tvec2<valType> const & value\r
+)\r
+{\r
+       return detail::tvec2<int>(\r
+               lowestBit(value[0]),\r
+               lowestBit(value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<int> lowestBit\r
+(\r
+       detail::tvec3<valType> const & value\r
+)\r
+{\r
+       return detail::tvec3<int>(\r
+               lowestBit(value[0]),\r
+               lowestBit(value[1]),\r
+               lowestBit(value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<int> lowestBit\r
+(\r
+       detail::tvec4<valType> const & value\r
+)\r
+{\r
+       return detail::tvec4<int>(\r
+               lowestBit(value[0]),\r
+               lowestBit(value[1]),\r
+               lowestBit(value[2]),\r
+               lowestBit(value[3]));\r
+}\r
+\r
+// highestBit\r
+template <typename genType>\r
+inline int highestBit\r
+(\r
+       genType const & value\r
+)\r
+{\r
+       genType bit = genType(-1);\r
+       for(genType tmp = value; tmp; tmp >>= 1, ++bit);\r
+       return bit;\r
+}\r
+\r
+//template <>\r
+//inline int highestBit<int>\r
+//(\r
+//     int value\r
+//)\r
+//{\r
+//     int bit = -1;\r
+//     for(int tmp = value; tmp; tmp >>= 1, ++bit);\r
+//     return bit;\r
+//}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<int> highestBit\r
+(\r
+       detail::tvec2<valType> const & value\r
+)\r
+{\r
+       return detail::tvec2<int>(\r
+               highestBit(value[0]),\r
+               highestBit(value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<int> highestBit\r
+(\r
+       detail::tvec3<valType> const & value\r
+)\r
+{\r
+       return detail::tvec3<int>(\r
+               highestBit(value[0]),\r
+               highestBit(value[1]),\r
+               highestBit(value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<int> highestBit\r
+(\r
+       detail::tvec4<valType> const & value\r
+)\r
+{\r
+       return detail::tvec4<int>(\r
+               highestBit(value[0]),\r
+               highestBit(value[1]),\r
+               highestBit(value[2]),\r
+               highestBit(value[3]));\r
+}\r
+\r
+// highestBitValue\r
+template <typename genType>\r
+inline genType highestBitValue\r
+(\r
+       genType const & value\r
+)\r
+{\r
+       genType tmp = value;\r
+       genType result = genType(0);\r
+       while(tmp)\r
+       {\r
+               result = (tmp & (~tmp + 1)); // grab lowest bit\r
+               tmp &= ~result; // clear lowest bit\r
+       }\r
+       return result;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<int> highestBitValue\r
+(\r
+       detail::tvec2<valType> const & value\r
+)\r
+{\r
+       return detail::tvec2<int>(\r
+               highestBitValue(value[0]),\r
+               highestBitValue(value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<int> highestBitValue\r
+(\r
+       detail::tvec3<valType> const & value\r
+)\r
+{\r
+       return detail::tvec3<int>(\r
+               highestBitValue(value[0]),\r
+               highestBitValue(value[1]),\r
+               highestBitValue(value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<int> highestBitValue\r
+(\r
+       detail::tvec4<valType> const & value\r
+)\r
+{\r
+       return detail::tvec4<int>(\r
+               highestBitValue(value[0]),\r
+               highestBitValue(value[1]),\r
+               highestBitValue(value[2]),\r
+               highestBitValue(value[3]));\r
+}\r
+\r
+// isPowerOfTwo\r
+template <typename genType>\r
+inline bool isPowerOfTwo(genType const & Value)\r
+{\r
+       //detail::If<std::numeric_limits<genType>::is_signed>::apply(abs, Value);\r
+       //return !(Value & (Value - 1));\r
+\r
+    // For old complier?\r
+       genType Result = Value;\r
+       if(std::numeric_limits<genType>::is_signed)\r
+               Result = abs(Result);\r
+       return !(Result & (Result - 1));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<bool> isPowerOfTwo\r
+(\r
+       detail::tvec2<valType> const & value\r
+)\r
+{\r
+       return detail::tvec2<bool>(\r
+               isPowerOfTwo(value[0]),\r
+               isPowerOfTwo(value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<bool> isPowerOfTwo\r
+(\r
+       detail::tvec3<valType> const & value\r
+)\r
+{\r
+       return detail::tvec3<bool>(\r
+               isPowerOfTwo(value[0]),\r
+               isPowerOfTwo(value[1]),\r
+               isPowerOfTwo(value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<bool> isPowerOfTwo\r
+(\r
+       detail::tvec4<valType> const & value\r
+)\r
+{\r
+       return detail::tvec4<bool>(\r
+               isPowerOfTwo(value[0]),\r
+               isPowerOfTwo(value[1]),\r
+               isPowerOfTwo(value[2]),\r
+               isPowerOfTwo(value[3]));\r
+}\r
+\r
+// powerOfTwoAbove\r
+template <typename genType>\r
+inline genType powerOfTwoAbove(genType const & value)\r
+{\r
+       return isPowerOfTwo(value) ? value : highestBitValue(value) << 1;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> powerOfTwoAbove\r
+(\r
+       detail::tvec2<valType> const & value\r
+)\r
+{\r
+       return detail::tvec2<valType>(\r
+               powerOfTwoAbove(value[0]),\r
+               powerOfTwoAbove(value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> powerOfTwoAbove\r
+(\r
+       detail::tvec3<valType> const & value\r
+)\r
+{\r
+       return detail::tvec3<valType>(\r
+               powerOfTwoAbove(value[0]),\r
+               powerOfTwoAbove(value[1]),\r
+               powerOfTwoAbove(value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> powerOfTwoAbove\r
+(\r
+       detail::tvec4<valType> const & value\r
+)\r
+{\r
+       return detail::tvec4<valType>(\r
+               powerOfTwoAbove(value[0]),\r
+               powerOfTwoAbove(value[1]),\r
+               powerOfTwoAbove(value[2]),\r
+               powerOfTwoAbove(value[3]));\r
+}\r
+\r
+// powerOfTwoBelow\r
+template <typename genType>\r
+inline genType powerOfTwoBelow\r
+(\r
+       genType const & value\r
+)\r
+{\r
+       return isPowerOfTwo(value) ? value : highestBitValue(value);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> powerOfTwoBelow\r
+(\r
+       detail::tvec2<valType> const & value\r
+)\r
+{\r
+       return detail::tvec2<valType>(\r
+               powerOfTwoBelow(value[0]),\r
+               powerOfTwoBelow(value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> powerOfTwoBelow\r
+(\r
+       detail::tvec3<valType> const & value\r
+)\r
+{\r
+       return detail::tvec3<valType>(\r
+               powerOfTwoBelow(value[0]),\r
+               powerOfTwoBelow(value[1]),\r
+               powerOfTwoBelow(value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> powerOfTwoBelow\r
+(\r
+       detail::tvec4<valType> const & value\r
+)\r
+{\r
+       return detail::tvec4<valType>(\r
+               powerOfTwoBelow(value[0]),\r
+               powerOfTwoBelow(value[1]),\r
+               powerOfTwoBelow(value[2]),\r
+               powerOfTwoBelow(value[3]));\r
+}\r
+\r
+// powerOfTwoNearest\r
+template <typename genType>\r
+inline genType powerOfTwoNearest\r
+(\r
+       genType const & value\r
+)\r
+{\r
+       if(isPowerOfTwo(value))\r
+               return value;\r
+\r
+       genType prev = highestBitValue(value);\r
+       genType next = prev << 1;\r
+       return (next - value) < (value - prev) ? next : prev;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> powerOfTwoNearest\r
+(\r
+       detail::tvec2<valType> const & value\r
+)\r
+{\r
+       return detail::tvec2<valType>(\r
+               powerOfTwoNearest(value[0]),\r
+               powerOfTwoNearest(value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> powerOfTwoNearest\r
+(\r
+       detail::tvec3<valType> const & value\r
+)\r
+{\r
+       return detail::tvec3<valType>(\r
+               powerOfTwoNearest(value[0]),\r
+               powerOfTwoNearest(value[1]),\r
+               powerOfTwoNearest(value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> powerOfTwoNearest\r
+(\r
+       detail::tvec4<valType> const & value\r
+)\r
+{\r
+       return detail::tvec4<valType>(\r
+               powerOfTwoNearest(value[0]),\r
+               powerOfTwoNearest(value[1]),\r
+               powerOfTwoNearest(value[2]),\r
+               powerOfTwoNearest(value[3]));\r
+}\r
+\r
+template <typename genType>\r
+inline genType bitRevert(genType const & In)\r
+{\r
+       GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_integer);\r
+\r
+       genType Out = 0;\r
+       std::size_t BitSize = sizeof(genType) * 8;\r
+       for(std::size_t i = 0; i < BitSize; ++i)\r
+               if(In & (1 << i))\r
+                       Out |= 1 << (BitSize - 1 - i);\r
+       return Out;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> bitRevert\r
+(\r
+       detail::tvec2<valType> const & Value\r
+)\r
+{\r
+       return detail::tvec2<valType>(\r
+               bitRevert(Value[0]),\r
+               bitRevert(Value[1]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> bitRevert\r
+(\r
+       detail::tvec3<valType> const & Value\r
+)\r
+{\r
+       return detail::tvec3<valType>(\r
+               bitRevert(Value[0]),\r
+               bitRevert(Value[1]),\r
+               bitRevert(Value[2]));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> bitRevert\r
+(\r
+       detail::tvec4<valType> const & Value\r
+)\r
+{\r
+       return detail::tvec4<valType>(\r
+               bitRevert(Value[0]),\r
+               bitRevert(Value[1]),\r
+               bitRevert(Value[2]),\r
+               bitRevert(Value[3]));\r
+}\r
+\r
+template <typename genType>\r
+inline genType bitRotateRight(genType const & In, std::size_t Shift)\r
+{\r
+       GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_integer);\r
+\r
+       std::size_t BitSize = sizeof(genType) * 8;\r
+       return (In << Shift) | (In >> (BitSize - Shift));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> bitRotateRight\r
+(\r
+       detail::tvec2<valType> const & Value, \r
+       std::size_t Shift\r
+)\r
+{\r
+       return detail::tvec2<valType>(\r
+               bitRotateRight(Value[0], Shift),\r
+               bitRotateRight(Value[1], Shift));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> bitRotateRight\r
+(\r
+       detail::tvec3<valType> const & Value, \r
+       std::size_t Shift\r
+)\r
+{\r
+       return detail::tvec3<valType>(\r
+               bitRotateRight(Value[0], Shift),\r
+               bitRotateRight(Value[1], Shift),\r
+               bitRotateRight(Value[2], Shift));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> bitRotateRight\r
+(\r
+       detail::tvec4<valType> const & Value, \r
+       std::size_t Shift\r
+)\r
+{\r
+       return detail::tvec4<valType>(\r
+               bitRotateRight(Value[0], Shift),\r
+               bitRotateRight(Value[1], Shift),\r
+               bitRotateRight(Value[2], Shift),\r
+               bitRotateRight(Value[3], Shift));\r
+}\r
+\r
+template <typename genType>\r
+inline genType bitRotateLeft(genType const & In, std::size_t Shift)\r
+{\r
+       GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_integer);\r
+\r
+       std::size_t BitSize = sizeof(genType) * 8;\r
+       return (In >> Shift) | (In << (BitSize - Shift));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> bitRotateLeft\r
+(\r
+       detail::tvec2<valType> const & Value, \r
+       std::size_t Shift\r
+)\r
+{\r
+       return detail::tvec2<valType>(\r
+               bitRotateLeft(Value[0], Shift),\r
+               bitRotateLeft(Value[1], Shift));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> bitRotateLeft\r
+(\r
+       detail::tvec3<valType> const & Value, \r
+       std::size_t Shift\r
+)\r
+{\r
+       return detail::tvec3<valType>(\r
+               bitRotateLeft(Value[0], Shift),\r
+               bitRotateLeft(Value[1], Shift),\r
+               bitRotateLeft(Value[2], Shift));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> bitRotateLeft\r
+(\r
+       detail::tvec4<valType> const & Value, \r
+       std::size_t Shift\r
+)\r
+{\r
+       return detail::tvec4<valType>(\r
+               bitRotateLeft(Value[0], Shift),\r
+               bitRotateLeft(Value[1], Shift),\r
+               bitRotateLeft(Value[2], Shift),\r
+               bitRotateLeft(Value[3], Shift));\r
+}\r
+\r
+}//namespace bit\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/closest_point.hpp b/glm/gtx/closest_point.hpp
new file mode 100644 (file)
index 0000000..776c2f4
--- /dev/null
@@ -0,0 +1,48 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-30\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/closest_point.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_closest_point\r
+#define glm_gtx_closest_point\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_closest_point();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_closest_point extension: Find the point on a straight line which is the closet of a point.\r
+       namespace closest_point{\r
+\r
+       //! Find the point on a straight line which is the closet of a point. \r
+       //! From GLM_GTX_closest_point extension.\r
+       template <typename T> \r
+       detail::tvec3<T> closestPointOnLine(\r
+               detail::tvec3<T> const & point, \r
+               detail::tvec3<T> const & a, \r
+               detail::tvec3<T> const & b);\r
+\r
+       }//namespace closest_point\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_closest_point namespace gtx::closest_point\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_closest_point;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "closest_point.inl"\r
+\r
+#endif//glm_gtx_closest_point\r
diff --git a/glm/gtx/closest_point.inl b/glm/gtx/closest_point.inl
new file mode 100644 (file)
index 0000000..f58046b
--- /dev/null
@@ -0,0 +1,41 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-30\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/closest_point.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_closest_point\r
+#define glm_gtx_closest_point\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace closest_point{\r
+\r
+template <typename valType> \r
+inline detail::tvec3<valType> closestPointOnLine\r
+(\r
+       detail::tvec3<valType> const & point, \r
+       detail::tvec3<valType> const & a, \r
+       detail::tvec3<valType> const & b\r
+)\r
+{\r
+    valType LineLength = distance(a, b);\r
+    detail::tvec3<valType> Vector = point - a;\r
+    detail::tvec3<valType> LineDirection = (b - a) / LineLength;\r
+\r
+    // Project Vector to LineDirection to get the distance of point from a\r
+    valType Distance = dot(Vector, LineDirection);\r
+\r
+    if(Distance <= valType(0)) return a;\r
+    if(Distance >= LineLength) return b;\r
+    return a + LineDirection * Distance;\r
+}\r
+\r
+}//namespace closest_point\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+#endif//glm_gtx_closest_point\r
diff --git a/glm/gtx/color_cast.hpp b/glm/gtx/color_cast.hpp
new file mode 100644 (file)
index 0000000..e211a66
--- /dev/null
@@ -0,0 +1,107 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-06-21\r
+// Updated : 2009-06-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/color_cast.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_number_precision\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_color_cast\r
+#define glm_gtx_color_cast\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/number_precision.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_ext_gtx_color_cast();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_color_cast extension: Conversion between two color types\r
+       namespace color_cast\r
+       {\r
+               using namespace gtx::number_precision;\r
+\r
+               //! Conversion of a floating value into a 8bit unsigned int value. \r
+               //! From GLM_GTX_color_cast extension.\r
+               template <typename valType> gtc::type_precision::uint8 u8channel_cast(valType a);\r
+\r
+               //! Conversion of a floating value into a 16bit unsigned int value. \r
+               //! From GLM_GTX_color_cast extension.\r
+               template <typename valType>     gtc::type_precision::uint16 u16channel_cast(valType a);\r
+\r
+               template <typename T> gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 32bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint64 u64_xrgb_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint64 u64_bgrx_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint64 u64_xbgr_cast(const detail::tvec3<T>& c);             //!< \brief Conversion of a 3 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4<T>& c);             //!< \brief Conversion of a 4 components color into an 64bit unsigned int value. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtx::number_precision::f16vec1 f16_channel_cast(T a);     //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::f16vec3 f16_rgbx_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f16vec3 f16_xrgb_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f16vec3 f16_bgrx_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f16vec3 f16_xbgr_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::f16vec4 f16_rgba_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f16vec4 f16_argb_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f16vec4 f16_bgra_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f16vec4 f16_abgr_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtx::number_precision::f32vec1 f32_channel_cast(T a);     //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::f32vec3 f32_rgbx_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f32vec3 f32_xrgb_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f32vec3 f32_bgrx_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f32vec3 f32_xbgr_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::f32vec4 f32_rgba_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f32vec4 f32_argb_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f32vec4 f32_bgra_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f32vec4 f32_abgr_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtx::number_precision::f64vec1 f64_channel_cast(T a);     //!< \brief Conversion of a u8 or u16 value to a single channel floating value. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::f64vec3 f64_rgbx_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f64vec3 f64_xrgb_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f64vec3 f64_bgrx_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f64vec3 f64_xbgr_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 3 components floating color. (From GLM_GTX_color_cast extension)\r
+\r
+               template <typename T> gtc::type_precision::f64vec4 f64_rgba_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f64vec4 f64_argb_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f64vec4 f64_bgra_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+               template <typename T> gtc::type_precision::f64vec4 f64_abgr_cast(T c);          //!< \brief Conversion of a u32 or u64 color into 4 components floating color. (From GLM_GTX_color_cast extension)\r
+       }//namespace color_space\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_color_cast             namespace gtx::color_cast\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_color_cast;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "color_cast.inl"\r
+\r
+#endif//glm_gtx_color_cast\r
diff --git a/glm/gtx/color_cast.inl b/glm/gtx/color_cast.inl
new file mode 100644 (file)
index 0000000..58f50fe
--- /dev/null
@@ -0,0 +1,739 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-06-21\r
+// Updated : 2007-08-03\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/color_cast.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+//! GLM_GTX_color_cast extension: Conversion between two color types\r
+namespace color_cast{\r
+\r
+template <typename T> \r
+inline gtc::type_precision::uint8 u8channel_cast(T a)\r
+{\r
+       return static_cast<gtc::type_precision::uint8>(a * T(255));\r
+}\r
+\r
+template <typename T> \r
+inline gtc::type_precision::uint16 u16channel_cast(T a)\r
+{\r
+       return static_cast<gtc::type_precision::uint16>(a * T(65535));\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_rgbx_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) <<  0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 16;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_xrgb_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+    result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 16;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) << 24;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_bgrx_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 16;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_xbgr_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec3<T>::value_type(255)) << 24;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec3<T>::value_type(255)) << 16;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec3<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec3<T>::value_type(255)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_rgba_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) <<  0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 16;\r
+       result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 24;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_argb_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 16;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) << 24;\r
+       result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_bgra_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 16;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) <<  0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) << 24;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint32 u32_abgr_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint32 result = 0;\r
+       result += static_cast<gtc::type_precision::uint32>(c.x * detail::tvec4<T>::value_type(255)) << 24;\r
+       result += static_cast<gtc::type_precision::uint32>(c.y * detail::tvec4<T>::value_type(255)) << 16;\r
+       result += static_cast<gtc::type_precision::uint32>(c.z * detail::tvec4<T>::value_type(255)) <<  8;\r
+       result += static_cast<gtc::type_precision::uint32>(c.w * detail::tvec4<T>::value_type(255)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u64_rgbx_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) <<  0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 32;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u32_xrgb_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 32;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 48;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u32_bgrx_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 32;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u32_xbgr_cast(const detail::tvec3<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec3<T>::value_type(65535)) << 48;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec3<T>::value_type(65535)) << 32;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec3<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec3<T>::value_type(65535)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u64_rgba_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) <<  0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 32;\r
+       result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 48;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u64_argb_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 32;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 48;\r
+       result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u64_bgra_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 32;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) <<  0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) << 48;\r
+       return result;\r
+}\r
+\r
+template <typename T>\r
+inline gtc::type_precision::uint64 u64_abgr_cast(const detail::tvec4<T>& c)\r
+{\r
+       gtc::type_precision::uint64 result = 0;\r
+       result += static_cast<gtc::type_precision::uint64>(c.x * detail::tvec4<T>::value_type(65535)) << 48;\r
+       result += static_cast<gtc::type_precision::uint64>(c.y * detail::tvec4<T>::value_type(65535)) << 32;\r
+       result += static_cast<gtc::type_precision::uint64>(c.z * detail::tvec4<T>::value_type(65535)) << 16;\r
+       result += static_cast<gtc::type_precision::uint64>(c.w * detail::tvec4<T>::value_type(65535)) <<  0;\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline f16vec1 f16_channel_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color)\r
+{\r
+       return gtc::type_precision::f16(static_cast<float>(color >>  0) / static_cast<float>(255));\r
+}\r
+\r
+template <>\r
+inline gtc::type_precision::f16vec3 f16_rgbx_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color)\r
+{\r
+       gtc::type_precision::f16vec3 result;\r
+       result.x = gtc::type_precision::f16(static_cast<float>(color >>  0) / static_cast<float>(255));\r
+       result.y = gtc::type_precision::f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       result.z = gtc::type_precision::f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline gtc::type_precision::f16vec3 f16_xrgb_cast<gtc::type_precision::uint32>(gtc::type_precision::uint32 color)\r
+{\r
+       gtc::type_precision::f16vec3 result;\r
+       result.x = gtc::type_precision::f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       result.y = gtc::type_precision::f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       result.z = gtc::type_precision::f16(static_cast<float>(color >> 24) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline f16vec3 f16_bgrx_cast<uint32>(uint32 color)\r
+{\r
+       f16vec3 result;\r
+       result.x = f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       result.y = f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       result.z = f16(static_cast<float>(color >>  0) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline f16vec3 f16_xbgr_cast<uint32>(uint32 color)\r
+{\r
+       f16vec3 result;\r
+       result.x = f16(static_cast<float>(color >> 24) / static_cast<float>(255));\r
+       result.y = f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       result.z = f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline f16vec4 f16_rgba_cast<uint32>(uint32 color)\r
+{\r
+       f16vec4 result;\r
+       result.x = f16(static_cast<float>(color >>  0) / static_cast<float>(255));\r
+       result.y = f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       result.z = f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       result.w = f16(static_cast<float>(color >> 24) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline f16vec4 f16_argb_cast<uint32>(uint32 color)\r
+{\r
+       f16vec4 result;\r
+       result.x = f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       result.y = f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       result.z = f16(static_cast<float>(color >> 24) / static_cast<float>(255));\r
+       result.w = f16(static_cast<float>(color >>  0) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline f16vec4 f16_bgra_cast<uint32>(uint32 color)\r
+{\r
+       f16vec4 result;\r
+       result.x = f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       result.y = f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       result.z = f16(static_cast<float>(color >>  0) / static_cast<float>(255));\r
+       result.w = f16(static_cast<float>(color >> 24) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline f16vec4 f16_abgr_cast<uint32>(uint32 color)\r
+{\r
+       f16vec4 result;\r
+       result.x = f16(static_cast<float>(color >> 24) / static_cast<float>(255));\r
+       result.y = f16(static_cast<float>(color >> 16) / static_cast<float>(255));\r
+       result.z = f16(static_cast<float>(color >>  8) / static_cast<float>(255));\r
+       result.w = f16(static_cast<float>(color >>  0) / static_cast<float>(255));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline float f32_channel_cast<uint8>(uint8 color)\r
+{\r
+       return static_cast<float>(color >>  0) / static_cast<float>(255);\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_rgbx_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >>  0) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_xrgb_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >> 24) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_bgrx_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >>  0) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_xbgr_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >> 24) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_rgba_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >>  0) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       result.w = static_cast<float>(color >> 24) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_argb_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >> 24) / static_cast<float>(255);\r
+       result.w = static_cast<float>(color >>  0) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_bgra_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >>  0) / static_cast<float>(255);\r
+       result.w = static_cast<float>(color >> 24) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_abgr_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >> 24) / static_cast<float>(255);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(255);\r
+       result.z = static_cast<float>(color >>  8) / static_cast<float>(255);\r
+       result.w = static_cast<float>(color >>  0) / static_cast<float>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline double f64_channel_cast<uint8>(uint8 color)\r
+{\r
+       return static_cast<double>(color >>  0) / static_cast<double>(255);\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_rgbx_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >>  0) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_xrgb_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >> 24) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_bgrx_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >>  0) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_xbgr_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >> 24) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_rgba_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >>  0) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       result.w = static_cast<double>(color >> 24) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_argb_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >> 24) / static_cast<double>(255);\r
+       result.w = static_cast<double>(color >>  0) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_bgra_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >>  0) / static_cast<double>(255);\r
+       result.w = static_cast<double>(color >> 24) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_abgr_cast<uint32>(uint32 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >> 24) / static_cast<double>(255);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(255);\r
+       result.z = static_cast<double>(color >>  8) / static_cast<double>(255);\r
+       result.w = static_cast<double>(color >>  0) / static_cast<double>(255);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::thalf f16_channel_cast<uint16>(uint16 color)\r
+{\r
+       return detail::thalf(static_cast<float>(color >>  0) / static_cast<float>(65535));\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<detail::thalf> f16_rgbx_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >>  0) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<detail::thalf> f16_xrgb_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<detail::thalf> f16_bgrx_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >>  0) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<detail::thalf> f16_xbgr_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<detail::thalf> f16_rgba_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >>  0) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       result.w = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<detail::thalf> f16_argb_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));\r
+       result.w = detail::thalf(static_cast<float>(color >>  0) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<detail::thalf> f16_bgra_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >>  0) / static_cast<float>(65535));\r
+       result.w = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<detail::thalf> f16_abgr_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<detail::thalf> result;\r
+       result.x = detail::thalf(static_cast<float>(color >> 48) / static_cast<float>(65535));\r
+       result.y = detail::thalf(static_cast<float>(color >> 32) / static_cast<float>(65535));\r
+       result.z = detail::thalf(static_cast<float>(color >> 16) / static_cast<float>(65535));\r
+       result.w = detail::thalf(static_cast<float>(color >>  0) / static_cast<float>(65535));\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline float f32_channel_cast<uint16>(uint16 color)\r
+{\r
+       return static_cast<float>(color >>  0) / static_cast<float>(65535);\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_rgbx_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >>  0) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_xrgb_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >> 48) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_bgrx_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >>  0) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<float> f32_xbgr_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<float> result;\r
+       result.x = static_cast<float>(color >> 48) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_rgba_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >>  0) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       result.w = static_cast<float>(color >> 48) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_argb_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >> 48) / static_cast<float>(65535);\r
+       result.w = static_cast<float>(color >>  0) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_bgra_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >>  0) / static_cast<float>(65535);\r
+       result.w = static_cast<float>(color >> 48) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<float> f32_abgr_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<float> result;\r
+       result.x = static_cast<float>(color >> 48) / static_cast<float>(65535);\r
+       result.y = static_cast<float>(color >> 32) / static_cast<float>(65535);\r
+       result.z = static_cast<float>(color >> 16) / static_cast<float>(65535);\r
+       result.w = static_cast<float>(color >>  0) / static_cast<float>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline double f64_channel_cast<uint16>(uint16 color)\r
+{\r
+       return static_cast<double>(color >>  0) / static_cast<double>(65535);\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_rgbx_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >>  0) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_xrgb_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >> 48) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_bgrx_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >>  0) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec3<double> f64_xbgr_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec3<double> result;\r
+       result.x = static_cast<double>(color >> 48) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_rgba_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >>  0) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       result.w = static_cast<double>(color >> 48) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_argb_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >> 48) / static_cast<double>(65535);\r
+       result.w = static_cast<double>(color >>  0) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_bgra_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >>  0) / static_cast<double>(65535);\r
+       result.w = static_cast<double>(color >> 48) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+template <>\r
+inline detail::tvec4<double> f64_abgr_cast<uint64>(uint64 color)\r
+{\r
+       detail::tvec4<double> result;\r
+       result.x = static_cast<double>(color >> 48) / static_cast<double>(65535);\r
+       result.y = static_cast<double>(color >> 32) / static_cast<double>(65535);\r
+       result.z = static_cast<double>(color >> 16) / static_cast<double>(65535);\r
+       result.w = static_cast<double>(color >>  0) / static_cast<double>(65535);\r
+       return result;\r
+}\r
+\r
+}//namespace color_space\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/color_space.hpp b/glm/gtx/color_space.hpp
new file mode 100644 (file)
index 0000000..3438bbd
--- /dev/null
@@ -0,0 +1,78 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2007-02-22\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/color_space.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_color_space\r
+#define glm_gtx_color_space\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_color_space();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_color_space extension: Related to RGB to HSV conversions and operations\r
+    namespace color_space\r
+    {\r
+               //! Converts a color from HSV color space to its color in RGB color space.\r
+               //! From GLM_GTX_color_space extension.\r
+        template <typename valType> \r
+               detail::tvec3<valType> rgbColor(\r
+                       detail::tvec3<valType> const & hsvValue);\r
+\r
+               //! Converts a color from RGB color space to its color in HSV color space.\r
+               //! From GLM_GTX_color_space extension.\r
+        template <typename valType> \r
+               detail::tvec3<valType> hsvColor(\r
+                       detail::tvec3<valType> const & rgbValue);\r
+               \r
+               //! Build a saturation matrix.\r
+               //! From GLM_GTX_color_space extension\r
+        template <typename valType> \r
+               detail::tmat4x4<valType> saturation(\r
+                       valType const s);\r
+\r
+        //! Modify the saturation of a color.\r
+               //! From GLM_GTX_color_space extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> saturation(\r
+                       valType const s, \r
+                       detail::tvec3<valType> const & color);\r
+               \r
+               //! Modify the saturation of a color.\r
+               //! From GLM_GTX_color_space extension.\r
+        template <typename valType> \r
+               detail::tvec4<valType> saturation(\r
+                       valType const s, \r
+                       detail::tvec4<valType> const & color);\r
+               \r
+               //! Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.\r
+               //! From GLM_GTX_color_space extension.\r
+               template <typename valType> \r
+               valType luminosity(\r
+                       detail::tvec3<valType> const & color);\r
+               \r
+       }//namespace color_space\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_color_space namespace gtx::color_space\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_color_space;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "color_space.inl"\r
+\r
+#endif//glm_gtx_color_space\r
diff --git a/glm/gtx/color_space.inl b/glm/gtx/color_space.inl
new file mode 100644 (file)
index 0000000..540da8a
--- /dev/null
@@ -0,0 +1,154 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2007-02-22\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/color_space.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace color_space\r
+{\r
+    template <typename T> \r
+    inline detail::tvec3<T> rgbColor(const detail::tvec3<T>& hsvColor)\r
+    {\r
+               detail::tvec3<T> hsv = hsvColor;\r
+        detail::tvec3<T> rgbColor;\r
+\r
+           if(hsv.y == T(0))\r
+                   // achromatic (grey)\r
+            rgbColor = detail::tvec3<T>(hsv.z);\r
+           else\r
+           {\r
+            T sector = floor(hsv.x / T(60));\r
+                       T frac = (hsv.x / T(60)) - sector;\r
+            // factorial part of h\r
+            T o = hsv.z * (T(1) - hsv.y);\r
+            T p = hsv.z * (T(1) - hsv.y * frac);\r
+            T q = hsv.z * (T(1) - hsv.y * (T(1) - frac));\r
+\r
+            switch(int(sector))\r
+            {\r
+            default:\r
+            case 0:\r
+                rgbColor.r = hsv.z;\r
+                rgbColor.g = q;\r
+                rgbColor.b = o;\r
+                break;\r
+            case 1:\r
+                rgbColor.r = p;\r
+                rgbColor.g = hsv.z;\r
+                rgbColor.b = o;\r
+                break;\r
+            case 2:\r
+                rgbColor.r = o;\r
+                rgbColor.g = hsv.z;\r
+                rgbColor.b = q;\r
+                break;\r
+            case 3:\r
+                rgbColor.r = o;\r
+                rgbColor.g = p;\r
+                rgbColor.b = hsv.z;\r
+                break;\r
+            case 4:\r
+                rgbColor.r = q; \r
+                rgbColor.g = o; \r
+                rgbColor.b = hsv.z;\r
+                break;\r
+                       case 5:\r
+                rgbColor.r = hsv.z; \r
+                rgbColor.g = o; \r
+                rgbColor.b = p;\r
+                break;\r
+            }\r
+           }\r
+\r
+               return rgbColor;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> hsvColor(const detail::tvec3<T>& rgbColor)\r
+    {\r
+        detail::tvec3<T> hsv = rgbColor;\r
+           float Min   = min(min(rgbColor.r, rgbColor.g), rgbColor.b);\r
+           float Max   = max(max(rgbColor.r, rgbColor.g), rgbColor.b);\r
+           float Delta = Max - Min;\r
+\r
+           hsv.z = Max;                               \r
+       \r
+           if(Max != T(0))\r
+           {\r
+                   hsv.y = Delta / hsv.z;    \r
+                       T h = T(0);\r
+\r
+                   if(rgbColor.r == Max)\r
+                           // between yellow & magenta\r
+                           h = T(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta;\r
+                   else if(rgbColor.g == Max)\r
+                           // between cyan & yellow\r
+                           h = T(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta;\r
+                   else\r
+                           // between magenta & cyan\r
+                           h = T(240) + T(60) * (rgbColor.r - rgbColor.g) / Delta;\r
+            \r
+                   if(h < T(0)) \r
+                hsv.x = h + T(360);\r
+                       else\r
+                               hsv.x = h;\r
+           }\r
+           else\r
+           {\r
+                   // If r = g = b = 0 then s = 0, h is undefined\r
+                   hsv.y = T(0);\r
+                   hsv.x = T(0);\r
+           }\r
+\r
+               return hsv;\r
+    }\r
+\r
+       template <typename T> \r
+       inline detail::tmat4x4<T> saturation(const T s)\r
+       {\r
+               detail::tvec3<T> rgbw = detail::tvec3<T>(T(0.2126), T(0.7152), T(0.0722));\r
+\r
+               T col0 = (T(1) - s) * rgbw.r;\r
+               T col1 = (T(1) - s) * rgbw.g;\r
+               T col2 = (T(1) - s) * rgbw.b;\r
+\r
+               detail::tmat4x4<T> result(T(1));\r
+               result[0][0] = col0 + s;\r
+               result[0][1] = col0;\r
+               result[0][2] = col0;\r
+               result[1][0] = col1;\r
+               result[1][1] = col1 + s;\r
+               result[1][2] = col1;\r
+               result[2][0] = col2;\r
+               result[2][1] = col2;\r
+               result[2][2] = col2 + s;\r
+               return result;\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tvec3<T> saturation(const T s, const detail::tvec3<T>& color)\r
+       {\r
+               return detail::tvec3<T>(saturation(s) * detail::tvec4<T>(color, T(0)));\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tvec4<T> saturation(const T s, const detail::tvec4<T>& color)\r
+       {\r
+               return saturation(s) * color;\r
+       }\r
+\r
+       template <typename T> \r
+       inline T luminosity(const detail::tvec3<T>& color)\r
+       {\r
+               const detail::tvec3<T> tmp = detail::tvec3<T>(0.33, 0.59, 0.11);\r
+               return dot(color, tmp);\r
+       }\r
+\r
+}//namespace color_space\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/color_space_YCoCg.hpp b/glm/gtx/color_space_YCoCg.hpp
new file mode 100644 (file)
index 0000000..1932ffd
--- /dev/null
@@ -0,0 +1,66 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-28\r
+// Updated : 2008-10-28\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/color_space_YCoCg.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_color_space_YCoCg\r
+#define glm_gtx_color_space_YCoCg\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_color_space_YCoCg();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_color_space_YCoCg extension: RGB to YCoCg conversions and operations\r
+    namespace color_space_YCoCg\r
+    {\r
+        //! Convert a color from RGB color space to YCoCg color space.\r
+               //! From GLM_GTX_color_space_YCoCg extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> rgb2YCoCg(\r
+                       detail::tvec3<valType> const & rgbColor);\r
+\r
+        //! Convert a color from YCoCg color space to RGB color space.\r
+               //! From GLM_GTX_color_space_YCoCg extension.\r
+        template <typename valType> \r
+               detail::tvec3<valType> YCoCg2rgb(\r
+                       detail::tvec3<valType> const & YCoCgColor);\r
+\r
+        //! Convert a color from RGB color space to YCoCgR color space.\r
+               //! \see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"\r
+               //! From GLM_GTX_color_space_YCoCg extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> rgb2YCoCgR(\r
+                       detail::tvec3<valType> const & rgbColor);\r
+\r
+        //! Convert a color from YCoCgR color space to RGB color space.\r
+               //! \see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"\r
+               //! From GLM_GTX_color_space_YCoCg extension.\r
+        template <typename valType> \r
+               detail::tvec3<valType> YCoCgR2rgb(\r
+                       detail::tvec3<valType> const & YCoCgColor);\r
+\r
+       }//namespace color_space_YCoCg\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_color_space_YCoCg namespace gtx::color_space_YCoCg\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_color_space_YCoCg;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "color_space_YCoCg.inl"\r
+\r
+#endif//glm_gtx_color_space_YCoCg\r
diff --git a/glm/gtx/color_space_YCoCg.inl b/glm/gtx/color_space_YCoCg.inl
new file mode 100644 (file)
index 0000000..7d9e7ec
--- /dev/null
@@ -0,0 +1,69 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-28\r
+// Updated : 2008-10-28\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/color_space_YCoCg.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace color_space_YCoCg{\r
+\r
+template <typename valType> \r
+inline detail::tvec3<valType> rgb2YCoCg\r
+(\r
+       detail::tvec3<valType> const & rgbColor\r
+)\r
+{\r
+       detail::tvec3<valType> result;\r
+       result.x/*Y */ =   rgbColor.r / valType(4) + rgbColor.g / valType(2) + rgbColor.b / valType(4);\r
+       result.y/*Co*/ =   rgbColor.r / valType(2) + rgbColor.g * valType(0) - rgbColor.b / valType(2);\r
+       result.z/*Cg*/ = - rgbColor.r / valType(4) + rgbColor.g / valType(2) - rgbColor.b / valType(4);\r
+       return result;\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<valType> rgb2YCoCgR\r
+(\r
+       detail::tvec3<valType> const & rgbColor\r
+)\r
+{\r
+       detail::tvec3<valType> result;\r
+       result.x/*Y */ = rgbColor.g / valType(2) + (rgbColor.r + rgbColor.b) / valType(4);\r
+       result.y/*Co*/ = rgbColor.r - rgbColor.b;\r
+       result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) / valType(2);\r
+       return result;\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<valType> YCoCg2rgb\r
+(\r
+       detail::tvec3<valType> const & YCoCgColor\r
+)\r
+{\r
+       detail::tvec3<valType> result;\r
+       result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z;\r
+       result.g = YCoCgColor.x                + YCoCgColor.z;\r
+       result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z;\r
+       return result;\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<valType> YCoCgR2rgb\r
+(\r
+       detail::tvec3<valType> const & YCoCgRColor\r
+)\r
+{\r
+       detail::tvec3<valType> result;\r
+       valType tmp = YCoCgRColor.x - (YCoCgRColor.z / valType(2));\r
+       result.g = YCoCgRColor.z + tmp;\r
+       result.b = tmp - (YCoCgRColor.y / valType(2));\r
+       result.r = result.b + YCoCgRColor.y;\r
+       return result;\r
+}\r
+\r
+}//namespace color_space_YCoCg\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/comparison.hpp b/glm/gtx/comparison.hpp
new file mode 100644 (file)
index 0000000..1f071b4
--- /dev/null
@@ -0,0 +1,50 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-06-22\r
+// Updated : 2008-10-27\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/comparison.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_comparison\r
+#define glm_gtx_comparison\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_comparison();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_comparison extension: Defined comparison operators for vectors.\r
+       namespace comparison{\r
+\r
+               //! Define == operator for vectors\r
+               //! From GLM_GTX_comparison extension.\r
+               template <typename vecType>\r
+               bool operator== (vecType const & x, vecType const & y);\r
+\r
+               //! Define != operator for vectors\r
+               //! From GLM_GTX_comparison extension.\r
+               template <typename vecType>\r
+               bool operator!= (vecType const & x, vecType const & y);\r
+\r
+       }//namespace comparison\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_comparison namespace glm::gtx::comparison\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_comparison;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "comparison.inl"\r
+\r
+#endif//glm_gtx_comparison\r
diff --git a/glm/gtx/comparison.inl b/glm/gtx/comparison.inl
new file mode 100644 (file)
index 0000000..31a8022
--- /dev/null
@@ -0,0 +1,76 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-06-22\r
+// Updated : 2008-10-27\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/comparison.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace comparison{\r
+\r
+template <typename valType>\r
+inline bool operator== \r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y\r
+)\r
+{\r
+       return glm::all(glm::equal(x, y));\r
+}\r
+\r
+template <typename valType>\r
+inline bool operator== \r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y\r
+)\r
+{\r
+       return glm::all(glm::equal(x, y));\r
+}\r
+\r
+template <typename valType>\r
+inline bool operator== \r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y\r
+)\r
+{\r
+       return glm::all(glm::equal(x, y));\r
+}\r
+\r
+template <typename valType>\r
+inline bool operator!= \r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y\r
+)\r
+{\r
+       return glm::any(glm::notEqual(x, y));\r
+}\r
+\r
+template <typename valType>\r
+inline bool operator!= \r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y\r
+)\r
+{\r
+       return glm::any(glm::notEqual(x, y));\r
+}\r
+\r
+template <typename valType>\r
+inline bool operator!= \r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y\r
+)\r
+{\r
+       return glm::any(glm::notEqual(x, y));\r
+}\r
+\r
+}//namespace comparison\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/compatibility.hpp b/glm/gtx/compatibility.hpp
new file mode 100644 (file)
index 0000000..80643c3
--- /dev/null
@@ -0,0 +1,174 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-01-24\r
+// Updated : 2008-10-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/compatibility.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_half_float\r
+// - GLM_GTX_double_float\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_compatibility\r
+#define glm_gtx_compatibility\r
+\r
+// Dependency:\r
+#include "../glm.hpp"  \r
+#include "../gtc/half_float.hpp"\r
+#include "../gtc/double_float.hpp"\r
+\r
+#ifdef GLM_COMPILER_VC\r
+#include <cfloat>\r
+#endif\r
+#ifdef GLM_COMPILER_GCC\r
+#include <cmath>\r
+#endif\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_compatibility();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_compatibility extension: Provide functions to increase the compatibility with Cg and HLSL languages\r
+       namespace compatibility\r
+       {\r
+               template <typename T> 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)\r
+               template <typename T> inline detail::tvec2<T> lerp(const detail::tvec2<T>& x, const detail::tvec2<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)\r
+               template <typename T> inline detail::tvec3<T> lerp(const detail::tvec3<T>& x, const detail::tvec3<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)\r
+               template <typename T> inline detail::tvec4<T> lerp(const detail::tvec4<T>& x, const detail::tvec4<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)\r
+               template <typename T> inline detail::tvec2<T> lerp(const detail::tvec2<T>& x, const detail::tvec2<T>& y, const detail::tvec2<T>& 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)\r
+               template <typename T> inline detail::tvec3<T> lerp(const detail::tvec3<T>& x, const detail::tvec3<T>& y, const detail::tvec3<T>& 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)\r
+               template <typename T> inline detail::tvec4<T> lerp(const detail::tvec4<T>& x, const detail::tvec4<T>& y, const detail::tvec4<T>& 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)\r
+\r
+               template <typename T> inline T saturate(T x){return clamp(x, T(0), T(1));}                                                                                                              //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)\r
+               template <typename T> inline detail::tvec2<T> saturate(const detail::tvec2<T>& x){return clamp(x, T(0), T(1));}                                 //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)\r
+               template <typename T> inline detail::tvec3<T> saturate(const detail::tvec3<T>& x){return clamp(x, T(0), T(1));}                                 //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)\r
+               template <typename T> inline detail::tvec4<T> saturate(const detail::tvec4<T>& x){return clamp(x, T(0), T(1));}                                 //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)\r
+\r
+               template <typename T> inline T atan2(T x, T y){return 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)\r
+               template <typename T> inline detail::tvec2<T> atan2(const detail::tvec2<T>& x, const detail::tvec2<T>& y){return 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)\r
+               template <typename T> inline detail::tvec3<T> atan2(const detail::tvec3<T>& x, const detail::tvec3<T>& y){return 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)\r
+               template <typename T> inline detail::tvec4<T> atan2(const detail::tvec4<T>& x, const detail::tvec4<T>& y){return 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)\r
+\r
+               template <typename genType> bool isfinite(genType const & x);                                                                                   //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)\r
+               template <typename valType> detail::tvec2<bool> isfinite(const detail::tvec2<valType>& x);                              //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)\r
+               template <typename valType> detail::tvec3<bool> isfinite(const detail::tvec3<valType>& x);                              //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)\r
+               template <typename valType> detail::tvec4<bool> isfinite(const detail::tvec4<valType>& x);                              //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)\r
+\r
+               template <typename genType> bool isinf(genType const & x);                                                                                                              //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) \r
+               template <typename genType> detail::tvec2<bool> isinf(const detail::tvec2<genType>& x);                                 //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) \r
+               template <typename genType> detail::tvec3<bool> isinf(const detail::tvec3<genType>& x);                                 //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) \r
+               template <typename genType> detail::tvec4<bool> isinf(const detail::tvec4<genType>& x);                                 //!< \brief Determines whether the given floating-point value is infinite. (From GLM_GTX_compatibility extension) \r
+\r
+               template <typename genType> bool isnan(genType const & x);                                                                                                              //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension)\r
+               template <typename genType> detail::tvec2<bool> isnan(const detail::tvec2<genType>& x);                                 //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension)\r
+               template <typename genType> detail::tvec3<bool> isnan(const detail::tvec3<genType>& x);                                 //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension)\r
+               template <typename genType> detail::tvec4<bool> isnan(const detail::tvec4<genType>& x);                                 //!< \brief Checks given floating-point value for not a number (NAN) (From GLM_GTX_compatibility extension)\r
+\r
+               typedef bool                                            bool1;                  //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec2<bool>                     bool2;                  //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec3<bool>                     bool3;                  //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec4<bool>                     bool4;                  //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef bool                                            bool1x1;                //!< \brief boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x2<bool>           bool2x2;                //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x3<bool>           bool2x3;                //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x4<bool>           bool2x4;                //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x2<bool>           bool3x2;                //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x3<bool>           bool3x3;                //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x4<bool>           bool3x4;                //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x2<bool>           bool4x2;                //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x3<bool>           bool4x3;                //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x4<bool>           bool4x4;                //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef int                                                     int1;                   //!< \brief integer vector with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec2<int>                      int2;                   //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec3<int>                      int3;                   //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec4<int>                      int4;                   //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef int                                                     int1x1;                 //!< \brief integer matrix with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x2<int>            int2x2;                 //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x3<int>            int2x3;                 //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x4<int>            int2x4;                 //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x2<int>            int3x2;                 //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x3<int>            int3x3;                 //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x4<int>            int3x4;                 //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x2<int>            int4x2;                 //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x3<int>            int4x3;                 //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x4<int>            int4x4;                 //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef gtc::half_float::half                                           half1;                  //!< \brief half-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec2<gtc::half_float::half>            half2;                  //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec3<gtc::half_float::half>            half3;                  //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec4<gtc::half_float::half>            half4;                  //!< \brief half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef gtc::half_float::half                                           half1x1;                //!< \brief half-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x2<gtc::half_float::half>          half2x2;                //!< \brief half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x3<gtc::half_float::half>          half2x3;                //!< \brief half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x4<gtc::half_float::half>          half2x4;                //!< \brief half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x2<gtc::half_float::half>          half3x2;                //!< \brief half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x3<gtc::half_float::half>          half3x3;                //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x4<gtc::half_float::half>          half3x4;                //!< \brief half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x2<gtc::half_float::half>          half4x2;                //!< \brief half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x3<gtc::half_float::half>          half4x3;                //!< \brief half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x4<gtc::half_float::half>          half4x4;                //!< \brief half-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef float                                           float1;                 //!< \brief single-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec2<float>            float2;                 //!< \brief single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec3<float>            float3;                 //!< \brief single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec4<float>            float4;                 //!< \brief single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef float                                           float1x1;               //!< \brief single-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x2<float>          float2x2;               //!< \brief single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x3<float>          float2x3;               //!< \brief single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x4<float>          float2x4;               //!< \brief single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x2<float>          float3x2;               //!< \brief single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x3<float>          float3x3;               //!< \brief single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x4<float>          float3x4;               //!< \brief single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x2<float>          float4x2;               //!< \brief single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x3<float>          float4x3;               //!< \brief single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x4<float>          float4x4;               //!< \brief single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef double                                          double1;                //!< \brief double-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec2<double>           double2;                //!< \brief double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec3<double>           double3;                //!< \brief double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tvec4<double>           double4;                //!< \brief double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+               typedef double                                          double1x1;              //!< \brief double-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x2<double>         double2x2;              //!< \brief double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x3<double>         double2x3;              //!< \brief double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat2x4<double>         double2x4;              //!< \brief double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x2<double>         double3x2;              //!< \brief double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x3<double>         double3x3;              //!< \brief double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat3x4<double>         double3x4;              //!< \brief double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x2<double>         double4x2;              //!< \brief double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x3<double>         double4x3;              //!< \brief double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)\r
+               typedef detail::tmat4x4<double>         double4x4;              //!< \brief double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)\r
+\r
+       }//namespace compatibility\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_compatibility namespace gtx::compatibility\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_compatibility;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "compatibility.inl"\r
+\r
+#endif//glm_gtx_compatibility\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/glm/gtx/compatibility.inl b/glm/gtx/compatibility.inl
new file mode 100644 (file)
index 0000000..2048145
--- /dev/null
@@ -0,0 +1,141 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-16\r
+// Updated : 2008-10-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/compatibility.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace compatibility{\r
+\r
+// isfinite\r
+template <typename genType> \r
+inline bool isfinite(\r
+       genType const & x)\r
+{\r
+#ifdef GLM_COMPILER_VC\r
+       return _finite(x);\r
+#else//GLM_COMPILER_GCC\r
+       return std::isfinite(x);\r
+#endif\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec2<bool> isfinite(\r
+       detail::tvec2<valType> const & x)\r
+{\r
+       return detail::tvec2<bool>(\r
+               isfinite(x.x),\r
+               isfinite(x.y));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<bool> isfinite(\r
+       detail::tvec3<valType> const & x)\r
+{\r
+       return detail::tvec3<bool>(\r
+               isfinite(x.x),\r
+               isfinite(x.y),\r
+               isfinite(x.z));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec4<bool> isfinite(\r
+       detail::tvec4<valType> const & x)\r
+{\r
+       return detail::tvec4<bool>(\r
+               isfinite(x.x),\r
+               isfinite(x.y),\r
+               isfinite(x.z),\r
+               isfinite(x.w));\r
+}\r
+\r
+// isinf\r
+template <typename genType> \r
+inline bool isinf(\r
+       genType const & x)\r
+{\r
+#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))\r
+       return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;\r
+#else\r
+       return std::isinf(x);\r
+#endif\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec2<bool> isinf(\r
+       detail::tvec2<valType> const & x)\r
+{\r
+       return detail::tvec2<bool>(\r
+               isinf(x.x),\r
+               isinf(x.y));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<bool> isinf(\r
+       detail::tvec3<valType> const & x)\r
+{\r
+       return detail::tvec3<bool>(\r
+               isinf(x.x),\r
+               isinf(x.y),\r
+               isinf(x.z));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec4<bool> isinf(\r
+       detail::tvec4<valType> const & x)\r
+{\r
+       return detail::tvec4<bool>(\r
+               isinf(x.x),\r
+               isinf(x.y),\r
+               isinf(x.z),\r
+               isinf(x.w));\r
+}\r
+\r
+// isnan\r
+template <typename genType> \r
+inline bool isnan(genType const & x)\r
+{\r
+#if(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC))\r
+       return _isnan(x);\r
+#else\r
+       return std::isnan(x);\r
+#endif\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec2<bool> isnan(\r
+       detail::tvec2<valType> const & x)\r
+{\r
+       return detail::tvec2<bool>(\r
+               isnan(x.x),\r
+               isnan(x.y));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<bool> isnan(\r
+       detail::tvec3<valType> const & x)\r
+{\r
+       return detail::tvec3<bool>(\r
+               isnan(x.x),\r
+               isnan(x.y),\r
+               isnan(x.z));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec4<bool> isnan(\r
+       detail::tvec4<valType> const & x)\r
+{\r
+       return detail::tvec4<bool>(\r
+               isnan(x.x),\r
+               isnan(x.y),\r
+               isnan(x.z),\r
+               isnan(x.w));\r
+}\r
+\r
+}//namespace compatibility\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/component_wise.hpp b/glm/gtx/component_wise.hpp
new file mode 100644 (file)
index 0000000..d2d6f11
--- /dev/null
@@ -0,0 +1,64 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-05-21\r
+// Updated : 2007-05-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/component_wise.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_component_wise\r
+#define glm_gtx_component_wise\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_component_wise();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_component_wise extension: Operations between components of a type\r
+       namespace component_wise\r
+       {\r
+               //! Add all vector components together. \r
+               //! From GLM_GTX_component_wise extension.\r
+               template <typename genType> \r
+               typename genType::value_type compAdd(\r
+                       genType const & v);\r
+\r
+               //! Multiply all vector components together. \r
+               //! From GLM_GTX_component_wise extension.\r
+               template <typename genType> \r
+               typename genType::value_type compMul(\r
+                       genType const & v);\r
+\r
+               //! Find the minimum value between single vector components.\r
+               //! From GLM_GTX_component_wise extension.\r
+               template <typename genType> \r
+               typename genType::value_type compMin(\r
+                       genType const & v);\r
+\r
+               //! Find the maximum value between single vector components.\r
+               //! From GLM_GTX_component_wise extension.\r
+               template <typename genType> \r
+               typename genType::value_type compMax(\r
+                       genType const & v);\r
+\r
+       }//namespace component_wise\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_component_wise namespace gtx::component_wise\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_component_wise;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "component_wise.inl"\r
+\r
+#endif//glm_gtx_component_wise\r
diff --git a/glm/gtx/component_wise.inl b/glm/gtx/component_wise.inl
new file mode 100644 (file)
index 0000000..dff9cfd
--- /dev/null
@@ -0,0 +1,88 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-05-21\r
+// Updated : 2007-05-21\r
+// Licence : This source is under MIT License\r
+// File    : gtx_component_wise.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace component_wise\r
+{\r
+       template <typename genType>\r
+       inline typename genType::value_type compAdd(const genType& v)\r
+       {\r
+        typename genType::size_type result = typename genType::value_type(0);\r
+               for(typename genType::size_type i = 0; i < genType::value_size(); ++i)\r
+                       result += v[i];\r
+               return result;\r
+       }\r
+/*\r
+       template <typename genType>\r
+       inline valType compAdd(const genType& v)\r
+       {\r
+               valType result = valType(0);\r
+               for(sizeType i = 0; i < valSize; ++i)\r
+                       result += v[i];\r
+               return result;\r
+       }\r
+*/\r
+       template <typename genType>\r
+       inline typename genType::value_type compMul(const genType& v)\r
+       {\r
+        typename genType::value_type result = typename genType::value_type(1);\r
+               for(typename genType::size_type i = 0; i < genType::value_size(); ++i)\r
+                       result *= v[i];\r
+               return result;\r
+       }\r
+/*\r
+       template <typename genType>\r
+       inline typename genType::value_type compMul(const genType& v)\r
+       {\r
+               valType result = valType(0);\r
+               for(GLMsizeType i = 0; i < valSize; ++i)\r
+                       result *= v[i];\r
+               return result;\r
+       }\r
+*/\r
+       template <typename genType>\r
+       inline typename genType::value_type compMin(const genType& v)\r
+       {\r
+        typename genType::value_type result = typename genType::value_type(v[0]);\r
+               for(typename genType::size_type i = 1; i < genType::value_size(); ++i)\r
+                       result = min(result, v[i]);\r
+               return result;\r
+       }\r
+/*\r
+       template <typename genType>\r
+       inline typename genType::value_type compMin(const genType& v)\r
+       {\r
+               valType result = valType(0);\r
+               for(GLMsizeType i = 0; i < valSize; ++i)\r
+                       result = min(result, v[i]);\r
+               return result;\r
+       }\r
+*/\r
+       template <typename genType>\r
+       inline typename genType::value_type compMax(const genType& v)\r
+       {\r
+        typename genType::value_type result = typename genType::value_type(v[0]);\r
+               for(typename genType::size_type i = 1; i < genType::value_size(); ++i)\r
+                       result = max(result, v[i]);\r
+               return result;\r
+       }\r
+/*\r
+       template <typename genType>\r
+       inline typename genType::value_type compMax(const genType& v)\r
+       {\r
+               GLMvalType result = GLMvalType(0);\r
+               for(GLMsizeType i = 0; i < GLMvalSize; ++i)\r
+                       result = max(result, v[i]);\r
+               return result;\r
+       }\r
+*/\r
+}//namespace component_wise\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/determinant.hpp b/glm/gtx/determinant.hpp
new file mode 100644 (file)
index 0000000..3b5db0c
--- /dev/null
@@ -0,0 +1,43 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-04-23\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/determinant.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_determinant\r
+#define glm_gtx_determinant\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/matrix_operation.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_determinant();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_determinant extension: Compute the determinant of a matrix\r
+       namespace determinant\r
+       {\r
+               using namespace gtc::matrix_operation;\r
+\r
+       }//namespace determinant\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_determinant namespace gtx::determinant\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_determinant;}\r
+#endif//GLM_GTC_GLOBAL\r
+\r
+#include "determinant.inl"\r
+\r
+#endif//glm_gtx_determinant\r
diff --git a/glm/gtx/determinant.inl b/glm/gtx/determinant.inl
new file mode 100644 (file)
index 0000000..5868517
--- /dev/null
@@ -0,0 +1,13 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2005-12-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/determinant.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+\r
+}\r
diff --git a/glm/gtx/double_float.hpp b/glm/gtx/double_float.hpp
new file mode 100644 (file)
index 0000000..ac49134
--- /dev/null
@@ -0,0 +1,56 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/double_float.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_double_float\r
+// - GLM_GTX_quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Note:\r
+// - This implementation doesn't need to redefine all build-in functions to\r
+// support double based type.\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_double_float\r
+#define glm_gtx_double_float\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/double_float.hpp"\r
+#include "../gtx/quaternion.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_double_float();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_double_float extension: Add support for double precision flotting-point types\r
+       namespace double_float\r
+       {\r
+               //! Quaternion of single-precision floating-point numbers. \r
+               //! From GLM_GTX_double extension.\r
+               typedef detail::tquat<float>    fquat;\r
+\r
+               //! Quaternion of double-precision floating-point numbers. \r
+               //! From GLM_GTX_double extension.\r
+               typedef detail::tquat<double>   dquat;\r
+\r
+       }//namespace double_float\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_double_float namespace gtc::double_float; using namespace gtx::double_float\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_double_float;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "double_float.inl"\r
+\r
+#endif//glm_gtx_double_float\r
diff --git a/glm/gtx/double_float.inl b/glm/gtx/double_float.inl
new file mode 100644 (file)
index 0000000..c7e1e5c
--- /dev/null
@@ -0,0 +1,13 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-04-29\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtc/double_float.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+\r
+}\r
diff --git a/glm/gtx/epsilon.hpp b/glm/gtx/epsilon.hpp
new file mode 100644 (file)
index 0000000..5e077da
--- /dev/null
@@ -0,0 +1,60 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/epsilon.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_double\r
+// - GLM_GTX_half\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_epsilon\r
+#define glm_gtx_epsilon\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/double_float.hpp"\r
+#include "../gtc/half_float.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_epsilon();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_epsilon extension: Comparaison functions for a user defined epsilon values.\r
+       namespace epsilon\r
+       {\r
+               //! Returns the component-wise compare of |x - y| < epsilon.\r
+               //! From GLM_GTX_epsilon extension.\r
+               template <typename genTypeT, typename genTypeU> \r
+               bool equalEpsilon(\r
+                       genTypeT const & x, \r
+                       genTypeT const & y, \r
+                       genTypeU const & epsilon);\r
+               \r
+               //! Returns the component-wise compare of |x - y| >= epsilon.\r
+               //! From GLM_GTX_epsilon extension.\r
+               template <typename genTypeT, typename genTypeU>\r
+               bool notEqualEpsilon(\r
+                       genTypeT const & x, \r
+                       genTypeT const & y, \r
+                       genTypeU const & epsilon);\r
+\r
+       }//namespace epsilon\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_epsilon namespace gtx::epsilon\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_epsilon;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "epsilon.inl"\r
+\r
+#endif//glm_gtx_epsilon\r
diff --git a/glm/gtx/epsilon.inl b/glm/gtx/epsilon.inl
new file mode 100644 (file)
index 0000000..60d1907
--- /dev/null
@@ -0,0 +1,204 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2006-01-16\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/epsilon.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace epsilon{\r
+\r
+template <typename genType>\r
+inline bool equalEpsilon\r
+(\r
+       genType const & x, \r
+       genType const & y, \r
+       genType const & epsilon\r
+)\r
+{\r
+    return abs(x - y) < epsilon;\r
+}\r
+\r
+template <typename genType>\r
+inline bool notEqualEpsilon\r
+(\r
+       genType const & x, \r
+       genType const & y, \r
+       genType const & epsilon\r
+)\r
+{\r
+    return abs(x - y) >= epsilon;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<bool> equalEpsilon\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y, \r
+       valType const & epsilon)\r
+{\r
+    return detail::tvec2<bool>(\r
+        abs(x.x - y.x) < epsilon,\r
+        abs(x.y - y.y) < epsilon);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<bool> equalEpsilon\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y, \r
+       valType const & epsilon)\r
+{\r
+    return detail::tvec3<bool>(\r
+        abs(x.x - y.x) < epsilon,\r
+        abs(x.y - y.y) < epsilon,\r
+        abs(x.z - y.z) < epsilon);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<bool> equalEpsilon\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y, \r
+       valType const & epsilon\r
+)\r
+{\r
+    return detail::tvec4<bool>(\r
+        abs(x.x - y.x) < epsilon,\r
+        abs(x.y - y.y) < epsilon,\r
+        abs(x.z - y.z) < epsilon,\r
+        abs(x.w - y.w) < epsilon);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<bool> notEqualEpsilon\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y, \r
+       valType const & epsilon\r
+)\r
+{\r
+    return detail::tvec2<bool>(\r
+        abs(x.x - y.x) >= epsilon,\r
+        abs(x.y - y.y) >= epsilon);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<bool> notEqualEpsilon\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y, \r
+       valType const & epsilon\r
+)\r
+{\r
+    return detail::tvec3<bool>(\r
+        abs(x.x - y.x) >= epsilon,\r
+        abs(x.y - y.y) >= epsilon,\r
+        abs(x.z - y.z) >= epsilon);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<bool> notEqualEpsilon\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y, \r
+       valType const & epsilon\r
+)\r
+{\r
+    return detail::tvec4<bool>(\r
+        abs(x.x - y.x) >= epsilon,\r
+        abs(x.y - y.y) >= epsilon,\r
+        abs(x.z - y.z) >= epsilon,\r
+        abs(x.w - y.w) >= epsilon);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<bool> equalEpsilon\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y, \r
+       detail::tvec2<valType> const & epsilon\r
+)\r
+{\r
+    return detail::tvec2<bool>(\r
+        abs(x.x - y.x) < epsilon.x,\r
+        abs(x.y - y.y) < epsilon.y);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<bool> equalEpsilon\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y, \r
+       detail::tvec3<valType> const & epsilon\r
+)\r
+{\r
+    return detail::tvec3<bool>(\r
+        abs(x.x - y.x) < epsilon.x,\r
+        abs(x.y - y.y) < epsilon.y,\r
+        abs(x.z - y.z) < epsilon.z);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<bool> equalEpsilon\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y, \r
+       detail::tvec4<valType> const & epsilon\r
+)\r
+{\r
+    return detail::tvec4<bool>(\r
+        abs(x.x - y.x) < epsilon.x,\r
+        abs(x.y - y.y) < epsilon.y,\r
+        abs(x.z - y.z) < epsilon.z,\r
+        abs(x.w - y.w) < epsilon.w);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<bool> notEqualEpsilon\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y, \r
+       detail::tvec2<valType> const & epsilon\r
+)\r
+{\r
+    return detail::tvec2<bool>(\r
+        abs(x.x - y.x) >= epsilon.x,\r
+        abs(x.y - y.y) >= epsilon.y);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<bool> notEqualEpsilon\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y, \r
+       detail::tvec3<valType> const & epsilon\r
+)\r
+{\r
+    return detail::tvec3<bool>(\r
+        abs(x.x - y.x) >= epsilon.x,\r
+        abs(x.y - y.y) >= epsilon.y,\r
+        abs(x.z - y.z) >= epsilon.z);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<bool> notEqualEpsilon\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y, \r
+       detail::tvec4<valType> const & epsilon\r
+)\r
+{\r
+    return detail::tvec4<bool>(\r
+        abs(x.x - y.x) >= epsilon.x,\r
+        abs(x.y - y.y) >= epsilon.y,\r
+        abs(x.z - y.z) >= epsilon.z,\r
+        abs(x.w - y.w) >= epsilon.w);\r
+}\r
+\r
+}//namespace epsilon\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/euler_angles.hpp b/glm/gtx/euler_angles.hpp
new file mode 100644 (file)
index 0000000..0391045
--- /dev/null
@@ -0,0 +1,139 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2007-08-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/euler_angles.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_double_float\r
+// - GLM_GTC_half_float\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// ToDo:\r
+// - mat2 mat2GTX(const vec2& angles) undefined\r
+// - mat3 mat3GTX(const vec2& angles) undefined\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_euler_angles\r
+#define glm_gtx_euler_angles\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/double_float.hpp"\r
+#include "../gtc/half_float.hpp"\r
+\r
+namespace glm\r
+{\r
+    namespace gtx{\r
+       //! GLM_GTX_euler_angles extension: Build matrices from euler angles.\r
+       namespace euler_angles\r
+       {\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X.\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleX(\r
+                       valType const & angleX);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y.\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleY(\r
+                       valType const & angleY);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z.\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleZ(\r
+                       valType const & angleZ);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleXY(\r
+                       valType const & angleX, \r
+                       valType const & angleY);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleYX(\r
+                       valType const & angleY, \r
+                       valType const & angleX);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleXZ(\r
+                       valType const & angleX, \r
+                       valType const & angleZ);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleZX(\r
+                       valType const & angleZ, \r
+                       valType const & angleX);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleYZ(\r
+                       valType const & angleY, \r
+                       valType const & angleZ);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleZY(\r
+                       valType const & angleZ, \r
+                       valType const & angleY);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> eulerAngleYXZ(\r
+                       valType const & yaw, \r
+                       valType const & pitch, \r
+                       valType const & roll);\r
+\r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> yawPitchRoll(\r
+                       valType const & yaw, \r
+                       valType const & pitch, \r
+                       valType const & roll);\r
+\r
+               //! Creates a 2D 2 * 2 rotation matrix from an euler angle.\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename T> \r
+               detail::tmat2x2<T> orientate2(T const & angle);\r
+\r
+               //! Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle.\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> orientate3(T const & angle);\r
+\r
+               //! Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). \r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> orientate3(detail::tvec3<T> const & angles);\r
+               \r
+               //! Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z).\r
+               //! From GLM_GTX_euler_angles extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> orientate4(detail::tvec3<T> const & angles);\r
+       }//namespace euler_angles\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_euler_angles namespace gtx::euler_angles\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_euler_angles;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "euler_angles.inl"\r
+\r
+#endif//glm_gtx_euler_angles\r
diff --git a/glm/gtx/euler_angles.inl b/glm/gtx/euler_angles.inl
new file mode 100644 (file)
index 0000000..57c51c9
--- /dev/null
@@ -0,0 +1,249 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2007-08-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/euler_angles.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace euler_angles{\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleX\r
+(\r
+       valType const & angleX\r
+)\r
+{\r
+       valType cosX = glm::cos(angleX);\r
+       valType sinX = glm::sin(angleX);\r
+       \r
+       return detail::tmat4x4<valType>(\r
+               valType(1), valType(0), valType(0), valType(0),\r
+               valType(0), cosX,               sinX,           valType(0),\r
+               valType(0),-sinX,               cosX,           valType(0),\r
+               valType(0), valType(0), valType(0), valType(1));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleY\r
+(\r
+       valType const & angleY\r
+)\r
+{\r
+       valType cosY = glm::cos(angleY);\r
+       valType sinY = glm::sin(angleY);\r
+\r
+       return detail::tmat4x4<valType>(\r
+               cosY,           valType(0),     sinY,           valType(0),\r
+               valType(0),     valType(1),     valType(0), valType(0),\r
+               -sinY,          valType(0),     cosY,           valType(0),\r
+               valType(0),     valType(0),     valType(0), valType(1));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleZ\r
+(\r
+       valType const & angleZ\r
+)\r
+{\r
+       valType cosZ = glm::cos(angleZ); \r
+       valType sinZ = glm::sin(angleZ);\r
+\r
+       return detail::tmat4x4<valType>(\r
+               cosZ,           sinZ,           valType(0), valType(0),\r
+               -sinZ,          cosZ,           valType(0), valType(0),\r
+               valType(0),     valType(0),     valType(1), valType(0),\r
+               valType(0),     valType(0),     valType(0), valType(1));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleXY\r
+(\r
+       valType const & angleX, \r
+       valType const & angleY\r
+)\r
+{\r
+       valType cosX = glm::cos(angleX);\r
+       valType sinX = glm::sin(angleX);\r
+       valType cosY = glm::cos(angleY);\r
+       valType sinY = glm::sin(angleY);\r
+\r
+       return detail::tmat4x4<valType>(\r
+               cosY,           -sinX * sinY,   cosX * sinY,    valType(0),\r
+               valType(0), cosX,                       sinX,                   valType(0),\r
+               -sinY ,         -sinX * cosY,   cosX * cosY,    valType(0),\r
+               valType(0), valType(0),     valType(0),         valType(1));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleYX\r
+(\r
+       valType const & angleY, \r
+       valType const & angleX\r
+)\r
+{\r
+       valType cosX = glm::cos(angleX); \r
+       valType sinX = glm::sin(angleX); \r
+       valType cosY = glm::cos(angleY); \r
+       valType sinY = glm::sin(angleY);\r
+\r
+       return detail::tmat4x4<valType>(\r
+               cosY,                   valType(0),             sinY,                   valType(0),\r
+               -sinX * sinY,   cosX,                   sinX * cosY,    valType(0),\r
+               -cosX * sinY,   -sinX,                  cosX * cosY,    valType(0),\r
+               valType(0),             valType(0),             valType(0),             valType(1));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleXZ\r
+(\r
+       valType const & angleX, \r
+       valType const & angleZ\r
+)\r
+{\r
+       return eulerAngleX(angleX) * eulerAngleZ(angleZ);\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleZX\r
+(\r
+       valType const & angleZ, \r
+       valType const & angleX\r
+)\r
+{\r
+       return eulerAngleZ(angleZ) * eulerAngleX(angleX);\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> eulerAngleYXZ\r
+(\r
+       valType const & yaw, \r
+       valType const & pitch, \r
+       valType const & roll\r
+)\r
+{\r
+    valType tmp_ch = glm::cos(yaw);\r
+    valType tmp_sh = glm::sin(yaw);\r
+    valType tmp_cp = glm::cos(pitch);\r
+    valType tmp_sp = glm::sin(pitch);\r
+    valType tmp_cb = glm::cos(roll);\r
+    valType tmp_sb = glm::sin(roll);\r
+\r
+    detail::tmat4x4<valType> Result;\r
+    Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb;\r
+    Result[0][1] = tmp_sb * tmp_cp;\r
+    Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb;\r
+    Result[0][3] = valType(0);\r
+    Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb;\r
+    Result[1][1] = tmp_cb * tmp_cp;\r
+    Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb;\r
+    Result[1][3] = valType(0);\r
+    Result[2][0] = tmp_sh * tmp_cp;\r
+    Result[2][1] = -tmp_sp;\r
+    Result[2][2] = tmp_ch * tmp_cp;\r
+    Result[2][3] = valType(0);\r
+    Result[3][0] = valType(0);\r
+    Result[3][1] = valType(0);\r
+    Result[3][2] = valType(0);\r
+    Result[3][3] = valType(1);\r
+    return Result;\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> yawPitchRoll\r
+(\r
+       valType const & yaw, \r
+       valType const & pitch, \r
+       valType const & roll\r
+)\r
+{\r
+    valType tmp_ch = glm::cos(yaw);\r
+    valType tmp_sh = glm::sin(yaw);\r
+    valType tmp_cp = glm::cos(pitch);\r
+    valType tmp_sp = glm::sin(pitch);\r
+    valType tmp_cb = glm::cos(roll);\r
+    valType tmp_sb = glm::sin(roll);\r
+\r
+    detail::tmat4x4<valType> Result;\r
+    Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb;\r
+    Result[0][1] = tmp_sb * tmp_cp;\r
+    Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb;\r
+    Result[0][3] = valType(0);\r
+    Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb;\r
+    Result[1][1] = tmp_cb * tmp_cp;\r
+    Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb;\r
+    Result[1][3] = valType(0);\r
+    Result[2][0] = tmp_sh * tmp_cp;\r
+    Result[2][1] = -tmp_sp;\r
+    Result[2][2] = tmp_ch * tmp_cp;\r
+    Result[2][3] = valType(0);\r
+    Result[3][0] = valType(0);\r
+    Result[3][1] = valType(0);\r
+    Result[3][2] = valType(0);\r
+    Result[3][3] = valType(1);\r
+    return Result;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tmat2x2<valType> orientate2\r
+(\r
+       valType const & angle\r
+)\r
+{\r
+    valType c = glm::cos(angle);\r
+    valType s = glm::sin(angle);\r
+\r
+       detail::tmat2x2<valType> Result;\r
+    Result[0][0] = c;\r
+    Result[0][1] = s;\r
+    Result[1][0] = -s;\r
+    Result[1][1] = c;\r
+       return Result;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tmat3x3<valType> orientate3\r
+(\r
+       valType const & angle\r
+)\r
+{\r
+    valType c = glm::cos(angle);\r
+    valType s = glm::sin(angle);\r
+\r
+       detail::tmat3x3<valType> Result;\r
+    Result[0][0] = c;\r
+    Result[0][1] = s;\r
+       Result[0][2] = 0.0f;\r
+    Result[1][0] = -s;\r
+    Result[1][1] = c;\r
+       Result[1][2] = 0.0f;\r
+       Result[2][0] = 0.0f;\r
+       Result[2][1] = 0.0f;\r
+       Result[2][2] = 1.0f;\r
+       return Result;\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tmat3x3<valType> orientate3\r
+(\r
+       detail::tvec3<valType> const & angles\r
+)\r
+{\r
+       return detail::tmat3x3<valType>(yawPitchRoll(angles.x, angles.y, angles.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tmat4x4<valType> orientate4\r
+(\r
+       detail::tvec3<valType> const & angles\r
+)\r
+{\r
+    return yawPitchRoll(angles.z, angles.x, angles.y);\r
+}\r
+\r
+}//namespace euler_angles\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/extend.hpp b/glm/gtx/extend.hpp
new file mode 100644 (file)
index 0000000..6cfb22e
--- /dev/null
@@ -0,0 +1,48 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-07\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/extend.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_extend\r
+#define glm_gtx_extend\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_extend();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_extend extension: Extend a position from a source to a position at a defined length.\r
+       namespace extend\r
+       {\r
+               //! Extends of Length the Origin position using the (Source - Origin) direction.\r
+               //! From GLM_GTX_extend extension.\r
+               template <typename genType> \r
+               genType extend(\r
+                       genType const & Origin, \r
+                       genType const & Source, \r
+                       typename genType::value_type const Length);\r
+\r
+       }//namespace extend\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_extend namespace gtx::extend\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_extend;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "extend.inl"\r
+\r
+#endif//glm_gtx_extend\r
diff --git a/glm/gtx/extend.inl b/glm/gtx/extend.inl
new file mode 100644 (file)
index 0000000..b45a003
--- /dev/null
@@ -0,0 +1,60 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-07\r
+// Updated : 2008-10-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/extend.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace extend{\r
+\r
+template <typename genType>\r
+genType extend\r
+(\r
+       genType const & Origin, \r
+       genType const & Source, \r
+       genType const & Distance\r
+)\r
+{\r
+    return Origin + (Source - Origin) * Distance;\r
+}\r
+\r
+template <typename valType>\r
+detail::tvec2<valType> extend\r
+(\r
+       detail::tvec2<valType> const & Origin, \r
+       detail::tvec2<valType> const & Source, \r
+       valType const & Distance\r
+)\r
+{\r
+    return Origin + (Source - Origin) * Distance;\r
+}\r
+\r
+template <typename valType>\r
+detail::tvec3<valType> extend\r
+(\r
+       detail::tvec3<valType> const & Origin, \r
+       detail::tvec3<valType> const & Source, \r
+       valType const & Distance\r
+)\r
+{\r
+    return Origin + (Source - Origin) * Distance;\r
+}\r
+\r
+template <typename valType>\r
+detail::tvec4<valType> extend\r
+(\r
+       detail::tvec4<valType> const & Origin, \r
+       detail::tvec4<valType> const & Source, \r
+       valType const & Distance\r
+)\r
+{\r
+    return Origin + (Source - Origin) * Distance;\r
+}\r
+\r
+}//namespace extend\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/extented_min_max.hpp b/glm/gtx/extented_min_max.hpp
new file mode 100644 (file)
index 0000000..6b3ac56
--- /dev/null
@@ -0,0 +1,82 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-14\r
+// Updated : 2007-08-14\r
+// Licence : This source is under MIT License\r
+// File    : gtx_extented_min_max.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_half_float\r
+// - GLM_GTX_double_float\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_extented_min_max\r
+#define glm_gtx_extented_min_max\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/half_float.hpp"\r
+#include "../gtc/double_float.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_ext_gtx_extented_min_max();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_extented_min_max extension: Min and max functions for 3 to 4 parameters.\r
+       namespace extented_min_max\r
+       {\r
+               template <typename T> T min(const T x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> T min(const T x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> min(const detail::tvec2<T>& x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> min(const detail::tvec3<T>& x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> min(const detail::tvec4<T>& x, const T y, const T z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> min(const detail::tvec2<T>& x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> min(const detail::tvec3<T>& x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> min(const detail::tvec4<T>& x, const T y, const T z, const T w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> min(const detail::tvec2<T>& x, const detail::tvec2<T>& y, const detail::tvec2<T>& z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> min(const detail::tvec3<T>& x, const detail::tvec3<T>& y, const detail::tvec3<T>& z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> min(const detail::tvec4<T>& x, const detail::tvec4<T>& y, const detail::tvec4<T>& z); //!< \brief Return the minimum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> min(const detail::tvec2<T>& x, const detail::tvec2<T>& y, const detail::tvec2<T>& z, const detail::tvec2<T>& w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> min(const detail::tvec3<T>& x, const detail::tvec3<T>& y, const detail::tvec3<T>& z, const detail::tvec3<T>& w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> min(const detail::tvec4<T>& x, const detail::tvec4<T>& y, const detail::tvec4<T>& z, const detail::tvec4<T>& w); //!< \brief Return the minimum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> T max(const T x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> T max(const T x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> max(const detail::tvec2<T>& x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> max(const detail::tvec3<T>& x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> max(const detail::tvec4<T>& x, const T y, const T z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> max(const detail::tvec2<T>& x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> max(const detail::tvec3<T>& x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> max(const detail::tvec4<T>& x, const T y, const T z, const T w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> max(const detail::tvec2<T>& x, const detail::tvec2<T>& y, const detail::tvec2<T>& z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> max(const detail::tvec3<T>& x, const detail::tvec3<T>& y, const detail::tvec3<T>& z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> max(const detail::tvec4<T>& x, const detail::tvec4<T>& y, const detail::tvec4<T>& z); //!< \brief Return the maximum component-wise values of 3 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+               template <typename T> detail::tvec2<T> max(const detail::tvec2<T>& x, const detail::tvec2<T>& y, const detail::tvec2<T>& z, const detail::tvec2<T>& w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec3<T> max(const detail::tvec3<T>& x, const detail::tvec3<T>& y, const detail::tvec3<T>& z, const detail::tvec3<T>& w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+               template <typename T> detail::tvec4<T> max(const detail::tvec4<T>& x, const detail::tvec4<T>& y, const detail::tvec4<T>& z, const detail::tvec4<T>& w); //!< \brief Return the maximum component-wise values of 4 imputs (From GLM_GTX_extented_min_max extension)\r
+\r
+       }//namespace extented_min_max\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_extented_min_max namespace gtx::extented_min_max\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_extented_min_max;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "extented_min_max.inl"\r
+\r
+#endif//glm_gtx_extented_min_max\r
diff --git a/glm/gtx/extented_min_max.inl b/glm/gtx/extented_min_max.inl
new file mode 100644 (file)
index 0000000..1625338
--- /dev/null
@@ -0,0 +1,282 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-14\r
+// Updated : 2007-03-14\r
+// Licence : This source is under MIT License\r
+// File    : gtx_extented_min_max.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace extented_min_max\r
+{\r
+       template <typename T> \r
+       inline T min(\r
+               const T x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return min(min(x, y), z);\r
+       }\r
+\r
+       template <typename T> \r
+       inline T min(\r
+               const T x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return min(min(x, y), min(z, w));\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tvec2<T> min(\r
+               const detail::tvec2<T>& x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return min(x, min(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> min(\r
+               const detail::tvec3<T>& x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return min(x, min(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> min(\r
+               const detail::tvec4<T>& x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return min(x, min(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec2<T> min(\r
+               const detail::tvec2<T>& x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return min(x, min(y, min(z, w)));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> min(\r
+               const detail::tvec3<T>& x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return min(x, min(y, min(z, w)));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> min(\r
+               const detail::tvec4<T>& x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return min(x, min(y, min(z, w)));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec2<T> min(\r
+               const detail::tvec2<T>& x, \r
+               const detail::tvec2<T>& y, \r
+               const detail::tvec2<T>& z)\r
+       {\r
+               return min(x, min(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> min(\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<T>& y, \r
+               const detail::tvec3<T>& z)\r
+       {\r
+               return min(x, min(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> min(\r
+               const detail::tvec4<T>& x, \r
+               const detail::tvec4<T>& y, \r
+               const detail::tvec4<T>& z)\r
+       {\r
+               return min(x, min(y, z));\r
+       }\r
+       \r
+    template <typename T> \r
+       inline detail::tvec2<T> min(\r
+               const detail::tvec2<T>& x, \r
+               const detail::tvec2<T>& y, \r
+               const detail::tvec2<T>& z, \r
+               const detail::tvec2<T>& w)\r
+       {\r
+               return min(min(x, y), min(z, w));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> min(\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<T>& y, \r
+               const detail::tvec3<T>& z, \r
+               const detail::tvec3<T>& w)\r
+       {\r
+               return min(min(x, y), min(z, w));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> min(\r
+               const detail::tvec4<T>& x, \r
+               const detail::tvec4<T>& y, \r
+               const detail::tvec4<T>& z, \r
+               const detail::tvec4<T>& w)\r
+       {\r
+               return min(min(x, y), min(z, w));\r
+       }\r
+\r
+       template <typename T> \r
+       inline T max(\r
+               const T x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return max(max(x, y), z);\r
+       }\r
+\r
+       template <typename T> \r
+       inline T max(\r
+               const T x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return max(max(x, y), max(z, w));\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tvec2<T> max(\r
+               const detail::tvec2<T>& x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return max(x, max(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> max(\r
+               const detail::tvec3<T>& x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return max(x, max(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> max(\r
+               const detail::tvec4<T>& x, \r
+               const T y, \r
+               const T z)\r
+       {\r
+               return max(x, max(y, z));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec2<T> max(\r
+               const detail::tvec2<T>& x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return max(max(x, y), max(z, w));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> max(\r
+               const detail::tvec3<T>& x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return max(max(x, y), max(z, w));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> max(\r
+               const detail::tvec4<T>& x, \r
+               const T y, \r
+               const T z, \r
+               const T w)\r
+       {\r
+               return max(max(x, y), max(z, w));\r
+       }\r
+       \r
+    template <typename T> \r
+       inline detail::tvec2<T> max(\r
+               const detail::tvec2<T>& x, \r
+               const detail::tvec2<T>& y, \r
+               const detail::tvec2<T>& z)\r
+       {\r
+               return max(max(x, y), z);\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> max(\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<T>& y, \r
+               const detail::tvec3<T>& z)\r
+       {\r
+               return max(max(x, y), z);\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> max(\r
+               const detail::tvec4<T>& x, \r
+               const detail::tvec4<T>& y, \r
+               const detail::tvec4<T>& z)\r
+       {\r
+               return max(max(x, y), z);\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec2<T> max(\r
+               const detail::tvec2<T>& x, \r
+               const detail::tvec2<T>& y, \r
+               const detail::tvec2<T>& z, \r
+               const detail::tvec2<T>& w)\r
+       {\r
+               return max(max(x, y), max(z, w));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec3<T> max(\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<T>& y, \r
+               const detail::tvec3<T>& z, \r
+               const detail::tvec3<T>& w)\r
+       {\r
+               return max(max(x, y), max(z, w));\r
+       }\r
+\r
+    template <typename T> \r
+       inline detail::tvec4<T> max(\r
+               const detail::tvec4<T>& x, \r
+               const detail::tvec4<T>& y, \r
+               const detail::tvec4<T>& z, \r
+               const detail::tvec4<T>& w)\r
+       {\r
+               return max(max(x, y), max(z, w));\r
+       }\r
+\r
+}//namespace extented_min_max\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/fast_exponential.hpp b/glm/gtx/fast_exponential.hpp
new file mode 100644 (file)
index 0000000..c531f00
--- /dev/null
@@ -0,0 +1,86 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-09\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/fast_exponential.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_half\r
+// - GLM_GTX_double\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_fast_exponential\r
+#define glm_gtx_fast_exponential\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/half_float.hpp"\r
+#include "../gtc/double_float.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_fast_exponential();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_fast_exponential extension: Fast but less accurate implementations of exponential based functions.\r
+       namespace fast_exponential\r
+       {\r
+               using namespace gtc::half_float;\r
+               using namespace gtc::double_float;\r
+\r
+               //! Faster than the common pow function but less accurate.\r
+               //! From GLM_GTX_fast_exponential extension.\r
+               template <typename valType> \r
+               valType fastPow(\r
+                       valType const & x, \r
+                       valType const & y);\r
+\r
+               //! Faster than the common pow function but less accurate.\r
+               //! From GLM_GTX_fast_exponential extension.\r
+               template <typename T, typename U> \r
+               T fastPow(\r
+                       const T& x, \r
+                       const U& y);\r
+               \r
+               //! Faster than the common exp function but less accurate.\r
+               //! From GLM_GTX_fast_exponential extension.\r
+               template <typename T> \r
+               T fastExp(const T& x);\r
+               \r
+               //! Faster than the common log function but less accurate.\r
+               //! From GLM_GTX_fast_exponential extension.\r
+               template <typename T> \r
+               T fastLog(const T& x);\r
+\r
+               //! Faster than the common exp2 function but less accurate.\r
+               //! From GLM_GTX_fast_exponential extension.\r
+               template <typename T> \r
+               T fastExp2(const T& x);\r
+               \r
+               //! Faster than the common log2 function but less accurate.\r
+               //! From GLM_GTX_fast_exponential extension.\r
+               template <typename T> \r
+               T fastLog2(const T& x);\r
+\r
+               //! Faster than the common ln function but less accurate.\r
+               //! From GLM_GTX_fast_exponential extension.\r
+               template <typename T> \r
+               T fastLn(const T& x);\r
+\r
+       }//namespace fast_exponential\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_fast_exponential namespace gtx::fast_exponential\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_fast_exponential;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "fast_exponential.inl"\r
+\r
+#endif//glm_gtx_fast_exponential\r
diff --git a/glm/gtx/fast_exponential.inl b/glm/gtx/fast_exponential.inl
new file mode 100644 (file)
index 0000000..e5a3a6c
--- /dev/null
@@ -0,0 +1,294 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-09\r
+// Updated : 2006-01-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/fast_exponential.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace fast_exponential\r
+{\r
+    // fastPow:\r
+       template <typename T>\r
+    inline T fastPow(const T x, const T y)\r
+    {\r
+        return exp(y * log(x));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> fastPow(\r
+               const detail::tvec2<T>& x, \r
+               const detail::tvec2<T>& y)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastPow(x.x, y.x),\r
+            fastPow(x.y, y.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> fastPow(\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<T>& y)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastPow(x.x, y.x),\r
+            fastPow(x.y, y.y),\r
+            fastPow(x.z, y.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> fastPow(\r
+               const detail::tvec4<T>& x, \r
+               const detail::tvec4<T>& y)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastPow(x.x, y.x),\r
+            fastPow(x.y, y.y),\r
+            fastPow(x.z, y.z),\r
+            fastPow(x.w, y.w));\r
+    }\r
+\r
+       template <typename T>\r
+       inline T fastPow(const T x, int y)\r
+    {\r
+        T f = T(1);\r
+        for(int i = 0; i < y; ++i)\r
+            f *= x;\r
+        return f;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> fastPow(\r
+               const detail::tvec2<T>& x, \r
+               const detail::tvec2<int>& y)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastPow(x.x, y.x),\r
+            fastPow(x.y, y.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> fastPow(\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<int>& y)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastPow(x.x, y.x),\r
+            fastPow(x.y, y.y),\r
+            fastPow(x.z, y.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> fastPow(\r
+               const detail::tvec4<T>& x, \r
+               const detail::tvec4<int>& y)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastPow(x.x, y.x),\r
+            fastPow(x.y, y.y),\r
+            fastPow(x.z, y.z),\r
+            fastPow(x.w, y.w));\r
+    }\r
+\r
+    // fastExp\r
+    // Note: This function provides accurate results only for value between -1 and 1, else avoid it.\r
+       template <typename T>\r
+    inline T fastExp(const T x)\r
+    {\r
+        // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower.\r
+        // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f))));\r
+        T x2 = x * x;\r
+        T x3 = x2 * x;\r
+        T x4 = x3 * x;\r
+        T x5 = x4 * x;\r
+        return T(1) + x + (x2 * T(0.5)) + (x3 * T(0.1666666667)) + (x4 * T(0.041666667)) + (x5 * T(0.008333333333));\r
+    }\r
+/*  // Try to handle all values of float... but often shower than std::exp, glm::floor and the loop kill the performance\r
+    inline float fastExp(float x)\r
+    {\r
+        const float e = 2.718281828f;\r
+        const float IntegerPart = floor(x);\r
+        const float FloatPart = x - IntegerPart;\r
+        float z = 1.f;\r
+\r
+        for(int i = 0; i < int(IntegerPart); ++i)\r
+            z *= e;\r
+\r
+        const float x2 = FloatPart * FloatPart;\r
+        const float x3 = x2 * FloatPart;\r
+        const float x4 = x3 * FloatPart;\r
+        const float x5 = x4 * FloatPart;\r
+        return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f));\r
+    }\r
+\r
+    // Increase accuracy on number bigger that 1 and smaller than -1 but it's not enough for high and negative numbers\r
+    inline float fastExp(float x)\r
+    {\r
+        // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower.\r
+        // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f))));\r
+        float x2 = x * x;\r
+        float x3 = x2 * x;\r
+        float x4 = x3 * x;\r
+        float x5 = x4 * x;\r
+        float x6 = x5 * x;\r
+        float x7 = x6 * x;\r
+        float x8 = x7 * x;\r
+        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);;\r
+    }\r
+*/\r
+    template <typename T>\r
+    inline detail::tvec2<T> fastExp(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastExp(x.x),\r
+            fastExp(x.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> fastExp(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastExp(x.x),\r
+            fastExp(x.y),\r
+            fastExp(x.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> fastExp(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastExp(x.x),\r
+            fastExp(x.y),\r
+            fastExp(x.z),\r
+            fastExp(x.w));\r
+    }\r
+\r
+    // fastLog\r
+       template <typename T>\r
+    inline T fastLog(const T x)\r
+    {\r
+        return std::log(x);\r
+    }\r
+\r
+    /* Slower than the VC7.1 function...\r
+    inline float fastLog(float x)\r
+    {\r
+        float y1 = (x - 1.0f) / (x + 1.0f);\r
+        float y2 = y1 * y1;\r
+        return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f)));\r
+    }\r
+    */\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> fastLog(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastLog(x.x),\r
+            fastLog(x.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> fastLog(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastLog(x.x),\r
+            fastLog(x.y),\r
+            fastLog(x.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> fastLog(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastLog(x.x),\r
+            fastLog(x.y),\r
+            fastLog(x.z),\r
+            fastLog(x.w));\r
+    }\r
+\r
+    //fastExp2, ln2 = 0.69314718055994530941723212145818f\r
+       template <typename T>\r
+    inline T fastExp2(const T x)\r
+    {\r
+        return fastExp(0.69314718055994530941723212145818f * x);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> fastExp2(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastExp2(x.x),\r
+            fastExp2(x.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> fastExp2(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastExp2(x.x),\r
+            fastExp2(x.y),\r
+            fastExp2(x.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> fastExp2(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastExp2(x.x),\r
+            fastExp2(x.y),\r
+            fastExp2(x.z),\r
+            fastExp2(x.w));\r
+    }\r
+\r
+    // fastLog2, ln2 = 0.69314718055994530941723212145818f\r
+       template <typename T>\r
+    inline T fastLog2(const T x)\r
+    {\r
+        return fastLog(x) / 0.69314718055994530941723212145818f;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> fastLog2(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastLog2(x.x),\r
+            fastLog2(x.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> fastLog2(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastLog2(x.x),\r
+            fastLog2(x.y),\r
+            fastLog2(x.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> fastLog2(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastLog2(x.x),\r
+            fastLog2(x.y),\r
+            fastLog2(x.z),\r
+            fastLog2(x.w));\r
+    }\r
+\r
+}//namespace fast_exponential\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/fast_square_root.hpp b/glm/gtx/fast_square_root.hpp
new file mode 100644 (file)
index 0000000..f4e3730
--- /dev/null
@@ -0,0 +1,69 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-04\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/fast_square_root.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Note:\r
+// - Sqrt optimisation based on Newton's method, \r
+// www.gamedev.net/community/forums/topic.asp?topic id=139956\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_fast_square_root\r
+#define glm_gtx_fast_square_root\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_fast_square_root();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_fast_square_root extension: Fast but less accurate implementations of square root based functions.\r
+       namespace fast_square_root\r
+       {\r
+               //! Faster than the common sqrt function but less accurate.\r
+               //! From GLM_GTX_fast_square_root extension.\r
+               template <typename genType> \r
+               genType fastSqrt(genType const & x);\r
+\r
+               //! Faster than the common inversesqrt function but less accurate.\r
+               //! From GLM_GTX_fast_square_root extension.\r
+               template <typename genType> \r
+               genType fastInverseSqrt(genType const & x);\r
+               \r
+               //! Faster than the common length function but less accurate.\r
+               //! From GLM_GTX_fast_square_root extension.\r
+               template <typename genType> \r
+               typename genType::value_type fastLength(genType const & x);\r
+\r
+               //! Faster than the common distance function but less accurate.\r
+               //! From GLM_GTX_fast_square_root extension.\r
+               template <typename genType> \r
+               typename genType::value_type fastDistance(genType const & x, genType const & y);\r
+\r
+               //! Faster than the common normalize function but less accurate.\r
+               //! From GLM_GTX_fast_square_root extension.\r
+               template <typename genType> \r
+               genType fastNormalize(genType const & x);\r
+\r
+       }//namespace fast_square_root\r
+       }//     namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_fast_square_root namespace gtx::fast_square_root\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_fast_square_root;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "fast_square_root.inl"\r
+\r
+#endif//glm_gtx_fast_square_root\r
diff --git a/glm/gtx/fast_square_root.inl b/glm/gtx/fast_square_root.inl
new file mode 100644 (file)
index 0000000..0e8be94
--- /dev/null
@@ -0,0 +1,237 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-04\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/fast_square_root.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace fast_square_root{\r
+\r
+// fastSqrt\r
+template <typename genType>\r
+inline genType fastSqrt\r
+(\r
+       genType const & x\r
+)\r
+{\r
+    return genType(1) / fastInverseSqrt(x);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> fastSqrt\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        fastSqrt(x.x), \r
+        fastSqrt(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> fastSqrt\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        fastSqrt(x.x), \r
+        fastSqrt(x.y), \r
+        fastSqrt(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> fastSqrt\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        fastSqrt(x.x), \r
+        fastSqrt(x.y), \r
+        fastSqrt(x.z), \r
+        fastSqrt(x.w));\r
+}\r
+\r
+// fastInversesqrt\r
+template <typename genType>\r
+inline genType fastInverseSqrt\r
+(\r
+       genType const & x\r
+)\r
+{\r
+       genType tmp = x;\r
+    float xhalf = 0.5f * float(tmp);\r
+    uint i = *(uint*)&x;\r
+    i = 0x5f375a86 - (i >> 1);\r
+    //x = *(float*)&i;\r
+       //x = *((float*)(char*)&i);\r
+       tmp = detail::uif(i).f;\r
+       tmp = tmp * (1.5f - xhalf * tmp * tmp);\r
+    return genType(tmp);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> fastInverseSqrt\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        fastInverseSqrt(x.x), \r
+        fastInverseSqrt(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> fastInverseSqrt\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        fastInverseSqrt(x.x), \r
+        fastInverseSqrt(x.y), \r
+        fastInverseSqrt(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> fastInverseSqrt\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        fastInverseSqrt(x.x), \r
+        fastInverseSqrt(x.y), \r
+        fastInverseSqrt(x.z), \r
+        fastInverseSqrt(x.w));\r
+}\r
+\r
+// fastLength\r
+template <typename genType>\r
+inline genType fastLength\r
+(\r
+       genType const & x\r
+)\r
+{\r
+    return abs(x);\r
+}\r
+\r
+template <typename valType>\r
+inline valType fastLength\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    valType sqr = x.x * x.x + x.y * x.y;\r
+    return fastSqrt(sqr);\r
+}\r
+\r
+template <typename valType>\r
+inline valType fastLength\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    valType sqr = x.x * x.x + x.y * x.y + x.z * x.z;\r
+    return fastSqrt(sqr);\r
+}\r
+\r
+template <typename valType>\r
+inline valType fastLength\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w;\r
+    return fastSqrt(sqr);\r
+}\r
+\r
+// fastDistance\r
+template <typename genType>\r
+inline genType fastDistance\r
+(\r
+       genType const & x, \r
+       genType const & y\r
+)\r
+{\r
+    return fastLength(y - x);\r
+}\r
+\r
+template <typename valType>\r
+inline valType fastDistance\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y\r
+)\r
+{\r
+    return fastLength(y - x);\r
+}\r
+\r
+template <typename valType>\r
+inline valType fastDistance\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y\r
+)\r
+{\r
+    return fastLength(y - x);\r
+}\r
+\r
+template <typename valType>\r
+inline valType fastDistance\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y\r
+)\r
+{\r
+    return fastLength(y - x);\r
+}\r
+\r
+// fastNormalize\r
+template <typename genType>\r
+inline genType fastNormalize\r
+(\r
+       genType const & x\r
+)\r
+{\r
+    return x > genType(0) ? genType(1) : -genType(1);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> fastNormalize\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    valType sqr = x.x * x.x + x.y * x.y;\r
+    return x * fastInverseSqrt(sqr);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> fastNormalize\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    valType sqr = x.x * x.x + x.y * x.y + x.z * x.z;\r
+    return x * fastInverseSqrt(sqr);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> fastNormalize\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    valType sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w;\r
+    return x * fastInverseSqrt(sqr);\r
+}\r
+\r
+}//namespace fast_square_root\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/fast_trigonometry.hpp b/glm/gtx/fast_trigonometry.hpp
new file mode 100644 (file)
index 0000000..18119b5
--- /dev/null
@@ -0,0 +1,82 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-08\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/fast_trigonometry.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_fast_trigonometry\r
+#define glm_gtx_fast_trigonometry\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_fast_trigonometry();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_fast_trigonometry extension: Fast but less accurate implementations of trigonometric functions.\r
+    namespace fast_trigonometry\r
+    {\r
+               //! Faster than the common sin function but less accurate. \r
+               //! Defined between -2pi and 2pi. \r
+               //! From GLM_GTX_fast_trigonometry extension.\r
+        template <typename T> \r
+               T fastSin(const T& angle);\r
+\r
+        //! Faster than the common cos function but less accurate.\r
+               //! Defined between -2pi and 2pi.\r
+               //! From GLM_GTX_fast_trigonometry extension.\r
+               template <typename T> \r
+               T fastCos(const T& angle);\r
+\r
+        //! Faster than the common tan function but less accurate. \r
+               //! Defined between -2pi and 2pi. \r
+               //! From GLM_GTX_fast_trigonometry extension.\r
+               template <typename T> \r
+               T fastTan(const T& angle);\r
+\r
+        //! Faster than the common asin function but less accurate. \r
+               //! Defined between -2pi and 2pi.\r
+               //! From GLM_GTX_fast_trigonometry extension.\r
+               template <typename T> \r
+               T fastAsin(const T& angle);\r
+\r
+               //! Faster than the common acos function but less accurate. \r
+               //! Defined between -2pi and 2pi. \r
+               //! From GLM_GTX_fast_trigonometry extension.\r
+        template <typename T> \r
+               T fastAcos(const T& angle);\r
+\r
+               //! Faster than the common atan function but less accurate.\r
+               //! Defined between -2pi and 2pi. \r
+               //! From GLM_GTX_fast_trigonometry extension.\r
+               template <typename T> \r
+               T fastAtan(const T& y, const T& x);\r
+\r
+               //! Faster than the common atan function but less accurate. \r
+               //! Defined between -2pi and 2pi.\r
+               //! From GLM_GTX_fast_trigonometry extension.\r
+        template <typename T> \r
+               T fastAtan(const T& angle);\r
+\r
+    }//namespace fast_trigonometry\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_fast_trigonometry namespace gtx::fast_trigonometry\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_fast_trigonometry;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "fast_trigonometry.inl"\r
+\r
+#endif//glm_gtx_fast_trigonometry\r
diff --git a/glm/gtx/fast_trigonometry.inl b/glm/gtx/fast_trigonometry.inl
new file mode 100644 (file)
index 0000000..9ed1181
--- /dev/null
@@ -0,0 +1,272 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-08\r
+// Updated : 2006-01-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/fast_trigonometry.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace fast_trigonometry\r
+{\r
+    // sin\r
+    template <typename T> \r
+    inline T fastSin(const T x)\r
+    {\r
+        return x - ((x * x * x) / T(6)) + ((x * x * x * x * x) / T(120)) - ((x * x * x * x * x * x * x) / T(5040));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> fastSin(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastSin(x.x),\r
+            fastSin(x.y));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> fastSin(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastSin(x.x),\r
+            fastSin(x.y),\r
+            fastSin(x.z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec4<T> fastSin(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastSin(x.x),\r
+            fastSin(x.y),\r
+            fastSin(x.z),\r
+            fastSin(x.w));\r
+    }\r
+\r
+    // cos\r
+    template <typename T> \r
+    inline T fastCos(const T x)\r
+    {\r
+        return T(1) - (x * x * T(0.5)) + (x * x * x * x * T(0.041666666666)) - (x * x * x * x * x * x * T(0.00138888888888));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> fastCos(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastCos(x.x),\r
+            fastCos(x.y));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> fastCos(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastCos(x.x),\r
+            fastCos(x.y),\r
+            fastCos(x.z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec4<T> fastCos(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastCos(x.x),\r
+            fastCos(x.y),\r
+            fastCos(x.z),\r
+            fastCos(x.w));\r
+    }\r
+\r
+    // tan\r
+    template <typename T> \r
+    inline T fastTan(const T x)\r
+    {\r
+        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));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> fastTan(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastTan(x.x),\r
+            fastTan(x.y));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> fastTan(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastTan(x.x),\r
+            fastTan(x.y),\r
+            fastTan(x.z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec4<T> fastTan(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastTan(x.x),\r
+            fastTan(x.y),\r
+            fastTan(x.z),\r
+            fastTan(x.w));\r
+    }\r
+\r
+    // asin\r
+    template <typename T> \r
+    inline T fastAsin(const T x)\r
+    {\r
+        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));\r
+    }\r
+\r
+    template <typename T> detail::tvec2<T> fastAsin(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastAsin(x.x),\r
+            fastAsin(x.y));\r
+    }\r
+\r
+    template <typename T> detail::tvec3<T> fastAsin(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastAsin(x.x),\r
+            fastAsin(x.y),\r
+            fastAsin(x.z));\r
+    }\r
+\r
+    template <typename T> detail::tvec4<T> fastAsin(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastAsin(x.x),\r
+            fastAsin(x.y),\r
+            fastAsin(x.z),\r
+            fastAsin(x.w));\r
+    }\r
+\r
+    // acos\r
+    template <typename T> \r
+    inline T fastAcos(const T x)\r
+    {\r
+        return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2)\r
+    }\r
+\r
+    template <typename T> detail::tvec2<T> fastAcos(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastAcos(x.x),\r
+            fastAcos(x.y));\r
+    }\r
+\r
+    template <typename T> detail::tvec3<T> fastAcos(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastAcos(x.x),\r
+            fastAcos(x.y),\r
+            fastAcos(x.z));\r
+    }\r
+\r
+    template <typename T> detail::tvec4<T> fastAcos(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastAcos(x.x),\r
+            fastAcos(x.y),\r
+            fastAcos(x.z),\r
+            fastAcos(x.w));\r
+    }\r
+\r
+    // atan\r
+    template <typename T> \r
+    inline T fastAtan(const T y, const T x)\r
+    {\r
+        T sgn = sign(y) * sign(x);\r
+        return abs(fastAtan(y / x)) * sgn;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> fastAtan(\r
+               const detail::tvec2<T>& y, \r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastAtan(y.x, x.x),\r
+            fastAtan(y.y, x.y));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> fastAtan(\r
+               const detail::tvec3<T>& y, \r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastAtan(y.x, x.x),\r
+            fastAtan(y.y, x.y),\r
+            fastAtan(y.z, x.z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec4<T> fastAtan(\r
+               const detail::tvec4<T>& y, \r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastAtan(y.x, x.x),\r
+            fastAtan(y.y, x.y),\r
+            fastAtan(y.z, x.z),\r
+            fastAtan(y.w, x.w));\r
+    }\r
+\r
+    template <typename T> \r
+    inline T fastAtan(const T x)\r
+    {\r
+        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));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<T> fastAtan(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return detail::tvec2<T>(\r
+            fastAtan(x.x),\r
+            fastAtan(x.y));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> fastAtan(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return detail::tvec3<T>(\r
+            fastAtan(x.x),\r
+            fastAtan(x.y),\r
+            fastAtan(x.z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec4<T> fastAtan(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return detail::tvec4<T>(\r
+            fastAtan(x.x),\r
+            fastAtan(x.y),\r
+            fastAtan(x.z),\r
+            fastAtan(x.w));\r
+    }\r
+\r
+}//namespace fast_trigonometry\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/flexible_mix.inl b/glm/gtx/flexible_mix.inl
new file mode 100644 (file)
index 0000000..99782bd
--- /dev/null
@@ -0,0 +1,60 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-09-21\r
+// Updated : 2007-09-21\r
+// Licence : This source is under MIT licence\r
+// File    : glm/gtx/flexible_mix.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+    // mix\r
+    template <typename T, typename U>\r
+    inline T mixGTX(T x, T y, U a)\r
+    {\r
+               //GLM_STATIC_ASSERT(detail::traits<U>::is_float);\r
+               //return T(x * (U(1) - a) + y * a);\r
+               return T(x + a * (y - x));\r
+    }\r
+\r
+       template <typename T, typename U>\r
+    inline detail::tvec2<T> mixGTX(const detail::tvec2<T>& x, const detail::tvec2<T>& y, U a)\r
+    {\r
+               return detail::tvec2<T>(detail::tvec2<U>(x) * (U(1) - a) + detail::tvec2<U>(y) * a);\r
+        //return x * (U(1) - a) + y * a;\r
+    }\r
+\r
+    template <typename T, typename U>\r
+    inline detail::tvec3<T> mixGTX(const detail::tvec3<T>& x, const detail::tvec3<T>& y, U a)\r
+    {\r
+               return detail::tvec3<T>(detail::tvec3<U>(x) * (U(1) - a) + detail::tvec3<U>(y) * a);\r
+        //return x * (U(1) - a) + y * a;\r
+               //return mix(x, y, tvec3<U>(a));\r
+    }\r
+\r
+    template <typename T, typename U>\r
+    inline detail::tvec4<T> mixGTX(const detail::tvec4<T>& x, const detail::tvec4<T>& y, U a)\r
+    {\r
+               return detail::tvec4<T>(detail::tvec4<U>(x) * (U(1) - a) + detail::tvec4<U>(y) * a);\r
+        //return x * (U(1) - a) + y * a;\r
+    }\r
+\r
+    template <typename T, typename U>\r
+    inline detail::tvec2<T> mixGTX(const detail::tvec2<T>& x, const detail::tvec2<T>& y, const detail::tvec2<U>& a)\r
+    {\r
+               return detail::tvec2<T>(detail::tvec2<U>(x) * (U(1) - a) + detail::tvec2<U>(y) * a);\r
+    }\r
+\r
+    template <typename T, typename U>\r
+    inline detail::tvec3<T> mixGTX(const detail::tvec3<T>& x, const detail::tvec3<T>& y, const detail::tvec3<U>& a)\r
+    {\r
+        return detail::tvec3<T>(detail::tvec3<U>(x) * (U(1) - a) + detail::tvec3<U>(y) * a);\r
+    }\r
+\r
+    template <typename T, typename U>\r
+    inline detail::tvec4<T> mixGTX(const detail::tvec4<T>& x, const detail::tvec4<T>& y, const detail::tvec4<U>& a)\r
+    {\r
+               return detail::tvec4<T>(detail::tvec4<U>(x) * (U(1) - a) + detail::tvec4<U>(y) * a);\r
+    }\r
+}\r
diff --git a/glm/gtx/gradient_paint.hpp b/glm/gtx/gradient_paint.hpp
new file mode 100644 (file)
index 0000000..39f2dea
--- /dev/null
@@ -0,0 +1,56 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-03-06\r
+// Updated : 2009-03-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/gradient_paint.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_gradient_paint\r
+#define glm_gtx_gradient_paint\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/optimum_pow.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_gradient_paint();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_gradient_paint extension: Compute a radient gradient according section OpenVG 1.1 specifications, 9.3.2 Radial Gradients\r
+       namespace gradient_paint\r
+       {\r
+               using namespace gtx::optimum_pow;\r
+\r
+               template <typename valType>\r
+               valType radialGradient(\r
+                       glm::detail::tvec2<valType> const & Center,\r
+                       valType const & Radius,\r
+                       glm::detail::tvec2<valType> const & Focal,\r
+                       glm::detail::tvec2<valType> const & Position);\r
+\r
+               template <typename valType>\r
+               valType linearGradient(\r
+                       glm::detail::tvec2<valType> const & Point0,\r
+                       glm::detail::tvec2<valType> const & Point1,\r
+                       glm::detail::tvec2<valType> const & Position);\r
+\r
+       }//namespace gradient_paint\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_gradient_paint namespace gtx::gradient_paint\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_gradient_paint;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "gradient_paint.inl"\r
+\r
+#endif//glm_gtx_gradient_paint\r
diff --git a/glm/gtx/gradient_paint.inl b/glm/gtx/gradient_paint.inl
new file mode 100644 (file)
index 0000000..c9750c6
--- /dev/null
@@ -0,0 +1,44 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-03-06\r
+// Updated : 2009-03-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/gradient_paint.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace gradient_paint{\r
+\r
+       template <typename valType>\r
+       valType radialGradient(\r
+               glm::detail::tvec2<valType> const & Center,\r
+               valType const & Radius,\r
+               glm::detail::tvec2<valType> const & Focal,\r
+               glm::detail::tvec2<valType> const & Position)\r
+       {\r
+               glm::detail::tvec2<valType> F = Focal - Center;\r
+               glm::detail::tvec2<valType> D = Position - Focal;\r
+               valType Radius2 = gtx::optimum_pow::pow2(Radius);\r
+               valType Fx2 = gtx::optimum_pow::pow2(F.x);\r
+               valType Fy2 = gtx::optimum_pow::pow2(F.y);\r
+\r
+               valType Numerator = (D.x * F.x + D.y * F.y) + glm::sqrt(Radius2 * (gtx::optimum_pow::pow2(D.x) + gtx::optimum_pow::pow2(D.y)) - gtx::optimum_pow::pow2(D.x * F.y - D.y * F.x));\r
+               valType Denominator = Radius2 - (Fx2 + Fy2);\r
+               return Numerator / Denominator;\r
+       }\r
+\r
+       template <typename valType>\r
+       valType linearGradient(\r
+               glm::detail::tvec2<valType> const & Point0,\r
+               glm::detail::tvec2<valType> const & Point1,\r
+               glm::detail::tvec2<valType> const & Position)\r
+       {\r
+               glm::detail::tvec2<valType> Dist = Point1 - Point0;\r
+               return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist);\r
+       }\r
+\r
+}//namespace gradient_paint\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/half_float.hpp b/glm/gtx/half_float.hpp
new file mode 100644 (file)
index 0000000..097e136
--- /dev/null
@@ -0,0 +1,48 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/half_float.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_half_float\r
+// - GLM_GTX_quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_half_float\r
+#define glm_gtx_half_float\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/half_float.hpp"\r
+#include "../gtx/quaternion.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_ext_gtx_half_float();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_half_float extension: Add support for half precision flotting-point types\r
+       namespace half_float\r
+       {\r
+               //! Quaternion of half-precision floating-point numbers.\r
+               //! From GLM_GTX_half_float extension.\r
+               typedef detail::tquat<detail::thalf>    hquat;\r
+\r
+       }//namespace half_float\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_half_float namespace gtc::half_float; using namespace gtx::half_float; using namespace gtx::quaternion\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_half_float;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "half_float.inl"\r
+\r
+#endif//glm_gtx_half_float\r
diff --git a/glm/gtx/half_float.inl b/glm/gtx/half_float.inl
new file mode 100644 (file)
index 0000000..2ca386e
--- /dev/null
@@ -0,0 +1,16 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-10-02\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/half.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+\r
+\r
+}//namespace detail\r
+}//namespace glm\r
diff --git a/glm/gtx/handed_coordinate_space.hpp b/glm/gtx/handed_coordinate_space.hpp
new file mode 100644 (file)
index 0000000..293ac58
--- /dev/null
@@ -0,0 +1,52 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/handed_coordinate_space.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_handed_coordinate_space\r
+#define glm_gtx_handed_coordinate_space\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_handed_coordinate_space extension: To know if a triedron is right or left handed\r
+       namespace handed_coordinate_space\r
+       {\r
+               //! Return if a trihedron right handed or not.\r
+               //! From GLM_GTX_handed_coordinate_space extension.\r
+               template <typename T> \r
+               bool rightHanded(\r
+                       detail::tvec3<T> const & tangent, \r
+                       detail::tvec3<T> const & binormal, \r
+                       detail::tvec3<T> const & normal);\r
+\r
+               //! Return if a trihedron left handed or not.\r
+               //! From GLM_GTX_handed_coordinate_space extension.\r
+               template <typename T> \r
+               bool leftHanded(\r
+                       detail::tvec3<T> const & tangent, \r
+                       detail::tvec3<T> const & binormal, \r
+                       detail::tvec3<T> const & normal);\r
+\r
+       }//namespace handed_coordinate_space\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_handed_coordinate_space namespace gtx::handed_coordinate_space\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_handed_coordinate_space;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "handed_coordinate_space.inl"\r
+\r
+#endif//glm_gtx_handed_coordinate_space\r
diff --git a/glm/gtx/handed_coordinate_space.inl b/glm/gtx/handed_coordinate_space.inl
new file mode 100644 (file)
index 0000000..3e447d6
--- /dev/null
@@ -0,0 +1,34 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/handed_coordinate_space.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace handed_coordinate_space\r
+{\r
+    template <typename T> \r
+    inline bool rightHanded(\r
+               detail::tvec3<T> const & tangent, \r
+               detail::tvec3<T> const & binormal,\r
+               detail::tvec3<T> const & normal)\r
+    {\r
+        return dot(cross(normal, tangent), binormal) > T(0);\r
+    }\r
+\r
+    template <typename T> \r
+    inline bool leftHanded(\r
+               detail::tvec3<T> const & tangent, \r
+               detail::tvec3<T> const & binormal, \r
+               detail::tvec3<T> const & normal)\r
+    {\r
+        return dot(cross(normal, tangent), binormal) < T(0);\r
+    }\r
+\r
+}//namespace handed_coordinate_space\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/inertia.hpp b/glm/gtx/inertia.hpp
new file mode 100644 (file)
index 0000000..588bbb2
--- /dev/null
@@ -0,0 +1,92 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-21\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/inertia.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_inertia\r
+#define glm_gtx_inertia\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_inertia extension: Create inertia matrices\r
+       namespace inertia\r
+       {\r
+               //! Build an inertia matrix for a box.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> boxInertia3(\r
+                       const T Mass, \r
+                       const detail::tvec3<T>& Scale);\r
+               \r
+               //! Build an inertia matrix for a box.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> boxInertia4(\r
+                       const T Mass, \r
+                       const detail::tvec3<T>& Scale);\r
+               \r
+               //! Build an inertia matrix for a disk.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> diskInertia3(\r
+                       const T Mass, \r
+                       const T Radius);\r
+\r
+               //! Build an inertia matrix for a disk.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> diskInertia4(\r
+                       const T Mass, \r
+                       const T Radius);\r
+\r
+               //! Build an inertia matrix for a ball.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> ballInertia3(\r
+                       const T Mass, \r
+                       const T Radius);\r
+               \r
+               //! Build an inertia matrix for a ball.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> ballInertia4(\r
+                       const T Mass, \r
+                       const T Radius);\r
+\r
+               //! Build an inertia matrix for a sphere.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> sphereInertia3(\r
+                       const T Mass, \r
+                       const T Radius);\r
+\r
+               //! Build an inertia matrix for a sphere.\r
+               //! From GLM_GTX_inertia extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> sphereInertia4(\r
+                       const T Mass, \r
+                       const T Radius);\r
+\r
+       }//namespace inertia\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_inertia namespace gtx::inertia\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_inertia;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "inertia.inl"\r
+\r
+#endif//glm_gtx_inertia\r
diff --git a/glm/gtx/inertia.inl b/glm/gtx/inertia.inl
new file mode 100644 (file)
index 0000000..1c7a290
--- /dev/null
@@ -0,0 +1,103 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-21\r
+// Updated : 2006-12-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/inertia.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace inertia{\r
+\r
+    template <typename T>\r
+    inline detail::tmat3x3<T> boxInertia3(\r
+               const T Mass, \r
+               const detail::tvec3<T>& Scale)\r
+    {\r
+           detail::tmat3x3<T> Result(T(1));\r
+           Result[0][0] = (Scale.y * Scale.y + Scale.z * Scale.z) * Mass / T(12);\r
+           Result[1][1] = (Scale.x * Scale.x + Scale.z * Scale.z) * Mass / T(12);\r
+           Result[2][2] = (Scale.x * Scale.x + Scale.y * Scale.y) * Mass / T(12);\r
+        return Result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tmat4x4<T> boxInertia4(\r
+               const T Mass, \r
+               const detail::tvec3<T>& Scale)\r
+    {\r
+           detail::tmat4x4<T> Result(T(1));\r
+           Result[0][0] = (Scale.y * Scale.y + Scale.z * Scale.z) * Mass / T(12);\r
+           Result[1][1] = (Scale.x * Scale.x + Scale.z * Scale.z) * Mass / T(12);\r
+           Result[2][2] = (Scale.x * Scale.x + Scale.y * Scale.y) * Mass / T(12);\r
+        return Result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tmat3x3<T> diskInertia3(\r
+               const T Mass, \r
+               const T Radius)\r
+    {\r
+        T a = Mass * Radius * Radius / T(2);\r
+        detail::tmat3x3<T> Result(a);\r
+        Result[2][2] *= T(2);\r
+        return Result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tmat4x4<T> diskInertia4(\r
+               const T Mass, \r
+               const T Radius)\r
+    {\r
+        T a = Mass * Radius * Radius / T(2);\r
+        detail::tmat4x4<T> Result(a);\r
+        Result[2][2] *= T(2);\r
+        Result[3][3] = T(1);\r
+        return Result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tmat3x3<T> ballInertia3(\r
+               const T Mass, \r
+               const T Radius)\r
+    {\r
+        T a = T(2) * Mass * Radius * Radius / T(5);\r
+        return detail::tmat3x3<T>(a);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tmat4x4<T> ballInertia4(\r
+               const T Mass, \r
+               const T Radius)\r
+    {\r
+        T a = T(2) * Mass * Radius * Radius / T(5);\r
+        detail::tmat4x4<T> Result(a);\r
+        Result[3][3] = T(1);\r
+        return Result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tmat3x3<T> sphereInertia3(\r
+               const T Mass, \r
+               const T Radius)\r
+    {\r
+        T a = T(2) * Mass * Radius * Radius / T(3);\r
+        return detail::tmat3x3<T>(a);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tmat4x4<T> sphereInertia4(\r
+               const T Mass, \r
+               const T Radius)\r
+    {\r
+        T a = T(2) * Mass * Radius * Radius / T(3);\r
+        detail::tmat4x4<T> Result(a);\r
+        Result[3][3] = T(1);\r
+        return Result;\r
+    }\r
+\r
+}//namespace inertia\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/integer.hpp b/glm/gtx/integer.hpp
new file mode 100644 (file)
index 0000000..17bc037
--- /dev/null
@@ -0,0 +1,53 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-24\r
+// Updated : 2006-11-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/integer.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_integer\r
+#define glm_gtx_integer\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_integer extension: Add support for integer for core functions\r
+       namespace integer\r
+       {\r
+               //! Returns x raised to the y power. \r
+               //! From GLM_GTX_integer extension.\r
+               int pow(int x, int y);\r
+\r
+               //! Returns the positive square root of x.\r
+               //! From GLM_GTX_integer extension.\r
+               int sqrt(int x);\r
+\r
+               //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y.\r
+               //! From GLM_GTX_integer extension.\r
+               int mod(int x, int y);\r
+\r
+               //! Return the factorial value of a number (!12 max, integer only)\r
+               //! From GLM_GTX_integer extension.\r
+               template <typename genType> \r
+               genType factorial(genType const & x);\r
+\r
+       }//namespace integer\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_integer namespace gtx::integer\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_integer;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "integer.inl"\r
+\r
+#endif//glm_gtx_integer\r
diff --git a/glm/gtx/integer.inl b/glm/gtx/integer.inl
new file mode 100644 (file)
index 0000000..ad8bad4
--- /dev/null
@@ -0,0 +1,90 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-24\r
+// Updated : 2006-12-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/integer.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace integer\r
+{\r
+    // pow\r
+    inline int pow(int x, int y)\r
+    {\r
+               if(y == 0)\r
+                       return 1;\r
+        int result = x;\r
+        for(int i = 1; i < y; ++i)\r
+            result *= x;\r
+        return result;\r
+    }\r
+\r
+    // sqrt: From Christopher J. Musial, An integer square root, Graphics Gems, 1990, page 387\r
+    inline int sqrt(int x)\r
+    {\r
+        if(x <= 1) return x;\r
+\r
+        int NextTrial = x >> 1;\r
+        int CurrentAnswer;\r
+\r
+        do\r
+        {\r
+            CurrentAnswer = NextTrial;\r
+            NextTrial = (NextTrial + x / NextTrial) >> 1;\r
+        } while(NextTrial < CurrentAnswer);\r
+\r
+        return CurrentAnswer;\r
+    }\r
+\r
+    // mod\r
+       inline int mod(int x, int y)\r
+       {\r
+               return x - y * (x / y);\r
+       }\r
+\r
+    // factorial (!12 max, integer only)\r
+       template <typename genType>\r
+    inline genType factorial(genType const & x)\r
+    {\r
+        genType Result;\r
+        for(Result = 1; x > 1; --x)\r
+            Result *= x;\r
+        return Result;\r
+    }\r
+\r
+       template <typename valType>\r
+    inline detail::tvec2<valType> factorial(\r
+               detail::tvec2<valType> const & x)\r
+    {\r
+        return detail::tvec2<valType>(\r
+            factorial(x.x),\r
+            factorial(x.y));\r
+    }\r
+\r
+       template <typename valType>\r
+    inline detail::tvec3<valType> factorial(\r
+               detail::tvec3<valType> const & x)\r
+    {\r
+        return detail::tvec3<valType>(\r
+            factorial(x.x),\r
+            factorial(x.y),\r
+            factorial(x.z));\r
+    }\r
+\r
+       template <typename valType>\r
+    inline detail::tvec4<valType> factorial(\r
+               detail::tvec4<valType> const & x)\r
+    {\r
+        return detail::tvec4<valType>(\r
+            factorial(x.x),\r
+            factorial(x.y),\r
+            factorial(x.z),\r
+            factorial(x.w));\r
+    }\r
+\r
+}//namespace integer\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/intersect.hpp b/glm/gtx/intersect.hpp
new file mode 100644 (file)
index 0000000..1dfcefa
--- /dev/null
@@ -0,0 +1,74 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-04-03\r
+// Updated : 2009-01-20\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/intersect.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_closest_point\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_intersect\r
+#define glm_gtx_intersect\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/closest_point.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_intesect();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_intersect extension: Add intersection functions\r
+       namespace intersect\r
+       {\r
+        //! Compute the intersection of a ray and a triangle.\r
+               //! From GLM_GTX_intersect extension.\r
+               template <typename genType>\r
+               bool intersectRayTriangle(\r
+                       genType const & orig, genType const & dir,\r
+                       genType const & vert0, genType const & vert1, genType const & vert2,\r
+                       genType & baryPosition);\r
+\r
+        //! Compute the intersection of a line and a triangle.\r
+               //! From GLM_GTX_intersect extension.\r
+               template <typename genType>\r
+               bool intersectLineTriangle(\r
+                       genType const & orig, genType const & dir,\r
+                       genType const & vert0, genType const & vert1, genType const & vert2,\r
+                       genType & position);\r
+\r
+        //! Compute the intersection of a ray and a sphere.\r
+               //! From GLM_GTX_intersect extension.\r
+               template <typename genType>\r
+               bool intersectRaySphere(\r
+                       genType const & orig, genType const & dir,\r
+                       genType const & center, typename genType::value_type radius,\r
+                       genType & position, genType & normal);\r
+\r
+        //! Compute the intersection of a line and a sphere.\r
+               //! From GLM_GTX_intersect extension\r
+               template <typename genType>\r
+               bool intersectLineSphere(\r
+                       genType const & point0, genType const & point1,\r
+                       genType const & center, typename genType::value_type radius,\r
+                       genType & position, genType & normal);\r
+\r
+       }//namespace intersect\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_intersect namespace gtx::intersect\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_intersect;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "intersect.inl"\r
+\r
+#endif//glm_gtx_intersect\r
diff --git a/glm/gtx/intersect.inl b/glm/gtx/intersect.inl
new file mode 100644 (file)
index 0000000..439ecc0
--- /dev/null
@@ -0,0 +1,201 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-04-03\r
+// Updated : 2009-01-20\r
+// Licence : This source is under MIT licence\r
+// File    : glm/gtx/intersect.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <cfloat>\r
+#include <limits>\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace intersect{\r
+\r
+template <typename genType>\r
+inline bool intersectRayTriangle\r
+(\r
+       genType const & orig, genType const & dir,\r
+       genType const & v0, genType const & v1, genType const & v2,\r
+       genType & baryPosition\r
+)\r
+{\r
+       genType e1 = v1 - v0;\r
+       genType e2 = v2 - v0;\r
+\r
+       genType p = glm::cross(dir, e2);\r
+\r
+       typename genType::value_type a = glm::dot(e1, p);\r
+\r
+       typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon();\r
+       if(a < Epsilon)\r
+               return false;\r
+\r
+       typename genType::value_type f = typename genType::value_type(1.0f) / a;\r
+\r
+       genType s = orig - v0;\r
+       baryPosition.x = f * glm::dot(s, p);\r
+       if(baryPosition.x < typename genType::value_type(0.0f))\r
+               return false;\r
+       if(baryPosition.x > typename genType::value_type(1.0f))\r
+               return false;\r
+\r
+       genType q = glm::cross(s, e1);\r
+       baryPosition.y = f * glm::dot(dir, q);\r
+       if(baryPosition.y < typename genType::value_type(0.0f))\r
+               return false;\r
+       if(baryPosition.y + baryPosition.x > typename genType::value_type(1.0f))\r
+               return false;\r
+\r
+       baryPosition.z = f * glm::dot(e2, q);\r
+\r
+       return baryPosition.z >= typename genType::value_type(0.0f);\r
+}\r
+\r
+//template <typename genType>\r
+//inline bool intersectRayTriangle\r
+//(\r
+//     genType const & orig, genType const & dir,\r
+//     genType const & vert0, genType const & vert1, genType const & vert2,\r
+//     genType & position\r
+//)\r
+//{\r
+//     typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon();\r
+//\r
+//     genType edge1 = vert1 - vert0;\r
+//     genType edge2 = vert2 - vert0;\r
+//\r
+//     genType pvec = cross(dir, edge2);\r
+//\r
+//     float det = dot(edge1, pvec);\r
+//     if(det < Epsilon)\r
+//             return false;\r
+//\r
+//     genType tvec = orig - vert0;\r
+//\r
+//     position.y = dot(tvec, pvec);\r
+//     if (position.y < typename genType::value_type(0) || position.y > det)\r
+//             return typename genType::value_type(0);\r
+//\r
+//     genType qvec = cross(tvec, edge1);\r
+//\r
+//     position.z = dot(dir, qvec);\r
+//     if (position.z < typename genType::value_type(0) || position.y + position.z > det)\r
+//             return typename genType::value_type(0);\r
+//\r
+//     position.x = dot(edge2, qvec);\r
+//     position *= typename genType::value_type(1) / det;\r
+//\r
+//     return typename genType::value_type(1);\r
+//}\r
+\r
+template <typename genType>\r
+inline bool intersectLineTriangle\r
+(\r
+       genType const & orig, genType const & dir,\r
+       genType const & vert0, genType const & vert1, genType const & vert2,\r
+       genType & position\r
+)\r
+{\r
+    typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon();\r
+\r
+       genType edge1 = vert1 - vert0;\r
+       genType edge2 = vert2 - vert0;\r
+\r
+       genType pvec = cross(dir, edge2);\r
+\r
+       float det = dot(edge1, pvec);\r
+\r
+       if (det > -Epsilon && det < Epsilon)\r
+               return false;\r
+       float inv_det = typename genType::value_type(1) / det;\r
+\r
+       genType tvec = orig - vert0;\r
+\r
+       position.y = dot(tvec, pvec) * inv_det;\r
+       if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1))\r
+               return false;\r
+\r
+       genType qvec = cross(tvec, edge1);\r
+\r
+       position.z = dot(dir, qvec) * inv_det;\r
+       if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1))\r
+               return false;\r
+\r
+       position.x = dot(edge2, qvec) * inv_det;\r
+\r
+       return true;\r
+}\r
+\r
+template <typename genType>\r
+inline bool intersectRaySphere\r
+(\r
+       genType const & rayStarting, genType const & rayDirection,\r
+       genType const & sphereCenter, typename genType::value_type sphereRadius,\r
+       genType & position, genType & normal\r
+)\r
+{\r
+       typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon();\r
+\r
+       typename genType::value_type a = dot(rayDirection, rayDirection);\r
+       typename genType::value_type b = typename genType::value_type(2) * dot(rayStarting, rayDirection);\r
+       typename genType::value_type c = dot(rayStarting, rayStarting) - sphereRadius * sphereRadius;\r
+       typename genType::value_type d = b * b - typename genType::value_type(4) * a * c;\r
+       typename genType::value_type e = sqrt(d);\r
+       typename genType::value_type x1 = (-b - e) / (typename genType::value_type(2) * a);\r
+       typename genType::value_type x2 = (-b + e) / (typename genType::value_type(2) * a);\r
+\r
+       if(x1 > Epsilon)\r
+       {\r
+               position = rayStarting + rayDirection * sphereRadius;\r
+               normal = (position - sphereCenter) / sphereRadius;\r
+               return true;\r
+       }\r
+       else if(x2 > Epsilon)\r
+       {\r
+               position = rayStarting + rayDirection * sphereRadius;\r
+               normal = (position - sphereCenter) / sphereRadius;\r
+               return true;\r
+       }\r
+       return false;\r
+}\r
+\r
+template <typename genType>\r
+inline bool intersectLineSphere\r
+(\r
+       genType const & point0, genType const & point1,\r
+       genType const & center, typename genType::value_type radius,\r
+       genType & position, genType & normal\r
+)\r
+{\r
+       typename genType::value_type Epsilon = std::numeric_limits<typename genType::value_type>::epsilon();\r
+\r
+    genType dir = point1 - point0;\r
+    typename genType::value_type a = dot(dir, dir);\r
+       typename genType::value_type b = typename genType::value_type(2) * dot(center, dir);\r
+       typename genType::value_type c = dot(center, center) - radius * radius;\r
+       typename genType::value_type d = b * b - typename genType::value_type(4) * a * c;\r
+       typename genType::value_type e = sqrt(d);\r
+       typename genType::value_type x1 = (-b - e) / (typename genType::value_type(2) * a);\r
+       typename genType::value_type x2 = (-b + e) / (typename genType::value_type(2) * a);\r
+\r
+       if(x1 > Epsilon)\r
+       {\r
+               position = center + dir * radius;\r
+               normal = (position - center) / radius;\r
+               return true;\r
+       }\r
+       else if(x2 > Epsilon)\r
+       {\r
+               position = center + dir * radius;\r
+               normal = (position - center) / radius;\r
+               return true;\r
+       }\r
+       return false;\r
+}\r
+\r
+}//namespace intersect\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/inverse.hpp b/glm/gtx/inverse.hpp
new file mode 100644 (file)
index 0000000..2dca92b
--- /dev/null
@@ -0,0 +1,43 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-09-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/inverse.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_inverse\r
+#define glm_gtx_inverse\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/matrix_operation.hpp"\r
+\r
+namespace glm{\r
+namespace gtx{\r
+//! GLM_GTX_inverse extension: Inverse matrix functions\r
+namespace inverse\r
+{\r
+       using namespace gtc::matrix_operation;\r
+\r
+       //! Fast matrix inverse for affine matrix.\r
+       //! From GLM_GTX_inverse extension.\r
+       template <typename genType> \r
+       genType affineInverse(genType const & m);\r
\r
+}//namespace inverse\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_inverse namespace gtx::inverse\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_inverse;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "inverse.inl"\r
+\r
+#endif//glm_gtx_inverse\r
diff --git a/glm/gtx/inverse.inl b/glm/gtx/inverse.inl
new file mode 100644 (file)
index 0000000..31aad6e
--- /dev/null
@@ -0,0 +1,44 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-09-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/inverse.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace inverse\r
+{\r
+       template <typename T> \r
+       inline detail::tmat3x3<T> affineInverse\r
+       (\r
+               detail::tmat3x3<T> const & m\r
+       )\r
+       {\r
+               detail::tmat3x3<T> Result(m);\r
+               Result[2] = detail::tvec3<T>(0, 0, 1);\r
+               Result = transpose(Result);\r
+               detail::tvec3<T> Translation = Result * detail::tvec3<T>(-detail::tvec2<T>(m[2]), m[2][2]);\r
+               Result[2] = Translation;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tmat4x4<T> affineInverse\r
+       (\r
+               detail::tmat4x4<T> const & m\r
+       )\r
+       {\r
+               detail::tmat4x4<T> Result(m);\r
+               Result[3] = detail::tvec4<T>(0, 0, 0, 1);\r
+               Result = transpose(Result);\r
+               detail::tvec4<T> Translation = Result * detail::tvec4<T>(-detail::tvec3<T>(m[3]), m[3][3]);\r
+               Result[3] = Translation;\r
+               return Result;\r
+       }\r
+\r
+}//namespace inverse\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/inverse_transpose.hpp b/glm/gtx/inverse_transpose.hpp
new file mode 100644 (file)
index 0000000..1c905fa
--- /dev/null
@@ -0,0 +1,42 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-04\r
+// Updated : 2008-10-23\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/inverse_transpose.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_inverse_transpose\r
+#define glm_gtx_inverse_transpose\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions\r
+       namespace inverse_transpose\r
+       {\r
+               //! Compute the inverse transpose of a matrix.\r
+               //! From GLM_GTX_inverse extension.\r
+               template <typename genType> \r
+               inline typename genType::value_type inverseTranspose(\r
+                       genType const & m);\r
+\r
+       }//namespace inverse_transpose\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_inverse_transpose namespace gtx::inverse_transpose\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_inverse_transpose;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "inverse_transpose.inl"\r
+\r
+#endif//glm_gtx_inverse_transpose\r
diff --git a/glm/gtx/inverse_transpose.inl b/glm/gtx/inverse_transpose.inl
new file mode 100644 (file)
index 0000000..f11a52d
--- /dev/null
@@ -0,0 +1,112 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-04\r
+// Updated : 2008-12-02\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/inverse_transpose.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+//! GLM_GTX_inverse_transpose extension: Inverse transpose matrix functions\r
+namespace inverse_transpose{\r
+\r
+template <typename valType> \r
+inline detail::tmat2x2<valType> inverseTranspose(\r
+       detail::tmat2x2<valType> const & m)\r
+{\r
+    valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];\r
+\r
+    detail::tmat2x2<valType> Inverse(\r
+        + m[1][1] / Determinant,\r
+        - m[0][1] / Determinant,\r
+        - m[1][0] / Determinant, \r
+        + m[0][0] / Determinant);\r
+\r
+    return Inverse;\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat3x3<valType> inverseTranspose(\r
+       detail::tmat3x3<valType> const & m)\r
+{\r
+    valType Determinant = \r
+               + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])\r
+               - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0])\r
+               + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);\r
+\r
+    detail::tmat3x3<valType> Inverse;\r
+    Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]);\r
+    Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]);\r
+    Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]);\r
+    Inverse[1][0] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]);\r
+    Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]);\r
+    Inverse[1][2] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]);\r
+    Inverse[2][0] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]);\r
+    Inverse[2][1] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]);\r
+    Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]);\r
+    Inverse /= Determinant;\r
+\r
+    return Inverse;\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tmat4x4<valType> inverseTranspose(\r
+       detail::tmat4x4<valType> const & m)\r
+{\r
+    valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];\r
+    valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];\r
+    valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];\r
+    valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];\r
+    valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];\r
+    valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];\r
+    valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3];\r
+    valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\r
+    valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2];\r
+    valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3];\r
+    valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2];\r
+    valType SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3];\r
+    valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1];\r
+    valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3];\r
+    valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3];\r
+    valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\r
+    valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3];\r
+    valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];\r
+    valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\r
+\r
+    detail::tmat4x4<valType> Inverse;\r
+    Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02);\r
+    Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04);\r
+    Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05);\r
+    Inverse[0][3] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05);\r
+\r
+    Inverse[1][0] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02);\r
+    Inverse[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04);\r
+    Inverse[1][2] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05);\r
+    Inverse[1][3] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05);\r
+\r
+    Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08);\r
+    Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10);\r
+    Inverse[2][2] = + (m[0][0] * SubFactor11 - m[0][1] * SubFactor09 + m[0][3] * SubFactor12);\r
+    Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor12);\r
+\r
+    Inverse[3][0] = - (m[0][1] * SubFactor13 - m[0][2] * SubFactor14 + m[0][3] * SubFactor15);\r
+    Inverse[3][1] = + (m[0][0] * SubFactor13 - m[0][2] * SubFactor16 + m[0][3] * SubFactor17);\r
+    Inverse[3][2] = - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18);\r
+    Inverse[3][3] = + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18);\r
+\r
+    valType Determinant = \r
+               + m[0][0] * Inverse[0][0] \r
+               + m[0][1] * Inverse[0][1] \r
+               + m[0][2] * Inverse[0][2] \r
+               + m[0][3] * Inverse[0][3];\r
+\r
+    Inverse /= Determinant;\r
+    \r
+    return Inverse;\r
+}\r
+\r
+}//namespace inverse_transpose\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/log_base.hpp b/glm/gtx/log_base.hpp
new file mode 100644 (file)
index 0000000..5c5a875
--- /dev/null
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-24\r
+// Updated : 2008-10-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/log_base.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_log_base\r
+#define glm_gtx_log_base\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_ext_gtx_log_base();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_log_base extension: Logarithm for any base. base can be a vector or a scalar.\r
+       namespace log_base\r
+       {\r
+               //! Logarithm for any base.\r
+               //! From GLM_GTX_log_base.\r
+               template <typename genType> \r
+               genType log(\r
+                       genType const & x, \r
+                       genType const & base);\r
+\r
+       }//namespace extend\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_log_base namespace gtx::log_base\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_log_base;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "log_base.inl"\r
+\r
+#endif//glm_gtx_log_base\r
diff --git a/glm/gtx/log_base.inl b/glm/gtx/log_base.inl
new file mode 100644 (file)
index 0000000..c24fea1
--- /dev/null
@@ -0,0 +1,92 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-24\r
+// Updated : 2008-10-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/log_base.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace log_base{\r
+\r
+template <typename genType> \r
+inline genType log(\r
+       genType const & x, \r
+       genType const & base)\r
+{\r
+       assert(x != genType(0));\r
+\r
+       return glm::log(x) / glm::log(base);\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec2<valType> log(\r
+       detail::tvec2<valType> const & v, \r
+       valType const & base)\r
+{\r
+       return detail::tvec2<valType>(\r
+               log(v.x, base),\r
+               log(v.y, base));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<valType> log(\r
+       detail::tvec3<valType> const & v, \r
+       valType const & base)\r
+{\r
+       return detail::tvec3<valType>(\r
+               log(v.x, base),\r
+               log(v.y, base),\r
+               log(v.z, base));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec4<valType> log(\r
+       detail::tvec4<valType> const & v, \r
+       valType const & base)\r
+{\r
+       return detail::tvec4<valType>(\r
+               log(v.x, base),\r
+               log(v.y, base),\r
+               log(v.z, base),\r
+               log(v.w, base));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec2<valType> log(\r
+       detail::tvec2<valType> const & v, \r
+       detail::tvec2<valType> const & base)\r
+{\r
+       return detail::tvec2<valType>(\r
+               log(v.x, base.x),\r
+               log(v.y, base.y));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec3<valType> log(\r
+       detail::tvec3<valType> const & v, \r
+       detail::tvec3<valType> const & base)\r
+{\r
+       return detail::tvec3<valType>(\r
+               log(v.x, base.x),\r
+               log(v.y, base.y),\r
+               log(v.z, base.z));\r
+}\r
+\r
+template <typename valType> \r
+inline detail::tvec4<valType> log(\r
+       detail::tvec4<valType> const & v, \r
+       detail::tvec4<valType> const & base)\r
+{\r
+       return detail::tvec4<valType>(\r
+               log(v.x, base.x),\r
+               log(v.y, base.y),\r
+               log(v.z, base.z),\r
+               log(v.w, base.w));\r
+}\r
+\r
+}//namespace log_base\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/mat4x3.inl b/glm/gtx/mat4x3.inl
new file mode 100644 (file)
index 0000000..d6f56ab
--- /dev/null
@@ -0,0 +1,405 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Created : 2006-04-17
+// Updated : 2006-04-17
+// Licence : This source is under MIT licence
+// File    : glm/gtx/mat4x3.inl
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace glm
+{
+    //////////////////////////////////////////////////////////////
+    // Constructors
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>::_xmat4x3GTX()
+    {
+        this->value[0] = tvec3<T>(1, 0, 0);
+        this->value[1] = tvec3<T>(0, 1, 0);
+        this->value[2] = tvec3<T>(0, 0, 1);
+        this->value[3] = tvec3<T>(0, 0, 0);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>::_xmat4x3GTX(const T f)
+    {
+        this->value[0] = tvec3<T>(f, 0, 0);
+        this->value[1] = tvec3<T>(0, f, 0);
+        this->value[2] = tvec3<T>(0, 0, f);
+        this->value[3] = tvec3<T>(0, 0, 0);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>::_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] = tvec3<T>(x0, y0, z0);
+        this->value[1] = tvec3<T>(x1, y1, z1);
+        this->value[2] = tvec3<T>(x2, y2, z2);
+        this->value[3] = tvec3<T>(x3, y3, z3);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>::_xmat4x3GTX
+    (
+        const tvec3<T> & v0, 
+        const tvec3<T> & v1, 
+        const tvec3<T> & v2,
+        const tvec3<T> & v3
+    )
+    {
+        this->value[0] = v0;
+        this->value[1] = v1;
+        this->value[2] = v2;
+        this->value[3] = v3;
+    }
+
+    //////////////////////////////////////////////////////////////
+    // Unary updatable operators
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator= (const _xmat4x3GTX<T>& m)
+    {
+        this->value[0] = m[0];
+        this->value[1] = m[1];
+        this->value[2] = m[2];
+        this->value[3] = m[3];
+        return *this;
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator+= (const T s)
+    {
+        this->value[0] += s;
+        this->value[1] += s;
+        this->value[2] += s;
+        this->value[3] += s;
+        return *this;
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator+= (const _xmat4x3GTX<T>& m)
+    {
+        this->value[0] += m[0];
+        this->value[1] += m[1];
+        this->value[2] += m[2];
+        this->value[3] += m[3];
+        return *this;
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator-= (const T s)
+    {
+        this->value[0] -= s;
+        this->value[1] -= s;
+        this->value[2] -= s;
+        this->value[3] -= s;
+        return *this;
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator-= (const _xmat4x3GTX<T>& m)
+    {
+        this->value[0] -= m[0];
+        this->value[1] -= m[1];
+        this->value[2] -= m[2];
+        this->value[3] -= m[3];
+        return *this;
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator*= (const T s)
+    {
+        this->value[0] *= s;
+        this->value[1] *= s;
+        this->value[2] *= s;
+        this->value[3] *= s;
+        return *this;
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator*= (const _xmat4x3GTX<T>& m)
+    {
+        return (*this = *this * m);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> & _xmat4x3GTX<T>::operator/= (const T s)
+    {
+        this->value[0] /= s;
+        this->value[1] /= s;
+        this->value[2] /= s;
+        this->value[3] /= s;
+        return *this;
+    }
+/*
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator/= (const _xmat4x3GTX<T>& m)
+    {
+        return (*this = *this / m);
+    }
+*/
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator++ ()
+    {
+        ++this->value[0];
+        ++this->value[1];
+        ++this->value[2];
+        ++this->value[3];
+        return *this;
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T>& _xmat4x3GTX<T>::operator-- ()
+    {
+        --this->value[0];
+        --this->value[1];
+        --this->value[2];
+        --this->value[3];
+        return *this;
+    }
+    
+    //////////////////////////////////////////////////////////////
+    // Unary constant operators
+    template <typename T> 
+    inline const _xmat4x3GTX<T> _xmat4x3GTX<T>::operator- () const
+    {
+        return _xmat4x3GTX<T>(
+            -this->value[0], 
+            -this->value[1],
+            -this->value[2],
+            -this->value[3]);
+    }
+
+    template <typename T> 
+    inline const _xmat4x3GTX<T> _xmat4x3GTX<T>::operator-- (int n) const 
+    {
+        _xmat4x3GTX<T> m = *this;
+        --m.value[0];
+        --m.value[1];
+        --m.value[2];
+        --m.value[3];
+        return m;
+    }
+
+    template <typename T> 
+    inline const _xmat4x3GTX<T> _xmat4x3GTX<T>::operator++ (int n) const
+    {
+        detail::tmat4x4<T> m = *this;
+        ++m.value[0];
+        ++m.value[1];
+        ++m.value[2];
+        ++m.value[3];
+        return m;
+    }
+
+    //////////////////////////////////////////////////////////////
+    // Binary operators
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator+ (const _xmat4x3GTX<T>& m, const T s)
+    {
+        return _xmat4x3GTX<T>(
+            m[0] + s,
+            m[1] + s,
+            m[2] + s,
+            m[3] + s);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator+ (const _xmat4x3GTX<T>& m1, const _xmat4x3GTX<T>& m2)
+    {
+        return _xmat4x3GTX<T>(
+            m1[0] + m2[0],
+            m1[1] + m2[1],
+            m1[2] + m2[2],
+            m1[3] + m2[3]);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator- (const _xmat4x3GTX<T>& m, const T s)
+    {
+        return _xmat4x3GTX<T>(
+            m[0] - s,
+            m[1] - s,
+            m[2] - s,
+            m[3] - s);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator- (const _xmat4x3GTX<T>& m1, const _xmat4x3GTX<T>& m2)
+    {
+        return _xmat4x3GTX<T>(
+            m1[0] - m2[0],
+            m1[1] - m2[1],
+            m1[2] - m2[2],
+            m1[3] - m2[3]);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator* (const _xmat4x3GTX<T>& m, const T s)
+    {
+        return _xmat4x3GTX<T>(
+            m[0] * s,
+            m[1] * s,
+            m[2] * s,
+            m[3] * s);
+    }
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator* (const T s, const _xmat4x3GTX<T> & m)
+    {
+        return _xmat4x3GTX<T>(
+            m[0] * s,
+            m[1] * s,
+            m[2] * s,
+            m[3] * s);
+    }
+   
+    template <typename T>
+    inline tvec3<T> operator* (const _xmat4x3GTX<T>& m, const tvec4<T>& v)
+    {
+        return tvec3<T>(
+            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 <typename T> 
+    inline tvec3<T> operator* (const tvec4<T>& v, const _xmat4x3GTX<T>& m) 
+    {
+        return tvec3<T>(
+            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 <typename T> 
+    inline _xmat4x3GTX<T> operator* (const _xmat4x3GTX<T>& m1, const _xmat4x3GTX<T>& 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<T> 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 <typename T> 
+    inline _xmat4x3GTX<T> operator/ (const _xmat4x3GTX<T>& m, const T s)
+    {
+        return _xmat4x3GTX<T>(
+            m.value[0] / s,
+            m.value[1] / s,
+            m.value[2] / s,
+            m.value[3] / s);        
+    }
+/*
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator/ (const T s, const _xmat4x3GTX<T>& m)
+    {
+        return _xmat4x3GTX<T>(
+            s / m.value[0],
+            s / m.value[1],
+            s / m.value[2],
+            s / m.value[3]);        
+    }
+    
+    template <typename T> 
+    tvec3<T> operator/ (const _xmat4x3GTX<T>& m, const tvec4<T>& v)
+    {
+      
+    }
+
+    template <typename T> 
+    tvec3<T> operator/ (const tvec4<T>& v, const _xmat4x3GTX<T>& m)
+    {
+      
+    }
+*/
+
+    template <typename T> 
+    inline _xmat4x3GTX<T> operator/ (const _xmat4x3GTX<T>& m1, const _xmat4x3GTX<T>& 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<T> 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/glm/gtx/matrix_access.hpp b/glm/gtx/matrix_access.hpp
new file mode 100644 (file)
index 0000000..ba03ba8
--- /dev/null
@@ -0,0 +1,51 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-27\r
+// Updated : 2006-12-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_access.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_access\r
+#define glm_gtx_matrix_access\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm{\r
+namespace gtx{\r
+//! GLM_GTX_matrix_access extension: Set a column or a row of a matrix\r
+namespace matrix_access\r
+{\r
+       //! Set a specific row to a matrix.\r
+       //! From GLM_GTX_matrix_access extension.\r
+    template <typename genType> \r
+       genType row(\r
+               const genType& m, \r
+               int index, \r
+               typename genType::row_type const & x);\r
+\r
+        //! Set a specific column to a matrix.\r
+        //! From GLM_GTX_matrix_access extension.\r
+       template <typename genType> \r
+       genType column(\r
+               const genType& m, \r
+               int index, \r
+               typename genType::col_type const & x);\r
+\r
+}//namespace matrix_access\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_matrix_access namespace gtx::matrix_access\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matrix_access;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matrix_access.inl"\r
+\r
+#endif//glm_gtx_matrix_access\r
diff --git a/glm/gtx/matrix_access.inl b/glm/gtx/matrix_access.inl
new file mode 100644 (file)
index 0000000..99c6226
--- /dev/null
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-27\r
+// Updated : 2005-12-27\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_access.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace matrix_access{\r
+\r
+    template <typename genType>\r
+    inline genType row(\r
+               genType const & m, \r
+               int index, \r
+               typename genType::row_type const & x)\r
+    {\r
+        genType Result = m;\r
+        for(typename genType::size_type i = 0; i < genType::row_size(); ++i)\r
+                       Result[i][index] = x[i];\r
+        return Result;\r
+    }\r
+\r
+    template <typename genType>\r
+    inline genType column(\r
+               genType const & m, \r
+               int index, \r
+               typename genType::col_type const & x)\r
+    {\r
+        genType Result = m;\r
+        Result[index] = x;\r
+        return Result;\r
+    }\r
+\r
+}//namespace matrix_access\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
diff --git a/glm/gtx/matrix_cross_product.hpp b/glm/gtx/matrix_cross_product.hpp
new file mode 100644 (file)
index 0000000..7794f36
--- /dev/null
@@ -0,0 +1,52 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_cross_product.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_cross_product\r
+#define glm_gtx_matrix_cross_product\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_matrix_cross_product();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_matrix_cross_product: Build cross product matrices\r
+       namespace matrix_cross_product\r
+       {\r
+               //! Build a cross product matrix.\r
+               //! From GLM_GTX_matrix_cross_product extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> matrixCross3(\r
+                       detail::tvec3<T> const & x);\r
+               \r
+               //! Build a cross product matrix.\r
+               //! From GLM_GTX_matrix_cross_product extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> matrixCross4(\r
+                       detail::tvec3<T> const & x);\r
+\r
+       }//namespace matrix_cross_product\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_matrix_cross_product namespace gtx::matrix_cross_product\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matrix_cross_product;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matrix_cross_product.inl"\r
+\r
+#endif//glm_gtx_matrix_cross_product\r
diff --git a/glm/gtx/matrix_cross_product.inl b/glm/gtx/matrix_cross_product.inl
new file mode 100644 (file)
index 0000000..b58692d
--- /dev/null
@@ -0,0 +1,44 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2005-12-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_cross_product.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace matrix_cross_product\r
+{\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> matrixCross3(\r
+               detail::tvec3<T> const & x)\r
+    {\r
+        detail::tmat3x3<T> Result(T(0));\r
+        Result[0][1] = x.z;\r
+        Result[1][0] = -x.z;\r
+        Result[0][2] = -x.y;\r
+        Result[2][0] = x.y;\r
+        Result[1][2] = x.x;\r
+        Result[2][1] = -x.x;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> matrixCross4(\r
+               detail::tvec3<T> const & x)\r
+    {\r
+        detail::tmat4x4<T> Result(T(0));\r
+        Result[0][1] = x.z;\r
+        Result[1][0] = -x.z;\r
+        Result[0][2] = -x.y;\r
+        Result[2][0] = x.y;\r
+        Result[1][2] = x.x;\r
+        Result[2][1] = -x.x;\r
+        return Result;\r
+    }\r
+\r
+}//namespace matrix_cross_product\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/matrix_major_storage.hpp b/glm/gtx/matrix_major_storage.hpp
new file mode 100644 (file)
index 0000000..71f8b7b
--- /dev/null
@@ -0,0 +1,120 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-19\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_major_storage.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_major_storage\r
+#define glm_gtx_matrix_major_storage\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_matrix_cross_product: Build matrices with specific matrix order, row or column\r
+       namespace matrix_major_storage\r
+       {\r
+               //! Build a row major matrix from row vectors.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat2x2<T> rowMajor2(\r
+                       const detail::tvec2<T>& v1, \r
+                       const detail::tvec2<T>& v2);\r
+               \r
+               //! Build a row major matrix from other matrix.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat2x2<T> rowMajor2(\r
+                       const detail::tmat2x2<T>& m);\r
+\r
+               //! Build a row major matrix from row vectors.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> rowMajor3(\r
+                       const detail::tvec3<T>& v1, \r
+                       const detail::tvec3<T>& v2, \r
+                       const detail::tvec3<T>& v3);\r
+\r
+               //! Build a row major matrix from other matrix.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> rowMajor3(\r
+                       const detail::tmat3x3<T>& m);\r
+\r
+               //! Build a row major matrix from row vectors.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> rowMajor4(\r
+                       const detail::tvec4<T>& v1, \r
+                       const detail::tvec4<T>& v2,\r
+                       const detail::tvec4<T>& v3, \r
+                       const detail::tvec4<T>& v4);\r
+\r
+               //! Build a row major matrix from other matrix.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> rowMajor4(\r
+                       const detail::tmat4x4<T>& m);\r
+\r
+               //! Build a column major matrix from column vectors.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat2x2<T> colMajor2(\r
+                       const detail::tvec2<T>& v1, \r
+                       const detail::tvec2<T>& v2);\r
+               \r
+               //! Build a column major matrix from other matrix.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat2x2<T> colMajor2(\r
+                       const detail::tmat2x2<T>& m);\r
+\r
+               //! Build a column major matrix from column vectors.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> colMajor3(\r
+                       const detail::tvec3<T>& v1, \r
+                       const detail::tvec3<T>& v2, \r
+                       const detail::tvec3<T>& v3);\r
+               \r
+               //! Build a column major matrix from other matrix.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> colMajor3(\r
+                       const detail::tmat3x3<T>& m);\r
+               \r
+               //! Build a column major matrix from column vectors.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> colMajor4(\r
+                       const detail::tvec4<T>& v1, \r
+                       const detail::tvec4<T>& v2, \r
+                       const detail::tvec4<T>& v3, \r
+                       const detail::tvec4<T>& v4);\r
+                               \r
+               //! Build a column major matrix from other matrix.\r
+               //! From GLM_GTX_matrix_major_storage extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> colMajor4(\r
+                       const detail::tmat4x4<T>& m);\r
+               \r
+       }//namespace matrix_major_storage\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_matrix_major_storage namespace gtx::matrix_major_storage\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matrix_major_storage;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matrix_major_storage.inl"\r
+\r
+#endif//glm_gtx_matrix_major_storage\r
diff --git a/glm/gtx/matrix_major_storage.inl b/glm/gtx/matrix_major_storage.inl
new file mode 100644 (file)
index 0000000..4e45666
--- /dev/null
@@ -0,0 +1,176 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-19\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_major_storage.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace matrix_major_storage\r
+{\r
+    template <typename T> \r
+    inline detail::tmat2x2<T> rowMajor2(\r
+               const detail::tvec2<T>& v1, \r
+               const detail::tvec2<T>& v2)\r
+    {\r
+        detail::tmat2x2<T> Result;\r
+        Result[0][0] = v1.x;\r
+        Result[1][0] = v1.y;\r
+        Result[0][1] = v2.x;\r
+        Result[1][1] = v2.y;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat2x2<T> rowMajor2(\r
+               const detail::tmat2x2<T>& m)\r
+    {\r
+        detail::tmat2x2<T> Result;\r
+        Result[0][0] = m[0][0];\r
+        Result[0][1] = m[1][0];\r
+        Result[1][0] = m[0][1];\r
+        Result[1][1] = m[1][1];\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> rowMajor3(\r
+               const detail::tvec3<T>& v1, \r
+               const detail::tvec3<T>& v2, \r
+               const detail::tvec3<T>& v3)\r
+    {\r
+        detail::tmat3x3<T> Result;\r
+        Result[0][0] = v1.x;\r
+        Result[1][0] = v1.y;\r
+        Result[2][0] = v1.z;\r
+        Result[0][1] = v2.x;\r
+        Result[1][1] = v2.y;\r
+        Result[2][1] = v2.z;\r
+        Result[0][2] = v3.x;\r
+        Result[1][2] = v3.y;\r
+        Result[2][2] = v3.z;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+       inline detail::tmat3x3<T> rowMajor3(\r
+               const detail::tmat3x3<T>& m)\r
+    {\r
+        detail::tmat3x3<T> Result;\r
+        Result[0][0] = m[0][0];\r
+        Result[0][1] = m[1][0];\r
+        Result[0][2] = m[2][0];\r
+        Result[1][0] = m[0][1];\r
+        Result[1][1] = m[1][1];\r
+        Result[1][2] = m[2][1];\r
+        Result[2][0] = m[0][2];\r
+        Result[2][1] = m[1][2];\r
+        Result[2][2] = m[2][2];\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> rowMajor4(\r
+               const detail::tvec4<T>& v1, \r
+               const detail::tvec4<T>& v2, \r
+               const detail::tvec4<T>& v3, \r
+               const detail::tvec4<T>& v4)\r
+    {\r
+        detail::tmat4x4<T> Result;\r
+        Result[0][0] = v1.x;\r
+        Result[1][0] = v1.y;\r
+        Result[2][0] = v1.z;\r
+        Result[3][0] = v1.w;\r
+        Result[0][1] = v2.x;\r
+        Result[1][1] = v2.y;\r
+        Result[2][1] = v2.z;\r
+        Result[3][1] = v2.w;\r
+        Result[0][2] = v3.x;\r
+        Result[1][2] = v3.y;\r
+        Result[2][2] = v3.z;\r
+        Result[3][2] = v3.w;\r
+        Result[0][3] = v4.x;\r
+        Result[1][3] = v4.y;\r
+        Result[2][3] = v4.z;\r
+        Result[3][3] = v4.w;\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> rowMajor4(\r
+               const detail::tmat4x4<T>& m)\r
+    {\r
+        detail::tmat4x4<T> Result;\r
+        Result[0][0] = m[0][0];\r
+        Result[0][1] = m[1][0];\r
+        Result[0][2] = m[2][0];\r
+        Result[0][3] = m[3][0];\r
+        Result[1][0] = m[0][1];\r
+        Result[1][1] = m[1][1];\r
+        Result[1][2] = m[2][1];\r
+        Result[1][3] = m[3][1];\r
+        Result[2][0] = m[0][2];\r
+        Result[2][1] = m[1][2];\r
+        Result[2][2] = m[2][2];\r
+        Result[2][3] = m[3][2];\r
+        Result[3][0] = m[0][3];\r
+        Result[3][1] = m[1][3];\r
+        Result[3][2] = m[2][3];\r
+        Result[3][3] = m[3][3];\r
+        return Result;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat2x2<T> colMajor2(\r
+               const detail::tvec2<T>& v1, \r
+               const detail::tvec2<T>& v2)\r
+    {\r
+        return detail::tmat2x2<T>(v1, v2);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat2x2<T> colMajor2(\r
+               const detail::tmat2x2<T>& m)\r
+    {\r
+        return detail::tmat2x2<T>(m);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> colMajor3(\r
+               const detail::tvec3<T>& v1, \r
+               const detail::tvec3<T>& v2, \r
+               const detail::tvec3<T>& v3)\r
+    {\r
+        return detail::tmat3x3<T>(v1, v2, v3);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> colMajor3(\r
+               const detail::tmat3x3<T>& m)\r
+    {\r
+        return detail::tmat3x3<T>(m);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> colMajor4(\r
+               const detail::tvec4<T>& v1, \r
+               const detail::tvec4<T>& v2, \r
+               const detail::tvec4<T>& v3, \r
+               const detail::tvec4<T>& v4)\r
+    {\r
+        return detail::tmat4x4<T>(v1, v2, v3, v4);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> colMajor4(\r
+               const detail::tmat4x4<T>& m)\r
+    {\r
+        return detail::tmat4x4<T>(m);\r
+       }\r
+\r
+}//namespace matrix_major_storage\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/matrix_operation.hpp b/glm/gtx/matrix_operation.hpp
new file mode 100644 (file)
index 0000000..7063516
--- /dev/null
@@ -0,0 +1,94 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-08-29\r
+// Updated : 2009-08-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_operation.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_operation\r
+#define glm_gtx_matrix_operation\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_matrix_operation();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_matrix_operation: Build cross product matrices\r
+       namespace matrix_operation\r
+       {\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat2x2<valType> diagonal2x2(\r
+                       detail::tvec2<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat2x3<valType> diagonal2x3(\r
+                       detail::tvec2<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat2x4<valType> diagonal2x4(\r
+                       detail::tvec2<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat3x2<valType> diagonal3x2(\r
+                       detail::tvec2<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat3x3<valType> diagonal3x3(\r
+                       detail::tvec3<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat3x4<valType> diagonal3x4(\r
+                       detail::tvec3<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat4x2<valType> diagonal4x2(\r
+                       detail::tvec2<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat4x3<valType> diagonal4x3(\r
+                       detail::tvec3<valType> const & v);\r
+\r
+               //! Build a diagonal matrix.\r
+               //! From GLM_GTX_matrix_operation extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> diagonal4x4(\r
+                       detail::tvec4<valType> const & v);\r
+\r
+       }//namespace matrix_operation\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_matrix_operation namespace gtx::matrix_operation\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matrix_operation;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matrix_operation.inl"\r
+\r
+#endif//glm_gtx_matrix_operation\r
diff --git a/glm/gtx/matrix_operation.inl b/glm/gtx/matrix_operation.inl
new file mode 100644 (file)
index 0000000..4fa5c9f
--- /dev/null
@@ -0,0 +1,129 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-08-29\r
+// Updated : 2009-08-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_operation.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtc{\r
+namespace matrix_operation\r
+{\r
+       template <typename valType> \r
+       inline detail::tmat2x2<valType> diagonal2x2\r
+       (\r
+               detail::tvec2<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat2x2<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat2x3<valType> diagonal2x3\r
+       (\r
+               detail::tvec2<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat2x3<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat2x4<valType> diagonal2x4\r
+       (\r
+               detail::tvec2<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat2x4<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat3x2<valType> diagonal3x2\r
+       (\r
+               detail::tvec2<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat3x2<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat3x3<valType> diagonal3x3\r
+       (\r
+               detail::tvec3<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat3x3<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               Result[2][2] = v[2];\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat3x4<valType> diagonal3x4\r
+       (\r
+               detail::tvec3<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat3x4<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               Result[2][2] = v[2];\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat4x4<valType> diagonal4x4\r
+       (\r
+               detail::tvec4<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat4x4<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               Result[2][2] = v[2];\r
+               Result[3][3] = v[3];\r
+               return Result;          \r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat4x3<valType> diagonal4x3\r
+       (\r
+               detail::tvec3<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat4x3<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               Result[2][2] = v[2];\r
+               return Result;          \r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tmat4x2<valType> diagonal4x2\r
+       (\r
+               detail::tvec2<valType> const & v\r
+       )\r
+       {\r
+               detail::tmat4x2<valType> Result(valType(1));\r
+               Result[0][0] = v[0];\r
+               Result[1][1] = v[1];\r
+               return Result;          \r
+       }\r
+\r
+}//namespace matrix_operation\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/matrix_projection.hpp b/glm/gtx/matrix_projection.hpp
new file mode 100644 (file)
index 0000000..2f12a35
--- /dev/null
@@ -0,0 +1,64 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_projection.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_matrix_projection\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_projection\r
+#define glm_gtx_matrix_projection\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/matrix_projection.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_matrix_projection();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_matrix_projection: Varius ways to build and operate on projection matrices\r
+    namespace matrix_projection\r
+    {\r
+               //! Builds a perspective projection matrix based on a field of view\r
+               //! From GLM_GTX_matrix_projection extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> perspectiveFov(\r
+                       valType const & fov, \r
+                       valType const & width, \r
+                       valType const & height, \r
+                       valType const & zNear, \r
+                       valType const & zFar);\r
+\r
+               //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite .\r
+               //! From GLM_GTX_matrix_projection extension.\r
+        template <typename T> \r
+               detail::tmat4x4<T> infinitePerspective(\r
+                       T fovy, T aspect, T zNear);\r
+\r
+               //! Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.\r
+               //! From GLM_GTX_matrix_projection extension.\r
+        template <typename T> \r
+               detail::tmat4x4<T> tweakedInfinitePerspective(\r
+                       T fovy, T aspect, T zNear);\r
+\r
+    }//namespace matrix_projection\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_matrix_projection namespace gtc::matrix_projection; using namespace gtx::matrix_projection\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matrix_projection;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matrix_projection.inl"\r
+\r
+#endif//glm_gtx_matrix_projection\r
diff --git a/glm/gtx/matrix_projection.inl b/glm/gtx/matrix_projection.inl
new file mode 100644 (file)
index 0000000..6044f00
--- /dev/null
@@ -0,0 +1,81 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_projection.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace matrix_projection\r
+{\r
+       template <typename valType>\r
+       inline detail::tmat4x4<valType> perspectiveFov\r
+       (\r
+               valType const & fov, \r
+               valType const & width, \r
+               valType const & height, \r
+               valType const & zNear, \r
+               valType const & zFar\r
+       )\r
+       {\r
+               valType rad = glm::radians(fov);\r
+               valType h = glm::cos(valType(0.5) * rad) / glm::sin(valType(0.5) * rad);\r
+               valType w = h * height / width;\r
+\r
+               detail::tmat4x4<valType> Result(valType(0));\r
+               Result[0][0] = w;\r
+               Result[1][1] = h;\r
+               Result[2][2] = (zFar + zNear) / (zFar - zNear);\r
+               Result[2][3] = valType(1);\r
+               Result[3][2] = -(valType(2) * zFar * zNear) / (zFar - zNear);\r
+               return Result;\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tmat4x4<T> infinitePerspective(\r
+               T fovy, \r
+               T aspect, \r
+               T zNear)\r
+       {\r
+               T range = tan(radians(fovy / T(2))) * zNear;    \r
+               T left = -range * aspect;\r
+               T right = range * aspect;\r
+               T bottom = -range;\r
+               T top = range;\r
+\r
+               detail::tmat4x4<T> Result(T(0));\r
+               Result[0][0] = (T(2) * zNear) / (right - left);\r
+               Result[1][1] = (T(2) * zNear) / (top - bottom);\r
+               Result[2][2] = - T(1);\r
+               Result[2][3] = - T(1);\r
+               Result[3][2] = - T(2) * zNear;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tmat4x4<T> tweakedInfinitePerspective(\r
+               T fovy, \r
+               T aspect, \r
+               T zNear)\r
+       {\r
+               T range = tan(radians(fovy / T(2))) * zNear;    \r
+               T left = -range * aspect;\r
+               T right = range * aspect;\r
+               T bottom = -range;\r
+               T top = range;\r
+\r
+               detail::tmat4x4<T> Result(T(0));\r
+               Result[0][0] = (T(2) * zNear) / (right - left);\r
+               Result[1][1] = (T(2) * zNear) / (top - bottom);\r
+               Result[2][2] = T(0.0001) - T(1);\r
+               Result[2][3] = T(-1);\r
+               Result[3][2] = - (T(0.0001) - T(2)) * zNear;\r
+               return Result;\r
+       }\r
+\r
+}//namespace matrix_projection\r
+}//namespace gtc\r
+}//namespace glm\r
diff --git a/glm/gtx/matrix_query.hpp b/glm/gtx/matrix_query.hpp
new file mode 100644 (file)
index 0000000..9736825
--- /dev/null
@@ -0,0 +1,98 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-05\r
+// Updated : 2007-03-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_query.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_query\r
+#define glm_gtx_matrix_query\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+//#include <cfloat>\r
+#include <limits>\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_matrix_query();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_matrix_query: Query to evaluate matrices properties\r
+       namespace matrix_query\r
+       {\r
+               //! Return if a matrix a null matrix.\r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename T> \r
+               bool isNull(\r
+                       const detail::tmat2x2<T>& m, \r
+                       const T epsilon = std::numeric_limits<T>::epsilon());\r
+               \r
+               //! Return if a matrix a null matrix.\r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename T> \r
+               bool isNull(\r
+                       const detail::tmat3x3<T>& m, \r
+                       const T epsilon = std::numeric_limits<T>::epsilon());\r
+               \r
+               //! Return if a matrix a null matrix.\r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename T> \r
+               bool isNull(\r
+                       const detail::tmat4x4<T>& m, \r
+                       const T epsilon = std::numeric_limits<T>::epsilon());\r
+                       \r
+               //! Return if a matrix an identity matrix. \r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename genType> \r
+               bool isIdentity(\r
+                       const genType& m, \r
+                       const typename genType::value_type epsilon = std::numeric_limits<typename genType::value_type>::epsilon());\r
+\r
+               //! Return if a matrix a normalized matrix.\r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename T> \r
+               bool isNormalized(\r
+                       const detail::tmat2x2<T>& m, \r
+                       const T epsilon = std::numeric_limits<T>::epsilon());\r
+               \r
+               //! Return if a matrix a normalized matrix.\r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename T> \r
+               bool isNormalized(\r
+                       const detail::tmat3x3<T>& m, \r
+                       const T epsilon = std::numeric_limits<T>::epsilon());\r
+               \r
+               //! Return if a matrix a normalized matrix.\r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename T> \r
+               bool isNormalized(\r
+                       const detail::tmat4x4<T>& m, \r
+                       const T epsilon = std::numeric_limits<T>::epsilon());\r
+\r
+               //! Return if a matrix an orthonormalized matrix.\r
+               //! From GLM_GTX_matrix_query extension.\r
+               template<typename genType> \r
+               bool isOrthogonal(\r
+                       const genType& m, \r
+                       const typename genType::value_type epsilon = std::numeric_limits<typename genType::value_type>::epsilon());\r
+\r
+       }//namespace matrix_query\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_matrix_query namespace gtx::matrix_query\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matrix_query;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matrix_query.inl"\r
+\r
+#endif//glm_gtx_matrix_query\r
diff --git a/glm/gtx/matrix_query.inl b/glm/gtx/matrix_query.inl
new file mode 100644 (file)
index 0000000..8a5023c
--- /dev/null
@@ -0,0 +1,144 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-05\r
+// Updated : 2007-03-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_query.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace matrix_query\r
+{\r
+       template<typename T> \r
+       inline bool isNull(\r
+               const detail::tmat2x2<T>& m, \r
+               const T epsilon)\r
+       {\r
+               bool result = true;\r
+               for(int i = 0; result && i < 2 ; ++i)\r
+                       result = isNull(m[i], epsilon);\r
+               return result;\r
+       }\r
+\r
+       template<typename T> \r
+       inline bool isNull(\r
+               const detail::tmat3x3<T>& m, \r
+               const T epsilon)\r
+       {\r
+               bool result = true;\r
+               for(int i = 0; result && i < 3 ; ++i)\r
+                       result = isNull(m[i], epsilon);\r
+               return result;\r
+       }\r
+\r
+       template<typename T> \r
+       inline bool isNull(\r
+               const detail::tmat4x4<T>& m, \r
+               const T epsilon)\r
+       {\r
+               bool result = true;\r
+               for(int i = 0; result && i < 4 ; ++i)\r
+                       result = isNull(m[i], epsilon);\r
+               return result;\r
+       }\r
+\r
+       template<typename genType> \r
+       inline bool isIdentity(\r
+               const genType& m, \r
+               const typename genType::value_type epsilon)\r
+       {\r
+               bool result = true;\r
+               for(typename genType::value_type i = typename genType::value_type(0); result && i < genType::col_size(); ++i)\r
+               {\r
+                       for(typename genType::value_type j = typename genType::value_type(0); result && j < i ; ++j)\r
+                               result = abs(m[i][j]) <= epsilon;\r
+                       if(result)\r
+                               result = abs(m[i][i] - typename genType::value_type(1)) <= epsilon;\r
+                       for(typename genType::value_type j = i + typename genType::value_type(1); result && j < genType::row_size(); ++j)\r
+                               result = abs(m[i][j]) <= epsilon;\r
+               }\r
+               return result;\r
+       }\r
+\r
+       template<typename T> \r
+       inline bool isNormalized(\r
+               const detail::tmat2x2<T>& m, \r
+               const T epsilon)\r
+       {\r
+               bool result = true;\r
+               for(int i = 0; result && i < 2; ++i)\r
+                       result = isNormalized(m[i], epsilon);\r
+               for(int i = 0; result && i < 2; ++i)\r
+               {\r
+                       detail::tvec2<T> v;\r
+                       for(int j = 0; j < 2; ++j)\r
+                               v[j] = m[j][i];\r
+                       result = isNormalized(v, epsilon);\r
+               }\r
+               return result;\r
+       }\r
+\r
+       template<typename T> \r
+       inline bool isNormalized(\r
+               const detail::tmat3x3<T>& m, \r
+               const T epsilon)\r
+       {\r
+               bool result = true;\r
+               for(int i = 0; result && i < 3; ++i)\r
+                       result = isNormalized(m[i], epsilon);\r
+               for(int i = 0; result && i < 3; ++i)\r
+               {\r
+                       detail::tvec3<T> v;\r
+                       for(int j = 0; j < 3; ++j)\r
+                               v[j] = m[j][i];\r
+                       result = isNormalized(v, epsilon);\r
+               }\r
+               return result;\r
+       }\r
+\r
+       template<typename T> \r
+       inline bool isNormalized(\r
+               const detail::tmat4x4<T>& m, \r
+               const T epsilon)\r
+       {\r
+               bool result = true;\r
+               for(int i = 0; result && i < 4; ++i)\r
+                       result = isNormalized(m[i], epsilon);\r
+               for(int i = 0; result && i < 4; ++i)\r
+               {\r
+                       detail::tvec4<T> v;\r
+                       for(int j = 0; j < 4; ++j)\r
+                               v[j] = m[j][i];\r
+                       result = isNormalized(v, epsilon);\r
+               }\r
+               return result;\r
+       }\r
+\r
+       template<typename genType> \r
+       inline bool isOrthogonal(\r
+               const genType& m, \r
+               const typename genType::value_type epsilon)\r
+       {\r
+               bool result = true;\r
+               for(int i = 0; result && i < genType::col_size() - 1; ++i)\r
+               for(int j= i + 1; result && j < genType::col_size(); ++j)\r
+                       result = areOrthogonal(m[i], m[j], epsilon);\r
+\r
+               if(result)\r
+               {\r
+                       genType tmp = transpose(m);\r
+                       for(int i = 0; result && i < genType::col_size() - 1 ; ++i)\r
+                       for(int j = i + 1; result && j < genType::col_size(); ++j)\r
+                               result = areOrthogonal(tmp[i], tmp[j], epsilon);\r
+               }\r
+               return result;\r
+       }\r
+\r
+}//namespace matrix_query\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/matrix_selection.hpp b/glm/gtx/matrix_selection.hpp
new file mode 100644 (file)
index 0000000..557c960
--- /dev/null
@@ -0,0 +1,82 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_selection.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matrix_selection\r
+#define glm_gtx_matrix_selection\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_matrix_selection();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_matrix_selection extension: Access to matrix columns or rows.\r
+       namespace matrix_selection\r
+       {\r
+               //! Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the row index.\r
+               //! From GLM_GTX_matrix_selection extension.\r
+               template <typename T> \r
+               detail::tvec2<T> row(\r
+                       const detail::tmat2x2<T>& m, \r
+                       int index);\r
+               \r
+               //! Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the row index.\r
+               //! From GLM_GTX_matrix_selection extension.\r
+               template <typename T> \r
+               detail::tvec3<T> row(\r
+                       const detail::tmat3x3<T>& m, \r
+                       int index);\r
+\r
+               //! Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the row index.\r
+               //! From GLM_GTX_matrix_selection extension.\r
+               template <typename T> \r
+               detail::tvec4<T> row(\r
+                       const detail::tmat4x4<T>& m, \r
+                       int index);\r
+\r
+               //! Returns a 2 components vector that contains the row of the matrix m witch values is the ones of the column index.\r
+               //! From GLM_GTX_matrix_selection extension.\r
+               template <typename T> \r
+               detail::tvec2<T> column(\r
+                       const detail::tmat2x2<T>& m, \r
+                       int index);\r
+\r
+               //! Returns a 3 components vector that contains the row of the matrix m witch values is the ones of the column index.\r
+               //! From GLM_GTX_matrix_selection extension.\r
+               template <typename T> \r
+               detail::tvec3<T> column(\r
+                       const detail::tmat3x3<T>& m, \r
+                       int index);\r
+\r
+               //! Returns a 4 components vector that contains the row of the matrix m witch values is the ones of the column index.\r
+               //! From GLM_GTX_matrix_selection extension.\r
+               template <typename T> \r
+               detail::tvec4<T> column(\r
+                       const detail::tmat4x4<T>& m, \r
+                       int index);\r
+\r
+       }//namespace matrix_selection\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_matrix_selection namespace gtx::matrix_selection\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matrix_selection;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matrix_selection.inl"\r
+\r
+#endif//glm_gtx_matrix_selection\r
diff --git a/glm/gtx/matrix_selection.inl b/glm/gtx/matrix_selection.inl
new file mode 100644 (file)
index 0000000..9d7c1b2
--- /dev/null
@@ -0,0 +1,65 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matrix_selection.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace matrix_selection\r
+{\r
+    template <typename T>\r
+    inline detail::tvec2<T> row(\r
+               const detail::tmat2x2<T>& m, \r
+               int index)\r
+    {\r
+        return detail::tvec2<T>(m[0][index], m[1][index]);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> row(\r
+               const detail::tmat3x3<T>& m, \r
+               int index)\r
+    {\r
+        return detail::tvec3<T>(m[0][index], m[1][index], m[2][index]);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> row(\r
+               const detail::tmat4x4<T>& m, \r
+               int index)\r
+    {\r
+        return detail::tvec4<T>(m[0][index], m[1][index], m[2][index], m[3][index]);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> column(\r
+               const detail::tmat2x2<T>& m, \r
+               int index)\r
+    {\r
+        return m[index];\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> column(\r
+               const detail::tmat3x3<T>& m, \r
+               int index)\r
+    {\r
+        return m[index];\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> column(\r
+               const detail::tmat4x4<T>& m, \r
+               int index)\r
+    {\r
+        return m[index];\r
+    }\r
+\r
+}//namespace matrix_selection\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
diff --git a/glm/gtx/matx.hpp b/glm/gtx/matx.hpp
new file mode 100644 (file)
index 0000000..ed3a048
--- /dev/null
@@ -0,0 +1,182 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-02-21\r
+// Updated : 2007-03-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matx.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_vecx\r
+// - GLM_GTX_matrix_selection\r
+// - GLM_GTX_matrix_access\r
+// - GLM_GTX_inverse_transpose\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_matx\r
+#define glm_gtx_matx\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/vecx.hpp"\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+    template <int N, typename T = float> \r
+       class _xmatxGTX\r
+    {\r
+    private:\r
+        // Data\r
+        _xvecxGTX<N, T> value[N];\r
+\r
+    public:\r
+        _xmatxGTX<N, T> _inverse() const;\r
+\r
+    public:\r
+               typedef T value_type;\r
+               typedef int size_type;\r
+               static const size_type value_size;\r
+\r
+        // Constructors\r
+        _xmatxGTX();\r
+        explicit _xmatxGTX(const T x);\r
+\r
+        // Accesses\r
+        _xvecxGTX<N, T>& operator[](int i) {return value[i];}\r
+        const _xvecxGTX<N, T> & operator[](int i) const {return value[i];}\r
+        operator T*() {return &value[0][0];}\r
+        operator const T*() const {return &value[0][0];}\r
+\r
+        // Unary updatable operators\r
+        _xmatxGTX<N, T>& operator=  (const _xmatxGTX<N, T>& m);\r
+        _xmatxGTX<N, T>& operator+= (const T s);\r
+        _xmatxGTX<N, T>& operator+= (const _xmatxGTX<N, T>& m);\r
+        _xmatxGTX<N, T>& operator-= (const T s);\r
+        _xmatxGTX<N, T>& operator-= (const _xmatxGTX<N, T>& m);\r
+        _xmatxGTX<N, T>& operator*= (const T s);\r
+        _xmatxGTX<N, T>& operator*= (const _xmatxGTX<N, T>& m);\r
+        _xmatxGTX<N, T>& operator/= (const T s);\r
+        _xmatxGTX<N, T>& operator/= (const _xmatxGTX<N, T>& m);\r
+        _xmatxGTX<N, T>& operator++ ();\r
+        _xmatxGTX<N, T>& operator-- ();\r
+    };\r
+\r
+       // Binary operators\r
+    template <int N, typename T>\r
+    _xmatxGTX<N, T> operator+ (const _xmatxGTX<N, T>& m, const T s);\r
+\r
+    template <int N, typename T> \r
+    _xmatxGTX<N, T> operator+ (const T s, const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T>\r
+    _xvecxGTX<N, T> operator+ (const _xmatxGTX<N, T>& m, const _xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    _xvecxGTX<N, T> operator+ (const _xvecxGTX<N, T>& v, const _xmatxGTX<N, T>& m);\r
\r
+    template <int N, typename T> \r
+    _xmatxGTX<N, T> operator+ (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2);\r
+    \r
+    template <int N, typename T> \r
+    _xmatxGTX<N, T> operator- (const _xmatxGTX<N, T>& m, const T s);\r
+\r
+    template <int N, typename T> \r
+    _xmatxGTX<N, T> operator- (const T s, const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T> \r
+    _xvecxGTX<N, T> operator- (const _xmatxGTX<N, T>& m, const _xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T> \r
+    _xvecxGTX<N, T> operator- (const _xvecxGTX<N, T>& v, const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T>\r
+    _xmatxGTX<N, T> operator- (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2);\r
+\r
+    template <int N, typename T> \r
+    _xmatxGTX<N, T> operator* (const _xmatxGTX<N, T>& m, const T s);\r
+\r
+    template <int N, typename T>\r
+    _xmatxGTX<N, T> operator* (const T s, const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T>\r
+    _xvecxGTX<N, T> operator* (const _xmatxGTX<N, T>& m, const _xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    _xvecxGTX<N, T> operator* (const _xvecxGTX<N, T>& v, const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T>\r
+    _xmatxGTX<N, T> operator* (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2);\r
+\r
+    template <int N, typename T>\r
+    _xmatxGTX<N, T> operator/ (const _xmatxGTX<N, T>& m, const T s);\r
+\r
+    template <int N, typename T>\r
+    _xmatxGTX<N, T> operator/ (const T s, const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T>\r
+    _xvecxGTX<N, T> operator/ (const _xmatxGTX<N, T>& m, const _xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    _xvecxGTX<N, T> operator/ (const _xvecxGTX<N, T>& v, const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T>\r
+    _xmatxGTX<N, T> operator/ (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2);\r
+\r
+       // Unary constant operators\r
+    template <int N, typename T>\r
+    const _xmatxGTX<N, T> operator- (const _xmatxGTX<N, T>& m);\r
+\r
+    template <int N, typename T>\r
+    const _xmatxGTX<N, T> operator-- (const _xmatxGTX<N, T>& m, int);\r
+\r
+    template <int N, typename T>\r
+    const _xmatxGTX<N, T> operator++ (const _xmatxGTX<N, T>& m, int);\r
+\r
+}//namespace detail\r
+\r
+       // Extension functions\r
+       template <int N, typename T> detail::_xmatxGTX<N, T> matrixCompMultGTX(const detail::_xmatxGTX<N, T>& x, const detail::_xmatxGTX<N, T>& y);\r
+       template <int N, typename T> detail::_xmatxGTX<N, T> outerProductGTX(const detail::_xvecxGTX<N, T>& c, const detail::_xvecxGTX<N, T>& r);\r
+       template <int N, typename T> detail::_xmatxGTX<N, T> transposeGTX(const detail::_xmatxGTX<N, T>& x);\r
+       \r
+       template <int N, typename T> T determinantGTX(const detail::_xmatxGTX<N, T>& m);\r
+       template <int N, typename T> detail::_xmatxGTX<N, T> inverseTransposeGTX(const detail::_xmatxGTX<N, T> & m);\r
+\r
+       template <int N, typename T> void columnGTX(detail::_xmatxGTX<N, T>& m, int ColIndex, const detail::_xvecxGTX<N, T>& v);\r
+       template <int N, typename T> void rowGTX(detail::_xmatxGTX<N, T>& m, int RowIndex, const detail::_xvecxGTX<N, T>& v);\r
+\r
+       template <int N, typename T> detail::_xvecxGTX<N, T> columnGTX(const detail::_xmatxGTX<N, T>& m, int ColIndex);\r
+       template <int N, typename T> detail::_xvecxGTX<N, T> rowGTX(const detail::_xmatxGTX<N, T>& m, int RowIndex);\r
+\r
+    namespace gtx\r
+    {\r
+               //! GLM_GTX_matx extension: - Work in progress - NxN matrix types.\r
+        namespace matx\r
+        {\r
+               // Matrix Functions\r
+               template <int N, typename T> inline detail::_xmatxGTX<N, T> matrixCompMult(const detail::_xmatxGTX<N, T>& x, const detail::_xmatxGTX<N, T>& y){return matrixCompMult(x, y);}\r
+               template <int N, typename T> inline detail::_xmatxGTX<N, T> outerProduct(const detail::_xvecxGTX<N, T>& c, const detail::_xvecxGTX<N, T>& r){return outerProductGTX(c, r);}\r
+               template <int N, typename T> inline detail::_xmatxGTX<N, T> transpose(const detail::_xmatxGTX<N, T>& x){return transposeGTX(x);}\r
+               \r
+               template <int N, typename T> inline T determinant(const detail::_xmatxGTX<N, T>& m){return determinantGTX(m);}\r
+               template <int N, typename T> inline detail::_xmatxGTX<N, T> inverseTranspose(const detail::_xmatxGTX<N, T>& m){return inverseTransposeGTX(m);}\r
+\r
+               template <int N, typename T> inline void column(detail::_xmatxGTX<N, T>& m, int ColIndex, const detail::_xvecxGTX<N, T>& v){setColumnGTX(m, v);}\r
+               template <int N, typename T> inline void row(detail::_xmatxGTX<N, T>& m, int RowIndex, const detail::_xvecxGTX<N, T>& v){setRowGTX(m, v);}\r
+\r
+               template <int N, typename T> inline detail::_xvecxGTX<N, T> column(const detail::_xmatxGTX<N, T>& m, int ColIndex){return column(m, ColIndex);}\r
+               template <int N, typename T> inline detail::_xvecxGTX<N, T> row(const detail::_xmatxGTX<N, T>& m, int RowIndex){return row(m, RowIndex);}\r
+        }\r
+    }\r
+}\r
+\r
+#define GLM_GTX_matx namespace gtx::matx\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_matx;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "matx.inl"\r
+\r
+#endif//glm_gtx_matx\r
diff --git a/glm/gtx/matx.inl b/glm/gtx/matx.inl
new file mode 100644 (file)
index 0000000..70954a9
--- /dev/null
@@ -0,0 +1,479 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-02-21\r
+// Updated : 2007-02-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/matx.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <cassert>\r
+#include <algorithm>\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <int N, typename T> const typename _xmatxGTX<N, T>::size_type _xmatxGTX<N, T>::value_size = N;\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // _xmatxGTX constructors\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>::_xmatxGTX()\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i][i] = T(0);\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>::_xmatxGTX(const T f)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i][i] = f;\r
+    }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // _xmatxGTX operators\r
+\r
+    // This function shouldn't required but it seems that VC7.1 have an optimisation bug if this operator wasn't declared\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator= (const _xmatxGTX<N, T>& m)\r
+    {\r
+        //memcpy could be faster\r
+        //memcpy(&this->value, &m.value, 16 * sizeof(T));\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i] = m[i];\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator+= (const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i] += s;\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator+= (const _xmatxGTX<N, T>& m)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i] += m[i];\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator-= (const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i] -= s;\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator-= (const _xmatxGTX<N, T>& m)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i] -= m[i];\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator*= (const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i] *= s;\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator*= (const _xmatxGTX<N, T>& m)\r
+    {\r
+        return (*this = *this * m);\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator/= (const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->value[i] /= s;\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator/= (const _xmatxGTX<N, T>& m)\r
+    {\r
+        return (*this = *this / m);\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator-- ()\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       --this->value[i];\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T>& _xmatxGTX<N, T>::operator++ ()\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+                       ++this->value[i];\r
+        return *this;\r
+    }\r
+\r
+    // Private functions\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> _xmatxGTX<N, T>::_inverse() const\r
+    {\r
+               _xmatxGTX<N, T> Result = *this;\r
+\r
+               int ColIndex[N];\r
+               int RowIndex[N];\r
+               bool Pivoted[N];\r
+               memset(ColIndex, 0, N * sizeof(int));\r
+               memset(RowIndex, 0, N * sizeof(int));\r
+               memset(Pivoted, 0, N * sizeof(bool));\r
+\r
+               int iRow = 0, iCol = 0;\r
+\r
+               // elimination by full pivoting\r
+               for(int i0 = 0; i0 < N; i0++)\r
+               {\r
+                       // search matrix (excluding pivoted rows) for maximum absolute entry\r
+                       T fMax = T(0);\r
+                       for(int i1 = 0; i1 < N; i1++)\r
+                       {\r
+                               if(Pivoted[i1])\r
+                                       continue;\r
+\r
+                               for(int i2 = 0; i2 < N; i2++)\r
+                               {\r
+                                       if(Pivoted[i2])\r
+                                               continue;\r
+                                               \r
+                                       T Abs = abs(Result[i1][i2]);\r
+                                       if(Abs > fMax)\r
+                                       {\r
+                                               fMax = Abs;\r
+                                               iRow = i1;\r
+                                               iCol = i2;\r
+                                       }\r
+                               }\r
+                       }\r
+\r
+                       if(fMax == T(0))\r
+                       {\r
+                               return _xmatxGTX<N, T>(1.0f); // Error\r
+                       }\r
+\r
+                       Pivoted[iCol] = true;\r
+\r
+                       // swap rows so that A[iCol][iCol] contains the pivot entry\r
+                       if(iRow != iCol)\r
+                       {\r
+                               _xvecxGTX<N, T> Row = rowGTX(Result, iRow);\r
+                               _xvecxGTX<N, T> Col = rowGTX(Result, iCol);\r
+                               rowGTX(Result, iRow, Col);\r
+                               rowGTX(Result, iCol, Row);\r
+                       }\r
+\r
+                       // keep track of the permutations of the rows\r
+                       RowIndex[i0] = iRow;\r
+                       ColIndex[i0] = iCol;\r
+\r
+                       // scale the row so that the pivot entry is 1\r
+                       T fInv = T(1) / Result[iCol][iCol];\r
+                       Result[iCol][iCol] = T(1);\r
+                       for(int i2 = 0; i2 < N; i2++)\r
+                               Result[iCol][i2] *= fInv;\r
+\r
+                       // zero out the pivot column locations in the other rows\r
+                       for(int i1 = 0; i1 < N; ++i1)\r
+                       {\r
+                               if(i1 == iCol)\r
+                                       continue;\r
+\r
+                               T Tmp = Result[i1][iCol];\r
+                               Result[i1][iCol] = T(0);\r
+                               for(int i2 = 0; i2 < N; i2++)\r
+                                       Result[i1][i2] -= Result[iCol][i2] * Tmp;\r
+                       }\r
+               }\r
+\r
+               // reorder rows so that A[][] stores the inverse of the original matrix\r
+               for(int i1 = N-1; i1 >= 0; --i1)\r
+               {\r
+                       if(RowIndex[i1] == ColIndex[i1])\r
+                               continue;\r
+                       for(int i2 = 0; i2 < N; ++i2)\r
+                               std::swap(Result[i2][RowIndex[i1]], Result[i2][ColIndex[i1]]);\r
+               }\r
+\r
+               return Result;\r
+    }\r
+\r
+       // Binary operators\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator+ (const _xmatxGTX<N, T>& m, const T s)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m[i] + s;\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator+ (const T s, const _xmatxGTX<N, T>& m)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = s + m[i];\r
+               return result;\r
+    }\r
+/*\r
+    template <int N, typename T>\r
+    inline tvec4<T> operator+ (const _xmatxGTX<N, T>& m, const tvec4<T>& v)\r
+    {\r
+\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline tvec4<T> operator+ (const tvec4<T>& v, const _xmatxGTX<N, T>& m)\r
+    {\r
+\r
+    }\r
+*/\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator+ (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m1[i] + m2[i];\r
+               return result;\r
+    }\r
+    \r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator- (const _xmatxGTX<N, T>& m, const T s)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m[i] - s;\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator- (const T s, const _xmatxGTX<N, T>& m)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = s - m[i];\r
+               return result;\r
+    }\r
+/*\r
+    template <int N, typename T>\r
+    inline tvec4<T> operator- (const _xmatxGTX<N, T>& m, const tvec4<T>& v)\r
+    {\r
+\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline tvec4<T> operator- (const tvec4<T>& v, const _xmatxGTX<N, T>& m)\r
+    {\r
+\r
+    }\r
+*/\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator- (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m1[i] - m2[i];\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator* (const _xmatxGTX<N, T>& m, const T s)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m[i] * s;\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator* (const T s, const _xmatxGTX<N, T>& m)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = s * m[i];\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xvecxGTX<N, T> operator* (const _xmatxGTX<N, T>& m, const _xvecxGTX<N, T>& v)\r
+    {\r
+               _xvecxGTX<N, T> result(T(0));\r
+               for(int j = 0; j < N; ++j)\r
+               for(int i = 0; i < N; ++i)\r
+                       result[j] += m[i][j] * v[i];\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xvecxGTX<N, T> operator* (const _xvecxGTX<N, T>& v, const _xmatxGTX<N, T>& m)\r
+    {\r
+               _xvecxGTX<N, T> result(T(0));\r
+               for(int j = 0; j < N; ++j)\r
+               for(int i = 0; i < N; ++i)\r
+                       result[j] += m[j][i] * v[i];\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator* (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2)\r
+    {\r
+        _xmatxGTX<N, T> Result(T(0));\r
+               for(int k = 0; k < N; ++k)\r
+               for(int j = 0; j < N; ++j)\r
+               for(int i = 0; i < N; ++i)\r
+                       Result[k][j] += m1[i][j] * m2[k][i];\r
+        return Result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator/ (const _xmatxGTX<N, T>& m, const T s)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m[i] / s;\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator/ (const T s, const _xmatxGTX<N, T>& m)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = s / m[i];\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xvecxGTX<N, T> operator/ (const _xmatxGTX<N, T>& m, const _xvecxGTX<N, T>& v)\r
+    {\r
+        return m._inverse() * v;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xvecxGTX<N, T> operator/ (const _xvecxGTX<N, T>& v, const _xmatxGTX<N, T>& m)\r
+    {\r
+        return v * m._inverse();\r
+    }\r
\r
+    template <int N, typename T>\r
+    inline _xmatxGTX<N, T> operator/ (const _xmatxGTX<N, T>& m1, const _xmatxGTX<N, T>& m2)\r
+    {\r
+        return m1 * m2._inverse();\r
+    }\r
+\r
+       // Unary constant operators\r
+    template <int N, typename T>\r
+    inline const _xmatxGTX<N, T> operator- (const _xmatxGTX<N, T>& m)\r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = -m[i];\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline const _xmatxGTX<N, T> operator++ (const _xmatxGTX<N, T>& m, int) \r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m[i] + T(1);\r
+               return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline const _xmatxGTX<N, T> operator-- (const _xmatxGTX<N, T>& m, int) \r
+    {\r
+               _xmatxGTX<N, T> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = m[i] - T(1);\r
+               return result;\r
+    }\r
+}//namespace detail\r
+\r
+       // Matrix Functions\r
+       template <int N, typename T> \r
+       inline detail::_xmatxGTX<N, T> matrixCompMultGTX(const detail::_xmatxGTX<N, T>& x, const detail::_xmatxGTX<N, T>& y)\r
+       {\r
+        detail::_xmatxGTX<N, T> result;\r
+        for(int j = 0; j < N; ++j)\r
+            for(int i = 0; i < N; ++i)\r
+                result[j][i] = x[j][i] * y[j][i];\r
+        return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       inline detail::_xmatxGTX<N, T> outerProductGTX(const detail::_xvecxGTX<N, T>& c, const detail::_xvecxGTX<N, T>& r)\r
+       {\r
+               detail::_xmatxGTX<N, T> result;\r
+               for(int j = 0; j < N; ++j)\r
+               for(int i = 0; i < N; ++i)\r
+                       result[j][i] = c[i] * r[j];\r
+        return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       inline detail::_xmatxGTX<N, T> transposeGTX(const detail::_xmatxGTX<N, T>& m)\r
+       {\r
+        detail::_xmatxGTX<N, T> result;\r
+               for(int j = 0; j < N; ++j)\r
+               for(int i = 0; i < N; ++i)\r
+                       result[j][i] = m[i][j];\r
+               return result;\r
+       }\r
+\r
+    template <int N, typename T>\r
+    inline T determinantGTX(const detail::_xmatxGTX<N, T>& m)\r
+    {\r
+\r
+    }\r
+\r
+       template <int N, typename T> \r
+       inline detail::_xmatxGTX<N, T> inverseTransposeGTX(const detail::_xmatxGTX<N, T>& m)\r
+       {\r
+               \r
+       }\r
+\r
+       template <int N, typename T> \r
+       inline void columnGTX(detail::_xmatxGTX<N, T>& m, int ColIndex, const detail::_xvecxGTX<N, T>& v)\r
+       {\r
+               m[ColIndex] = v;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       inline void rowGTX(detail::_xmatxGTX<N, T>& m, int RowIndex, const detail::_xvecxGTX<N, T>& v)\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+                       m[i][RowIndex] = v[i];\r
+       }\r
+\r
+       template <int N, typename T> \r
+       inline detail::_xvecxGTX<N, T> columnGTX(const detail::_xmatxGTX<N, T>& m, int ColIndex)\r
+       {\r
+               return m[ColIndex];\r
+       }\r
+\r
+       template <int N, typename T> \r
+       inline detail::_xvecxGTX<N, T> rowGTX(const detail::_xmatxGTX<N, T>& m, int RowIndex)\r
+       {\r
+               detail::_xvecxGTX<N, T> v;\r
+               for(int i = 0; i < N; ++i)\r
+                       v[i] = m[i][RowIndex];\r
+               return v;\r
+       }\r
+} //namespace glm\r
diff --git a/glm/gtx/mixed_product.hpp b/glm/gtx/mixed_product.hpp
new file mode 100644 (file)
index 0000000..4080499
--- /dev/null
@@ -0,0 +1,46 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-04-03\r
+// Updated : 2008-09-17\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/mixed_product.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_mixed_product\r
+#define glm_gtx_mixed_product\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_matrix_selection();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_mixed_product extension: Mixed product of 3 vectors.\r
+       namespace mixed_product\r
+       {\r
+               //! \brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension)\r
+               template <typename valType> \r
+               valType mixedProduct(\r
+                       detail::tvec3<valType> const & v1, \r
+                       detail::tvec3<valType> const & v2, \r
+                       detail::tvec3<valType> const & v3);\r
+       }//namespace mixed_product\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_mixed_product namespace gtx::mixed_product\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_mixed_product;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "mixed_product.inl"\r
+\r
+#endif//glm_gtx_mixed_product\r
diff --git a/glm/gtx/mixed_product.inl b/glm/gtx/mixed_product.inl
new file mode 100644 (file)
index 0000000..06acce5
--- /dev/null
@@ -0,0 +1,36 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-04-03\r
+// Updated : 2008-09-17\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/mixed_product.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+\r
+namespace mixed_product\r
+{\r
+    template <typename valType> \r
+       inline valType mixedProduct(\r
+               detail::tvec3<valType> const & v1, \r
+               detail::tvec3<valType> const & v2, \r
+               detail::tvec3<valType> const & v3)\r
+       {\r
+               return dot(cross(v1, v2), v3);\r
+       }\r
+}\r
+//namespace mixed_product\r
+\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/glm/gtx/norm.hpp b/glm/gtx/norm.hpp
new file mode 100644 (file)
index 0000000..10bfc2b
--- /dev/null
@@ -0,0 +1,146 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-07-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/norm.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_quaternion\r
+// - GLM_GTC_double_float\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// ToDo:\r
+// - Study the validity of the notion of length2 to quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_norm\r
+#define glm_gtx_norm\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/double_float.hpp"\r
+#include "../gtx/quaternion.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_norm();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_norm extension: Varius way to compute vector norms.\r
+       namespace norm\r
+       {\r
+               //! Returns the squared length of x.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T length2(\r
+                       const T x);\r
+\r
+               //! Returns the squared length of x.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T length2(\r
+                       const detail::tvec2<T> & x);\r
+\r
+               //! Returns the squared length of x.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T>\r
+               T length2(\r
+                       const detail::tvec3<T>& x);\r
+               \r
+               //! Returns the squared length of x.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T length2(\r
+                       const detail::tvec4<T>& x);\r
+               \r
+               //! Returns the squared length of x.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T>\r
+               T length2(\r
+                       const detail::tquat<T>& q);\r
+\r
+               //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T>\r
+               T distance2(\r
+                       const T p0, \r
+                       const T p1);\r
+               \r
+               //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T distance2(\r
+                       const detail::tvec2<T>& p0, \r
+                       const detail::tvec2<T>& p1);\r
+\r
+               //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T>\r
+               T distance2(\r
+                       const detail::tvec3<T>& p0,\r
+                       const detail::tvec3<T>& p1);\r
+\r
+               //! Returns the squared distance between p0 and p1, i.e., length(p0 - p1).\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T>\r
+               T distance2(\r
+                       const detail::tvec4<T>& p0, \r
+                       const detail::tvec4<T>& p1);\r
+\r
+               //! Returns the L1 norm between x and y.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T>\r
+               T l1Norm(\r
+                       const detail::tvec3<T>& x,\r
+                       const detail::tvec3<T>& y);\r
+               \r
+               //! Returns the L1 norm of v.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T l1Norm(\r
+                       const detail::tvec3<T>& v);\r
+               \r
+               //! Returns the L2 norm between x and y.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T l2Norm(\r
+                       const detail::tvec3<T>& x, \r
+                       const detail::tvec3<T>& y);\r
+               \r
+               //! Returns the L2 norm of v.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T l2Norm(\r
+                       const detail::tvec3<T>& x);\r
+               \r
+               //! Returns the L norm between x and y.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T> \r
+               T lxNorm(\r
+                       const detail::tvec3<T>& x,\r
+                       const detail::tvec3<T>& y,\r
+                       unsigned int Depth);\r
+\r
+               //! Returns the L norm of v.\r
+               //! From GLM_GTX_norm extension.\r
+               template <typename T>\r
+               T lxNorm(\r
+                       const detail::tvec3<T>& x,\r
+                       unsigned int Depth);\r
+\r
+       }//namespace norm\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_norm namespace gtx::norm\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_norm;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "norm.inl"\r
+\r
+#endif//glm_gtx_norm\r
diff --git a/glm/gtx/norm.inl b/glm/gtx/norm.inl
new file mode 100644 (file)
index 0000000..f01c16c
--- /dev/null
@@ -0,0 +1,130 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-07-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/norm.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace norm\r
+{\r
+       template <typename T>\r
+    inline T length2(\r
+               const T x)\r
+    {\r
+        return x * x;\r
+    }\r
+\r
+    template <typename T>\r
+    inline T length2(\r
+               const detail::tvec2<T>& x)\r
+    {\r
+        return dot(x, x);\r
+    }\r
+\r
+    template <typename T>\r
+    inline T length2(\r
+               const detail::tvec3<T>& x)\r
+    {\r
+        return dot(x, x);\r
+    }\r
+\r
+    template <typename T>\r
+    inline T length2(\r
+               const detail::tvec4<T>& x)\r
+    {\r
+        return dot(x, x);\r
+    }\r
+\r
+    template <typename T> \r
+    inline T length2(\r
+               const detail::tquat<T>& q)\r
+    {\r
+        return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;\r
+    }\r
+\r
+    template <typename T> \r
+       T distance2(\r
+               const T p0, \r
+               const T p1)\r
+       {\r
+               return length2(p1 - p0);\r
+       }\r
+\r
+    template <typename T> \r
+       T distance2(\r
+               const detail::tvec2<T>& p0, \r
+               const detail::tvec2<T>& p1)\r
+       {\r
+               return length2(p1 - p0);\r
+       }\r
+\r
+    template <typename T> \r
+       T distance2(\r
+               const detail::tvec3<T>& p0, \r
+               const detail::tvec3<T>& p1)\r
+       {\r
+               return length2(p1 - p0);\r
+       }\r
+\r
+    template <typename T>\r
+       T distance2(\r
+               const detail::tvec4<T>& p0, \r
+               const detail::tvec4<T>& p1)\r
+       {\r
+               return length2(p1 - p0);\r
+       }\r
+\r
+    template <typename T> \r
+    inline T l1Norm(\r
+               const detail::tvec3<T>& a, \r
+               const detail::tvec3<T>& b)\r
+    {\r
+        return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z);\r
+    }\r
+\r
+    template <typename T> \r
+    inline T l1Norm(\r
+               const detail::tvec3<T>& v)\r
+    {\r
+        return abs(v.x) + abs(v.y) + abs(v.z);\r
+    }\r
+\r
+    template <typename T> \r
+    inline T l2Norm(\r
+               const detail::tvec3<T>& a, \r
+               const detail::tvec3<T>& b)\r
+    {\r
+        return length(b - a);\r
+    }\r
+\r
+    template <typename T> \r
+    inline T l2Norm(\r
+               const detail::tvec3<T>& v)\r
+    {\r
+        return length(v);\r
+    }\r
+\r
+       template <typename T> \r
+       inline T lxNorm(\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<T>& y, \r
+               unsigned int Depth)\r
+       {\r
+               return pow(pow(y.x - x.x, T(Depth)) + pow(y.y - x.y, T(Depth)) + pow(y.z - x.z, T(Depth)), T(1) / T(Depth));\r
+       }\r
+\r
+       template <typename T> \r
+       inline T lxNorm(\r
+               const detail::tvec3<T>& v, \r
+               unsigned int Depth)\r
+       {\r
+               return pow(pow(v.x, T(Depth)) + pow(v.y, T(Depth)) + pow(v.z, T(Depth)), T(1) / T(Depth));\r
+       }\r
+\r
+}//namespace norm\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/normal.hpp b/glm/gtx/normal.hpp
new file mode 100644 (file)
index 0000000..6c9eeec
--- /dev/null
@@ -0,0 +1,48 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/normal.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_normal\r
+#define glm_gtx_normal\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_normal();\r
+       }//namespace test\r
+       \r
+       namespace gtx{\r
+       //! GLM_GTX_normal extension: Compute the normal of a triangle.\r
+    namespace normal\r
+    {\r
+               //! Computes triangle normal from triangle points. \r
+               //! From GLM_GTX_normal extension.\r
+        template <typename T> \r
+               detail::tvec3<T> triangleNormal(\r
+                       detail::tvec3<T> const & p1, \r
+                       detail::tvec3<T> const & p2, \r
+                       detail::tvec3<T> const & p3);\r
+\r
+    }//namespace normal\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_normal namespace gtx::normal\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_normal;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "normal.inl"\r
+\r
+#endif//glm_gtx_normal\r
diff --git a/glm/gtx/normal.inl b/glm/gtx/normal.inl
new file mode 100644 (file)
index 0000000..630d5df
--- /dev/null
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2005-12-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/normal.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace normal{\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> triangleNormal\r
+       (\r
+               detail::tvec3<T> const & p1, \r
+               detail::tvec3<T> const & p2, \r
+               detail::tvec3<T> const & p3\r
+       )\r
+    {\r
+        return normalize(cross(p1 - p2, p1 - p3));\r
+    }\r
+\r
+}//namespace normal\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/normalize_dot.hpp b/glm/gtx/normalize_dot.hpp
new file mode 100644 (file)
index 0000000..1db3aea
--- /dev/null
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+//////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-09-28\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/normalize_dot.h\r
+//////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_fast_square_root\r
+//////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_normalize_dot\r
+#define glm_gtx_normalize_dot\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/fast_square_root.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root.\r
+       namespace normalize_dot\r
+       {\r
+               //! Normalize parameters and returns the dot product of x and y.\r
+               //! It's faster that dot(normalize(x), normalize(y)).\r
+               //! From GLM_GTX_normalize_dot extension.\r
+               template <typename genType> \r
+               typename genType::value_type normalizeDot(\r
+                       genType const & x, \r
+                       genType const & y);\r
+\r
+               //! Normalize parameters and returns the dot product of x and y.\r
+               //! Faster that dot(fastNormalize(x), fastNormalize(y)).\r
+               //! From GLM_GTX_normalize_dot extension.\r
+               template <typename genType> \r
+               typename genType::value_type fastNormalizeDot(\r
+                       genType const & x, \r
+                       genType const & y);\r
+\r
+       }//namespace normalize_dot\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_normalize_dot namespace gtx::fast_square_root; using namespace gtx::normalize_dot\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_normalize_dot;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "normalize_dot.inl"\r
+\r
+#endif//glm_gtx_normalize_dot\r
diff --git a/glm/gtx/normalize_dot.inl b/glm/gtx/normalize_dot.inl
new file mode 100644 (file)
index 0000000..5f0527e
--- /dev/null
@@ -0,0 +1,120 @@
+//////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+//////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-09-28\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/normalize_dot.inl\r
+//////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace normalize_dot{\r
+\r
+template <typename genType> \r
+inline genType normalizeDot\r
+(\r
+       genType const & x, \r
+       genType const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::inversesqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+template <typename valType> \r
+inline valType normalizeDot\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::inversesqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+template <typename valType> \r
+inline valType normalizeDot\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::inversesqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+template <typename valType> \r
+inline valType normalizeDot\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::inversesqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+template <typename genType> \r
+inline genType fastNormalizeDot\r
+(\r
+       genType const & x, \r
+       genType const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+template <typename valType> \r
+inline valType fastNormalizeDot\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+template <typename valType> \r
+inline valType fastNormalizeDot\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+template <typename valType> \r
+inline valType fastNormalizeDot\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y\r
+)\r
+{\r
+       return \r
+               glm::dot(x, y) * \r
+               glm::gtx::fast_square_root::fastInverseSqrt(glm::dot(x, x) * \r
+               glm::dot(y, y));\r
+}\r
+\r
+}//namespace normalize_dot\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/number_precision.hpp b/glm/gtx/number_precision.hpp
new file mode 100644 (file)
index 0000000..40b3916
--- /dev/null
@@ -0,0 +1,65 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-05-10\r
+// Updated : 2009-06-04\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/number_precision.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_type_precision\r
+// - GLM_GTC_quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_number_precision\r
+#define glm_gtx_number_precision\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/type_precision.hpp"\r
+\r
+namespace glm{\r
+namespace gtx{\r
+//! GLM_GTX_number_precision extension: Defined size types.\r
+namespace number_precision\r
+{\r
+       using namespace gtc::type_precision;\r
+\r
+       /////////////////////////////\r
+       // Unsigned int vector types \r
+\r
+       typedef u8                      u8vec1;         //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension)\r
+       typedef u16                     u16vec1;    //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension)\r
+       typedef u32                     u32vec1;    //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension)\r
+       typedef u64                     u64vec1;    //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension)\r
+\r
+       //////////////////////\r
+       // Float vector types \r
+\r
+       typedef f16                     f16vec1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+       typedef f32                     f32vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+       typedef f64                     f64vec1;    //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+\r
+       //////////////////////\r
+       // Float matrix types \r
+\r
+       typedef f16                     f16mat1;    //!< \brief Half-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+       typedef f16                     f16mat1x1;      //!< \brief Half-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+       typedef f32                     f32mat1;        //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+       typedef f32                     f32mat1x1;      //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+       typedef f64                     f64mat1;        //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+       typedef f64                     f64mat1x1;      //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension)\r
+\r
+}//namespace number_precision\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_number_precision namespace gtx::number_precision\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_number_precision;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "number_precision.inl"\r
+\r
+#endif//glm_gtx_number_precision\r
diff --git a/glm/gtx/number_precision.inl b/glm/gtx/number_precision.inl
new file mode 100644 (file)
index 0000000..37b9419
--- /dev/null
@@ -0,0 +1,13 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-05-10\r
+// Updated : 2007-05-10\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/number_precision.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+\r
+}\r
diff --git a/glm/gtx/ocl_type.hpp b/glm/gtx/ocl_type.hpp
new file mode 100644 (file)
index 0000000..c7814c9
--- /dev/null
@@ -0,0 +1,106 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-07\r
+// Updated : 2009-05-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/number_precision.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_ocl_type\r
+#define glm_gtx_ocl_type\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm{\r
+namespace gtx{\r
+//! GLM_GTX_ocl_type extension: OpenCL types.\r
+namespace ocl_type\r
+{\r
+       ///////////////////////////\r
+       // Scalar types \r
+\r
+       typedef detail::int8                                            cl_char;                //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::int16                                           cl_short;               //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::int32                                           cl_int;                 //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::int64                                           cl_long;                //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       typedef detail::uint8                                           cl_uchar;               //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::uint16                                          cl_ushort;              //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::uint32                                          cl_uint;                //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::uint64                                          cl_ulong;               //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       typedef detail::float16                                         cl_half;        //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::float32                                         cl_float;       //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+\r
+\r
+       typedef detail::int8                                            cl_char1;               //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::int16                                           cl_short1;              //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::int32                                           cl_int1;                        //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::int64                                           cl_long1;               //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       typedef detail::uint8                                           cl_uchar1;              //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::uint16                                          cl_ushort1;             //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::uint32                                          cl_uint1;               //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::uint64                                          cl_ulong1;              //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       //typedef detail::float16                                               cl_half1;       //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::float32                                         cl_float1;      //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+\r
+\r
+       typedef detail::tvec2<detail::int8>                     cl_char2;               //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec2<detail::int16>            cl_short2;              //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec2<detail::int32>            cl_int2;                        //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec2<detail::int64>            cl_long2;               //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       typedef detail::tvec2<detail::uint8>            cl_uchar2;              //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec2<detail::uint16>           cl_ushort2;             //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec2<detail::uint32>           cl_uint2;               //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec2<detail::uint64>           cl_ulong2;              //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       //typedef detail::tvec2<detail::float16>                cl_half2;       //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec2<detail::float32>          cl_float2;      //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+\r
+\r
+       typedef detail::tvec3<detail::int8>                     cl_char3;               //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec3<detail::int16>            cl_short3;              //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec3<detail::int32>            cl_int3;                        //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec3<detail::int64>            cl_long3;               //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       typedef detail::tvec3<detail::uint8>            cl_uchar3;              //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec3<detail::uint16>           cl_ushort3;             //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec3<detail::uint32>           cl_uint3;               //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec3<detail::uint64>           cl_ulong3;              //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       //typedef detail::tvec3<detail::float16>                cl_half3;       //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec3<detail::float32>          cl_float3;      //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+\r
+\r
+       typedef detail::tvec4<detail::int8>                     cl_char4;               //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::int16>            cl_short4;              //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::int32>            cl_int4;                        //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::int64>            cl_long4;               //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::uint8>            cl_uchar4;              //!< \brief 8bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::uint16>           cl_ushort4;             //!< \brief 16bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::uint32>           cl_uint4;               //!< \brief 32bit signed integer. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::uint64>           cl_ulong4;              //!< \brief 64bit signed integer. (from GLM_GTX_ocl_type extension)\r
+\r
+       //typedef detail::tvec4<detail::float16>                cl_half4;       //!< \brief Half-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+       typedef detail::tvec4<detail::float32>          cl_float4;      //!< \brief Single-precision floating-point scalar. (from GLM_GTX_ocl_type extension)\r
+\r
+}//namespace ocl_type\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_ocl_type               namespace gtx::ocl_type;\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_ocl_type;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "ocl_type.inl"\r
+\r
+#endif//glm_gtx_ocl_type\r
diff --git a/glm/gtx/ocl_type.inl b/glm/gtx/ocl_type.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtx/optimum_pow.hpp b/glm/gtx/optimum_pow.hpp
new file mode 100644 (file)
index 0000000..31af92e
--- /dev/null
@@ -0,0 +1,71 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/optimum_pow.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_optimum_pow\r
+#define glm_gtx_optimum_pow\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_optimum_pow();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_optimum_pow extension: Integer exponenciation of power functions.\r
+    namespace optimum_pow\r
+    {\r
+               //! Returns x raised to the power of 2.\r
+               //! From GLM_GTX_optimum_pow extension.\r
+        template <typename genType> \r
+               genType pow2(const genType& x);\r
+\r
+               //! Returns x raised to the power of 3.\r
+               //! From GLM_GTX_optimum_pow extension.\r
+        template <typename genType> \r
+               genType pow3(const genType& x);\r
+\r
+               //! Returns x raised to the power of 4.\r
+               //! From GLM_GTX_optimum_pow extension.\r
+               template <typename genType> \r
+               genType pow4(const genType& x);\r
+        \r
+               //! Checks if the parameter is a power of 2 number. \r
+               //! From GLM_GTX_optimum_pow extension.\r
+        bool powOfTwo(int num);\r
+\r
+               //! Checks to determine if the parameter component are power of 2 numbers.\r
+               //! From GLM_GTX_optimum_pow extension.\r
+        detail::tvec2<bool> powOfTwo(const detail::tvec2<int>& x);\r
+\r
+               //! Checks to determine if the parameter component are power of 2 numbers. \r
+               //! From GLM_GTX_optimum_pow extension.\r
+        detail::tvec3<bool> powOfTwo(const detail::tvec3<int>& x);\r
+\r
+               //! Checks to determine if the parameter component are power of 2 numbers. \r
+               //! From GLM_GTX_optimum_pow extension.\r
+        detail::tvec4<bool> powOfTwo(const detail::tvec4<int>& x);\r
+\r
+    }//namespace optimum_pow\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_optimum_pow namespace gtx::optimum_pow\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_optimum_pow;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "optimum_pow.inl"\r
+\r
+#endif//glm_gtx_optimum_pow\r
diff --git a/glm/gtx/optimum_pow.inl b/glm/gtx/optimum_pow.inl
new file mode 100644 (file)
index 0000000..4176a29
--- /dev/null
@@ -0,0 +1,63 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2005-12-27\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/optimum_pow.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace optimum_pow{\r
+\r
+    template <typename genType> \r
+    inline genType pow2(const genType& x)\r
+    {\r
+        return x * x;\r
+    }\r
+\r
+    template <typename genType> \r
+    inline genType pow3(const genType& x)\r
+    {\r
+        return x * x * x;\r
+    }\r
+\r
+    template <typename genType> \r
+    inline genType pow4(const genType& x)\r
+    {\r
+        return x * x * x * x;\r
+    }\r
+\r
+    inline bool powOfTwo(int x)\r
+    {\r
+        return !(x & (x - 1));\r
+    }\r
+\r
+    inline detail::tvec2<bool> powOfTwo(const detail::tvec2<int>& x)\r
+    {\r
+        return detail::tvec2<bool>(\r
+            powOfTwo(x.x),\r
+            powOfTwo(x.y));\r
+    }\r
+\r
+    inline detail::tvec3<bool> powOfTwo(const detail::tvec3<int>& x)\r
+    {\r
+        return detail::tvec3<bool>(\r
+            powOfTwo(x.x),\r
+            powOfTwo(x.y),\r
+            powOfTwo(x.z));\r
+    }\r
+\r
+    inline detail::tvec4<bool> powOfTwo(const detail::tvec4<int>& x)\r
+    {\r
+        return detail::tvec4<bool>(\r
+            powOfTwo(x.x),\r
+            powOfTwo(x.y),\r
+            powOfTwo(x.z),\r
+            powOfTwo(x.w));\r
+    }\r
+\r
+}//namespace optimum_pow\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/orthonormalize.hpp b/glm/gtx/orthonormalize.hpp
new file mode 100644 (file)
index 0000000..e6eda84
--- /dev/null
@@ -0,0 +1,53 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/orthonormalize.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_orthonormalize\r
+#define glm_gtx_orthonormalize\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_orthonormalize();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_orthonormalize extension: Orthonormalize matrices.\r
+    namespace orthonormalize\r
+    {\r
+        //! Returns the orthonormalized matrix of m.\r
+               //! From GLM_GTX_orthonormalize extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> orthonormalize(\r
+                       const detail::tmat3x3<T>& m);\r
+               \r
+        //! Orthonormalizes x according y.\r
+               //! From GLM_GTX_orthonormalize extension.\r
+               template <typename T> \r
+               detail::tvec3<T> orthonormalize(\r
+                       const detail::tvec3<T>& x, \r
+                       const detail::tvec3<T>& y);\r
+\r
+    }//namespace orthonormalize\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_orthonormalize namespace gtx::orthonormalize\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_orthonormalize;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "orthonormalize.inl"\r
+\r
+#endif//glm_gtx_orthonormalize\r
diff --git a/glm/gtx/orthonormalize.inl b/glm/gtx/orthonormalize.inl
new file mode 100644 (file)
index 0000000..bd6857d
--- /dev/null
@@ -0,0 +1,49 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2005-12-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/orthonormalize.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace orthonormalize{\r
+\r
+    template <typename T>\r
+    inline detail::tmat3x3<T> orthonormalize\r
+       (\r
+               const detail::tmat3x3<T>& m\r
+       )\r
+    {\r
+        detail::tmat3x3<T> r = m;\r
+\r
+        r[0] = normalize(r[0]);\r
+\r
+           float d0 = dot(r[0], r[1]);\r
+           r[1] -= r[0] * d0;\r
+           r[1] = normalize(r[1]);\r
+\r
+           float d1 = dot(r[1], r[2]);\r
+           d0 = dot(r[0], r[2]);\r
+           r[2] -= r[0] * d0 + r[1] * d1;\r
+           r[2] = normalize(r[2]);\r
+\r
+        return r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> orthonormalize\r
+       (\r
+               const detail::tvec3<T>& x, \r
+               const detail::tvec3<T>& y\r
+       )\r
+    {\r
+        return normalize(x - y * dot(y, x));\r
+    }\r
+\r
+}//namespace orthonormalize\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
diff --git a/glm/gtx/perpendicular.hpp b/glm/gtx/perpendicular.hpp
new file mode 100644 (file)
index 0000000..9eb07b6
--- /dev/null
@@ -0,0 +1,63 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-03-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/perpendicular.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_projection\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_perpendicular\r
+#define glm_gtx_perpendicular\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/projection.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_perpendicular();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_perpendicular extension: Perpendicular of a vector from other one\r
+    namespace perpendicular\r
+    {\r
+        //! Projects x a perpendicular axis of Normal.\r
+               //! From GLM_GTX_perpendicular extension.\r
+               template <typename T> \r
+               detail::tvec2<T> perp(\r
+                       detail::tvec2<T> const & x, \r
+                       detail::tvec2<T> const & Normal);\r
+\r
+        //! Projects x a perpendicular axis of Normal.\r
+               //! From GLM_GTX_perpendicular extension.\r
+               template <typename T> \r
+               detail::tvec3<T> perp(\r
+                       detail::tvec3<T> const & x, \r
+                       detail::tvec3<T> const & Normal);\r
+\r
+        //! Projects x a perpendicular axis of Normal.\r
+               //! From GLM_GTX_perpendicular extension.\r
+               template <typename T> \r
+               detail::tvec4<T> perp(\r
+                       detail::tvec4<T> const & x, \r
+                       detail::tvec4<T> const & Normal);\r
+               \r
+    }//namespace perpendicular\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_perpendicular namespace gtx::perpendicular\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_perpendicular;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "perpendicular.inl"\r
+\r
+#endif//glm_gtx_perpendicular\r
diff --git a/glm/gtx/perpendicular.inl b/glm/gtx/perpendicular.inl
new file mode 100644 (file)
index 0000000..8732653
--- /dev/null
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-03-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/perpendicular.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace perpendicular{\r
+\r
+template <typename T> \r
+inline detail::tvec2<T> perp(\r
+       detail::tvec2<T> const & x, \r
+       detail::tvec2<T> const & Normal)\r
+{\r
+    return x - projection::proj(x, Normal);\r
+}\r
+\r
+template <typename T> \r
+inline detail::tvec3<T> perp(\r
+       detail::tvec3<T> const & x, \r
+       detail::tvec3<T> const & Normal)\r
+{\r
+    return x - projection::proj(x, Normal);\r
+}\r
+\r
+template <typename T> \r
+inline detail::tvec4<T> perp(\r
+       detail::tvec4<T> const & x, \r
+       detail::tvec4<T> const & Normal)\r
+{\r
+    return x - projection::proj(x, Normal);\r
+}\r
+\r
+}//namespace perpendicular\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/polar_coordinates.hpp b/glm/gtx/polar_coordinates.hpp
new file mode 100644 (file)
index 0000000..e6b22f5
--- /dev/null
@@ -0,0 +1,46 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-06\r
+// Updated : 2009-05-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/polar_coordinates.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_polar_coordinates\r
+#define glm_gtx_polar_coordinates\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_polar_coordinates extension: Conversion from Euclidean space to polar space and revert.\r
+       namespace polar_coordinates\r
+       {\r
+               //! Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude.\r
+               //! From GLM_GTX_polar_coordinates extension.\r
+               template <typename T> \r
+               detail::tvec3<T> polar(const detail::tvec3<T>& euclidean);\r
+\r
+               //! Convert Polar to Euclidean coordinates.\r
+               //! From GLM_GTX_polar_coordinates extension.\r
+               template <typename T> \r
+               detail::tvec3<T> euclidean(const detail::tvec3<T>& polar);\r
+\r
+       }//namespace polar_coordinates\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_polar_coordinates namespace gtx::polar_coordinates\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_polar_coordinates;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "polar_coordinates.inl"\r
+\r
+#endif//glm_gtx_polar_coordinates\r
diff --git a/glm/gtx/polar_coordinates.inl b/glm/gtx/polar_coordinates.inl
new file mode 100644 (file)
index 0000000..4b9295c
--- /dev/null
@@ -0,0 +1,42 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-06\r
+// Updated : 2009-05-01\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/polar_coordinates.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace polar_coordinates\r
+{\r
+       template <typename T> \r
+       inline detail::tvec3<T> polar(\r
+               const detail::tvec3<T>& euclidean)\r
+       {\r
+               T length = length(euclidean);\r
+               detail::tvec3<T> tmp = euclidean / length;\r
+               T xz_dist = sqrt(tmp.x * tmp.x + tmp.z * tmp.z);\r
+\r
+               return detail::tvec3<T>(\r
+                       degrees(atan(xz_dist, tmp.y)),  // latitude\r
+                       degrees(atan(tmp.x, tmp.z)),            // longitude\r
+                       xz_dist);                                                                       // xz distance\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tvec3<T> euclidean(\r
+               const detail::tvec3<T>& polar)\r
+       {\r
+               T latitude = radians(polar.x);\r
+               T longitude = radians(polar.y);\r
+               return detail::tvec3<T>(\r
+                       cos(latitude) * sin(longitude),\r
+                       sin(latitude),\r
+                       cos(latitude) * cos(longitude));\r
+       }\r
+\r
+}//namespace polar_coordinates\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/projection.hpp b/glm/gtx/projection.hpp
new file mode 100644 (file)
index 0000000..e542565
--- /dev/null
@@ -0,0 +1,61 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-03-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/projection.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_projection\r
+#define glm_gtx_projection\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_projection();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_projection extension: Projection of a vector to other one\r
+       namespace projection\r
+       {\r
+               //! Projects x on Normal.\r
+               //! From GLM_GTX_projection extension.\r
+               template <typename T> \r
+               detail::tvec2<T> proj(\r
+                       detail::tvec2<T> const & x, \r
+                       detail::tvec2<T> const & Normal);\r
+               \r
+               //! Projects x on Normal.\r
+               //! From GLM_GTX_projection extension.\r
+               template <typename T> \r
+               detail::tvec3<T> proj(\r
+                       detail::tvec3<T> const & x, \r
+                       detail::tvec3<T> const & Normal);\r
+\r
+               //! Projects x on Normal.\r
+               //! From GLM_GTX_projection extension.\r
+               template <typename T> \r
+               detail::tvec4<T> proj(\r
+                       detail::tvec4<T> const & x, \r
+                       detail::tvec4<T> const & Normal);\r
+               \r
+       }//namespace projection\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_projection namespace gtx::projection\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_projection;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "projection.inl"\r
+\r
+#endif//glm_gtx_projection\r
diff --git a/glm/gtx/projection.inl b/glm/gtx/projection.inl
new file mode 100644 (file)
index 0000000..d7fcb7d
--- /dev/null
@@ -0,0 +1,40 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-03-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/projection.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace projection{\r
+\r
+template <typename T> \r
+inline detail::tvec2<T> proj(\r
+       detail::tvec2<T> const & x, \r
+       detail::tvec2<T> const & Normal)\r
+{\r
+       return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;\r
+}\r
+\r
+template <typename T> \r
+inline detail::tvec3<T> proj(\r
+       detail::tvec3<T> const & x, \r
+       detail::tvec3<T> const & Normal)\r
+{\r
+       return dot(x, Normal) / glm::dot(Normal, Normal) * Normal;\r
+}\r
+\r
+template <typename T> \r
+inline detail::tvec4<T> proj(\r
+       detail::tvec4<T> const & x, \r
+       detail::tvec4<T> const & Normal)\r
+{\r
+       return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;\r
+}\r
+\r
+}//namespace projection\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/quaternion.hpp b/glm/gtx/quaternion.hpp
new file mode 100644 (file)
index 0000000..f339b9d
--- /dev/null
@@ -0,0 +1,198 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-05-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/quaternion.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// ToDo:\r
+// - Study constructors with angles and axis\r
+// - Study constructors with vec3 that are the imaginary component of quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_quaternion\r
+#define glm_gtx_quaternion\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/quaternion.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_quaternion extension: Quaternion types and functions\r
+    namespace quaternion\r
+    {\r
+               using namespace gtc::quaternion;\r
+\r
+        //! Compute a cross product between a quaternion and a vector. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> cross(\r
+                       detail::tquat<valType> const & q, \r
+                       detail::tvec3<valType> const & v);\r
+\r
+               //! Compute a cross product between a vector and a quaternion.\r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> cross(\r
+                       detail::tvec3<valType> const & v, \r
+                       detail::tquat<valType> const & q);\r
+\r
+               //! Compute a point on a path according squad equation. \r
+               //! q1 and q2 are control points; s1 and s2 are intermediate control points.\r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> squad(\r
+                       detail::tquat<valType> const & q1, \r
+                       detail::tquat<valType> const & q2, \r
+                       detail::tquat<valType> const & s1, \r
+                       detail::tquat<valType> const & s2, \r
+                       valType const & h);\r
+\r
+               //! Returns an intermediate control point for squad interpolation.\r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> intermediate(\r
+                       detail::tquat<valType> const & prev, \r
+                       detail::tquat<valType> const & curr, \r
+                       detail::tquat<valType> const & next);\r
+\r
+               //! Returns a exp of a quaternion. \r
+               //! From GLM_GTX_quaternion extension.\r
+        template <typename valType> \r
+               detail::tquat<valType> exp(\r
+                       detail::tquat<valType> const & q, \r
+                       valType const & exponent);\r
+\r
+               //! Returns a log of a quaternion. \r
+               //! From GLM_GTX_quaternion extension.\r
+        template <typename valType> \r
+               detail::tquat<valType> log(\r
+                       detail::tquat<valType> const & q);\r
+\r
+               //! Returns x raised to the y power.\r
+               //! From GLM_GTX_quaternion extension.\r
+        template <typename valType> \r
+               detail::tquat<valType> pow(\r
+                       detail::tquat<valType> const & x, \r
+                       valType const & y);\r
+\r
+               //! Returns quarternion square root.\r
+               //! From GLM_GTX_quaternion extension.\r
+               //template <typename valType> \r
+               //detail::tquat<valType> sqrt(\r
+               //      detail::tquat<valType> const & q);\r
+\r
+               //! Rotates a 3 components vector by a quaternion. \r
+               //! From GLM_GTX_transform extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> rotate(\r
+                       detail::tquat<valType> const & q, \r
+                       detail::tvec3<valType> const & v);\r
+\r
+        //! Rotates a 4 components vector by a quaternion.\r
+               //! From GLM_GTX_transform extension.\r
+               template <typename valType> \r
+               detail::tvec4<valType> rotate(\r
+                       detail::tquat<valType> const & q, \r
+                       detail::tvec4<valType> const & v);\r
+               \r
+        //! Returns the q rotation angle. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               valType angle(\r
+                       detail::tquat<valType> const & x);\r
+\r
+               //! Returns the q rotation axis. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> axis(\r
+                       detail::tquat<valType> const & x);\r
+\r
+               //! Build a quaternion from an angle and an axis. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> angleAxis(\r
+                       valType const & angle, \r
+                       valType const & x, \r
+                       valType const & y, \r
+                       valType const & z);\r
+\r
+        //! Build a quaternion from an angle and an axis.\r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> angleAxis(\r
+                       valType const & angle, \r
+                       detail::tvec3<valType> const & v);\r
+\r
+               //! Extract the real component of a quaternion.\r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               valType extractRealComponent(\r
+                       detail::tquat<valType> const & q);\r
+\r
+        //! Returns roll value of euler angles. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               valType roll(\r
+                       detail::tquat<valType> const & x);\r
+\r
+               //! Returns pitch value of euler angles. \r
+               //! From GLM_GTX_quaternion extension.\r
+        template <typename valType> \r
+               valType pitch(\r
+                       detail::tquat<valType> const & x);\r
+\r
+        //! Returns yaw value of euler angles. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               valType yaw(\r
+                       detail::tquat<valType> const & x);\r
+               \r
+               //! Returns euler angles, yitch as x, yaw as y, roll as z. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tvec3<valType> eularAngles(\r
+                       detail::tquat<valType> const & x);\r
+\r
+               //! Converts a quaternion to a 3 * 3 matrix. \r
+               //! From GLM_GTX_quaternion extension.\r
+        template <typename valType> \r
+               detail::tmat3x3<valType> toMat3(\r
+                       detail::tquat<valType> const & x){return gtc::quaternion::mat3_cast(x);}\r
+\r
+               //! Converts a quaternion to a 4 * 4 matrix. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> toMat4(\r
+                       detail::tquat<valType> const & x){return gtc::quaternion::mat4_cast(x);}\r
+\r
+               //! Converts a 3 * 3 matrix to a quaternion. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> toQuat(\r
+                       detail::tmat3x3<valType> const & x){return gtc::quaternion::quat_cast(x);}\r
+\r
+               //! Converts a 4 * 4 matrix to a quaternion. \r
+               //! From GLM_GTX_quaternion extension.\r
+               template <typename valType> \r
+               detail::tquat<valType> toQuat(\r
+                       detail::tmat4x4<valType> const & x){return gtc::quaternion::quat_cast(x);}\r
+\r
+    }//namespace quaternion\r
+    }//namespace gtx\r
+} //namespace glm\r
+\r
+#define GLM_GTX_quaternion namespace gtx::quaternion\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_quaternion;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "quaternion.inl"\r
+\r
+#endif//glm_gtx_quaternion\r
diff --git a/glm/gtx/quaternion.inl b/glm/gtx/quaternion.inl
new file mode 100644 (file)
index 0000000..405b675
--- /dev/null
@@ -0,0 +1,251 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2008-11-27\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/quaternion.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <limits>\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace quaternion\r
+{\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> cross\r
+       (\r
+               detail::tvec3<valType> const & v, \r
+               detail::tquat<valType> const & q\r
+       )\r
+    {\r
+               return gtc::quaternion::inverse(q) * v;\r
+    }\r
+\r
+       template <typename valType> \r
+    inline detail::tvec3<valType> cross\r
+       (\r
+               detail::tquat<valType> const & q, \r
+               detail::tvec3<valType> const & v\r
+       )\r
+    {\r
+               return q * v;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tquat<T> squad\r
+       (\r
+               detail::tquat<T> const & q1, \r
+               detail::tquat<T> const & q2, \r
+               detail::tquat<T> const & s1, \r
+               detail::tquat<T> const & s2, \r
+               T const & h)\r
+    {\r
+        return mix(mix(q1, q2, h), mix(s1, s2, h), T(2) * h (T(1) - h));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tquat<T> intermediate\r
+       (\r
+               detail::tquat<T> const & prev, \r
+               detail::tquat<T> const & curr, \r
+               detail::tquat<T> const & next\r
+       )\r
+    {\r
+        detail::tquat<T> invQuat = gtc::quaternion::inverse(curr);\r
+        return ext((log(next + invQuat) + log(prev + invQuat)) / T(-4)) * curr;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tquat<T> exp\r
+       (\r
+               detail::tquat<T> const & q, \r
+               T const & exponent\r
+       )\r
+    {\r
+        detail::tvec3<T> u(q.x, q.y, q.z);\r
+               float a = glm::length(u);\r
+        detail::tvec3<T> v(u / a);\r
+        return detail::tquat<T>(cos(a), sin(a) * v);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tquat<T> log\r
+       (\r
+               detail::tquat<T> const & q\r
+       )\r
+    {\r
+        if((q.x == T(0)) && (q.y == T(0)) && (q.z == T(0)))\r
+        {\r
+            if(q.w > T(0))\r
+                return detail::tquat<T>(log(q.w), T(0), T(0), T(0));\r
+            else if(q.w < T(0))\r
+                return detail::tquat<T>(log(-q.w), T(3.1415926535897932384626433832795), T(0),T(0));\r
+            else\r
+                return detail::tquat<T>(std::numeric_limits<T>::infinity(), std::numeric_limits<T>::infinity(), std::numeric_limits<T>::infinity(), std::numeric_limits<T>::infinity());\r
+        } \r
+        else \r
+        {\r
+            T Vec3Len = sqrt(q.x * q.x + q.y * q.y + q.z * q.z);\r
+            T QuatLen = sqrt(Vec3Len * Vec3Len + q.w * q.w);\r
+            T t = atan(Vec3Len, T(q.w)) / Vec3Len;\r
+            return detail::tquat<T>(t * q.x, t * q.y, t * q.z, log(QuatLen));\r
+        }\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tquat<T> pow\r
+       (\r
+               detail::tquat<T> const & x, \r
+               T const & y\r
+       )\r
+    {\r
+        if(abs(x.w) > T(0.9999))\r
+            return x;\r
+        float Angle = acos(y);\r
+        float NewAngle = Angle * y;\r
+        float Div = sin(NewAngle) / sin(Angle);\r
+        return detail::tquat<T>(\r
+            cos(NewAngle),\r
+            x.x * Div,\r
+            x.y * Div,\r
+            x.z * Div);\r
+    }\r
+\r
+       //template <typename T> \r
+       //inline detail::tquat<T> sqrt\r
+       //(\r
+       //      detail::tquat<T> const & q\r
+       //)\r
+       //{\r
+       //      T q0 = T(1) - dot(q, q);\r
+       //      return T(2) * (T(1) + q0) * q;\r
+       //}\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> rotate\r
+       (\r
+               detail::tquat<T> const & q, \r
+               detail::tvec3<T> const & v\r
+       )\r
+    {\r
+               return q * v;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec4<T> rotate\r
+       (\r
+               detail::tquat<T> const & q, \r
+               detail::tvec4<T> const & v\r
+       )\r
+    {\r
+        return q * v;\r
+    }\r
+\r
+    template <typename T> \r
+    inline T angle\r
+       (\r
+               detail::tquat<T> const & x\r
+       )\r
+    {\r
+        return acos(x.w) * T(2);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<T> axis\r
+       (\r
+               detail::tquat<T> const & x\r
+       )\r
+    {\r
+        T tmp1 = T(1) - x.w * x.w;\r
+        if(tmp1 <= T(0))\r
+            return detail::tvec3<T>(0, 0, 1);\r
+        T tmp2 = T(1) / sqrt(tmp1);\r
+        return detail::tvec3<T>(x.x * tmp2, x.y * tmp2, x.z * tmp2);\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tquat<valType> angleAxis\r
+       (\r
+               valType const & angle, \r
+               valType const & x, \r
+               valType const & y, \r
+               valType const & z\r
+       )\r
+    {\r
+        return angleAxis(angle, detail::tvec3<valType>(x, y, z));\r
+    }\r
+\r
+    template <typename valType> \r
+    inline detail::tquat<valType> angleAxis\r
+       (\r
+               valType const & angle, \r
+               detail::tvec3<valType> const & v\r
+       )\r
+    {\r
+        detail::tquat<valType> result;\r
+        detail::tvec3<valType> v_normalized = glm::normalize(v);\r
+\r
+               valType a = glm::radians(angle);\r
+        valType s = glm::sin(a * valType(0.5));\r
+\r
+        result.w = glm::cos(a * valType(0.5));\r
+        result.x = v.x * s;\r
+        result.y = v.y * s;\r
+        result.z = v.z * s;\r
+        return result;\r
+    }\r
+\r
+    template <typename T> \r
+       inline T extractRealComponent\r
+       (\r
+               detail::tquat<T> const & q\r
+       )\r
+    {\r
+        T w = T(1.0) - q.x * q.x - q.y * q.y - q.z * q.z;\r
+        if(w < T(0))\r
+            return T(0);\r
+        else\r
+            return -sqrt(w);\r
+    }\r
+\r
+       template <typename valType> \r
+       inline valType roll\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+       {\r
+               return atan2(valType(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);\r
+       }\r
+\r
+       template <typename valType> \r
+       inline valType pitch\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+       {\r
+               return atan2(valType(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);\r
+       }\r
+\r
+       template <typename valType> \r
+       inline valType yaw\r
+       (\r
+               detail::tquat<valType> const & q\r
+       )\r
+       {\r
+               return asin(valType(-2) * (q.x * q.z - q.w * q.y));\r
+       }\r
+\r
+    template <typename valType> \r
+    inline detail::tvec3<valType> eularAngles\r
+       (\r
+               detail::tquat<valType> const & x\r
+       )\r
+    {\r
+        return detail::tvec3<valType>(pitch(x), yaw(x), roll(x));\r
+    }\r
+\r
+}//namespace quaternion\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/random.hpp b/glm/gtx/random.hpp
new file mode 100644 (file)
index 0000000..c35b70a
--- /dev/null
@@ -0,0 +1,85 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-16\r
+// Updated : 2007-08-30\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/random.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_vecx\r
+// - GLM_GTX_half_float\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_random\r
+#define glm_gtx_random\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/half_float.hpp"\r
+\r
+namespace glm{\r
+namespace gtx{\r
+//! GLM_GTX_random extension: Generate random number from varius distribution methods\r
+namespace random\r
+{\r
+       //! Generate a random number in the interval [-1, 1], according a linear distribution.\r
+       //! From GLM_GTX_random extension.\r
+    template <typename T> T signedRand1();\r
+       \r
+       template <> float signedRand1();                                                                                     //!< \brief Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension)\r
+    template <> double signedRand1();                                                                                   //!< \brief Generate a random number in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> signedRand2();                                                                           //!< \brief Generate 2 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> signedRand3();                                                                           //!< \brief Generate 3 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> signedRand4();                                                                           //!< \brief Generate 4 random numbers in the interval [-1, 1], according a linear distribution (From GLM_GTX_random extension)\r
+    \r
+       template <typename T> detail::tvec2<T> normalizedRand2();                                                                          //!< \brief Generate a normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension)\r
+       template <typename T> detail::tvec2<T> normalizedRand2(T Min, T Max);                                                         //!< \brief Generate a scaled and normalized 2D vector regulary distribute on a circle (From GLM_GTX_random extension)\r
+       template <typename T> detail::tvec3<T> normalizedRand3();                                                                          //!< \brief Generate a normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension)\r
+       template <typename T> detail::tvec3<T> normalizedRand3(T Min, T Max);                                                        //!< \brief Generate a scaled and normalized 3D vector regulary distribute on a sphere (From GLM_GTX_random extension)\r
+\r
+    template <typename T> T compRand1();                                                                                       //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension)\r
+       template <> float compRand1();                                                                                         //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension)\r
+    template <> double compRand1();                                                                                      //!< \brief Generate a random number in the interval [0, 1], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> T compRand1(T Min, T Max);                                                                     //!< \brief Generate a random number in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> compRand2(T Min, T Max);                                                              //!< \brief Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> compRand3(T Min, T Max);                                                             //!< \brief Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> compRand4(T Min, T Max);                                                              //!< \brief Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> compRand2(const detail::tvec2<T>& Min, const detail::tvec2<T>& Max);                                //!< \brief Generate 2 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> compRand3(const detail::tvec3<T>& Min, const detail::tvec3<T>& Max);                                //!< \brief Generate 3 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> compRand4(const detail::tvec4<T>& Min, const detail::tvec4<T>& Max);                                //!< \brief Generate 4 random numbers in the interval [Min, Max], according a linear distribution (From GLM_GTX_random extension)\r
+\r
+    template <typename T> detail::tvec2<T> vecRand2();                                                                                 //!< \brief Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> vecRand2(T MinRadius, T MaxRadius);                                        //!< \brief Generate a random normalized 2 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> vecRand3();                                                                                 //!< \brief Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> vecRand3(T MinRadius, T MaxRadius);                                        //!< \brief Generate a random normalized 3 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> vecRand4();                                                                                 //!< \brief Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> vecRand4(T MinRadius, T MaxRadius);                                        //!< \brief Generate a random normalized 4 component vector. It's a spherical uniform distribution. (From GLM_GTX_random extension)\r
+\r
+    template <typename T> T gaussRand1(T mean, T std_deviation);                                           //!< \brief Gererate a random floating number according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> gaussRand2(T mean, T std_deviation);                                   //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> gaussRand3(T mean, T std_deviation);                                   //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> gaussRand4(T mean, T std_deviation);                                   //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> gaussRand2(const detail::tvec2<T>& mean, T std_deviation);                    //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> gaussRand3(const detail::tvec3<T>& mean, T std_deviation);                    //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> gaussRand4(const detail::tvec4<T>& mean, T std_deviation);                    //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> gaussRand2(T  mean, const detail::tvec2<T>& std_deviation);                   //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> gaussRand3(T  mean, const detail::tvec3<T>& std_deviation);                   //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> gaussRand4(T  mean, const detail::tvec4<T>& std_deviation);                   //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec2<T> gaussRand2(const detail::tvec2<T>& mean, const detail::tvec2<T>& std_deviation);     //!< \brief Gererate 2 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec3<T> gaussRand3(const detail::tvec3<T>& mean, const detail::tvec3<T>& std_deviation);     //!< \brief Gererate 3 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+    template <typename T> detail::tvec4<T> gaussRand4(const detail::tvec4<T>& mean, const detail::tvec4<T>& std_deviation);     //!< \brief Gererate 4 random floating numbers according a Gauss distribution. (From GLM_GTX_random extension)\r
+\r
+}//namespace random\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_random namespace gtx::random\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_random;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "random.inl"\r
+\r
+#endif//glm_gtx_random\r
diff --git a/glm/gtx/random.inl b/glm/gtx/random.inl
new file mode 100644 (file)
index 0000000..5a87681
--- /dev/null
@@ -0,0 +1,515 @@
+//////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+//////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-16\r
+// Updated : 2006-01-16\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/random.inl\r
+//////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <ctime>\r
+#include <cassert>\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace random\r
+{\r
+    template <>\r
+       inline float signedRand1()\r
+       {\r
+               #if(GLM_COMPILER == GLM_COMPILER_VC80)\r
+               #define RAND_SHIFT_NUM 5\r
+               #else\r
+               #define RAND_SHIFT_NUM 0\r
+               #endif\r
+               return float((std::rand() - (RAND_MAX >> 1) - 1) << 1) / float(RAND_MAX - RAND_SHIFT_NUM);\r
+       }\r
+\r
+    template <>\r
+       inline double signedRand1()\r
+       {\r
+               return double(signedRand1<float>());\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec2<T> signedRand2()\r
+       {\r
+               return detail::tvec2<T>(\r
+                       signedRand1<float>(),\r
+                       signedRand1<float>());\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> signedRand3()\r
+       {\r
+               return detail::tvec3<T>(\r
+                       signedRand1<float>(),\r
+                       signedRand1<float>(),\r
+                       signedRand1<float>());\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> signedRand4()\r
+       {\r
+               return detail::tvec4<T>(\r
+                       signedRand1<float>(),\r
+                       signedRand1<float>(),\r
+                       signedRand1<float>(),\r
+                       signedRand1<float>());\r
+       }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> normalizedRand2()\r
+    {\r
+        T a = compRand1<T>(T(0), T(6.283185307179586476925286766559f));\r
+        return detail::tvec2<T>(cos(a), sin(a));\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec3<T> normalizedRand3()\r
+    {\r
+           T z = compRand1(T(-1), T(1));\r
+           T a = compRand1(T(0), T(6.283185307179586476925286766559f));\r
+\r
+        T r = sqrt(T(1) - z * z);\r
+\r
+           T x = r * cos(a);\r
+           T y = r * sin(a);\r
+\r
+        return detail::tvec3<T>(x, y, z);\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> normalizedRand3(\r
+               T Min, \r
+               T Max)\r
+    {\r
+        return normalizedRand3<T>() * compRand1(Min, Max);\r
+    }\r
+\r
+       template <>\r
+       inline float compRand1()\r
+       {\r
+               return float(std::rand()) / float(RAND_MAX);\r
+       }\r
+\r
+       template <>\r
+       inline double compRand1()\r
+       {\r
+               return double(std::rand()) / double(RAND_MAX);\r
+       }\r
+\r
+       template <typename T>\r
+       inline T compRand1(\r
+               T Min, \r
+               T Max)\r
+       {\r
+               return compRand1<T>() * (Max - Min) + Min;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec2<T> compRand2(\r
+               T Min, \r
+               T Max)\r
+       {\r
+               return detail::tvec2<T>(\r
+                       compRand1(Min, Max),\r
+                       compRand1(Min, Max));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> compRand3(\r
+               T Min, \r
+               T Max)\r
+       {\r
+               return detail::tvec3<T>(\r
+                       compRand1(Min, Max),\r
+                       compRand1(Min, Max),\r
+                       compRand1(Min, Max));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> compRand4(\r
+               T Min, \r
+               T Max)\r
+       {\r
+               return detail::tvec4<T>(\r
+                       compRand1(Min, Max),\r
+                       compRand1(Min, Max),\r
+                       compRand1(Min, Max),\r
+                       compRand1(Min, Max));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec2<T> compRand2(\r
+               T Min, \r
+               const detail::tvec2<T>& Max)\r
+       {\r
+               return detail::tvec2<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> compRand3(\r
+               T Min, \r
+               const detail::tvec3<T>& Max)\r
+       {\r
+               return detail::tvec3<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y),\r
+                       compRand1(Min.z, Max.z));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> compRand4(\r
+               T Min, \r
+               const detail::tvec4<T>& Max)\r
+       {\r
+               return detail::tvec4<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y),\r
+                       compRand1(Min.z, Max.z),\r
+                       compRand1(Min.w, Max.w));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec2<T> compRand2(\r
+               const detail::tvec2<T>& Min, \r
+               T Max)\r
+       {\r
+               return detail::tvec2<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> compRand3(\r
+               const detail::tvec3<T>& Min, \r
+               T Max)\r
+       {\r
+               return detail::tvec3<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y),\r
+                       compRand1(Min.z, Max.z));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> compRand4(\r
+               const detail::tvec4<T>& Min, \r
+               T Max)\r
+       {\r
+               return detail::tvec4<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y),\r
+                       compRand1(Min.z, Max.z),\r
+                       compRand1(Min.w, Max.w));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec2<T> compRand2(\r
+               const detail::tvec2<T>& Min, \r
+               const detail::tvec2<T>& Max)\r
+       {\r
+               return detail::tvec2<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> compRand3(\r
+               const detail::tvec3<T>& Min, \r
+               const detail::tvec3<T>& Max)\r
+       {\r
+               return detail::tvec3<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y),\r
+                       compRand1(Min.z, Max.z));\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> compRand4(\r
+               const detail::tvec4<T>& Min, \r
+               const detail::tvec4<T>& Max)\r
+       {\r
+               return detail::tvec4<T>(\r
+                       compRand1(Min.x, Max.x),\r
+                       compRand1(Min.y, Max.y),\r
+                       compRand1(Min.z, Max.z),\r
+                       compRand1(Min.w, Max.w));\r
+       }\r
+\r
+       template <typename T>\r
+    inline detail::tvec2<float> vecRand2()\r
+    {\r
+               detail::tvec2<float> result(float(0));\r
+               do\r
+               {\r
+                       result = compRand2(float(-1), float(1));\r
+               } while (length(result) > float(1));\r
+\r
+        return result;\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec2<double> vecRand2()\r
+    {\r
+               detail::tvec2<double> result(double(0));\r
+               do\r
+               {\r
+                       result = compRand2(double(-1), double(1));\r
+               } while (length(result) > double(1));\r
+\r
+        return result;\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec2<T> vecRand2(\r
+               T MinRadius, \r
+               T MaxRadius)\r
+    {\r
+               assert(MinRadius <= MaxRadius);\r
+\r
+               detail::tvec2<T> Result(T(0));\r
+               T LenRadius(0);\r
+\r
+               do\r
+               {\r
+                       Result = compRand2(-MaxRadius, MaxRadius);\r
+                       LenRadius = length(Result);\r
+               }\r
+               while(LenRadius > MaxRadius || LenRadius < MinRadius);\r
+\r
+        return Result;\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec3<T> vecRand3()\r
+    {\r
+               detail::tvec3<T> Result(T(0));\r
+               do\r
+               {\r
+                       Result = compRand3(T(-1), T(1));\r
+               }\r
+               while(length(Result) > T(1));\r
+\r
+        return Result;\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec3<T> vecRand3(\r
+               T MinRadius, \r
+               T MaxRadius)\r
+    {\r
+               assert(MinRadius <= MaxRadius);\r
+\r
+               detail::tvec3<T> Result(0);\r
+               T LenRadius(0);\r
+\r
+               do\r
+               {\r
+                       Result = compRand3(-MaxRadius, MaxRadius);\r
+                       LenRadius = length(Result);\r
+               }\r
+               while(LenRadius > MaxRadius || LenRadius < MinRadius);\r
+\r
+        return Result;\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec4<float> vecRand4()\r
+    {\r
+               detail::tvec4<float> result(float(0));\r
+               do\r
+               {\r
+                       result = compRand4(float(-1), float(1));\r
+               } while (length(result) > float(1));\r
+\r
+        return result;\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec4<double> vecRand4()\r
+    {\r
+               detail::tvec4<double> result(double(0));\r
+               do\r
+               {\r
+                       result = compRand4(double(-1), double(1));\r
+               } while (length(result) > double(1));\r
+\r
+        return result;\r
+    }\r
+\r
+       template <typename T>\r
+    inline detail::tvec4<T> vecRand4(\r
+               T MinRadius, \r
+               T MaxRadius)\r
+    {\r
+               assert(MinRadius <= MaxRadius);\r
+\r
+               detail::tvec4<T> Result(T(0));\r
+               T LenRadius(T(0));\r
+\r
+               do\r
+               {\r
+                       Result = compRand4(-MaxRadius, MaxRadius);\r
+                       LenRadius = length(Result);\r
+               }\r
+               while(LenRadius > MaxRadius || LenRadius < MinRadius);\r
+\r
+        return Result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline T gaussRand1(\r
+               T mean, \r
+               T std_deviation)\r
+    {\r
+        T w, x1, x2;\r
+\r
+        do\r
+        {\r
+            x1 = compRand1(T(-1), T(1));\r
+            x2 = compRand1(T(-1), T(1));\r
+\r
+            w = x1 * x1 + x2 * x2;\r
+        } while(w > T(1));\r
+\r
+        return x2 * std_deviation * std_deviation * sqrt((T(-2) * log(w)) / w) + mean;\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> gaussRand2(\r
+               T mean, \r
+               T std_deviation)\r
+    {\r
+        return detail::tvec2<T>(\r
+            gaussRand1(mean, std_deviation),\r
+            gaussRand1(mean, std_deviation));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> gaussRand3(\r
+               T mean, \r
+               T std_deviation)\r
+    {\r
+        return detail::tvec3<T>(\r
+            gaussRand1(mean, std_deviation),\r
+            gaussRand1(mean, std_deviation),\r
+            gaussRand1(mean, std_deviation));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> gaussRand4(\r
+               T mean, \r
+               T std_deviation)\r
+    {\r
+        return detail::tvec4<T>(\r
+            gaussRand1(mean, std_deviation),\r
+            gaussRand1(mean, std_deviation),\r
+            gaussRand1(mean, std_deviation),\r
+            gaussRand1(mean, std_deviation));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> gaussRand2(\r
+               T mean, \r
+               const detail::tvec2<T>& std_deviation)\r
+    {\r
+        return detail::tvec2<T>(\r
+            gaussRand1(mean, std_deviation.x),\r
+            gaussRand1(mean, std_deviation.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> gaussRand3(\r
+               T mean, \r
+               const detail::tvec3<T>& std_deviation)\r
+    {\r
+        return detail::tvec3<T>(\r
+            gaussRand1(mean, std_deviation.x),\r
+            gaussRand1(mean, std_deviation.y),\r
+            gaussRand1(mean, std_deviation.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> gaussRand4(\r
+               T mean, \r
+               const detail::tvec4<T>& std_deviation)\r
+    {\r
+        return detail::tvec4<T>(\r
+            gaussRand1(mean, std_deviation.x),\r
+            gaussRand1(mean, std_deviation.y),\r
+            gaussRand1(mean, std_deviation.z),\r
+            gaussRand1(mean, std_deviation.w));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> gaussRand2(\r
+               const detail::tvec2<T>& mean, \r
+               T std_deviation)\r
+    {\r
+        return detail::tvec2<T>(\r
+            gaussRand1(mean.x, std_deviation),\r
+            gaussRand1(mean.y, std_deviation));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> gaussRand3(\r
+               const detail::tvec3<T>& mean, \r
+               T std_deviation)\r
+    {\r
+        return detail::tvec3<T>(\r
+            gaussRand1(mean.x, std_deviation),\r
+            gaussRand1(mean.y, std_deviation),\r
+            gaussRand1(mean.z, std_deviation));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> gaussRand4(\r
+               const detail::tvec4<T>& mean, \r
+               T std_deviation)\r
+    {\r
+        return detail::tvec4<T>(\r
+            gaussRand1(mean.x, std_deviation),\r
+            gaussRand1(mean.y, std_deviation),\r
+            gaussRand1(mean.z, std_deviation),\r
+            gaussRand1(mean.w, std_deviation));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec2<T> gaussRand2(\r
+               const detail::tvec2<T>& mean, \r
+               const detail::tvec2<T>& std_deviation)\r
+    {\r
+        return detail::tvec2<T>(\r
+            gaussRand1(mean.x, std_deviation.x),\r
+            gaussRand1(mean.y, std_deviation.y));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec3<T> gaussRand3(\r
+               const detail::tvec3<T>& mean, \r
+               const detail::tvec3<T>& std_deviation)\r
+    {\r
+        return detail::tvec3<T>(\r
+            gaussRand1(mean.x, std_deviation.x),\r
+            gaussRand1(mean.y, std_deviation.y),\r
+            gaussRand1(mean.z, std_deviation.z));\r
+    }\r
+\r
+    template <typename T>\r
+    inline detail::tvec4<T> gaussRand4(\r
+               const detail::tvec4<T>& mean, \r
+               const detail::tvec4<T>& std_deviation)\r
+    {\r
+        return detail::tvec4<T>(\r
+            gaussRand1(mean.x, std_deviation.x),\r
+            gaussRand1(mean.y, std_deviation.y),\r
+            gaussRand1(mean.z, std_deviation.z),\r
+            gaussRand1(mean.w, std_deviation.w));\r
+    }\r
+\r
+}//namespace random\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/raw_data.hpp b/glm/gtx/raw_data.hpp
new file mode 100644 (file)
index 0000000..0a51da1
--- /dev/null
@@ -0,0 +1,53 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-11-19\r
+// Updated : 2008-11-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/raw_data.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_raw_data\r
+#define glm_gtx_raw_data\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/type_precision.hpp"\r
+\r
+namespace glm\r
+{\r
+    namespace gtx\r
+    {\r
+               //! GLM_GTX_raw_data extension: Projection of a vector to other one\r
+        namespace raw_data\r
+        {\r
+                       //! Type for byte numbers. \r
+                       //! From GLM_GTX_raw_data extension.\r
+                       typedef gtc::type_precision::uint8              byte;\r
+\r
+                       //! Type for word numbers. \r
+                       //! From GLM_GTX_raw_data extension.\r
+                       typedef gtc::type_precision::uint16             word;\r
+\r
+                       //! Type for dword numbers. \r
+                       //! From GLM_GTX_raw_data extension.\r
+                       typedef gtc::type_precision::uint32             dword;\r
+\r
+                       //! Type for qword numbers. \r
+                       //! From GLM_GTX_raw_data extension.\r
+                       typedef gtc::type_precision::uint64             qword;\r
+               }\r
+    }\r
+}\r
+\r
+#define GLM_GTX_raw_data namespace gtx::raw_data\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_raw_data;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "raw_data.inl"\r
+\r
+#endif//glm_gtx_raw_data\r
diff --git a/glm/gtx/raw_data.inl b/glm/gtx/raw_data.inl
new file mode 100644 (file)
index 0000000..fa89e37
--- /dev/null
@@ -0,0 +1,11 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-11-19\r
+// Updated : 2008-11-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/raw_data.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
diff --git a/glm/gtx/reciprocal.hpp b/glm/gtx/reciprocal.hpp
new file mode 100644 (file)
index 0000000..21e4e9f
--- /dev/null
@@ -0,0 +1,100 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-09\r
+// Updated : 2008-10-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/reciprocal.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_reciprocal\r
+#define glm_gtx_reciprocal\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_reciprocal();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_reciprocal extension: Define secant, cosecant and cotangent functions.\r
+       namespace reciprocal\r
+       {\r
+               //! Secant function. \r
+               //! hypotenuse / adjacent or 1 / cos(x)\r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType sec(genType const & angle);\r
+\r
+               //! Cosecant function. \r
+               //! hypotenuse / opposite or 1 / sin(x)\r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType csc(genType const & angle);\r
+               \r
+               //! Cotangent function. \r
+               //! adjacent / opposite or 1 / tan(x)\r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType cot(genType const & angle);\r
+\r
+               //! Inverse secant function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType asec(genType const & x);\r
+\r
+               //! Inverse cosecant function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType acsc(genType const & x);\r
+               \r
+               //! Inverse cotangent function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType acot(genType const & x);\r
+\r
+               //! Secant hyperbolic function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType sech(genType const & angle);\r
+\r
+               //! Cosecant hyperbolic function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType csch(genType const & angle);\r
+               \r
+               //! Cotangent hyperbolic function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType coth(genType const & angle);\r
+\r
+               //! Inverse secant hyperbolic function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType asech(genType const & x);\r
+\r
+               //! Inverse cosecant hyperbolic function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType acsch(genType const & x);\r
+               \r
+               //! Inverse cotangent hyperbolic function. \r
+               //! From GLM_GTX_reciprocal extension.\r
+               template <typename genType> \r
+               genType acoth(genType const & x);\r
+\r
+       }//namespace reciprocal\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_reciprocal namespace gtx::reciprocal\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_reciprocal;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "reciprocal.inl"\r
+\r
+#endif//glm_gtx_reciprocal\r
diff --git a/glm/gtx/reciprocal.inl b/glm/gtx/reciprocal.inl
new file mode 100644 (file)
index 0000000..e13f677
--- /dev/null
@@ -0,0 +1,593 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-09\r
+// Updated : 2008-10-09\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/reciprocal.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace reciprocal{\r
+\r
+// sec\r
+template <typename genType>\r
+inline genType sec\r
+(\r
+       genType const & angle\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       return genType(1) / glm::cos(angle);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> sec\r
+(\r
+       detail::tvec2<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        sec(angle.x),\r
+        sec(angle.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> sec\r
+(\r
+       detail::tvec3<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        sec(angle.x),\r
+        sec(angle.y),\r
+        sec(angle.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> sec\r
+(\r
+       detail::tvec4<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        sec(angle.x),\r
+        sec(angle.y),\r
+        sec(angle.z),\r
+        sec(angle.w));\r
+}\r
+\r
+// csc\r
+template <typename genType>\r
+inline genType csc\r
+(\r
+       genType const & angle\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+    return genType(1) / glm::sin(angle);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> csc\r
+(\r
+       detail::tvec2<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        csc(angle.x),\r
+        csc(angle.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> csc\r
+(\r
+       detail::tvec3<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        csc(angle.x),\r
+        csc(angle.y),\r
+        csc(angle.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> csc\r
+(      \r
+       detail::tvec4<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        csc(angle.x),\r
+        csc(angle.y),\r
+        csc(angle.z),\r
+        csc(angle.w));\r
+}\r
+\r
+// cot\r
+template <typename genType>\r
+inline genType cot\r
+(\r
+       genType const & angle\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       return genType(1) / glm::tan(angle);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> cot\r
+(\r
+       detail::tvec2<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        cot(angle.x),\r
+        cot(angle.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> cot\r
+(\r
+       detail::tvec3<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        cot(angle.x),\r
+        cot(angle.y),\r
+        cot(angle.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> cot\r
+(\r
+       detail::tvec4<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        cot(angle.x),\r
+        cot(angle.y),\r
+        cot(angle.z),\r
+        cot(angle.w));\r
+}\r
+\r
+// asec\r
+template <typename genType>\r
+inline genType asec\r
+(\r
+       genType const & x\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+       \r
+       return acos(genType(1) / x);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> asec\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        asec(x.x),\r
+        asec(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> asec\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        asec(x.x),\r
+        asec(x.y),\r
+        asec(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> asec\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        asec(x.x),\r
+        asec(x.y),\r
+        asec(x.z),\r
+        asec(x.w));\r
+}\r
+\r
+// acsc\r
+template <typename genType>\r
+inline genType acsc\r
+(\r
+       genType const & x\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       return asin(genType(1) / x);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> acsc\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        acsc(x.x),\r
+        acsc(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> acsc\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        acsc(x.x),\r
+        acsc(x.y),\r
+        acsc(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> acsc\r
+(      \r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        acsc(x.x),\r
+        acsc(x.y),\r
+        acsc(x.z),\r
+        acsc(x.w));\r
+}\r
+\r
+// acot\r
+template <typename genType>\r
+inline genType acot\r
+(\r
+       genType const & x\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0);\r
+       return pi_over_2 - atan(x);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> acot\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        acot(x.x),\r
+        acot(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> acot\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        acot(x.x),\r
+        acot(x.y),\r
+        acot(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> acot\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        acot(x.x),\r
+        acot(x.y),\r
+        acot(x.z),\r
+        acot(x.w));\r
+}\r
+\r
+// sech\r
+template <typename genType>\r
+inline genType sech\r
+(\r
+       genType const & angle\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       return genType(1) / glm::cosh(angle);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> sech\r
+(\r
+       detail::tvec2<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        sech(angle.x),\r
+        sech(angle.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> sech\r
+(\r
+       detail::tvec3<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        sech(angle.x),\r
+        sech(angle.y),\r
+        sech(angle.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> sech\r
+(\r
+       detail::tvec4<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        sech(angle.x),\r
+        sech(angle.y),\r
+        sech(angle.z),\r
+        sech(angle.w));\r
+}\r
+\r
+// csch\r
+template <typename genType>\r
+inline genType csch\r
+(\r
+       genType const & angle\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+    return genType(1) / glm::sinh(angle);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> csch\r
+(\r
+       detail::tvec2<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        csch(angle.x),\r
+        csch(angle.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> csch\r
+(\r
+       detail::tvec3<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        csch(angle.x),\r
+        csch(angle.y),\r
+        csch(angle.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> csch\r
+(      \r
+       detail::tvec4<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        csch(angle.x),\r
+        csch(angle.y),\r
+        csch(angle.z),\r
+        csch(angle.w));\r
+}\r
+\r
+// coth\r
+template <typename genType>\r
+inline genType coth\r
+(\r
+       genType const & angle\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       return glm::cosh(angle) / glm::sinh(angle);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> coth\r
+(\r
+       detail::tvec2<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        coth(angle.x),\r
+        coth(angle.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> coth\r
+(\r
+       detail::tvec3<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        coth(angle.x),\r
+        coth(angle.y),\r
+        coth(angle.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> coth\r
+(\r
+       detail::tvec4<valType> const & angle\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        coth(angle.x),\r
+        coth(angle.y),\r
+        coth(angle.z),\r
+        coth(angle.w));\r
+}\r
+\r
+// asech\r
+template <typename genType>\r
+inline genType asech\r
+(\r
+       genType const & x\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       return acosh(genType(1) / x);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> asech\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        asech(x.x),\r
+        asech(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> asech\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        asech(x.x),\r
+        asech(x.y),\r
+        asech(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> asech\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        asech(x.x),\r
+        asech(x.y),\r
+        asech(x.z),\r
+        asech(x.w));\r
+}\r
+\r
+// acsch\r
+template <typename genType>\r
+inline genType acsch\r
+(\r
+       genType const & x\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+    return asinh(genType(1) / x);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> acsch\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        acsch(x.x),\r
+        acsch(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> acsch\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        acsch(x.x),\r
+        acsch(x.y),\r
+        acsch(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> acsch\r
+(      \r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        acsch(x.x),\r
+        acsch(x.y),\r
+        acsch(x.z),\r
+        acsch(x.w));\r
+}\r
+\r
+// acoth\r
+template <typename genType>\r
+inline genType acoth\r
+(\r
+       genType const & x\r
+)\r
+{\r
+       GLM_STATIC_ASSERT(detail::type<genType>::is_float);\r
+\r
+       return atanh(genType(1) / x);\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec2<valType> acoth\r
+(\r
+       detail::tvec2<valType> const & x\r
+)\r
+{\r
+    return detail::tvec2<valType>(\r
+        acoth(x.x),\r
+        acoth(x.y));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec3<valType> acoth\r
+(\r
+       detail::tvec3<valType> const & x\r
+)\r
+{\r
+    return detail::tvec3<valType>(\r
+        acoth(x.x),\r
+        acoth(x.y),\r
+        acoth(x.z));\r
+}\r
+\r
+template <typename valType>\r
+inline detail::tvec4<valType> acoth\r
+(\r
+       detail::tvec4<valType> const & x\r
+)\r
+{\r
+    return detail::tvec4<valType>(\r
+        acoth(x.x),\r
+        acoth(x.y),\r
+        acoth(x.z),\r
+        acoth(x.w));\r
+}\r
+\r
+}//namespace reciprocal\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/rotate_vector.hpp b/glm/gtx/rotate_vector.hpp
new file mode 100644 (file)
index 0000000..efb5ad2
--- /dev/null
@@ -0,0 +1,110 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-11-02\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/rotate_vector.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_rotate_vector\r
+#define glm_gtx_rotate_vector\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/transform.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace gtx{\r
+       //! GLM_GTX_rotate_vector extension: Function to directly rotate a vector\r
+       namespace rotate_vector\r
+       {\r
+               using namespace transform;\r
+\r
+               //! Rotate a two dimentionnals vector.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec2<T> rotate(\r
+                       const detail::tvec2<T>& v, \r
+                       T angle);\r
+               \r
+               //! Rotate a three dimentionnals vector around an axis.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec3<T> rotate(\r
+                       const detail::tvec3<T>& v, \r
+                       T angle, \r
+                       const detail::tvec3<T>& normal);\r
+               \r
+               //! Rotate a four dimentionnals vector around an axis.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec4<T> rotate(\r
+                       const detail::tvec4<T>& v, T angle, \r
+                       const detail::tvec3<T>& normal);\r
+               \r
+               //! Rotate a three dimentionnals vector around the X axis.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec3<T> rotateX(\r
+                       const detail::tvec3<T>& v, \r
+                       T angle);\r
+\r
+               //! Rotate a three dimentionnals vector around the Y axis.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec3<T> rotateY(\r
+                       const detail::tvec3<T>& v, \r
+                       T angle);\r
+               \r
+               //! Rotate a three dimentionnals vector around the Z axis.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec3<T> rotateZ(\r
+                       const detail::tvec3<T>& v, \r
+                       T angle);\r
+               \r
+               //! Rotate a four dimentionnals vector around the X axis.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec4<T> rotateX(\r
+                       const detail::tvec4<T>& v, \r
+                       T angle);\r
+               \r
+               //! Rotate a four dimentionnals vector around the X axis.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec4<T> rotateY(\r
+                       const detail::tvec4<T>& v, \r
+                       T angle);\r
+               \r
+               //! Rotate a four dimentionnals vector around the X axis. \r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tvec4<T> rotateZ(\r
+                       const detail::tvec4<T>& v, \r
+                       T angle);\r
+               \r
+               //! Build a rotation matrix from a normal and a up vector.\r
+               //! From GLM_GTX_rotate_vector extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> orientation(\r
+                       const detail::tvec3<T>& Normal, \r
+                       const detail::tvec3<T>& Up);\r
+               \r
+       }//namespace rotate_vector\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_rotate_vector namespace gtx::rotate_vector\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_rotate_vector;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "rotate_vector.inl"\r
+\r
+#endif//glm_gtx_rotate_vector\r
diff --git a/glm/gtx/rotate_vector.inl b/glm/gtx/rotate_vector.inl
new file mode 100644 (file)
index 0000000..d2200e8
--- /dev/null
@@ -0,0 +1,145 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-11-02\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/rotate_vector.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace rotate_vector\r
+{\r
+       template <typename T>\r
+       inline detail::tvec2<T> rotate(\r
+               const detail::tvec2<T>& v, \r
+               T angle)\r
+       {\r
+               detail::tvec2<T> Result;\r
+               const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+               Result.x = v.x * Cos - v.y * Sin;\r
+               Result.y = v.x * Sin + v.y * Cos;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tvec3<T> rotate(\r
+               const detail::tvec3<T>& v, T angle, \r
+               const detail::tvec3<T>& normal)\r
+       {\r
+               return detail::tmat3x3<T>(transform::rotate(angle, normal)) * v;\r
+       }\r
+/*\r
+    template <typename T> \r
+    inline detail::tvec3<T> rotateGTX(const detail::tvec3<T>& x, T angle, const detail::tvec3<T>& normal)\r
+    {\r
+        const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+        return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin;\r
+    }\r
+*/\r
+       template <typename T> \r
+       inline detail::tvec4<T> rotate(\r
+               const detail::tvec4<T>& v, \r
+               T angle, \r
+               const detail::tvec3<T>& normal)\r
+       {\r
+               return transform::rotate(angle, normal) * v;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> rotateX(\r
+               const detail::tvec3<T>& v, \r
+               T angle)\r
+       {\r
+               detail::tvec3<T> Result = v;\r
+               const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+               Result.y = v.y * Cos - v.z * Sin;\r
+               Result.z = v.y * Sin + v.z * Cos;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> rotateY(\r
+               const detail::tvec3<T>& v, \r
+               T angle)\r
+       {\r
+               detail::tvec3<T> Result = v;\r
+               const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+               Result.x =  v.x * Cos + v.z * Sin;\r
+               Result.z = -v.x * Sin + v.z * Cos;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec3<T> rotateZ(\r
+               const detail::tvec3<T>& v, \r
+               T angle)\r
+       {\r
+               detail::tvec3<T> Result = v;\r
+               const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+               Result.x = v.x * Cos - v.y * Sin;\r
+               Result.y = v.x * Sin + v.y * Cos;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> rotateX(\r
+               const detail::tvec4<T>& v, \r
+               T angle)\r
+       {\r
+               detail::tvec4<T> Result = v;\r
+               const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+               Result.y = v.y * Cos - v.z * Sin;\r
+               Result.z = v.y * Sin + v.z * Cos;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> rotateY(\r
+               const detail::tvec4<T>& v, \r
+               T angle)\r
+       {\r
+               detail::tvec4<T> Result = v;\r
+               const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+               Result.x =  v.x * Cos + v.z * Sin;\r
+               Result.z = -v.x * Sin + v.z * Cos;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tvec4<T> rotateZ(\r
+               const detail::tvec4<T>& v, \r
+               T angle)\r
+       {\r
+               detail::tvec4<T> Result = v;\r
+               const T Cos = cos(radians(angle));\r
+        const T Sin = sin(radians(angle));\r
+               Result.x = v.x * Cos - v.y * Sin;\r
+               Result.y = v.x * Sin + v.y * Cos;\r
+               return Result;\r
+       }\r
+\r
+       template <typename T>\r
+       inline detail::tmat4x4<T> orientation(\r
+               const detail::tvec3<T>& Normal, \r
+               const detail::tvec3<T>& Up)\r
+       {\r
+               if(all(equal(Normal, Up)))\r
+                       return detail::tmat4x4<T>(T(1));\r
+\r
+               detail::tvec3<T> RotationAxis = cross(Up, Normal);\r
+               T Angle = degrees(acos(dot(Normal, Up)));\r
+               return rotate(Angle, RotationAxis);\r
+       }\r
+\r
+}//namespace rotate_vector\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/simd_common.hpp b/glm/gtx/simd_common.hpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtx/simd_common.inl b/glm/gtx/simd_common.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtx/simd_geometric.hpp b/glm/gtx/simd_geometric.hpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtx/simd_geometric.inl b/glm/gtx/simd_geometric.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtx/simd_mat4.hpp b/glm/gtx/simd_mat4.hpp
new file mode 100644 (file)
index 0000000..8c94ec1
--- /dev/null
@@ -0,0 +1,144 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-07\r
+// Updated : 2009-05-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/simd_vec4.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - intrinsic\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_simd_mat4\r
+#define glm_gtx_simd_mat4\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include <xmmintrin.h>\r
+#include <emmintrin.h>\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               GLM_ALIGN(16) struct fmat4x4SIMD\r
+               {\r
+                       static __m128 one;\r
+\r
+                       enum no_init\r
+                       {\r
+                               NO_INIT\r
+                       };\r
+\r
+                       typedef float value_type;\r
+                       typedef fvec4SIMD col_type;\r
+                       typedef fvec4SIMD row_type;\r
+                       typedef glm::sizeType size_type;\r
+                       static size_type value_size();\r
+                       static size_type col_size();\r
+                       static size_type row_size();\r
+                       static bool is_matrix();\r
+\r
+                       fvec4SIMD Data[4];\r
+\r
+                       //////////////////////////////////////\r
+                       // Constructors\r
+\r
+                       fmat4x4SIMD();\r
+                       explicit fmat4x4SIMD(float const & s);\r
+                       explicit fmat4x4SIMD(\r
+                               float const & x0, float const & y0, float const & z0, float const & w0,\r
+                               float const & x1, float const & y1, float const & z1, float const & w1,\r
+                               float const & x2, float const & y2, float const & z2, float const & w2,\r
+                               float const & x3, float const & y3, float const & z3, float const & w3);\r
+                       explicit fmat4x4SIMD(\r
+                               fvec4SIMD const & v0,\r
+                               fvec4SIMD const & v1,\r
+                               fvec4SIMD const & v2,\r
+                               fvec4SIMD const & v3);\r
+                       explicit fmat4x4SIMD(\r
+                               tmat4x4 const & m);\r
+\r
+                       // Conversions\r
+                       //template <typename U> \r
+                       //explicit tmat4x4(tmat4x4<U> const & m);\r
+\r
+                       //explicit tmat4x4(tmat2x2<T> const & x);\r
+                       //explicit tmat4x4(tmat3x3<T> const & x);\r
+                       //explicit tmat4x4(tmat2x3<T> const & x);\r
+                       //explicit tmat4x4(tmat3x2<T> const & x);\r
+                       //explicit tmat4x4(tmat2x4<T> const & x);\r
+                       //explicit tmat4x4(tmat4x2<T> const & x);\r
+                       //explicit tmat4x4(tmat3x4<T> const & x);\r
+                       //explicit tmat4x4(tmat4x3<T> const & x);\r
+\r
+                       // Accesses\r
+                       fvec4SIMD & operator[](size_type i);\r
+                       fvec4SIMD const & operator[](size_type i) const;\r
+\r
+                       // Unary updatable operators\r
+                       fmat4x4SIMD & operator= (fmat4x4SIMD const & m);\r
+                       fmat4x4SIMD & operator+= (float const & s);\r
+                       fmat4x4SIMD & operator+= (fmat4x4SIMD const & m);\r
+                       fmat4x4SIMD & operator-= (float const & s);\r
+                       fmat4x4SIMD & operator-= (fmat4x4SIMD const & m);\r
+                       fmat4x4SIMD & operator*= (float const & s);\r
+                       fmat4x4SIMD & operator*= (fmat4x4SIMD const & m);\r
+                       fmat4x4SIMD & operator/= (float const & s);\r
+                       fmat4x4SIMD & operator/= (fmat4x4SIMD const & m);\r
+                       fmat4x4SIMD & operator++ ();\r
+                       fmat4x4SIMD & operator-- ();\r
+               };\r
+\r
+               // Binary operators\r
+               fmat4x4SIMD operator+ (fmat4x4SIMD const & m, float const & s);\r
+               fmat4x4SIMD operator+ (float const & s, fmat4x4SIMD const & m);\r
+               fmat4x4SIMD operator+ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);\r
+           \r
+               fmat4x4SIMD operator- (fmat4x4SIMD const & m, float const & s);\r
+               fmat4x4SIMD operator- (float const & s, fmat4x4SIMD const & m);\r
+               fmat4x4SIMD operator- (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);\r
+\r
+               fmat4x4SIMD operator* (fmat4x4SIMD const & m, float const & s);\r
+               fmat4x4SIMD operator* (float const & s, fmat4x4SIMD const & m);\r
+\r
+               fvec4SIMD operator* (fmat4x4SIMD const & m, fvec4SIMD const & v);\r
+               fvec4SIMD operator* (fvec4SIMD const & v, fmat4x4SIMD const & m);\r
+\r
+               fmat4x4SIMD operator* (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);\r
+\r
+               fmat4x4SIMD operator/ (fmat4x4SIMD const & m, float const & s);\r
+               fmat4x4SIMD operator/ (float const & s, fmat4x4SIMD const & m);\r
+\r
+               fvec4SIMD operator/ (fmat4x4SIMD const & m, fvec4SIMD const & v);\r
+               fvec4SIMD operator/ (fvec4SIMD const & v, fmat4x4SIMD const & m);\r
+\r
+               fmat4x4SIMD operator/ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);\r
+\r
+               // Unary constant operators\r
+               fmat4x4SIMD const operator-  (fmat4x4SIMD const & m);\r
+               fmat4x4SIMD const operator-- (fmat4x4SIMD const & m, int);\r
+               fmat4x4SIMD const operator++ (fmat4x4SIMD const & m, int);\r
+\r
+       }//namespace detail\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_simd_mat4 extension: SIMD implementation of vec4 type.\r
+       namespace simd_mat4\r
+       {\r
+               typedef detail::fmat4SIMD mat4SIMD;\r
+\r
+       }//namespace simd_mat4\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_simd_mat4              namespace gtx::simd_mat4;\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_simd_mat4;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "simd_mat4.inl"\r
+\r
+#endif//glm_gtx_simd_mat4\r
diff --git a/glm/gtx/simd_mat4.inl b/glm/gtx/simd_mat4.inl
new file mode 100644 (file)
index 0000000..a66a22c
--- /dev/null
@@ -0,0 +1,221 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-19\r
+// Updated : 2009-05-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/simd_mat4.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace detail\r
+{\r
+    inline fmat4x4SIMD::fmat4x4SIMD()\r
+    {}\r
+\r
+    inline fmat4x4SIMD::fmat4x4SIMD(float const & s)\r
+    {\r
+        this->value[0] = fvec4SIMD(s, 0, 0, 0);\r
+        this->value[1] = fvec4SIMD(0, s, 0, 0);\r
+        this->value[2] = fvec4SIMD(0, 0, s, 0);\r
+        this->value[3] = fvec4SIMD(0, 0, 0, s);\r
+    }\r
+\r
+       inline fmat4x4SIMD::fmat4x4SIMD\r
+       (\r
+               float const & x0, float const & y0, float const & z0, float const & w0,\r
+               float const & x1, float const & y1, float const & z1, float const & w1,\r
+               float const & x2, float const & y2, float const & z2, float const & w2,\r
+               float const & x3, float const & y3, float const & z3, float const & w3\r
+       )\r
+       {\r
+        this->value[0] = fvec4SIMD(x0, y0, z0, w0);\r
+        this->value[1] = fvec4SIMD(x1, y1, z1, w1);\r
+        this->value[2] = fvec4SIMD(x2, y2, z2, w2);\r
+        this->value[3] = fvec4SIMD(x3, y3, z3, w3);\r
+       }\r
+\r
+       inline fmat4x4SIMD::fmat4x4SIMD\r
+       (\r
+               fvec4SIMD const & v0,\r
+               fvec4SIMD const & v1,\r
+               fvec4SIMD const & v2,\r
+               fvec4SIMD const & v3\r
+       )\r
+       {\r
+        this->value[0] = v0;\r
+        this->value[1] = v1;\r
+        this->value[2] = v2;\r
+        this->value[3] = v3;\r
+       }\r
+\r
+       inline fmat4x4SIMD::fmat4x4SIMD\r
+       (\r
+               tmat4x4 const & m\r
+       )\r
+       {\r
+        this->value[0] = fvec4SIMD(m[0]);\r
+        this->value[1] = fvec4SIMD(m[1]);\r
+        this->value[2] = fvec4SIMD(m[2]);\r
+        this->value[3] = fvec4SIMD(m[3]);\r
+       }\r
+\r
+       //////////////////////////////////////\r
+       // Accesses\r
+\r
+       inline fvec4SIMD & fmat4x4SIMD::operator[]\r
+       (\r
+               typename fmat4x4SIMD::size_type i\r
+       )\r
+       {\r
+               assert(\r
+                       i >= typename tmat4x4<valType>::size_type(0) && \r
+                       i < tmat4x4<valType>::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+       inline fvec4SIMD const & fmat4x4SIMD::operator[]\r
+       (\r
+               typename fmat4x4SIMD::size_type i\r
+       ) const\r
+       {\r
+               assert(\r
+                       i >= typename fmat4x4SIMD::size_type(0) && \r
+                       i < fmat4x4SIMD::col_size());\r
+\r
+               return value[i];\r
+       }\r
+\r
+    //////////////////////////////////////////////////////////////\r
+    // mat4 operators\r
+\r
+    inline fmat4x4SIMD& fmat4x4SIMD::operator= \r
+       (\r
+               fmat4x4SIMD const & m\r
+       )\r
+    {\r
+        this->value[0].Data = m[0].Data;\r
+        this->value[1].Data = m[1].Data;\r
+        this->value[2].Data = m[2].Data;\r
+        this->value[3].Data = m[3].Data;\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator+= \r
+       (\r
+               fmat4x4SIMD const & m\r
+       )\r
+    {\r
+               this->value[0].Data = _mm_add_ps(this->value[0].Data, m[0].Data);\r
+        this->value[1].Data = _mm_add_ps(this->value[1].Data, m[1].Data);\r
+        this->value[2].Data = _mm_add_ps(this->value[2].Data, m[2].Data);\r
+        this->value[3].Data = _mm_add_ps(this->value[3].Data, m[3].Data);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator-= \r
+       (\r
+               fmat4x4SIMD const & m\r
+       )\r
+    {\r
+               this->value[0].Data = _mm_sub_ps(this->value[0].Data, m[0].Data);\r
+        this->value[1].Data = _mm_sub_ps(this->value[1].Data, m[1].Data);\r
+        this->value[2].Data = _mm_sub_ps(this->value[2].Data, m[2].Data);\r
+        this->value[3].Data = _mm_sub_ps(this->value[3].Data, m[3].Data);\r
+\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator*= \r
+       (\r
+               fmat4x4SIMD const & m\r
+       )\r
+    {\r
+               _mm_mul_ps(this->Data, m.Data, this->Data);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator/= \r
+       (\r
+               fmat4x4SIMD const & m\r
+       )\r
+    {\r
+               __m128 Inv[4];\r
+               _mm_inverse_ps(m.Data, Inv);\r
+               _mm_mul_ps(this->Data, Inv, this->Data);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator+= \r
+       (\r
+               float const & s\r
+       )\r
+    {\r
+               __m128 Operand = _mm_set_ps1(s);\r
+               this->value[0].Data = _mm_add_ps(this->value[0].Data, Operand);\r
+        this->value[1].Data = _mm_add_ps(this->value[1].Data, Operand);\r
+        this->value[2].Data = _mm_add_ps(this->value[2].Data, Operand);\r
+        this->value[3].Data = _mm_add_ps(this->value[3].Data, Operand);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator-= \r
+       (\r
+               float const & s\r
+       )\r
+    {\r
+               __m128 Operand = _mm_set_ps1(s);\r
+        this->value[0].Data = _mm_sub_ps(this->value[0].Data, Operand);\r
+        this->value[1].Data = _mm_sub_ps(this->value[1].Data, Operand);\r
+        this->value[2].Data = _mm_sub_ps(this->value[2].Data, Operand);\r
+        this->value[3].Data = _mm_sub_ps(this->value[3].Data, Operand);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator*= \r
+       (\r
+               float const & s\r
+       )\r
+    {\r
+               __m128 Operand = _mm_set_ps1(s);\r
+        this->value[0].Data = _mm_mul_ps(this->value[0].Data, Operand);\r
+        this->value[1].Data = _mm_mul_ps(this->value[1].Data, Operand);\r
+        this->value[2].Data = _mm_mul_ps(this->value[2].Data, Operand);\r
+        this->value[3].Data = _mm_mul_ps(this->value[3].Data, Operand);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator/= \r
+       (\r
+               float const & s\r
+       )\r
+    {\r
+               __m128 Operand = _mm_div_ps(one, s));\r
+        this->value[0].Data = _mm_mul_ps(this->value[0].Data, Operand);\r
+        this->value[1].Data = _mm_mul_ps(this->value[1].Data, Operand);\r
+        this->value[2].Data = _mm_mul_ps(this->value[2].Data, Operand);\r
+        this->value[3].Data = _mm_mul_ps(this->value[3].Data, Operand);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator++ ()\r
+    {\r
+               this->value[0].Data = _mm_add_ps(this->value[0].Data, one);\r
+        this->value[1].Data = _mm_add_ps(this->value[1].Data, one);\r
+        this->value[2].Data = _mm_add_ps(this->value[2].Data, one);\r
+        this->value[3].Data = _mm_add_ps(this->value[3].Data, one);\r
+        return *this;\r
+    }\r
+\r
+    inline fmat4x4SIMD & fmat4x4SIMD::operator-- ()\r
+    {\r
+               this->value[0].Data = _mm_sub_ps(this->value[0].Data, one);\r
+        this->value[1].Data = _mm_sub_ps(this->value[1].Data, one);\r
+        this->value[2].Data = _mm_sub_ps(this->value[2].Data, one);\r
+        this->value[3].Data = _mm_sub_ps(this->value[3].Data, one);\r
+        return *this;\r
+    }\r
+\r
+}//namespace detail\r
+}//namespace glm\r
diff --git a/glm/gtx/simd_vec4.hpp b/glm/gtx/simd_vec4.hpp
new file mode 100644 (file)
index 0000000..daf7d4d
--- /dev/null
@@ -0,0 +1,130 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-07\r
+// Updated : 2009-05-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/simd_vec4.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - intrinsic\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_simd_vec4\r
+#define glm_gtx_simd_vec4\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../core/intrinsic_common.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               GLM_ALIGN(4) struct fvec4SIMD\r
+               {\r
+                       static __m128 one;\r
+\r
+                       union\r
+                       {\r
+                               __m128 Data;\r
+                               struct{float x, y, z, w;};\r
+                               float array[4];\r
+                       };\r
+\r
+                       //////////////////////////////////////\r
+                       // Implicit basic constructors\r
+\r
+                       fvec4SIMD();\r
+                       fvec4SIMD(__m128 const & Data);\r
+                       fvec4SIMD(fvec4SIMD const & v);\r
+                       fvec4SIMD(tvec4<float> const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Explicit basic constructors\r
+\r
+                       fvec4SIMD(float const & s);\r
+                       fvec4SIMD(float const & x, float const & y, float const & z, float const & w);\r
+                       fvec4SIMD(float const v[4]);\r
+\r
+                       ////////////////////////////////////////\r
+                       //// Swizzle constructors\r
+\r
+                       //fvec4SIMD(ref4<float> const & r);\r
+\r
+                       ////////////////////////////////////////\r
+                       //// Convertion vector constructors\r
+\r
+                       fvec4SIMD(vec2 const & v, float const & s1, float const & s2);\r
+                       fvec4SIMD(float const & s1, vec2 const & v, float const & s2);\r
+                       fvec4SIMD(float const & s1, float const & s2, vec2 const & v);\r
+                       fvec4SIMD(vec3 const & v, float const & s);\r
+                       fvec4SIMD(float const & s, vec3 const & v);\r
+                       fvec4SIMD(vec2 const & v1, vec2 const & v2);\r
+                       //fvec4SIMD(ivec4SIMD const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Unary arithmetic operators\r
+\r
+                       fvec4SIMD& operator= (fvec4SIMD const & v);\r
+                       fvec4SIMD& operator+=(fvec4SIMD const & v);\r
+                       fvec4SIMD& operator-=(fvec4SIMD const & v);\r
+                       fvec4SIMD& operator*=(fvec4SIMD const & v);\r
+                       fvec4SIMD& operator/=(fvec4SIMD const & v);\r
+\r
+                       fvec4SIMD& operator+=(float const & s);\r
+                       fvec4SIMD& operator-=(float const & s);\r
+                       fvec4SIMD& operator*=(float const & s);\r
+                       fvec4SIMD& operator/=(float const & s);\r
+\r
+                       fvec4SIMD& operator++();\r
+                       fvec4SIMD& operator--();\r
+\r
+                       ////////////////////////////////////////\r
+                       //// Unary bit operators\r
+\r
+                       //fvec4SIMD& operator%= (float s);\r
+                       //fvec4SIMD& operator%= (fvec4SIMD const & v);\r
+                       //fvec4SIMD& operator&= (float s);\r
+                       //fvec4SIMD& operator&= (fvec4SIMD const & v);\r
+                       //fvec4SIMD& operator|= (float s);\r
+                       //fvec4SIMD& operator|= (fvec4SIMD const & v);\r
+                       //fvec4SIMD& operator^= (float s);\r
+                       //fvec4SIMD& operator^= (fvec4SIMD const & v);\r
+                       //fvec4SIMD& operator<<=(float s);\r
+                       //fvec4SIMD& operator<<=(fvec4SIMD const & v);\r
+                       //fvec4SIMD& operator>>=(float s);\r
+                       //fvec4SIMD& operator>>=(fvec4SIMD const & v);\r
+\r
+                       //////////////////////////////////////\r
+                       // Swizzle operators\r
+\r
+                       //float swizzle(comp X) const;\r
+                       //vec2 const swizzle(comp X, comp Y) const;\r
+                       //vec3 const swizzle(comp X, comp Y, comp Z) const;\r
+                       //fvec4SIMD const swizzle(comp X, comp Y, comp Z, comp W) const;\r
+                       //fvec4SIMD const swizzle(int X, int Y, int Z, int W) const;\r
+                       //ref4<float> swizzle(comp X, comp Y, comp Z, comp W);\r
+               };\r
+\r
+       }//namespace detail\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_simd_vec4 extension: SIMD implementation of vec4 type.\r
+       namespace simd_vec4\r
+       {\r
+               typedef detail::fvec4SIMD vec4SIMD;\r
+\r
+       }//namespace simd_vec4\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_simd_vec4              namespace gtx::simd_vec4;\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_simd_vec4;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "simd_vec4.inl"\r
+\r
+#endif//glm_gtx_simd_vec4\r
diff --git a/glm/gtx/simd_vec4.inl b/glm/gtx/simd_vec4.inl
new file mode 100644 (file)
index 0000000..461675b
--- /dev/null
@@ -0,0 +1,263 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-07\r
+// Updated : 2009-05-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/simd_vec4.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+       namespace detail\r
+       {\r
+               __m128 fvec4SIMD::one = _mm_set_ps1(1.f);\r
+\r
+               //////////////////////////////////////\r
+               // Implicit basic constructors\r
+\r
+               inline fvec4SIMD::fvec4SIMD()\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(__m128 const & Data) :\r
+                       Data(Data)\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(fvec4SIMD const & v) :\r
+                       Data(v.Data)\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(tvec4<float> const & v) :\r
+                       Data(_mm_set_ps(v.w, v.z, v.y, v.x))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Explicit basic constructors\r
+\r
+               inline fvec4SIMD::fvec4SIMD(float const & s) :\r
+                       Data(_mm_set1_ps(s))\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(float const & x, float const & y, float const & z, float const & w) :\r
+       //              Data(_mm_setr_ps(x, y, z, w))\r
+                       Data(_mm_set_ps(w, z, y, x))\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(float const v[4]) :\r
+                       Data(_mm_load_ps(v))\r
+               {}\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle constructors\r
+\r
+               //fvec4SIMD(ref4<float> const & r);\r
+\r
+               //////////////////////////////////////\r
+               // Convertion vector constructors\r
+\r
+               inline fvec4SIMD::fvec4SIMD(vec2 const & v, float const & s1, float const & s2) :\r
+                       Data(_mm_set_ps(s2, s1, v.y, v.x))\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(float const & s1, vec2 const & v, float const & s2) :\r
+                       Data(_mm_set_ps(s2, v.y, v.x, s1))\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(float const & s1, float const & s2, vec2 const & v) :\r
+                       Data(_mm_set_ps(v.y, v.x, s2, s1))\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(vec3 const & v, float const & s) :\r
+                       Data(_mm_set_ps(s, v.z, v.y, v.x))\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(float const & s, vec3 const & v) :\r
+                       Data(_mm_set_ps(v.z, v.y, v.x, s))\r
+               {}\r
+\r
+               inline fvec4SIMD::fvec4SIMD(vec2 const & v1, vec2 const & v2) :\r
+                       Data(_mm_set_ps(v2.y, v2.x, v1.y, v1.x))\r
+               {}\r
+\r
+               //inline fvec4SIMD::fvec4SIMD(ivec4SIMD const & v) :\r
+               //      Data(_mm_cvtepi32_ps(v.Data))\r
+               //{}\r
+\r
+               //////////////////////////////////////\r
+               // Unary arithmetic operators\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator=(fvec4SIMD const & v)\r
+               {\r
+                       this->Data = v.Data;\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator+=(float const & s)\r
+               {\r
+                       this->Data = _mm_add_ps(Data, _mm_set_ps1(s));\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator+=(fvec4SIMD const & v)\r
+               {\r
+                       this->Data = _mm_add_ps(this->Data , v.Data);\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator-=(float const & s)\r
+               {\r
+                       this->Data = _mm_sub_ps(Data, _mm_set_ps1(s));\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator-=(fvec4SIMD const & v)\r
+               {\r
+                       this->Data = _mm_sub_ps(this->Data , v.Data);\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator*=(float const & s)\r
+               {\r
+                       this->Data = _mm_mul_ps(this->Data, _mm_set_ps1(s));\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator*=(fvec4SIMD const & v)\r
+               {\r
+                       this->Data = _mm_mul_ps(this->Data , v.Data);\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator/=(float const & s)\r
+               {\r
+                       this->Data = _mm_div_ps(Data, _mm_set1_ps(s));\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator/=(fvec4SIMD const & v)\r
+               {\r
+                       this->Data = _mm_div_ps(this->Data , v.Data);\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator++()\r
+               {\r
+                       this->Data = _mm_add_ps(this->Data , glm::detail::one);\r
+                       return *this;\r
+               }\r
+\r
+               inline fvec4SIMD& fvec4SIMD::operator--()\r
+               {\r
+                       this->Data = _mm_sub_ps(this->Data , glm::detail::one);\r
+                       return *this;\r
+               }\r
+\r
+               //////////////////////////////////////\r
+               // Swizzle operators\r
+\r
+               //inline fvec4SIMD const fvec4SIMD::swizzle(int d, int c, int b, int a) const\r
+               //{\r
+               //      int const Mask = ((d << 6) | (c << 4) | (b << 2) | (a << 0));\r
+\r
+               //      __m128 Data = _mm_shuffle_ps(this->Data, this->Data, Mask);\r
+               //      return fvec4SIMD(Data);\r
+               //}\r
+\r
+               // operator+\r
+               inline fvec4SIMD operator+ (fvec4SIMD const & v, float s)\r
+               {\r
+                       return fvec4SIMD(_mm_add_ps(v.Data, _mm_set1_ps(s)));\r
+               }\r
+\r
+               inline fvec4SIMD operator+ (float s, fvec4SIMD const & v)\r
+               {\r
+                       return fvec4SIMD(_mm_add_ps(_mm_set1_ps(s), v.Data));\r
+               }\r
+\r
+               inline fvec4SIMD operator+ (fvec4SIMD const & v1, fvec4SIMD const & v2)\r
+               {\r
+                       return fvec4SIMD(_mm_add_ps(v1.Data, v2.Data));\r
+               }\r
+\r
+               //operator-\r
+               inline fvec4SIMD operator- (fvec4SIMD const & v, float s)\r
+               {\r
+                       return fvec4SIMD(_mm_sub_ps(v.Data, _mm_set1_ps(s)));\r
+               }\r
+\r
+               inline fvec4SIMD operator- (float s, fvec4SIMD const & v)\r
+               {\r
+                       return fvec4SIMD(_mm_sub_ps(_mm_set1_ps(s), v.Data));\r
+               }\r
+\r
+               inline fvec4SIMD operator- (fvec4SIMD const & v1, fvec4SIMD const & v2)\r
+               {\r
+                       return fvec4SIMD(_mm_sub_ps(v1.Data, v2.Data));\r
+               }\r
+\r
+               //operator*\r
+               inline fvec4SIMD operator* (fvec4SIMD const & v, float s)\r
+               {\r
+                       __m128 par0 = v.Data;\r
+                       __m128 par1 = _mm_set1_ps(s);\r
+                       return fvec4SIMD(_mm_mul_ps(par0, par1));\r
+               }\r
+\r
+               inline fvec4SIMD operator* (float s, fvec4SIMD const & v)\r
+               {\r
+                       __m128 par0 = _mm_set1_ps(s);\r
+                       __m128 par1 = v.Data;\r
+                       return fvec4SIMD(_mm_mul_ps(par0, par1));\r
+               }\r
+\r
+               inline fvec4SIMD operator* (fvec4SIMD const & v1, fvec4SIMD const & v2)\r
+               {\r
+                       return fvec4SIMD(_mm_mul_ps(v1.Data, v2.Data));\r
+               }\r
+\r
+               //operator/\r
+               inline fvec4SIMD operator/ (fvec4SIMD const & v, float s)\r
+               {\r
+                       __m128 par0 = v.Data;\r
+                       __m128 par1 = _mm_set1_ps(s);\r
+                       return fvec4SIMD(_mm_div_ps(par0, par1));\r
+               }\r
+\r
+               inline fvec4SIMD operator/ (float s, fvec4SIMD const & v)\r
+               {\r
+                       __m128 par0 = _mm_set1_ps(s);\r
+                       __m128 par1 = v.Data;\r
+                       return fvec4SIMD(_mm_div_ps(par0, par1));\r
+               }\r
+\r
+               inline fvec4SIMD operator/ (fvec4SIMD const & v1, fvec4SIMD const & v2)\r
+               {\r
+                       return fvec4SIMD(_mm_div_ps(v1.Data, v2.Data));\r
+               }\r
+\r
+               // Unary constant operators\r
+               inline fvec4SIMD operator- (fvec4SIMD const & v)\r
+               {\r
+                       return fvec4SIMD(_mm_sub_ps(_mm_setzero_ps(), v.Data));\r
+               }\r
+\r
+               inline fvec4SIMD operator++ (fvec4SIMD const & v, int)\r
+               {\r
+                       return fvec4SIMD(_mm_add_ps(v.Data, glm::detail::one));\r
+               }\r
+\r
+               inline fvec4SIMD operator-- (fvec4SIMD const & v, int)\r
+               {\r
+                       return fvec4SIMD(_mm_sub_ps(v.Data, glm::detail::one));\r
+               }\r
+\r
+       }//namespace detail\r
+\r
+       namespace gtx{\r
+       namespace simd_vec4\r
+       {\r
+               \r
+\r
+       }//namespace simd_vec4\r
+       }//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/spline.hpp b/glm/gtx/spline.hpp
new file mode 100644 (file)
index 0000000..bff9e58
--- /dev/null
@@ -0,0 +1,68 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-01-25\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/spline.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_spline\r
+#define glm_gtx_spline\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/optimum_pow.hpp"\r
+\r
+namespace glm\r
+{\r
+    namespace gtx{\r
+       //! GLM_GTX_spline extension: Spline functions\r
+    namespace spline\r
+    {\r
+        //! Return a point from a catmull rom curve.\r
+               //! From GLM_GTX_spline extension.\r
+               template <typename genType> \r
+               genType catmullRom(\r
+                       const genType& v1, \r
+                       const genType& v2, \r
+                       const genType& v3, \r
+                       const genType& v4, \r
+                       const GLMvalType& s);\r
+               \r
+               //! Return a point from a hermite curve.\r
+               //! From GLM_GTX_spline extension.\r
+        template <typename genType> \r
+               genType hermite(\r
+                       const genType& v1, \r
+                       const genType& t1, \r
+                       const genType& v2, \r
+                       const genType& t2, \r
+                       const GLMvalType& s);\r
+               \r
+        //! Return a point from a cubic curve. \r
+               //! From GLM_GTX_spline extension.\r
+               template <typename genType> \r
+               genType cubic(\r
+                       const genType& v1, \r
+                       const genType& v2, \r
+                       const genType& v3, \r
+                       const genType& v4, \r
+                       const GLMvalType& s);\r
+\r
+       }//namespace spline\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_spline namespace gtx::optimum_pow; using namespace gtx::spline\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_spline;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "spline.inl"\r
+\r
+#endif//glm_gtx_spline\r
+\r
diff --git a/glm/gtx/spline.inl b/glm/gtx/spline.inl
new file mode 100644 (file)
index 0000000..5427ce5
--- /dev/null
@@ -0,0 +1,68 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-01-25\r
+// Updated : 2009-02-19\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/spline.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace spline\r
+{\r
+       template <typename genType>\r
+       inline genType catmullRom(\r
+               const genType& v1, \r
+               const genType& v2, \r
+               const genType& v3, \r
+               const genType& v4, \r
+               const GLMvalType& s)\r
+       {\r
+               GLMvalType s1 = s;\r
+               GLMvalType s2 = optimum_pow::pow2(s);\r
+               GLMvalType s3 = optimum_pow::pow3(s);\r
+\r
+               GLMvalType f1 = -s3 + GLMvalType(2) * s2 - s;\r
+               GLMvalType f2 = GLMvalType(3) * s3 - GLMvalType(5) * s2 + GLMvalType(2);\r
+               GLMvalType f3 = GLMvalType(-3) * s3 + GLMvalType(4) * s2 + s;\r
+               GLMvalType f4 = s3 - s2;\r
+\r
+               return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / GLMvalType(2);\r
+\r
+       }\r
+\r
+       template <typename genType>\r
+       inline genType hermite(\r
+               const genType& v1, \r
+               const genType& t1, \r
+               const genType& v2, \r
+               const genType& t2, \r
+               const GLMvalType& s)\r
+       {\r
+               GLMvalType s1 = s;\r
+               GLMvalType s2 = optimum_pow::pow2(s);\r
+               GLMvalType s3 = optimum_pow::pow3(s);\r
+\r
+               GLMvalType f1 = GLMvalType(2) * s3 - GLMvalType(3) * s2 + GLMvalType(1);\r
+               GLMvalType f2 = GLMvalType(-2) * s3 + GLMvalType(3) * s2;\r
+               GLMvalType f3 = s3 - GLMvalType(2) * s2 + s;\r
+               GLMvalType f4 = s3 - s2;\r
+\r
+               return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2;\r
+       }\r
+\r
+       template <typename genType>\r
+       inline genType cubic(\r
+               const genType& v1, \r
+               const genType& v2, \r
+               const genType& v3, \r
+               const genType& v4, \r
+               const GLMvalType& s)\r
+       {\r
+               return ((v1 * s + v2) * s + v3) * s + v4;\r
+       }\r
+\r
+}//namespace spline\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/statistics_operation.hpp b/glm/gtx/statistics_operation.hpp
new file mode 100644 (file)
index 0000000..65429e3
--- /dev/null
@@ -0,0 +1,70 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-11-21\r
+// Updated : 2007-11-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/statistics_operation.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_statistics_operation\r
+#define glm_gtx_statistics_operation\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       template <typename T> T statDistanceGTX(const detail::tvec2<T>& v1, const detail::tvec2<T>& v2);\r
+    template <typename T> T statDistanceGTX(const detail::tvec3<T>& v1, const detail::tvec3<T>& v2);\r
+    template <typename T> T statDistanceGTX(const detail::tvec4<T>& v1, const detail::tvec4<T>& v2);\r
+\r
+    template <typename T> T statDistanceGTX(const detail::tmat2x2<T>& m1, const detail::tmat2x2<T>& m2);\r
+    template <typename T> T statDistanceGTX(const detail::tmat3x3<T>& m1, const detail::tmat3x3<T>& m2);\r
+    template <typename T> T statDistanceGTX(const detail::tmat4x4<T>& m1, const detail::tmat4x4<T>& m2);\r
+\r
+    template <typename T> T expectedValueGTX(const detail::tvec2<T>& v1, const detail::tvec2<T>& v2);\r
+    template <typename T> T expectedValueGTX(const detail::tvec3<T>& v1, const detail::tvec3<T>& v2);\r
+    template <typename T> T expectedValueGTX(const detail::tvec4<T>& v1, const detail::tvec4<T>& v2);\r
+\r
+    template <typename T> T expectedValueGTX(const detail::tmat2x2<T>& m1, const detail::tmat2x2<T>& m2);\r
+    template <typename T> T expectedValueGTX(const detail::tmat3x3<T>& m1, const detail::tmat3x3<T>& m2);\r
+    template <typename T> T expectedValueGTX(const detail::tmat4x4<T>& m1, const detail::tmat4x4<T>& m2);\r
+\r
+    template <typename T> T varianceGTX(const detail::tvec2<T>& v1, const detail::tvec2<T>& v2);\r
+    template <typename T> T varianceGTX(const detail::tvec3<T>& v1, const detail::tvec3<T>& v2);\r
+    template <typename T> T varianceGTX(const detail::tvec4<T>& v1, const detail::tvec4<T>& v2);\r
+\r
+    template <typename T> T varianceGTX(const detail::tmat2x2<T>& m1, const detail::tmat2x2<T>& m2);\r
+    template <typename T> T varianceGTX(const detail::tmat3x3<T>& m1, const detail::tmat3x3<T>& m2);\r
+    template <typename T> T varianceGTX(const detail::tmat4x4<T>& m1, const detail::tmat4x4<T>& m2);\r
+\r
+    template <typename T> T standardDevitionGTX(const detail::tvec2<T>& v1, const detail::tvec2<T>& v2);\r
+    template <typename T> T standardDevitionGTX(const detail::tvec3<T>& v1, const detail::tvec3<T>& v2);\r
+    template <typename T> T standardDevitionGTX(const detail::tvec4<T>& v1, const detail::tvec4<T>& v2);\r
+\r
+    template <typename T> T standardDevitionGTX(const detail::tmat2x2<T>& m1, const detail::tmat2x2<T>& m2);\r
+    template <typename T> T standardDevitionGTX(const detail::tmat3x3<T>& m1, const detail::tmat3x3<T>& m2);\r
+    template <typename T> T standardDevitionGTX(const detail::tmat4x4<T>& m1, const detail::tmat4x4<T>& m2);\r
+\r
+    namespace gtx\r
+    {\r
+               //! GLM_GTX_statistics_operation extension: - Work in progress - Statistics functions\r
+        namespace statistics_operation\r
+        {\r
+\r
+        }\r
+    }\r
+}\r
+\r
+#define GLM_GTX_statistics_operation namespace gtx::statistics_operation\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_statistics_operation;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "statistics_operation.inl"\r
+\r
+#endif//glm_gtx_statistics_operation\r
diff --git a/glm/gtx/statistics_operation.inl b/glm/gtx/statistics_operation.inl
new file mode 100644 (file)
index 0000000..7c3b9e4
--- /dev/null
@@ -0,0 +1,81 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-11-21\r
+// Updated : 2007-11-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/statistics_operator.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <cassert>\r
+\r
+namespace glm\r
+{\r
+    //! Compute the sum of square of differences between each matrices paremeters\r
+    template <typename T>\r
+    inline T statDistanceGTX(const detail::tmat2x2<T>& m1, const detail::tmat2x2<T>& m2)\r
+    {\r
+        T result = T(0);\r
+        for(int j = 0; j < 2; ++j)\r
+        for(int i = 0; i < 2; ++i)\r
+        {\r
+            T diff = m1[j][i] - m2[j][i];\r
+            result += diff * diff;\r
+        }\r
+        return result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline T statDistanceGTX(const detail::tmat3x3<T>& m1, const detail::tmat3x3<T>& m2)\r
+    {\r
+        T result = T(0);\r
+        for(int j = 0; j < 3; ++j)\r
+        for(int i = 0; i < 3; ++i)\r
+        {\r
+            T diff = m1[j][i] - m2[j][i];\r
+            result += diff * diff;\r
+        }\r
+        return result;\r
+    }\r
+\r
+    template <typename T>\r
+    inline T statDistanceGTX(const detail::tmat4x4<T>& m1, const detail::tmat4x4<T>& m2)\r
+    {\r
+        T result = T(0);\r
+        for(int j = 0; j < 4; ++j)\r
+        for(int i = 0; i < 4; ++i)\r
+        {\r
+            T diff = m1[j][i] - m2[j][i];\r
+            result += diff * diff;\r
+        }\r
+        return result;\r
+    }\r
+\r
+    template <typename T> \r
+    T expectedValueGTX(const detail::tmat4x4<T>& m)\r
+    {\r
+        T result = T(0);\r
+        for(int j = 0; j < 4; ++j)\r
+        for(int i = 0; i < 4; ++i)\r
+            result += m[j][i];\r
+        result *= T(0,0625);\r
+        return result;\r
+    }\r
+\r
+    template <typename T> \r
+    T varianceGTX(const detail::tmat4x4<T>& m)\r
+    {\r
+        T ExpectedValue = expectedValueGTX(m);\r
+        T ExpectedValueOfSquaredMatrix = expectedValueGTX(matrixCompMult(m));\r
+        return ExpectedValueOfSquaredMatrix - ExpectedValue * ExpectedValue;\r
+    }\r
+\r
+    template <typename T> \r
+    T standardDevitionGTX(const detail::tmat4x4<T>& m)\r
+    {\r
+        return sqrt(varianceGTX(m));\r
+    }\r
+}\r
diff --git a/glm/gtx/std_based_type.hpp b/glm/gtx/std_based_type.hpp
new file mode 100644 (file)
index 0000000..4a88053
--- /dev/null
@@ -0,0 +1,77 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-06-08\r
+// Updated : 2008-06-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/std_based_type.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_std_based_type\r
+#define glm_gtx_std_based_type\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include <cstdlib>\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_std_based_type();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_std_based_type extension: Add support vector types based on C++ standard type\r
+       namespace std_based_type\r
+       {\r
+               typedef detail::tvec2<std::size_t>              size2;\r
+               typedef detail::tvec3<std::size_t>              size3;\r
+               typedef detail::tvec4<std::size_t>              size4;\r
+\r
+               typedef detail::tvec2<signed char>              scvec2;\r
+               typedef detail::tvec3<signed char>              scvec3;\r
+               typedef detail::tvec4<signed char>              scvec4;\r
+\r
+               typedef detail::tvec2<unsigned char>    ucvec2;\r
+               typedef detail::tvec3<unsigned char>    ucvec3;\r
+               typedef detail::tvec4<unsigned char>    ucvec4;\r
+\r
+               typedef detail::tvec2<signed short>             ssvec2;\r
+               typedef detail::tvec3<signed short>             ssvec3;\r
+               typedef detail::tvec4<signed short>             ssvec4;\r
+\r
+               typedef detail::tvec2<unsigned short>   usvec2;\r
+               typedef detail::tvec3<unsigned short>   usvec3;\r
+               typedef detail::tvec4<unsigned short>   usvec4;\r
+\r
+               typedef detail::tvec2<signed int>               sivec2;\r
+               typedef detail::tvec3<signed int>               sivec3;\r
+               typedef detail::tvec4<signed int>               sivec4;\r
+\r
+               typedef detail::tvec2<unsigned int>             uivec2;\r
+               typedef detail::tvec3<unsigned int>             uivec3;\r
+               typedef detail::tvec4<unsigned int>             uivec4;\r
+\r
+               typedef detail::tvec2<signed long>              slvec2;\r
+               typedef detail::tvec3<signed long>              slvec3;\r
+               typedef detail::tvec4<signed long>              slvec4;\r
+\r
+               typedef detail::tvec2<unsigned long>    ulvec2;\r
+               typedef detail::tvec3<unsigned long>    ulvec3;\r
+               typedef detail::tvec4<unsigned long>    ulvec4;\r
+\r
+       }//namespace std_based_type\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_std_based_type namespace gtx::std_based_type\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_std_based_type;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "std_based_type.inl"\r
+\r
+#endif//glm_gtx_std_based_type\r
diff --git a/glm/gtx/std_based_type.inl b/glm/gtx/std_based_type.inl
new file mode 100644 (file)
index 0000000..877436f
--- /dev/null
@@ -0,0 +1,13 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-06-08\r
+// Updated : 2008-06-08\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/std_based_type.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm\r
+{\r
+\r
+}\r
diff --git a/glm/gtx/string_cast.hpp b/glm/gtx/string_cast.hpp
new file mode 100644 (file)
index 0000000..ce980c2
--- /dev/null
@@ -0,0 +1,61 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2006 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-04-26\r
+// Updated : 2008-05-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/string_cast.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_double\r
+// - GLM_GTX_half\r
+// - GLM_GTX_integer\r
+// - GLM_GTX_quaternion\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_string_cast\r
+#define glm_gtx_string_cast\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/double_float.hpp"\r
+#include "../gtc/half_float.hpp"\r
+#include "../gtx/integer.hpp"\r
+#include "../gtx/unsigned_int.hpp"\r
+#include "../gtx/quaternion.hpp"\r
+#include <string>\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_string_cast();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_string_cast extension: Setup strings for GLM type values\r
+       namespace string_cast\r
+       {\r
+               using namespace gtc::double_float; \r
+               using namespace gtc::half_float; \r
+               using namespace gtx::integer; \r
+               using namespace gtx::unsigned_int; \r
+               using namespace gtx::quaternion; \r
+\r
+               //! Create a string from a GLM type value.\r
+               //! From GLM_GTX_string_cast extension.\r
+               template <typename genType> \r
+               std::string string(genType const & x);\r
+\r
+       }//namespace string_cast\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_string_cast namespace gtx::string_cast\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_string_cast;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "string_cast.inl"\r
+\r
+#endif//glm_gtx_string_cast\r
diff --git a/glm/gtx/string_cast.inl b/glm/gtx/string_cast.inl
new file mode 100644 (file)
index 0000000..c9e9134
--- /dev/null
@@ -0,0 +1,597 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2006 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-04-27\r
+// Updated : 2008-05-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/string_cast.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <cstdarg>\r
+#include <cstdio>\r
+\r
+namespace glm{\r
+namespace detail\r
+{\r
+       inline std::string format(const char* msg, ...)\r
+       {\r
+               const int STRING_BUFFER = 4096;\r
+               char text[STRING_BUFFER];\r
+               va_list list;\r
+\r
+               if(msg == 0)\r
+                       return std::string();\r
+\r
+               va_start(list, msg);\r
+                       vsprintf(text, msg, list);\r
+               va_end(list);\r
+\r
+               return std::string(text);\r
+       }\r
+\r
+       static const char* True = "true";\r
+       static const char* False = "false";\r
+}//namespace detail\r
+\r
+namespace gtx{\r
+namespace string_cast\r
+{\r
+       ////////////////////////////////\r
+       // Scalars\r
+\r
+       inline std::string string(detail::thalf const & x)\r
+       {\r
+               return detail::format("half(%f)", float(x));\r
+       }\r
+\r
+       inline std::string string(float x)\r
+       {\r
+               return detail::format("float(%f)", x);\r
+       }\r
+\r
+       inline std::string string(double x)\r
+       {\r
+               return detail::format("double(%f)", x);\r
+       }\r
+\r
+       inline std::string string(int x)\r
+       {\r
+               return detail::format("int(%d)", x);\r
+       }\r
+\r
+       inline std::string string(unsigned int x)\r
+       {\r
+               return detail::format("uint(%d)", x);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Bool vectors\r
+\r
+       inline std::string string\r
+       (\r
+               detail::tvec2<bool> const & v\r
+       )\r
+       {\r
+               return detail::format("bvec2(%s, %s)", \r
+                       v.x ? detail::True : detail::False, \r
+                       v.y ? detail::True : detail::False);\r
+       }\r
+\r
+       inline std::string string\r
+       (\r
+               detail::tvec3<bool> const & v\r
+       )\r
+       {\r
+               return detail::format("bvec3(%s, %s, %s)", \r
+                       v.x ? detail::True : detail::False, \r
+                       v.y ? detail::True : detail::False, \r
+                       v.z ? detail::True : detail::False);\r
+       }\r
+\r
+       inline std::string string\r
+       (\r
+               detail::tvec4<bool> const & v\r
+       )\r
+       {\r
+               return detail::format("bvec4(%s, %s, %s, %s)", \r
+                       v.x ? detail::True : detail::False, \r
+                       v.y ? detail::True : detail::False, \r
+                       v.z ? detail::True : detail::False, \r
+                       v.w ? detail::True : detail::False);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Half vectors\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tvec2<detail::thalf> const & v\r
+       )\r
+       {\r
+               return detail::format("hvec2(%f, %f)", float(v.x), float(v.y));\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec3<detail::thalf> const & v\r
+       )\r
+       {\r
+               return detail::format("hvec3(%f, %f, %f)", float(v.x), float(v.y), float(v.z));\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec4<detail::thalf> const & v\r
+       )\r
+       {\r
+               return detail::format("hvec4(%f, %f, %f, %f)", float(v.x), float(v.y), float(v.z), float(v.w));\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Float vectors\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tvec2<float> const & v\r
+       )\r
+       {\r
+               return detail::format("fvec2(%f, %f)", v.x, v.y);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec3<float> const & v\r
+       )\r
+       {\r
+               return detail::format("fvec3(%f, %f, %f)", v.x, v.y, v.z);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec4<float> const & v\r
+       )\r
+       {\r
+               return detail::format("fvec4(%f, %f, %f, %f)", v.x, v.y, v.z, v.w);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Double vectors\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tvec2<double> const & v\r
+       )\r
+       {\r
+               return detail::format("dvec2(%f, %f)", v.x, v.y);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec3<double> const & v\r
+       )\r
+       {\r
+               return detail::format("dvec3(%f, %f, %f)", v.x, v.y, v.z);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec4<double> const & v\r
+       )\r
+       {\r
+               return detail::format("dvec4(%f, %f, %f, %f)", v.x, v.y, v.z, v.w);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Int vectors\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tvec2<int> const & v\r
+       )\r
+       {\r
+               return detail::format("ivec2(%d, %d)", v.x, v.y);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec3<int> const & v\r
+       )\r
+       {\r
+               return detail::format("ivec3(%d, %d, %d)", v.x, v.y, v.z);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec4<int> const & v\r
+       )\r
+       {\r
+               return detail::format("ivec4(%d, %d, %d, %d)", v.x, v.y, v.z, v.w);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Unsigned int vectors\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tvec2<unsigned int> const & v\r
+       )\r
+       {\r
+               return detail::format("uvec2(%d, %d)", v.x, v.y);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec3<unsigned int> const & v\r
+       )\r
+       {\r
+               return detail::format("uvec3(%d, %d, %d)", v.x, v.y, v.z);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tvec4<unsigned int> const & v\r
+       )\r
+       {\r
+               return detail::format("uvec4(%d, %d, %d, %d)", v.x, v.y, v.z, v.w);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Half matrices\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x2<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat2x2<float> x(m);\r
+               return detail::format("hmat2x2((%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x3<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat2x3<float> x(m);\r
+               return detail::format("hmat2x3((%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], \r
+                       x[1][0], x[1][1], x[1][2]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x4<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat2x4<float> x(m);\r
+               return detail::format("hmat2x4((%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3], \r
+                       x[1][0], x[1][1], x[1][2], x[1][3]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x2<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat3x2<float> x(m);\r
+               return detail::format("hmat3x2((%f, %f), (%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1], \r
+                       x[2][0], x[2][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x3<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat3x3<float> x(m);\r
+               return detail::format("hmat3x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], \r
+                       x[1][0], x[1][1], x[1][2],\r
+                       x[2][0], x[2][1], x[2][2]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x4<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat3x4<float> x(m);\r
+               return detail::format("hmat3x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3], \r
+                       x[1][0], x[1][1], x[1][2], x[1][3], \r
+                       x[2][0], x[2][1], x[2][2], x[2][3]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat4x2<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat4x2<float> x(m);\r
+               return detail::format("hmat4x2((%f, %f), (%f, %f), (%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1], \r
+                       x[2][0], x[2][1], \r
+                       x[3][0], x[3][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat4x3<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat4x3<float> x(m);\r
+               return detail::format("hmat4x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2],\r
+                       x[1][0], x[1][1], x[1][2], \r
+                       x[2][0], x[2][1], x[2][2],\r
+                       x[3][0], x[3][1], x[3][2]);\r
+       }\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tmat4x4<detail::thalf> const & m\r
+       )\r
+       {\r
+               detail::tmat4x4<float> x(m);\r
+               return detail::format("hmat4x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3],\r
+                       x[1][0], x[1][1], x[1][2], x[1][3],\r
+                       x[2][0], x[2][1], x[2][2], x[2][3],\r
+                       x[3][0], x[3][1], x[3][2], x[3][3]);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Float matrices\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x2<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat2x2((%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x3<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat2x3((%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], \r
+                       x[1][0], x[1][1], x[1][2]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x4<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat2x4((%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3], \r
+                       x[1][0], x[1][1], x[1][2], x[1][3]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x2<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat3x2((%f, %f), (%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1], \r
+                       x[2][0], x[2][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x3<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat3x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], \r
+                       x[1][0], x[1][1], x[1][2],\r
+                       x[2][0], x[2][1], x[2][2]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x4<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat3x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3], \r
+                       x[1][0], x[1][1], x[1][2], x[1][3], \r
+                       x[2][0], x[2][1], x[2][2], x[2][3]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat4x2<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat4x2((%f, %f), (%f, %f), (%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1], \r
+                       x[2][0], x[2][1], \r
+                       x[3][0], x[3][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat4x3<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat4x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2],\r
+                       x[1][0], x[1][1], x[1][2], \r
+                       x[2][0], x[2][1], x[2][2],\r
+                       x[3][0], x[3][1], x[3][2]);\r
+       }\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tmat4x4<float> const & x\r
+       )\r
+       {\r
+               return detail::format("mat4x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3],\r
+                       x[1][0], x[1][1], x[1][2], x[1][3],\r
+                       x[2][0], x[2][1], x[2][2], x[2][3],\r
+                       x[3][0], x[3][1], x[3][2], x[3][3]);\r
+       }\r
+\r
+       ////////////////////////////////\r
+       // Double matrices\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x2<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat2x2((%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x3<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat2x3((%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], \r
+                       x[1][0], x[1][1], x[1][2]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat2x4<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat2x4((%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3], \r
+                       x[1][0], x[1][1], x[1][2], x[1][3]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x2<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat3x2((%f, %f), (%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1],\r
+                       x[2][0], x[2][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x3<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat3x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], \r
+                       x[1][0], x[1][1], x[1][2],\r
+                       x[2][0], x[2][1], x[2][2]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat3x4<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat3x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3], \r
+                       x[1][0], x[1][1], x[1][2], x[1][3],\r
+                       x[2][0], x[2][1], x[2][2], x[2][3]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat4x2<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat4x2((%f, %f), (%f, %f), (%f, %f), (%f, %f))", \r
+                       x[0][0], x[0][1], \r
+                       x[1][0], x[1][1], \r
+                       x[2][0], x[2][1], \r
+                       x[3][0], x[3][1]);\r
+       }\r
+\r
+       template <> \r
+       inline std::string string\r
+       (\r
+               detail::tmat4x3<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat4x3((%f, %f, %f), (%f, %f, %f), (%f, %f, %f), (%f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], \r
+                       x[1][0], x[1][1], x[1][2], \r
+                       x[2][0], x[2][1], x[2][2], \r
+                       x[3][0], x[3][1], x[3][2]);\r
+       }\r
+\r
+       template <>\r
+       inline std::string string\r
+       (\r
+               detail::tmat4x4<double> const & x\r
+       )\r
+       {\r
+               return detail::format("dmat4x4((%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f), (%f, %f, %f, %f))", \r
+                       x[0][0], x[0][1], x[0][2], x[0][3],\r
+                       x[1][0], x[1][1], x[1][2], x[1][3],\r
+                       x[2][0], x[2][1], x[2][2], x[2][3],\r
+                       x[3][0], x[3][1], x[3][2], x[3][3]);\r
+       }\r
+\r
+       }//namespace string_cast\r
+       }//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/transform.hpp b/glm/gtx/transform.hpp
new file mode 100644 (file)
index 0000000..410527e
--- /dev/null
@@ -0,0 +1,104 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/transform.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTC_matric_transform\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_transform\r
+#define glm_gtx_transform\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtc/matrix_transform.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_transform();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_transform extension: Add transformation matrices\r
+       namespace transform\r
+       {\r
+               using namespace gtc::matrix_transform; \r
+\r
+               //! Builds a translation 4 * 4 matrix created from 3 scalars.\r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> translate(\r
+                       T x, T y, T z);\r
+               \r
+               //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. \r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> translate(\r
+                       detail::tmat4x4<T> const & m, \r
+                       T x, T y, T z);\r
+               \r
+               //! Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. \r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> translate(\r
+                       detail::tvec3<T> const & v);\r
+\r
+               //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. \r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> rotate(\r
+                       T angle, \r
+                       T x, T y, T z);\r
+\r
+               //! Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. \r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> rotate(\r
+                       T angle, \r
+                       detail::tvec3<T> const & v);\r
+\r
+               //! Transforms a matrix with a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in degrees. \r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> rotate(\r
+                       detail::tmat4x4<T> const & m, \r
+                       T angle, \r
+                       T x, T y, T z);\r
+               \r
+               //! Builds a scale 4 * 4 matrix created from 3 scalars. \r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> scale(\r
+                       T x, T y, T z);\r
+               \r
+               //! Transforms a matrix with a scale 4 * 4 matrix created from 3 scalars.\r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> scale(\r
+                       detail::tmat4x4<T> const & m, \r
+                       T x, T y, T z);\r
+\r
+               //! Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components.\r
+               //! From GLM_GTX_transform extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> scale(\r
+                       detail::tvec3<T> const & v);\r
+\r
+       }//namespace transform\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_transform namespace gtx::transform\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_transform;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "transform.inl"\r
+\r
+#endif//glm_gtx_transform\r
diff --git a/glm/gtx/transform.inl b/glm/gtx/transform.inl
new file mode 100644 (file)
index 0000000..9f2950c
--- /dev/null
@@ -0,0 +1,94 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2009-04-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/transform.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace transform\r
+{\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> translate(\r
+               T x, T y, T z)\r
+    {\r
+               return gtc::matrix_transform::translate(\r
+                       detail::tmat4x4<T>(1.0f), \r
+                       detail::tvec3<T>(x, y , z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> translate(\r
+               detail::tmat4x4<T> const & m, \r
+               T x, T y, T z)\r
+    {\r
+        return gtc::matrix_transform::translate(\r
+                       m, detail::tvec3<T>(x, y , z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> translate(\r
+               detail::tvec3<T> const & v)\r
+    {\r
+               return gtc::matrix_transform::translate(\r
+                       detail::tmat4x4<T>(1.0f), v);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> rotate(\r
+               T angle, \r
+               T x, T y, T z)\r
+    {\r
+               return gtc::matrix_transform::rotate(\r
+                       detail::tmat4x4<T>(1), angle, detail::tvec3<T>(x, y, z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> rotate(\r
+               T angle, \r
+               detail::tvec3<T> const & v)\r
+    {\r
+               return gtc::matrix_transform::rotate(\r
+                       detail::tmat4x4<T>(1), angle, v);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> rotate(\r
+               detail::tmat4x4<T> const & m, \r
+               T angle, \r
+               T x, T y, T z)\r
+    {\r
+               return gtc::matrix_transform::rotate(\r
+                       m, angle, detail::tvec3<T>(x, y, z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> scale(T x, T y, T z)\r
+    {\r
+               return gtc::matrix_transform::scale(\r
+                       detail::tmat4x4<T>(1), detail::tvec3<T>(x, y, z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> scale(\r
+               detail::tmat4x4<T> const & m, \r
+               T x, T y, T z)\r
+    {\r
+        return gtc::matrix_transform::scale(\r
+                       m, detail::tvec3<T>(x, y, z));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> scale(\r
+               detail::tvec3<T> const & v)\r
+    {\r
+        return gtc::matrix_transform::scale(\r
+                       detail::tmat4x4<T>(1.0f), v);\r
+    }\r
+\r
+}//namespace transform\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/transform2.hpp b/glm/gtx/transform2.hpp
new file mode 100644 (file)
index 0000000..d6c317c
--- /dev/null
@@ -0,0 +1,127 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-21\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/transform2.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_transform\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_transform2\r
+#define glm_gtx_transform2\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/transform.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_transform2();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_transform2 extension: Add extra transformation matrices\r
+       namespace transform2\r
+       {\r
+               using namespace gtx::transform;\r
+\r
+               //! Transforms a matrix with a shearing on X axis.\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> shearX2D(\r
+                       detail::tmat3x3<T> const & m, \r
+                       T y);\r
+\r
+               //! Transforms a matrix with a shearing on Y axis.\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> shearY2D(\r
+                       detail::tmat3x3<T> const & m, \r
+                       T x);\r
+\r
+               //! Transforms a matrix with a shearing on X axis\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> shearX3D(\r
+                       const detail::tmat4x4<T> & m,\r
+                       T y, \r
+                       T z);\r
+               \r
+               //! Transforms a matrix with a shearing on Y axis.\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> shearY3D(\r
+                       const detail::tmat4x4<T> & m, \r
+                       T x, \r
+                       T z);\r
+               \r
+               //! Transforms a matrix with a shearing on Z axis. \r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> shearZ3D(\r
+                       const detail::tmat4x4<T> & m, \r
+                       T x, \r
+                       T y);\r
+\r
+               //template <typename T> inline detail::tmat4x4<T> shear(const detail::tmat4x4<T> & m, shearPlane, planePoint, angle)\r
+               // Identity + tan(angle) * cross(Normal, OnPlaneVector)     0\r
+               // - dot(PointOnPlane, normal) * OnPlaneVector              1\r
+\r
+               // Reflect functions seem to don't work\r
+               //template <typename T> detail::tmat3x3<T> reflect2D(const detail::tmat3x3<T> & m, const detail::tvec3<T>& normal){return reflect2DGTX(m, normal);}                                                                     //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)\r
+               //template <typename T> detail::tmat4x4<T> reflect3D(const detail::tmat4x4<T> & m, const detail::tvec3<T>& normal){return reflect3DGTX(m, normal);}                                                                     //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension)\r
+               \r
+               //! Build planar projection matrix along normal axis.\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat3x3<T> proj2D(\r
+                       const detail::tmat3x3<T> & m, \r
+                       const detail::tvec3<T>& normal);\r
+                               \r
+               //! Build planar projection matrix along normal axis.\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> proj3D(\r
+                       const detail::tmat4x4<T> & m, \r
+                       const detail::tvec3<T>& normal);\r
+\r
+               //! Build a look at view matrix.\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename T> \r
+               detail::tmat4x4<T> lookAt(\r
+                       detail::tvec3<T> const & eye, \r
+                       detail::tvec3<T> const & center, \r
+                       detail::tvec3<T> const & up);\r
+\r
+               //! Build a scale bias matrix. \r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> scaleBias(\r
+                       valType scale, \r
+                       valType bias);\r
+\r
+               //! Build a scale bias matrix.\r
+               //! From GLM_GTX_transform2 extension.\r
+               template <typename valType> \r
+               detail::tmat4x4<valType> scaleBias(\r
+                       detail::tmat4x4<valType> const & m, \r
+                       valType scale, \r
+                       valType bias);\r
+\r
+       }//namespace transform2\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_transform2 namespace gtx::transform2\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_transform2;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "transform2.inl"\r
+\r
+#endif//glm_gtx_transform2\r
diff --git a/glm/gtx/transform2.inl b/glm/gtx/transform2.inl
new file mode 100644 (file)
index 0000000..1d56686
--- /dev/null
@@ -0,0 +1,187 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-02-28\r
+// Updated : 2005-04-23\r
+// Licence : This source is under MIT License\r
+// File : glm/gtx/transform2.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace transform2\r
+{\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> shearX2D(\r
+               const detail::tmat3x3<T>& m, \r
+               T s)\r
+    {\r
+        detail::tmat3x3<T> r(1);\r
+        r[0][1] = s;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> shearY2D(\r
+               const detail::tmat3x3<T>& m, \r
+               T s)\r
+    {\r
+        detail::tmat3x3<T> r(1);\r
+        r[1][0] = s;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> shearX3D(\r
+               const detail::tmat4x4<T>& m, \r
+               T s, \r
+               T t)\r
+    {\r
+        detail::tmat4x4<T> r(1);\r
+        r[1][0] = s;\r
+        r[2][0] = t;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> shearY3D(\r
+               const detail::tmat4x4<T>& m, \r
+               T s, \r
+               T t)\r
+    {\r
+        detail::tmat4x4<T> r(1);\r
+        r[0][1] = s;\r
+        r[2][1] = t;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T>     \r
+       inline detail::tmat4x4<T> shearZ3D(\r
+               const detail::tmat4x4<T>& m, \r
+               T s, \r
+               T t)\r
+    {\r
+        detail::tmat4x4<T> r(1);\r
+        r[0][2] = s;\r
+        r[1][2] = t;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> reflect2D(\r
+               const detail::tmat3x3<T>& m, \r
+               const detail::tvec3<T>& normal)\r
+    {\r
+        detail::tmat3x3<T> r(1);\r
+        r[0][0] = 1 - 2 * normal.x * normal.x;\r
+        r[0][1] = -2 * normal.x * normal.y;\r
+        r[1][0] = -2 * normal.x * normal.y;\r
+        r[1][1] = 1 - 2 * normal.y * normal.y;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> reflect3D(\r
+               const detail::tmat4x4<T>& m, \r
+               const detail::tvec3<T>& normal)\r
+    {\r
+        detail::tmat4x4<T> r(1);\r
+        r[0][0] = 1 - 2 * normal.x * normal.x;\r
+        r[0][1] = -2 * normal.x * normal.y;\r
+        r[0][2] = -2 * normal.x * normal.z;\r
+\r
+        r[1][0] = -2 * normal.x * normal.y;\r
+        r[1][1] = 1 - 2 * normal.y * normal.y;\r
+        r[1][2] = -2 * normal.y * normal.z;\r
+\r
+        r[2][0] = -2 * normal.x * normal.z;\r
+        r[2][1] = -2 * normal.y * normal.z;\r
+        r[2][2] = 1 - 2 * normal.z * normal.z;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat3x3<T> proj2D(\r
+               const detail::tmat3x3<T>& m, \r
+               const detail::tvec3<T>& normal)\r
+    {\r
+        detail::tmat3x3<T> r(1);\r
+        r[0][0] = 1 - normal.x * normal.x;\r
+        r[0][1] = - normal.x * normal.y;\r
+        r[1][0] = - normal.x * normal.y;\r
+        r[1][1] = 1 - normal.y * normal.y;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> proj3D(\r
+               const detail::tmat4x4<T>& m, \r
+               const detail::tvec3<T>& normal)\r
+    {\r
+        detail::tmat4x4<T> r(1);\r
+        r[0][0] = 1 - normal.x * normal.x;\r
+        r[0][1] = - normal.x * normal.y;\r
+        r[0][2] = - normal.x * normal.z;\r
+        r[1][0] = - normal.x * normal.y;\r
+        r[1][1] = 1 - normal.y * normal.y;\r
+        r[1][2] = - normal.y * normal.z;\r
+        r[2][0] = - normal.x * normal.z;\r
+        r[2][1] = - normal.y * normal.z;\r
+        r[2][2] = 1 - normal.z * normal.z;\r
+        return m * r;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tmat4x4<T> lookAt(\r
+               const detail::tvec3<T>& eye, \r
+               const detail::tvec3<T>& center, \r
+               const detail::tvec3<T>& up)\r
+    {\r
+        detail::tvec3<T> f = normalize(center - eye);\r
+        detail::tvec3<T> u = normalize(up);\r
+        detail::tvec3<T> s = normalize(cross(f, u));\r
+        u = cross(s, f);\r
+\r
+        detail::tmat4x4<T> Result(1);\r
+        Result[0][0] = s.x;\r
+        Result[1][0] = s.y;\r
+        Result[2][0] = s.z;\r
+        Result[0][1] = u.x;\r
+        Result[1][1] = u.y;\r
+        Result[2][1] = u.z;\r
+        Result[0][2] =-f.x;\r
+        Result[1][2] =-f.y;\r
+        Result[2][2] =-f.z;\r
+    /*  Test this instead of translate3D\r
+        Result[3][0] =-dot(s, eye);\r
+        Result[3][1] =-dot(y, eye);\r
+        Result[3][2] = dot(f, eye);\r
+    */  \r
+               return gtc::matrix_transform::translate(Result, -eye);\r
+    }\r
+\r
+       template <typename T> \r
+       inline detail::tmat4x4<T> scaleBias(\r
+               T scale, \r
+               T bias)\r
+       {\r
+               detail::tmat4x4<T> result;\r
+               result[3] = detail::tvec4<T>(detail::tvec3<T>(bias), T(1));\r
+               result[0][0] = scale;\r
+               result[1][1] = scale;\r
+               result[2][2] = scale;\r
+       }\r
+\r
+       template <typename T> \r
+       inline detail::tmat4x4<T> scaleBias(\r
+               const detail::tmat4x4<T>& m, \r
+               T scale, \r
+               T bias)\r
+       {\r
+               return m * scaleBias(scale, bias);\r
+       }\r
+\r
+}//namespace transform2\r
+}//namespace gtx\r
+}//namespace glm\r
+\r
diff --git a/glm/gtx/type_ptr.hpp b/glm/gtx/type_ptr.hpp
new file mode 100644 (file)
index 0000000..feedb14
--- /dev/null
@@ -0,0 +1,233 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-05-06\r
+// Updated : 2009-05-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/type_ptr.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_type_ptr\r
+#define glm_gtx_type_ptr\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_type_ptr();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_type_ptr extension: Get access to vectors & matrices value type address.\r
+       namespace type_ptr{\r
+\r
+               //! Get the const address of the vector content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tvec2<valType> const & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+\r
+               //! Get the address of the vector content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tvec2<valType> & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+\r
+               //! Get the const address of the vector content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tvec3<valType> const & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+\r
+               //! Get the address of the vector content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tvec3<valType>  & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+               \r
+               //! Get the const address of the vector content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tvec4<valType> const & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+\r
+               //! Get the address of the vector content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tvec4<valType> & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+\r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat2x2<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat2x2<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat3x3<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat3x3<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat4x4<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat4x4<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat2x3<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat2x3<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat3x2<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat3x2<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat2x4<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat2x4<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat4x2<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat4x2<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat3x4<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat3x4<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               //! Get the const address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType const * value_ptr(detail::tmat4x3<valType> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               //! Get the address of the matrix content.\r
+               //! From GLM_GTX_type_ptr extension.\r
+               template<typename valType>\r
+               inline valType * value_ptr(detail::tmat4x3<valType> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+       }//namespace type_ptr\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_type_ptr namespace gtx::type_ptr\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_type_ptr;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "type_ptr.inl"\r
+\r
+#endif//glm_gtx_type_ptr\r
+\r
diff --git a/glm/gtx/type_ptr.inl b/glm/gtx/type_ptr.inl
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/glm/gtx/unsigned_int.hpp b/glm/gtx/unsigned_int.hpp
new file mode 100644 (file)
index 0000000..73f1ca4
--- /dev/null
@@ -0,0 +1,58 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-24\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/unsigned_int.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_integer\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_unsigned_int\r
+#define glm_gtx_unsigned_int\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/integer.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_unsigned_int();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_unsigned_int extension: Add support for unsigned integer for core functions\r
+       namespace unsigned_int\r
+       {\r
+               //! 32bit signed integer. \r
+               //! From GLM_GTX_unsigned_int extension.\r
+               typedef signed int                                      sint;\r
+\r
+               //! Returns x raised to the y power.\r
+               //! From GLM_GTX_unsigned_int extension.\r
+               uint pow(uint x, uint y);\r
+\r
+               //! Returns the positive square root of x. \r
+               //! From GLM_GTX_unsigned_int extension.\r
+               uint sqrt(uint x);\r
+\r
+               //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y.\r
+               //! From GLM_GTX_unsigned_int extension.\r
+               uint mod(uint x, uint y);\r
+\r
+       }//namespace unsigned_int\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_unsigned_int namespace gtx::unsigned_int; using namespace gtx::integer\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_unsigned_int;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "unsigned_int.inl"\r
+\r
+#endif//glm_gtx_unsigned_int\r
diff --git a/glm/gtx/unsigned_int.inl b/glm/gtx/unsigned_int.inl
new file mode 100644 (file)
index 0000000..9bb5ec3
--- /dev/null
@@ -0,0 +1,45 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-24\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/unsigned_int.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace unsigned_int{\r
+\r
+inline uint pow(uint x, uint y)\r
+{\r
+    uint result = x;\r
+    for(uint i = 1; i < y; ++i)\r
+        result *= x;\r
+    return result;\r
+}\r
+\r
+inline uint sqrt(uint x)\r
+{\r
+    if(x <= 1) return x;\r
+\r
+    uint NextTrial = x >> 1;\r
+    uint CurrentAnswer;\r
+\r
+    do\r
+    {\r
+        CurrentAnswer = NextTrial;\r
+        NextTrial = (NextTrial + x / NextTrial) >> 1;\r
+    } while(NextTrial < CurrentAnswer);\r
+\r
+    return CurrentAnswer;\r
+}\r
+\r
+inline uint mod(uint x, uint y)\r
+{\r
+       return x - y * (x / y);\r
+}\r
+\r
+}//namespace unsigned_int\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/vector_access.hpp b/glm/gtx/vector_access.hpp
new file mode 100644 (file)
index 0000000..dff8b87
--- /dev/null
@@ -0,0 +1,67 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-16\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vector_access.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_vector_access\r
+#define glm_gtx_vector_access\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_vector_access();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_vector_access extension: Function to set values to vectors\r
+    namespace vector_access\r
+    {\r
+               //! Set values to a 2 components vector.\r
+               //! From GLM_GTX_vector_access extension.\r
+        template <typename valType> \r
+               void set(\r
+                       detail::tvec2<valType> & v, \r
+                       valType const & x, \r
+                       valType const & y);\r
+\r
+               //! Set values to a 3 components vector.\r
+               //! From GLM_GTX_vector_access extension.\r
+        template <typename valType> \r
+               void set(\r
+                       detail::tvec3<valType> & v, \r
+                       valType const & x, \r
+                       valType const & y, \r
+                       valType const & z);\r
+\r
+               //! Set values to a 4 components vector.\r
+               //! From GLM_GTX_vector_access extension.\r
+        template <typename valType> \r
+               void set(\r
+                       detail::tvec4<valType> & v, \r
+                       valType const & x, \r
+                       valType const & y, \r
+                       valType const & z, \r
+                       valType const & w);\r
+\r
+    }//namespace vector_access\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_vector_access namespace gtx::vector_access\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_vector_access;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "vector_access.inl"\r
+\r
+#endif//glm_gtx_vector_access\r
diff --git a/glm/gtx/vector_access.inl b/glm/gtx/vector_access.inl
new file mode 100644 (file)
index 0000000..88d38ea
--- /dev/null
@@ -0,0 +1,58 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-01-16\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vector_access.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace vector_access{\r
+\r
+template <typename valType> \r
+inline void set\r
+(\r
+       detail::tvec2<valType>& v, \r
+       valType const & x, \r
+       valType const & y\r
+)\r
+{\r
+    v.x = x;\r
+    v.y = y;\r
+}\r
+\r
+template <typename valType> \r
+inline void set\r
+(\r
+       detail::tvec3<valType>& v, \r
+       valType const & x, \r
+       valType const & y, \r
+       valType const & z\r
+)\r
+{\r
+    v.x = x;\r
+    v.y = y;\r
+    v.z = z;\r
+}\r
+\r
+template <typename valType>\r
+inline void set\r
+(\r
+       detail::tvec4<valType>& v, \r
+       valType const & x, \r
+       valType const & y, \r
+       valType const & z, \r
+       valType const & w\r
+)\r
+{\r
+    v.x = x;\r
+    v.y = y;\r
+    v.z = z;\r
+    v.w = w;\r
+}\r
+\r
+}//namespace vector_access\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/vector_angle.hpp b/glm/gtx/vector_angle.hpp
new file mode 100644 (file)
index 0000000..c86ffbf
--- /dev/null
@@ -0,0 +1,68 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-30\r
+// Updated : 2006-11-13\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vector_angle.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_quaternion\r
+// - GLM_GTX_epsilon\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_vector_angle\r
+#define glm_gtx_vector_angle\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include "../gtx/quaternion.hpp"\r
+#include "../gtx/epsilon.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_gtx_vector_angle();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_vector_angle extension: Compute angle between vectors\r
+    namespace vector_angle\r
+    {\r
+               //! Returns the absolute angle between x and y.\r
+               //! Parameters need to be normalized.\r
+               //! From GLM_GTX_vector_angle extension\r
+               template <typename vecType> \r
+               typename vecType::value_type angle(\r
+                       vecType const & x, \r
+                       vecType const & y);\r
+\r
+               //! Returns the oriented angle between x and y \r
+               //! Parameters need to be normalized.\r
+               //! From GLM_GTX_vector_angle extension.\r
+               template <typename vecType> \r
+               typename vecType::value_type orientedAngle(\r
+                       vecType const & x, \r
+                       vecType const & y);\r
+\r
+               //! Returns the orientation of a two vector base from a normal.\r
+               //! Parameters need to be normalized.\r
+               //! From GLM_GTX_vector_angle extension.\r
+               template <typename vecType>\r
+               typename vecType::value_type orientedAngleFromRef(\r
+                       vecType const & x,\r
+                       vecType const & y,\r
+                       detail::tvec3<typename vecType::value_type> const & ref);\r
+    }//namespace vector_angle\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_vector_angle namespace gtx::quaternion; using namespace gtx::epsilon; using namespace gtx::vector_angle\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_vector_angle;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "vector_angle.inl"\r
+\r
+#endif//glm_gtx_vector_angle\r
diff --git a/glm/gtx/vector_angle.inl b/glm/gtx/vector_angle.inl
new file mode 100644 (file)
index 0000000..eec01da
--- /dev/null
@@ -0,0 +1,124 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2005-12-30\r
+// Updated : 2008-09-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vector_angle.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace vector_angle{\r
+\r
+template <typename genType> \r
+inline typename genType::value_type angle\r
+(\r
+       genType const & x, \r
+       genType const & y\r
+)\r
+{\r
+       return degrees(acos(dot(x, y)));\r
+}\r
+\r
+//! \todo epsilon is hard coded to 0.01\r
+template <typename valType> \r
+inline valType orientedAngle\r
+(\r
+       detail::tvec2<valType> const & x, \r
+       detail::tvec2<valType> const & y\r
+)\r
+{\r
+    valType Angle = acos(dot(x, y));\r
+    valType c = cos(Angle);\r
+    valType s = sin(Angle);\r
+    detail::tvec2<valType> TransformedVector = detail::tvec2<valType>(c * y.x - s * y.y, s * y.x + c * y.y);\r
+    if(all(equalEpsilonGTX(x, TransformedVector, valType(0.01))))\r
+        return -degrees(Angle);\r
+    else\r
+        return degrees(Angle);\r
+}\r
+\r
+//! \todo epsilon is hard coded to 0.01\r
+template <typename valType> \r
+inline valType orientedAngle\r
+(\r
+       detail::tvec3<valType> const & x, \r
+       detail::tvec3<valType> const & y\r
+)\r
+{\r
+    valType Angle = degrees(acos(dot(x, y)));\r
+       detail::tvec3<valType> TransformedVector = rotate(detail::tquat<valType>(), Angle, cross(x, y)) * y;\r
+    if(all(equalEpsilon(x, TransformedVector, valType(0.01))))\r
+        return -degrees(Angle);\r
+    else\r
+        return degrees(Angle);\r
+}\r
+\r
+//! \todo epsilon is hard coded to 0.01\r
+template <typename valType>\r
+inline valType orientedAngle\r
+(\r
+       detail::tvec4<valType> const & x, \r
+       detail::tvec4<valType> const & y\r
+)\r
+{\r
+    valType Angle = degrees(acos(dot(x, y)));\r
+    detail::tvec4<valType> TransformedVector = rotate(detail::tquat<valType>(), Angle, cross(x, y)) * y;\r
+    if(all(equalEpsilon(x, TransformedVector, valType(0.01))))\r
+        return -degrees(Angle);\r
+    else\r
+        return degrees(Angle);\r
+}\r
+\r
+template <typename valType>\r
+inline valType orientedAngleFromRef\r
+(\r
+    detail::tvec2<valType> const & x,\r
+    detail::tvec2<valType> const & y,\r
+       detail::tvec3<valType> const & ref\r
+)\r
+{\r
+       valType Angle = glm::acos(glm::dot(x, y));\r
+\r
+       if(glm::dot(ref, detail::tvec3<valType>(glm::cross(x, y), valType(0))) < valType(0))\r
+               return -glm::degrees(Angle);\r
+       else\r
+               return glm::degrees(Angle);\r
+}\r
+\r
+template <typename valType>\r
+inline valType orientedAngleFromRef\r
+(\r
+       detail::tvec3<valType> const & x,\r
+       detail::tvec3<valType> const & y,\r
+       detail::tvec3<valType> const & ref\r
+)\r
+{\r
+       valType Angle = glm::acos(glm::dot(x, y));\r
+\r
+       if(glm::dot(ref, glm::cross(x, y)) < valType(0))\r
+               return -glm::degrees(Angle);\r
+       else\r
+               return glm::degrees(Angle);\r
+}\r
+\r
+template <typename valType>\r
+inline valType orientedAngleFromRef\r
+(\r
+       detail::tvec4<valType> const & x,\r
+       detail::tvec4<valType> const & y,\r
+       detail::tvec3<valType> const & ref\r
+)\r
+{\r
+       valType Angle = glm::acos(glm::dot(x, y));\r
+\r
+       if(glm::dot(ref, glm::cross(detail::tvec3<valType>(x), detail::tvec3<valType>(y))) < valType(0))\r
+               return -glm::degrees(Angle);\r
+       else\r
+               return glm::degrees(Angle);\r
+}\r
+\r
+}//namespace vector_angle\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/vector_query.hpp b/glm/gtx/vector_query.hpp
new file mode 100644 (file)
index 0000000..61555fc
--- /dev/null
@@ -0,0 +1,96 @@
+ ///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-05\r
+// Updated : 2007-03-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vector_query.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_vector_query\r
+#define glm_gtx_vector_query\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+#include <cfloat>\r
+#include <limits>\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_ext_gtx_vector_query();\r
+       }//namespace test\r
+\r
+    namespace gtx{\r
+       //! GLM_GTX_vector_query extension: Query informations of vector types\r
+    namespace vector_query\r
+    {\r
+        //! Check if two vectors are collinears.\r
+               //! From GLM_GTX_vector_query extensions.\r
+               template <typename genType> \r
+               bool areCollinear(\r
+                       const genType & v0, \r
+                       const genType & v1, \r
+                       const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());\r
+               \r
+        //! Check if two vectors are opposites.\r
+               //! From GLM_GTX_vector_query extensions.\r
+               template <typename genType> \r
+               bool areOpposite(\r
+                       const genType & v0, \r
+                       const genType & v1, \r
+                       const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());\r
+               \r
+        //! Check if two vectors are orthogonals.\r
+               //! From GLM_GTX_vector_query extensions.\r
+               template <typename genType> \r
+               bool areOrthogonal(\r
+                       const genType & v0, \r
+                       const genType & v1, \r
+                       const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());\r
+\r
+               //! Check if a vector is normalized.\r
+               //! From GLM_GTX_vector_query extensions.\r
+               template <typename genType> \r
+               bool isNormalized(\r
+                       const genType & v, \r
+                       const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());\r
+               \r
+               //! Check if a vector is null.\r
+               //! From GLM_GTX_vector_query extensions.\r
+               template <typename genType> \r
+               bool isNull(\r
+                       const genType& v, \r
+                       const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());\r
+\r
+               //! Check if two vectors are orthonormal.\r
+               //! From GLM_GTX_vector_query extensions.\r
+               template <typename genType>\r
+               bool areOrthonormal(\r
+                       const genType & v0, \r
+                       const genType & v1, \r
+                       const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());\r
+\r
+               //! Check if two vectors are similar.\r
+               //! From GLM_GTX_vector_query extensions.\r
+               template <typename genType> \r
+               bool areSimilar(\r
+                       const genType& v0, \r
+                       const genType& v1, \r
+                       const GLMvalType epsilon = std::numeric_limits<GLMvalType>::epsilon());\r
+\r
+    }//namespace vector_query\r
+    }//namespace gtx\r
+}//namespace glm\r
+\r
+#define GLM_GTX_vector_query namespace gtx::vector_query\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_vector_query;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "vector_query.inl"\r
+\r
+#endif//glm_gtx_vector_query\r
diff --git a/glm/gtx/vector_query.inl b/glm/gtx/vector_query.inl
new file mode 100644 (file)
index 0000000..507b7a8
--- /dev/null
@@ -0,0 +1,143 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-03-05\r
+// Updated : 2007-03-05\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vector_query.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <cassert>\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace vector_query\r
+{\r
+       template <typename T>\r
+       inline bool areCollinear(\r
+               const detail::tvec2<T>& v0, \r
+               const detail::tvec2<T>& v1, \r
+               const T epsilon)\r
+       {\r
+               return length(cross(detail::tvec3<T>(v0, T(0)), detail::tvec3<T>(v1, T(0)))) < epsilon;\r
+       }\r
+\r
+       template <typename T>\r
+       inline bool areCollinear(\r
+               const detail::tvec3<T>& v0, \r
+               const detail::tvec3<T>& v1, \r
+               const T epsilon)\r
+       {\r
+               return length(cross(v0, v1)) < epsilon;\r
+       }\r
+\r
+       template <typename T>\r
+       inline bool areCollinear(\r
+               const detail::tvec4<T>& v0, \r
+               const detail::tvec4<T>& v1, \r
+               const T epsilon)\r
+       {\r
+               return length(cross(detail::tvec3<T>(v0), detail::tvec3<T>(v1))) < epsilon;\r
+       }\r
+\r
+       template <typename genType>\r
+       inline bool areOpposite(\r
+               const genType& v0, \r
+               const genType& v1, \r
+               const GLMvalType epsilon)\r
+       {\r
+               assert(isNormalized(v0) && isNormalized(v1));\r
+        return((genType::value_type(1) + dot(v0, v1)) <= epsilon);\r
+       }\r
+\r
+       template <typename genType>\r
+       inline bool areOrthogonal(\r
+               const genType& v0, \r
+               const genType& v1, \r
+               const GLMvalType epsilon)\r
+       {\r
+               return abs(dot(v0, v1)) <= max(GLMvalType(1), length(v0)) * max(GLMvalType(1), length(v1)) * epsilon;\r
+       }\r
+\r
+       template <typename genType> \r
+       inline bool isNormalized(\r
+               const genType& v, \r
+               const GLMvalType epsilon)\r
+       {\r
+               return abs(length(v) - GLMvalType(1)) <= GLMvalType(2) * epsilon;\r
+       }\r
+\r
+       template <typename genType> \r
+       inline bool isNull(const genType& v, const GLMvalType epsilon)\r
+       {\r
+               return length(v) <= epsilon;\r
+       }\r
+\r
+    template <typename T> \r
+    inline bool isCompNull(\r
+               const T s, \r
+               const T epsilon)\r
+    {\r
+        return abs(s) < epsilon;\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec2<bool> isCompNull(\r
+               const detail::tvec2<T>& v, \r
+               const T epsilon)\r
+    {\r
+        return detail::tvec2<bool>(\r
+            (abs(v.x) < epsilon),\r
+            (abs(v.y) < epsilon));\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec3<bool> isCompNull(\r
+               const detail::tvec3<T>& v, \r
+               const T epsilon)\r
+    {\r
+        return detail::tvec3<bool>(\r
+            abs(v.x) < epsilon,\r
+            abs(v.y) < epsilon,\r
+            abs(v.z) < epsilon);\r
+    }\r
+\r
+    template <typename T> \r
+    inline detail::tvec4<bool> isCompNull(\r
+               const detail::tvec4<T>& v, \r
+               const T epsilon)\r
+    {\r
+        return detail::tvec4<bool>(\r
+            abs(v.x) < epsilon,\r
+            abs(v.y) < epsilon,\r
+            abs(v.z) < epsilon,\r
+            abs(v.w) < epsilon);\r
+    }\r
+\r
+       template <typename genType>\r
+       inline bool areOrthonormal(\r
+               const genType& v0, \r
+               const genType& v1, \r
+               const GLMvalType epsilon)\r
+       {\r
+               return isNormalized(v0, epsilon) && isNormalized(v1, epsilon) && (abs(dot(v0, v1)) <= epsilon);\r
+       }\r
+\r
+       template <typename genType>\r
+       inline bool areSimilar(\r
+               const genType& v0, \r
+               const genType& v1, \r
+               const GLMvalType epsilon)\r
+       {\r
+               bool similar = true;\r
+        for(typename genType::size_type i = 0; similar && i < genType::value_size(); i++)\r
+                       similar = (abs(v0[i] - v1[i]) <= epsilon);\r
+               return similar;\r
+       }\r
+\r
+}//namespace vector_query\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/gtx/vecx.hpp b/glm/gtx/vecx.hpp
new file mode 100644 (file)
index 0000000..cdb178f
--- /dev/null
@@ -0,0 +1,218 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-02-21\r
+// Updated : 2007-02-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vecx.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_vecx\r
+#define glm_gtx_vecx\r
+\r
+namespace glm{\r
+namespace detail{\r
+\r
+       template <int N>\r
+    class _bvecxGTX\r
+    {\r
+       private:\r
+               bool data[N];\r
+\r
+       public:\r
+               typedef bool value_type;\r
+               typedef int size_type;\r
+               static const size_type value_size;\r
+               static const size_type col_size;\r
+               static const size_type row_size;\r
+\r
+        // Common constructors\r
+           _bvecxGTX();\r
+        _bvecxGTX(const _bvecxGTX& v);\r
+\r
+               // Accesses\r
+        bool& operator[](int i);\r
+        bool operator[](int i) const;\r
+        operator bool*();\r
+           operator const bool*() const;\r
+\r
+        // Bool constructors\r
+        explicit _bvecxGTX(const bool a);\r
+\r
+        // Operators\r
+        _bvecxGTX<N>& operator=(const _bvecxGTX<N>& v);\r
+           _bvecxGTX<N> operator! () const;\r
+    };\r
+\r
+    template <int N, typename T = float>\r
+    class _xvecxGTX\r
+    {\r
+       private:\r
+               T data[N];\r
+\r
+       public:\r
+               typedef T value_type;\r
+               typedef int size_type;\r
+               static const size_type value_size;\r
+\r
+        // Common constructors\r
+           _xvecxGTX();\r
+        _xvecxGTX(const _xvecxGTX<N, T>& v);\r
+\r
+               // Accesses\r
+        T& operator[](int i);\r
+        T operator[](int i) const;\r
+        operator T*();\r
+           operator const T*() const;\r
+\r
+        // T constructors\r
+        explicit _xvecxGTX(const T x);\r
+\r
+        // Unary updatable operators\r
+        _xvecxGTX<N, T>& operator= (const _xvecxGTX<N, T>& v);\r
+           _xvecxGTX<N, T>& operator+=(const T s);\r
+           _xvecxGTX<N, T>& operator+=(const _xvecxGTX<N, T>& v);\r
+           _xvecxGTX<N, T>& operator-=(const T s);\r
+           _xvecxGTX<N, T>& operator-=(const _xvecxGTX<N, T>& v);\r
+           _xvecxGTX<N, T>& operator*=(const T s);\r
+           _xvecxGTX<N, T>& operator*=(const _xvecxGTX<N, T>& v);\r
+           _xvecxGTX<N, T>& operator/=(const T s);\r
+           _xvecxGTX<N, T>& operator/=(const _xvecxGTX<N, T>& v);\r
+           _xvecxGTX<N, T>& operator++();\r
+        _xvecxGTX<N, T>& operator--();\r
+    };\r
+\r
+    // Binary operators\r
+    template <int N, typename T>\r
+       detail::_xvecxGTX<N, T> operator+ (const detail::_xvecxGTX<N, T>& v, const T s);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator+ (const T s, const detail::_xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator+ (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);\r
+    \r
+    template <int N, typename T>\r
+       detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v, const T s);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator- (const T s, const detail::_xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator* (const detail::_xvecxGTX<N, T>& v, const T s);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator* (const T s, const detail::_xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator* (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator/ (const detail::_xvecxGTX<N, T>& v, const T s);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator/ (const T s, const detail::_xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    detail::_xvecxGTX<N, T> operator/ (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);\r
+\r
+    // Unary constant operators\r
+    template <int N, typename T>\r
+    const detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v);\r
+\r
+    template <int N, typename T>\r
+    const detail::_xvecxGTX<N, T> operator-- (const detail::_xvecxGTX<N, T>& v, int);\r
+\r
+    template <int N, typename T>\r
+    const detail::_xvecxGTX<N, T> operator++ (const detail::_xvecxGTX<N, T>& v, int);\r
+\r
+}//namespace detail\r
+\r
+       namespace gtx\r
+    {\r
+               //! GLM_GTX_vecx extension: - Work in progress - Add custom size vectors\r
+        namespace vecx\r
+        {\r
+                       template<typename T, int N>\r
+                       struct vec\r
+                       {\r
+                               typedef detail::_xvecxGTX<N, T> type;\r
+                       };\r
+\r
+                       // Trigonometric Functions\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> radiansGTX(const detail::_xvecxGTX<N, T>& degrees); //< \brief Converts degrees to radians and returns the result. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> degreesGTX(const detail::_xvecxGTX<N, T>& radians); //< \brief Converts radians to degrees and returns the result. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> sinGTX(const detail::_xvecxGTX<N, T>& angle);              //< \brief The standard trigonometric sine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> cosGTX(const detail::_xvecxGTX<N, T>& angle);              //< \brief The standard trigonometric cosine function. The values returned by this function will range from [-1, 1]. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> tanGTX(const detail::_xvecxGTX<N, T>& angle);              //< \brief The standard trigonometric tangent function. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> asinGTX(const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> acosGTX(const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> atanGTX(const detail::_xvecxGTX<N, T>& y, const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> atanGTX(const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+\r
+                       // Exponential Functions\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> powGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y); //< \brief Returns x raised to the y power. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> expGTX(const detail::_xvecxGTX<N, T>& x);  //< \brief Returns the natural exponentiation of x, i.e., e^x. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> logGTX(const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> exp2GTX(const detail::_xvecxGTX<N, T>& x); //< \brief Returns 2 raised to the x power. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> log2GTX(const detail::_xvecxGTX<N, T>& 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)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> sqrtGTX(const detail::_xvecxGTX<N, T>& x); //< \brief Returns the positive square root of x. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> inversesqrtGTX(const detail::_xvecxGTX<N, T>& x);  //< \brief Returns the reciprocal of the positive square root of x. (From GLM_GTX_vecx extension)\r
+\r
+                       // Common Functions\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> absGTX(const detail::_xvecxGTX<N, T>& x);          //< \brief Returns x if x >= 0; otherwise, it returns -x. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> floorGTX(const detail::_xvecxGTX<N, T>& x);                //< \brief Returns a value equal to the nearest integer that is less then or equal to x. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> ceilGTX(const detail::_xvecxGTX<N, T>& x);         //< \brief Returns a value equal to the nearest integer that is greater than or equal to x. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> fractGTX(const detail::_xvecxGTX<N, T>& x);                //< \brief Return x - floor(x). (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> modGTX(const detail::_xvecxGTX<N, 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_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> modGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& 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)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> minGTX(const detail::_xvecxGTX<N, T>& x, T y);                                                                     //< \brief Returns y if y < x; otherwise, it returns x. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> minGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                //< \brief Returns minimum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> maxGTX(const detail::_xvecxGTX<N, T>& x, T y);                                                                     //< \brief Returns y if x < y; otherwise, it returns x. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> maxGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                //< \brief Returns maximum of each component of x compared with the floating-point value y. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> clampGTX(const detail::_xvecxGTX<N, 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_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> clampGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& minVal, const detail::_xvecxGTX<N, T>& maxVal);  //< \brief Returns the component-wise result of min(max(x, minVal), maxVal). (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> stepGTX(T edge, const detail::_xvecxGTX<N, T>& x);                                                                                                                                                 //< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> stepGTX(const detail::_xvecxGTX<N, T>& edge, const detail::_xvecxGTX<N, T>& x);                                                                                            //< \brief Returns 0.0 if x <= edge; otherwise, it returns 1.0. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> smoothstepGTX(T edge0, T edge1, const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> smoothstepGTX(const detail::_xvecxGTX<N, T>& edge0, const detail::_xvecxGTX<N, T>& edge1, const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+\r
+                       // Geometric Functions\r
+                       template <int N, typename T> T lengthGTX(const detail::_xvecxGTX<N, T>& x);                                                                                     //< \brief Returns the length of x, i.e., sqrt(x * x). (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> T distanceGTX(const detail::_xvecxGTX<N, T>& p0, const detail::_xvecxGTX<N, T>& p1);       //< \brief Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> T dotGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& 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)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> normalizeGTX(const detail::_xvecxGTX<N, T>& x);                                    //< \brief Returns a vector in the same direction as x but with length of 1. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> faceforwardGTX(const detail::_xvecxGTX<N, T>& Norm, const detail::_xvecxGTX<N, T>& I, const detail::_xvecxGTX<N, T>& Nref);                //< \brief If dot(Nref, I) < 0.0, return N, otherwise, return -N. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> reflectGTX(const detail::_xvecxGTX<N, T>& I, const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_xvecxGTX<N, T> refractGTX(const detail::_xvecxGTX<N, T>& I, const detail::_xvecxGTX<N, 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 GLM_GTX_vecx extension)\r
+\r
+                       // Vector Relational Functions\r
+                       template <int N, typename T> detail::_bvecxGTX<N> lessThanGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                      //< \brief Returns the component-wise compare of x < y. (From GLM_GTX_vecx extension)  \r
+                       template <int N, typename T> detail::_bvecxGTX<N> lessThanEqualGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);         //< \brief Returns the component-wise compare of x <= y. (From GLM_GTX_vecx extension)  \r
+                       template <int N, typename T> detail::_bvecxGTX<N> greaterThanGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);           //< \brief Returns the component-wise compare of x > y. (From GLM_GTX_vecx extension)  \r
+                       template <int N, typename T> detail::_bvecxGTX<N> greaterThanEqualGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);      //< \brief Returns the component-wise compare of x >= y. (From GLM_GTX_vecx extension)\r
+                       template <int N> detail::_bvecxGTX<N> equalGTX(const detail::_bvecxGTX<N>& x, const detail::_bvecxGTX<N>& y);                                                           //< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_bvecxGTX<N> equalGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                         //< \brief Returns the component-wise compare of x == y. (From GLM_GTX_vecx extension)\r
+                       template <int N> detail::_bvecxGTX<N> notEqualGTX(const detail::_bvecxGTX<N>& x, const detail::_bvecxGTX<N>& y);                                                                //< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension)\r
+                       template <int N, typename T> detail::_bvecxGTX<N> notEqualGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                      //< \brief Returns the component-wise compare of x != y. (From GLM_GTX_vecx extension)\r
+                       template <int N> bool anyGTX(const detail::_bvecxGTX<N>& x);                                                                                                                                                                    //< \brief Returns true if any component of x is true. (From GLM_GTX_vecx extension)\r
+                       template <int N> bool allGTX(const detail::_bvecxGTX<N>& x);                                                                                                                                                                    //< \brief Returns true if all component of x is true. (From GLM_GTX_vecx extension)\r
+                       template <int N> detail::_bvecxGTX<N> notGTX(const detail::_bvecxGTX<N>& v); //< \brief Returns the component-wise logical complement of x. (From GLM_GTX_vecx extension)\r
+        }\r
+    }\r
+}\r
+\r
+#define GLM_GTX_vecx namespace gtx::vecx\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_vecx;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#include "vecx.inl"\r
+\r
+#endif//glm_gtx_vecx\r
diff --git a/glm/gtx/vecx.inl b/glm/gtx/vecx.inl
new file mode 100644 (file)
index 0000000..4b2807a
--- /dev/null
@@ -0,0 +1,863 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-02-21\r
+// Updated : 2007-02-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/vecx.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include <cassert>\r
+\r
+namespace glm\r
+{\r
+namespace detail{\r
+\r
+       template <int N> const typename _bvecxGTX<N>::size_type _bvecxGTX<N>::value_size = N;\r
+\r
+    // Bool constructors\r
+       template <int N>\r
+       inline _bvecxGTX<N>::_bvecxGTX()\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] = false;\r
+       }\r
+\r
+       template <int N>\r
+       inline _bvecxGTX<N>::_bvecxGTX(const _bvecxGTX<N>& v)\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] = v[i];\r
+       }\r
+\r
+       template <int N>\r
+    inline _bvecxGTX<N>::_bvecxGTX(const bool s)\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] = s;\r
+       }\r
+\r
+       // Accesses\r
+       template <int N>\r
+    inline bool& _bvecxGTX<N>::operator[](int i)\r
+       {\r
+        assert(i >= 0 && i < N);\r
+               return this->data[i];\r
+       }\r
+\r
+       template <int N>\r
+    inline bool _bvecxGTX<N>::operator[](int i) const\r
+       {\r
+        assert(i >= 0 && i < N);\r
+               return this->data[i];\r
+       }\r
+\r
+       template <int N>\r
+    inline _bvecxGTX<N>::operator bool*()\r
+       {\r
+               return data;\r
+       }\r
+\r
+       template <int N>\r
+    inline _bvecxGTX<N>::operator const bool*() const\r
+       {\r
+               return data;\r
+       }\r
+\r
+    // Operators\r
+       template <int N>\r
+    inline _bvecxGTX<N>& _bvecxGTX<N>::operator=(const _bvecxGTX<N>& v)\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+                       this->data[i] = v[i];\r
+               return *this;\r
+       }\r
+\r
+       template <int N>\r
+    inline _bvecxGTX<N> _bvecxGTX<N>::operator! () const\r
+       {\r
+               _bvecxGTX<N> result;\r
+               for(int i = 0; i < N; ++i)\r
+                       result[i] = !this->data[i];\r
+               return result;\r
+       }\r
+\r
+       template <int N, typename T> const typename _xvecxGTX<N, T>::size_type _xvecxGTX<N, T>::value_size = N;\r
+\r
+       // Common constructors\r
+       template <int N, typename T>\r
+       inline _xvecxGTX<N, T>::_xvecxGTX()\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] = T(0);\r
+       }\r
+\r
+       template <int N, typename T>\r
+    inline _xvecxGTX<N, T>::_xvecxGTX(const _xvecxGTX<N, T>& v)\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] = v[i];\r
+       }\r
+\r
+    // T constructors\r
+       template <int N, typename T> \r
+    inline _xvecxGTX<N, T>::_xvecxGTX(const T s)\r
+       {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] = s;\r
+       }\r
+\r
+       // Accesses\r
+    template <int N, typename T> \r
+    inline T& _xvecxGTX<N, T>::operator[](int i)\r
+    {\r
+        assert(i >= 0 && i < N);\r
+               return this->data[i];\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline T _xvecxGTX<N, T>::operator[](int i) const\r
+    {\r
+               assert(i >= 0 && i < N);\r
+        return this->data[i];\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>::operator T*()\r
+    {\r
+        return data;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>::operator const T*() const \r
+    {\r
+        return data;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator=(const _xvecxGTX<N, T>& v)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] = v[i];\r
+        return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator+= (const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] += s;\r
+           return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator+=(const _xvecxGTX<N, T>& v)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] += v[i];\r
+           return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator-= (const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] -= s;\r
+           return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator-=(const _xvecxGTX<N, T>& v)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] -= v[i];\r
+           return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator*=(const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] *= s;\r
+           return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator*= (const _xvecxGTX<N, T>& v)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] *= v[i];\r
+           return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator/=(const T s)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] /= s;\r
+           return *this;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline _xvecxGTX<N, T>& _xvecxGTX<N, T>::operator/= (const _xvecxGTX<N, T>& v)\r
+    {\r
+               for(int i = 0; i < N; ++i)\r
+               this->data[i] /= v[i];\r
+           return *this;\r
+    }\r
+\r
+\r
+   // Unary constant operators\r
+    template <int N, typename T> \r
+    inline const detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = -v[i];\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline const detail::_xvecxGTX<N, T> operator++ (const detail::_xvecxGTX<N, T>& v, int)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v[i] + T(1);\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T> \r
+    inline const detail::_xvecxGTX<N, T> operator-- (const detail::_xvecxGTX<N, T>& v, int)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v[i] - T(1);\r
+           return result;\r
+    }\r
+\r
+    // Binary operators\r
+    template <int N, typename T>\r
+       inline detail::_xvecxGTX<N, T> operator+ (const detail::_xvecxGTX<N, T>& v, const T s)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v[i] + s;\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator+ (const T s, const detail::_xvecxGTX<N, T>& v)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v[i] + s;\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator+ (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v1[i] + v2[i];\r
+           return result;\r
+    }\r
+    \r
+    template <int N, typename T>\r
+       inline detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v, const T s)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v[i] - s;\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator- (const T s, const detail::_xvecxGTX<N, T>& v)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = s - v[i];\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v1[i] - v2[i];\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator* (const detail::_xvecxGTX<N, T>& v, const T s)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v[i] * s;\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator* (const T s, const detail::_xvecxGTX<N, T>& v)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = s * v[i];\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator* (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v1[i] * v2[i];\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator/ (const detail::_xvecxGTX<N, T>& v, const T s)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v[i] / s;\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator/ (const T s, const detail::_xvecxGTX<N, T>& v)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = s / v[i];\r
+           return result;\r
+    }\r
+\r
+    template <int N, typename T>\r
+    inline detail::_xvecxGTX<N, T> operator/ (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2)\r
+    {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = v1[i] / v2[i];\r
+           return result;\r
+    }\r
+\r
+}//namespace detail\r
+\r
+       namespace gtx{\r
+       namespace vecx{\r
+\r
+       // Trigonometric Functions\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> radiansGTX(const detail::_xvecxGTX<N, T>& degrees)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = radians(degrees[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> degreesGTX(const detail::_xvecxGTX<N, T>& radians)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = degrees(radians[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> sinGTX(const detail::_xvecxGTX<N, T>& angle)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = sin(angle[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> cosGTX(const detail::_xvecxGTX<N, T>& angle)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = cos(angle[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> tanGTX(const detail::_xvecxGTX<N, T>& angle)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = tan(angle[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> asinGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = asin(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> acosGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = acos(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> atanGTX(const detail::_xvecxGTX<N, T>& y, const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = atan(y[i], x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> atanGTX(const detail::_xvecxGTX<N, T>& y_over_x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = atan(y_over_x[i]);\r
+           return result;\r
+       }\r
+\r
+       // Exponential Functions\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> powGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = pow(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> expGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = exp(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> logGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = log(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> exp2GTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = exp2(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> log2GTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = log2(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> sqrtGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = sqrt(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> inversesqrtGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = inversesqrt(x[i]);\r
+           return result;\r
+       }\r
+\r
+       // Common Functions\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> absGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = abs(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> signGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = sign(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> floorGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = floor(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> ceilGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = ceil(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> fractGTX(const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = fract(x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> modGTX(const detail::_xvecxGTX<N, T>& x, T y)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = mod(x[i], y);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> modGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = mod(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> minGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               T y)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = min(x[i], y);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> minGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = min(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> maxGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               T y)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = max(x[i], y);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> maxGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = max(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> clampGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               T minVal, \r
+               T maxVal)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = clamp(x[i], minVal, maxVal);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> clampGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& minVal, \r
+               const detail::_xvecxGTX<N, T>& maxVal)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = clamp(x[i], minVal[i], maxVal[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> stepGTX(\r
+               T edge, \r
+               const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = step(edge, x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> stepGTX(\r
+               const detail::_xvecxGTX<N, T>& edge, \r
+               const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = step(edge[i], x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> smoothstepGTX(\r
+               T edge0, \r
+               T edge1, \r
+               const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = step(edge0, edge1, x[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> smoothstepGTX(\r
+               const detail::_xvecxGTX<N, T>& edge0, \r
+               const detail::_xvecxGTX<N, T>& edge1, \r
+               const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+               detail::_xvecxGTX<N, T> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = step(edge0[i], edge1[i], x[i]);\r
+           return result;\r
+       }\r
+\r
+       // Geometric Functions\r
+       template <int N, typename T> \r
+       T lengthGTX(\r
+               const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+        T sqr = dot(x, x);\r
+        return sqrt(sqr);\r
+       }\r
+\r
+       template <int N, typename T> \r
+       T distanceGTX(\r
+               const detail::_xvecxGTX<N, T>& p0, \r
+               const detail::_xvecxGTX<N, T>& p1)\r
+       {\r
+        return lengthGTX(p1 - p0);\r
+       }\r
+\r
+       template <int N, typename T> \r
+       T dotGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               T result = T(0);\r
+               for(int i = 0; i < N; ++i)\r
+                       result += x[i] * y[i];\r
+               return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> normalizeGTX(\r
+               const detail::_xvecxGTX<N, T>& x)\r
+       {\r
+        T sqr = dot(x, x);\r
+           return x * inversesqrt(sqr);\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> faceforwardGTX(\r
+               const detail::_xvecxGTX<N, T>& Normal, \r
+               const detail::_xvecxGTX<N, T>& I, \r
+               const detail::_xvecxGTX<N, T>& Nref)\r
+       {\r
+               return dot(Nref, I) < T(0) ? Normal : -Normal;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> reflectGTX(\r
+               const detail::_xvecxGTX<N, T>& I, \r
+               const detail::_xvecxGTX<N, T>& Normal)\r
+       {\r
+               return I - Normal * dot(Normal, I) * T(2);\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_xvecxGTX<N, T> refractGTX(\r
+               const detail::_xvecxGTX<N, T>& I, \r
+               const detail::_xvecxGTX<N, T>& Normal, \r
+               T eta)\r
+       {\r
+        T dot = dot(Normal, I);\r
+        T k = T(1) - eta * eta * (T(1) - dot * dot);\r
+        if(k < T(0))\r
+            return detail::_xvecxGTX<N, T>(T(0));\r
+        else\r
+            return eta * I - (eta * dot + sqrt(k)) * Normal;\r
+       }\r
+\r
+       // Vector Relational Functions\r
+       template <int N, typename T> \r
+       detail::_bvecxGTX<N> lessThanGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = lessThan(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_bvecxGTX<N> lessThanEqualGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = lessThanEqual(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_bvecxGTX<N> greaterThanGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = greaterThan(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_bvecxGTX<N> greaterThanEqualGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = greaterThanEqual(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N> \r
+       detail::_bvecxGTX<N> equalGTX(\r
+               const detail::_bvecxGTX<N>& x, \r
+               const detail::_bvecxGTX<N>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = equal(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_bvecxGTX<N> equalGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = equal(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N> \r
+       detail::_bvecxGTX<N> notEqualGTX(\r
+               const detail::_bvecxGTX<N>& x, \r
+               const detail::_bvecxGTX<N>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = equal(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N, typename T> \r
+       detail::_bvecxGTX<N> notEqualGTX(\r
+               const detail::_xvecxGTX<N, T>& x, \r
+               const detail::_xvecxGTX<N, T>& y)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = notEqual(x[i], y[i]);\r
+           return result;\r
+       }\r
+\r
+       template <int N> \r
+       bool anyGTX(const detail::_bvecxGTX<N>& x)\r
+       {\r
+               for(int i = 0; i< N; ++i)\r
+                       if(x[i]) return true;\r
+           return false;\r
+       }\r
+\r
+       template <int N> \r
+       bool allGTX(const detail::_bvecxGTX<N>& x)\r
+       {\r
+               for(int i = 0; i< N; ++i)\r
+                       if(!x[i]) return false;\r
+           return true;\r
+       }\r
+\r
+    template <int N> \r
+       detail::_bvecxGTX<N> notGTX(\r
+               const detail::_bvecxGTX<N>& v)\r
+       {\r
+               detail::_bvecxGTX<N> result;\r
+               for(int i = 0; i< N; ++i)\r
+                       result[i] = !v[i];\r
+           return result;\r
+       }\r
+\r
+       }//namespace vecx\r
+       }//namespace gtx\r
+\r
+} //namespace glm\r
diff --git a/glm/gtx/verbose_operator.hpp b/glm/gtx/verbose_operator.hpp
new file mode 100644 (file)
index 0000000..adb8d91
--- /dev/null
@@ -0,0 +1,64 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2007-05-21\r
+// Updated : 2007-05-21\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/verbose_operator.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_gtx_verbose_operator\r
+#define glm_gtx_verbose_operator\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               void main_ext_gtx_verbose_operator();\r
+       }//namespace test\r
+\r
+       namespace gtx{\r
+       //! GLM_GTX_verbose_operator extension: Use words to replace operators\r
+       namespace verbose_operator\r
+       {\r
+               //! Addition of two values\r
+               //! From GLM_GTX_verbose_operator extension.\r
+               template <typename genTypeT, typename genTypeU> \r
+               genTypeT add(genTypeT const & a, genTypeU const & b);\r
+\r
+               //! Substration of two values\r
+               //! From GLM_GTX_verbose_operator extension.\r
+               template <typename genTypeT, typename genTypeU> \r
+               genTypeT sub(genTypeT const & a, genTypeU const & b);\r
+\r
+               //! Multiplication of two values\r
+               //! From GLM_GTX_verbose_operator extension.\r
+               template <typename genTypeT, typename genTypeU> \r
+               genTypeT mul(genTypeT const & a, genTypeU const & b);\r
+\r
+               //! Division of two values\r
+               //! From GLM_GTX_verbose_operator extension.\r
+               template <typename genTypeT, typename genTypeU> \r
+               genTypeT div(genTypeT const & a, genTypeU const & b);\r
+\r
+               //! Multiplication and addition of three values\r
+               //! From GLM_GTX_verbose_operator extension.\r
+               template <typename genTypeT, typename genTypeU, typename genTypeV> \r
+               genTypeT mad(genTypeT const & a, genTypeU const & b, genTypeV const & c);\r
+       }//namespace verbose_operator\r
+       }//namespace gtx\r
+}//namespace glm\r
+\r
+#include "verbose_operator.inl"\r
+\r
+#define GLM_GTX_verbose_operator namespace gtx::verbose_operator\r
+#ifndef GLM_GTX_GLOBAL\r
+namespace glm {using GLM_GTX_verbose_operator;}\r
+#endif//GLM_GTX_GLOBAL\r
+\r
+#endif//glm_gtx_verbose_operator\r
diff --git a/glm/gtx/verbose_operator.inl b/glm/gtx/verbose_operator.inl
new file mode 100644 (file)
index 0000000..08c0aae
--- /dev/null
@@ -0,0 +1,129 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-04-20\r
+// Updated : 2008-09-29\r
+// Licence : This source is under MIT License\r
+// File    : glm/gtx/verbose_operator.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace gtx{\r
+namespace verbose_operator{\r
+\r
+template <typename genType>\r
+inline genType add(genType const & a, genType const & b)\r
+{\r
+    return a + b;\r
+}\r
+\r
+template <typename genType>\r
+inline genType sub(genType const & a, genType const & b)\r
+{\r
+    return a - b;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tmat2x2<T> mul\r
+(\r
+       detail::tmat2x2<T> const & a, \r
+       detail::tmat2x2<T> const & b\r
+)\r
+{\r
+    return a * b;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tmat3x3<T> mul\r
+(\r
+       detail::tmat3x3<T> const & a, \r
+       detail::tmat3x3<T> const & b\r
+)\r
+{\r
+    return a * b;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tmat4x4<T> mul\r
+(\r
+       detail::tmat4x4<T> const & a, \r
+       detail::tmat4x4<T> const & b\r
+)\r
+{\r
+    return a * b;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tvec2<T> mul\r
+(\r
+       detail::tmat2x2<T> const & m, \r
+       detail::tvec2<T> const & v\r
+)\r
+{\r
+    return m * v;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tvec3<T> mul\r
+(\r
+       detail::tmat3x3<T> const & m, \r
+       detail::tvec3<T> const & v)\r
+{\r
+    return m * v;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tvec4<T> mul\r
+(\r
+       detail::tmat4x4<T> const & m, \r
+       detail::tvec4<T> const & v\r
+)\r
+{\r
+    return m * v;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tvec2<T> mul\r
+(\r
+       detail::tvec2<T> const & v, \r
+       detail::tmat2x2<T> const & m\r
+)\r
+{\r
+    return v * m;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tvec3<T> mul\r
+(\r
+       detail::tvec3<T> const & v, \r
+       detail::tmat3x3<T> const & m\r
+)\r
+{\r
+    return v * m;\r
+}\r
+\r
+template <typename T>\r
+inline detail::tvec4<T> mul\r
+(\r
+       detail::tvec4<T> const & v, \r
+       detail::tmat4x4<T> const & m\r
+)\r
+{\r
+    return v * m;\r
+}\r
+\r
+template <typename genType>\r
+inline genType div(genType const & a, genType const & b)\r
+{\r
+    return a / b;\r
+}\r
+\r
+template <typename genTypeT, typename genTypeU, typename genTypeV> \r
+inline genTypeT mad(genTypeT const & a, genTypeU const & b, genTypeV const & c)\r
+{\r
+       return a * b + c;\r
+}\r
+\r
+}//namespace verbose_operator\r
+}//namespace gtx\r
+}//namespace glm\r
diff --git a/glm/img.hpp b/glm/img.hpp
new file mode 100644 (file)
index 0000000..d494b45
--- /dev/null
@@ -0,0 +1,17 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-11-14\r
+// Updated : 2009-11-14\r
+// Licence : This source is under MIT License\r
+// File    : glm/img.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_img\r
+#define glm_img\r
+\r
+#define GLM_IMG_GLOBAL 1\r
+\r
+#include "./img/multiple.hpp"\r
+\r
+#endif//glm_img\r
diff --git a/glm/img/multiple.hpp b/glm/img/multiple.hpp
new file mode 100644 (file)
index 0000000..b7e7246
--- /dev/null
@@ -0,0 +1,55 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-10-26\r
+// Updated : 2009-10-26\r
+// Licence : This source is under MIT License\r
+// File    : glm/img/multiple.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_img_multiple\r
+#define glm_img_multiple\r
+\r
+// Dependency:\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace test{\r
+               bool main_img_multiple();\r
+       }//namespace test\r
+\r
+       namespace img\r
+       {\r
+               //! GLM_IMG_multiple: Find the closest number of a number multiple of other number.\r
+               namespace multiple\r
+               {\r
+                       //! Higher Multiple number of Source.\r
+                       //! From GLM_IMG_multiple extension.\r
+                       template <typename genType> \r
+                       genType higherMultiple(\r
+                               genType const & Source, \r
+                               genType const & Multiple);\r
+\r
+                       //! Lower Multiple number of Source.\r
+                       //! From GLM_IMG_multiple extension.\r
+                       template <typename genType> \r
+                       genType lowerMultiple(\r
+                               genType const & Source, \r
+                               genType const & Multiple);\r
+\r
+               }//namespace multiple\r
+       }//namespace img\r
+}//namespace glm\r
+\r
+#define GLM_IMG_multiple namespace img::multiple\r
+#ifndef GLM_IMG_GLOBAL\r
+namespace glm {using GLM_IMG_multiple;}\r
+#endif//GLM_IMG_GLOBAL\r
+\r
+#include "multiple.inl"\r
+\r
+#endif//glm_img_multiple\r
diff --git a/glm/img/multiple.inl b/glm/img/multiple.inl
new file mode 100644 (file)
index 0000000..8fab1b9
--- /dev/null
@@ -0,0 +1,191 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2009-10-26\r
+// Updated : 2009-10-26\r
+// Licence : This source is under MIT License\r
+// File    : glm/img/multiple.inl\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+namespace glm{\r
+namespace img{\r
+namespace multiple\r
+{\r
+       //////////////////////\r
+       // higherMultiple\r
+\r
+       template <typename genType> \r
+       inline genType higherMultiple\r
+       (\r
+               genType const & Source, \r
+               genType const & Multiple\r
+       )\r
+       {\r
+               genType Tmp = Source % Multiple;\r
+               return Tmp ? Source + Multiple - Tmp : Source;\r
+       }\r
+\r
+       template <> \r
+       inline detail::thalf higherMultiple\r
+       (\r
+               detail::thalf const & Source, \r
+               detail::thalf const & Multiple\r
+       )\r
+       {\r
+               int Tmp = int(float(Source)) % int(float(Multiple));\r
+               return Tmp ? Source + Multiple - detail::thalf(float(Tmp)) : Source;\r
+       }\r
+\r
+       template <> \r
+       inline float higherMultiple\r
+       (       \r
+               float const & Source, \r
+               float const & Multiple\r
+       )\r
+       {\r
+               int Tmp = int(Source) % int(Multiple);\r
+               return Tmp ? Source + Multiple - float(Tmp) : Source;\r
+       }\r
+\r
+       template <> \r
+       inline double higherMultiple\r
+       (\r
+               double const & Source, \r
+               double const & Multiple\r
+       )\r
+       {\r
+               long Tmp = long(Source) % long(Multiple);\r
+               return Tmp ? Source + Multiple - double(Tmp) : Source;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tvec2<valType> higherMultiple\r
+       (\r
+               detail::tvec2<valType> const & Source, \r
+               detail::tvec2<valType> const & Multiple\r
+       )\r
+       {\r
+               detail::tvec2<valType> Result;\r
+               for(typename detail::tvec2<valType>::size_type i = 0; i < detail::tvec2<valType>::value_size(); ++i)\r
+                       Result[i] = higherMultiple(Source[i], Multiple[i]);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tvec3<valType> higherMultiple\r
+       (\r
+               detail::tvec3<valType> const & Source, \r
+               detail::tvec3<valType> const & Multiple\r
+       )\r
+       {\r
+               detail::tvec3<valType> Result;\r
+               for(typename detail::tvec3<valType>::size_type i = 0; i < detail::tvec3<valType>::value_size(); ++i)\r
+                       Result[i] = higherMultiple(Source[i], Multiple[i]);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tvec4<valType> higherMultiple\r
+       (\r
+               detail::tvec4<valType> const & Source, \r
+               detail::tvec4<valType> const & Multiple\r
+       )\r
+       {\r
+               detail::tvec4<valType> Result;\r
+               for(typename detail::tvec4<valType>::size_type i = 0; i < detail::tvec4<valType>::value_size(); ++i)\r
+                       Result[i] = higherMultiple(Source[i], Multiple[i]);\r
+               return Result;\r
+       }\r
+\r
+       //////////////////////\r
+       // lowerMultiple\r
+\r
+       template <typename genType> \r
+       inline genType lowerMultiple\r
+       (\r
+               genType const & Source, \r
+               genType const & Multiple\r
+       )\r
+       {\r
+               genType Tmp = Source % Multiple;\r
+               return Tmp ? Source - Tmp : Source;\r
+       }\r
+\r
+       template <> \r
+       inline detail::thalf lowerMultiple\r
+       (\r
+               detail::thalf const & Source, \r
+               detail::thalf const & Multiple\r
+       )\r
+       {\r
+               int Tmp = int(float(Source)) % int(float(Multiple));\r
+               return Tmp ? Source - detail::thalf(float(Tmp)) : Source;\r
+       }\r
+\r
+       template <> \r
+       inline float lowerMultiple\r
+       (\r
+               float const & Source, \r
+               float const & Multiple\r
+       )\r
+       {\r
+               int Tmp = int(Source) % int(Multiple);\r
+               return Tmp ? Source - float(Tmp) : Source;\r
+       }\r
+\r
+       template <> \r
+       inline double lowerMultiple\r
+       (\r
+               double const & Source, \r
+               double const & Multiple\r
+       )\r
+       {\r
+               long Tmp = long(Source) % long(Multiple);\r
+               return Tmp ? Source - double(Tmp) : Source;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tvec2<valType> lowerMultiple\r
+       (\r
+               detail::tvec2<valType> const & Source, \r
+               detail::tvec2<valType> const & Multiple\r
+       )\r
+       {\r
+               detail::tvec2<valType> Result;\r
+               for(typename detail::tvec2<valType>::size_type i = 0; i < detail::tvec2<valType>::value_size(); ++i)\r
+                       Result[i] = lowerMultiple(Source[i], Multiple[i]);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tvec3<valType> lowerMultiple\r
+       (\r
+               detail::tvec3<valType> const & Source, \r
+               detail::tvec3<valType> const & Multiple\r
+       )\r
+       {\r
+               detail::tvec3<valType> Result;\r
+               for(typename detail::tvec3<valType>::size_type i = 0; i < detail::tvec3<valType>::value_size(); ++i)\r
+                       Result[i] = lowerMultiple(Source[i], Multiple[i]);\r
+               return Result;\r
+       }\r
+\r
+       template <typename valType> \r
+       inline detail::tvec4<valType> lowerMultiple\r
+       (\r
+               detail::tvec4<valType> const & Source, \r
+               detail::tvec4<valType> const & Multiple\r
+       )\r
+       {\r
+               detail::tvec4<valType> Result;\r
+               for(typename detail::tvec4<valType>::size_type i = 0; i < detail::tvec4<valType>::value_size(); ++i)\r
+                       Result[i] = lowerMultiple(Source[i], Multiple[i]);\r
+               return Result;\r
+       }\r
+\r
+}//namespace multiple\r
+}//namespace img\r
+}//namespace glm\r
diff --git a/glm/setup.hpp b/glm/setup.hpp
new file mode 100644 (file)
index 0000000..97853b4
--- /dev/null
@@ -0,0 +1,369 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2006-11-13\r
+// Updated : 2009-08-24\r
+// Licence : This source is under MIT License\r
+// File    : glm/setup.hpp\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_setup\r
+#define glm_setup\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Version\r
+\r
+#define GLM_VERSION                                    84\r
+#define GLM_REVISION                           724\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Common values\r
+\r
+#define GLM_DISABLE                                    0x00000000\r
+#define GLM_ENABLE                                     0x00000001\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Message\r
+\r
+#define GLM_MESSAGE_QUIET                      0x00000000\r
+\r
+#define GLM_MESSAGE_WARNING                    0x00000001\r
+#define GLM_MESSAGE_NOTIFICATION       0x00000002\r
+#define GLM_MESSAGE_CORE                       0x00000004\r
+#define GLM_MESSAGE_EXTS                       0x00000008\r
+#define GLM_MESSAGE_SETUP                      0x00000010\r
+\r
+#define GLM_MESSAGE_ALL                                GLM_MESSAGE_WARNING | GLM_MESSAGE_NOTIFICATION | GLM_MESSAGE_CORE | GLM_MESSAGE_EXTS | GLM_MESSAGE_SETUP\r
+\r
+//! By default:\r
+// #define GLM_MESSAGE GLM_MESSAGE_QUIET\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Precision\r
+\r
+#define GLM_PRECISION_NONE                     0x00000000\r
+\r
+#define GLM_PRECISION_LOWP_FLOAT       0x00000011\r
+#define GLM_PRECISION_MEDIUMP_FLOAT    0x00000012\r
+#define GLM_PRECISION_HIGHP_FLOAT      0x00000013      \r
+\r
+#define GLM_PRECISION_LOWP_INT         0x00001100\r
+#define GLM_PRECISION_MEDIUMP_INT      0x00001200\r
+#define GLM_PRECISION_HIGHP_INT                0x00001300\r
+\r
+#define GLM_PRECISION_LOWP_UINT                0x00110000\r
+#define GLM_PRECISION_MEDIUMP_UINT     0x00120000\r
+#define GLM_PRECISION_HIGHP_UINT       0x00130000      \r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Use options\r
+\r
+// To disable multiple vector component names access.\r
+// GLM_USE_ONLY_XYZW\r
+\r
+// To use anonymous union to provide multiple component names access for class valType. Visual C++ only.\r
+// GLM_USE_ANONYMOUS_UNION\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Compiler\r
+\r
+#define GLM_COMPILER_NONE                      0x00000000\r
+\r
+// Visual C++ defines\r
+#define GLM_COMPILER_VC                                0x01000000\r
+#define GLM_COMPILER_VC60                      0x01000040 // unsupported\r
+#define GLM_COMPILER_VC70                      0x01000080 // unsupported\r
+#define GLM_COMPILER_VC71                      0x01000100 // unsupported\r
+#define GLM_COMPILER_VC80                      0x01000200\r
+#define GLM_COMPILER_VC90                      0x01000400\r
+#define GLM_COMPILER_VC2010                    0x01000800\r
+\r
+// GCC defines\r
+#define GLM_COMPILER_GCC            0x02000000\r
+#define GLM_COMPILER_GCC28                     0x02000020 // unsupported\r
+#define GLM_COMPILER_GCC29                     0x02000040 // unsupported\r
+#define GLM_COMPILER_GCC30                     0x02000080 // unsupported\r
+#define GLM_COMPILER_GCC31                     0x02000100 // unsupported\r
+#define GLM_COMPILER_GCC32                     0x02000200\r
+#define GLM_COMPILER_GCC33                     0x02000400\r
+#define GLM_COMPILER_GCC34                     0x02000800\r
+#define GLM_COMPILER_GCC35                     0x02001000\r
+#define GLM_COMPILER_GCC40                     0x02002000\r
+#define GLM_COMPILER_GCC41                     0x02004000\r
+#define GLM_COMPILER_GCC42                     0x02008000\r
+#define GLM_COMPILER_GCC43                     0x02010000\r
+#define GLM_COMPILER_GCC44                     0x02020000\r
+#define GLM_COMPILER_GCC45                     0x02040000\r
+#define GLM_COMPILER_GCC46                     0x02080000\r
+#define GLM_COMPILER_GCC50                     0x0210000\r
+\r
+#define GLM_MODEL_32                           0x00000010\r
+#define GLM_MODEL_64                           0x00000020\r
+\r
+#ifndef GLM_COMPILER\r
+\r
+/////////////////\r
+// Visual C++ //\r
+\r
+#ifdef _MSC_VER\r
+\r
+#if defined(_WIN64)\r
+#define GLM_MODEL      GLM_MODEL_64\r
+#else\r
+#define GLM_MODEL      GLM_MODEL_32\r
+#endif//\r
+\r
+#if _MSC_VER == 1200\r
+#define GLM_COMPILER GLM_COMPILER_VC60\r
+#endif\r
+\r
+#if _MSC_VER == 1300\r
+#define GLM_COMPILER GLM_COMPILER_VC70\r
+#endif\r
+\r
+#if _MSC_VER == 1310\r
+#define GLM_COMPILER GLM_COMPILER_VC71\r
+#endif\r
+\r
+#if _MSC_VER == 1400\r
+#define GLM_COMPILER GLM_COMPILER_VC80\r
+#endif\r
+\r
+#if _MSC_VER == 1500\r
+#define GLM_COMPILER GLM_COMPILER_VC90\r
+#endif\r
+\r
+#if _MSC_VER == 1600\r
+#define GLM_COMPILER GLM_COMPILER_VC2010\r
+#endif\r
+\r
+#endif//_MSC_VER\r
+\r
+//////////////////\r
+// GCC defines //\r
+\r
+#ifdef __GNUC__\r
+\r
+#if(defined(__WORDSIZE) && (__WORDSIZE == 64)) || defined(__arch64__)\r
+#define GLM_MODEL      GLM_MODEL_64\r
+#else\r
+#define GLM_MODEL      GLM_MODEL_32\r
+#endif//\r
+\r
+#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 8)\r
+#error "GCC 2.8x isn't supported"\r
+#define GLM_COMPILER GLM_COMPILER_GCC28\r
+#endif\r
+\r
+#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 9)\r
+#error "GCC 2.9x isn't supported"\r
+#define GLM_COMPILER GLM_COMPILER_GCC29\r
+#endif\r
+\r
+#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 0)\r
+#error "GCC 3.0 isn't supported"\r
+#define GLM_COMPILER GLM_COMPILER_GCC30\r
+#endif\r
+\r
+#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 1)\r
+#error "GCC 3.1 isn't supported"\r
+#define GLM_COMPILER GLM_COMPILER_GCC31\r
+#endif\r
+\r
+#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2)\r
+#define GLM_COMPILER GLM_COMPILER_GCC32\r
+#endif\r
+\r
+#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 3)\r
+#define GLM_COMPILER GLM_COMPILER_GCC33\r
+#endif\r
+\r
+#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 4)\r
+#define GLM_COMPILER GLM_COMPILER_GCC34\r
+#endif\r
+\r
+#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 5)\r
+#define GLM_COMPILER GLM_COMPILER_GCC35\r
+#endif\r
+\r
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 0)\r
+#define GLM_COMPILER GLM_COMPILER_GCC40\r
+#endif\r
+\r
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 1)\r
+#define GLM_COMPILER GLM_COMPILER_GCC41\r
+#endif\r
+\r
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)\r
+#define GLM_COMPILER GLM_COMPILER_GCC42\r
+#endif\r
+\r
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)\r
+#define GLM_COMPILER GLM_COMPILER_GCC43\r
+#endif\r
+\r
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)\r
+#define GLM_COMPILER GLM_COMPILER_GCC44\r
+#endif\r
+\r
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)\r
+#define GLM_COMPILER GLM_COMPILER_GCC45\r
+#endif\r
+\r
+#if (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)\r
+#define GLM_COMPILER GLM_COMPILER_GCC46\r
+#endif\r
+\r
+#if (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)\r
+#define GLM_COMPILER GLM_COMPILER_GCC50\r
+#endif\r
+\r
+#endif//__GNUC__\r
+\r
+#endif//GLM_COMPILER\r
+\r
+#ifndef GLM_COMPILER\r
+#error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."\r
+#endif//GLM_COMPILER\r
+\r
+#if(!defined(GLM_MODEL) && GLM_COMPILER != 0)\r
+#error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message."\r
+#endif//GLM_MODEL\r
+\r
+#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))\r
+#      if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC)\r
+#              pragma message("GLM message: Compiled with Visual C++")\r
+#      elif(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_GCC)\r
+#              pragma message("GLM message: Compiled with GCC")\r
+#      else\r
+#              pragma message("GLM warning: Compiler not detected")\r
+#      endif\r
+#endif//GLM_MESSAGE\r
+\r
+#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))\r
+#      if(GLM_MODEL == GLM_MODEL_64)\r
+#              pragma message("GLM message: 64 bits model")\r
+#      elif(GLM_MODEL == GLM_MODEL_32)\r
+#              pragma message("GLM message: 32 bits model")\r
+#      endif//GLM_MODEL\r
+#endif//GLM_MESSAGE\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Compatibility\r
+\r
+#define GLM_COMPATIBILITY_DEFAULT      0\r
+#define GLM_COMPATIBILITY_STRICT       1\r
+\r
+//! By default:\r
+//#define GLM_COMPATIBILITY                    GLM_COMPATIBILITY_DEFAULT\r
+\r
+#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))\r
+#      if(!defined(GLM_COMPATIBILITY) || (defined(GLM_COMPATIBILITY) && (GLM_COMPATIBILITY == GLM_COMPATIBILITY_STRICT)))\r
+#\r
+#      elif(defined(GLM_COMPATIBILITY) && (GLM_COMPATIBILITY == GLM_COMPATIBILITY_STRICT))\r
+#              pragma message("GLM message: compatibility strict")\r
+#      endif//GLM_AUTO_CAST\r
+#endif//GLM_MESSAGE\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// External dependencies\r
+\r
+#define GLM_DEPENDENCE_NONE                    0x00000000\r
+#define GLM_DEPENDENCE_GLEW                    0x00000001\r
+#define GLM_DEPENDENCE_GLEE                    0x00000002\r
+#define GLM_DEPENDENCE_GL                      0x00000004\r
+#define GLM_DEPENDENCE_GL3                     0x00000008\r
+#define GLM_DEPENDENCE_BOOST           0x00000010\r
+#define GLM_DEPENDENCE_STL                     0x00000020\r
+#define GLM_DEPENDENCE_TR1                     0x00000040\r
+#define GLM_DEPENDENCE_TR2                     0x00000080\r
+\r
+//! By default:\r
+// #define GLM_DEPENDENCE GLM_DEPENDENCE_NONE\r
+\r
+#if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEW))\r
+#include <GL/glew.hpp>\r
+#elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEE))\r
+#include <GL/GLee.hpp> \r
+#elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GL))\r
+#include <GL/gl.h> \r
+#elif(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_GL3))\r
+#include <GL3/gl3.h> \r
+#endif//GLM_DEPENDENCE\r
+\r
+#if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_BOOST))\r
+#include <boost/static_assert.hpp>\r
+#endif//GLM_DEPENDENCE\r
+\r
+#if(defined(GLM_DEPENDENCE) && (GLM_DEPENDENCE & GLM_DEPENDENCE_BOOST)) || defined(BOOST_STATIC_ASSERT)\r
+#define GLM_STATIC_ASSERT(x) BOOST_STATIC_ASSERT(x)\r
+#else\r
+#define GLM_STATIC_ASSERT(x) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]\r
+#endif//GLM_DEPENDENCE\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Cast\r
+\r
+#define GLM_CAST_NONE                          0x00000000\r
+#define GLM_CAST_DIRECTX_9                     0x00000001\r
+#define GLM_CAST_DIRECTX_10                    0x00000002\r
+#define GLM_CAST_NVSG                          0x00000004\r
+#define GLM_CAST_WILD_MAGIC_3          0x00000008\r
+#define GLM_CAST_WILD_MAGIC_4          0x00000010\r
+#define GLM_CAST_PHYSX                         0x00000020\r
+#define GLM_CAST_ODE                           0x00000040\r
+\r
+//! By default:\r
+// #define GLM_CAST    GLM_CAST_NONE\r
+// #define GLM_CAST_EXT        GLM_CAST_NONE\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Automatic cast\r
+// glColor4fv(glm::vec4(1.0))\r
+\r
+//! By default:\r
+// #define GLM_AUTO_CAST                       GLM_ENABLE\r
+\r
+// GLM_AUTO_CAST isn't defined by defaut but also enable by default with GLM 0.7.x\r
+// Disable GLM_AUTO_CAST by default on Visual C++ 7.1\r
+#if(defined(GLM_COMPILER) && GLM_COMPILER & GLM_COMPILER_VC && GLM_COMPILER <= GLM_COMPILER_VC71)\r
+#      if(defined(GLM_AUTO_CAST) || (GLM_AUTO_CAST == GLM_ENABLE))\r
+#              error "GLM_AUTO_CAST isn't supported by Visual C++ 7.1 and below"\r
+#      else\r
+#              define GLM_AUTO_CAST GLM_DISABLE\r
+#      endif//GLM_AUTO_CAST\r
+#endif//GLM_COMPILER\r
+\r
+#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))\r
+#      if(!defined(GLM_AUTO_CAST) || (defined(GLM_AUTO_CAST) && (GLM_AUTO_CAST == GLM_ENABLE)))\r
+#              pragma message("GLM message: Auto cast enabled")\r
+#      else\r
+#              pragma message("GLM message: Auto cast disabled")\r
+#      endif//GLM_AUTO_CAST\r
+#endif//GLM_MESSAGE\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Swizzle operators\r
+\r
+#define GLM_SWIZZLE_NONE            0x00000000\r
+#define GLM_SWIZZLE_XYZW            0x00000002\r
+#define GLM_SWIZZLE_RGBA            0x00000004\r
+#define GLM_SWIZZLE_STQP            0x00000008\r
+#define GLM_SWIZZLE_FULL            (GLM_SWIZZLE_XYZW | GLM_SWIZZLE_RGBA | GLM_SWIZZLE_STQP)\r
+\r
+//! By default:\r
+// #define GLM_SWIZZLE GLM_SWIZZLE_NONE\r
+\r
+#if(defined(GLM_MESSAGE) && (GLM_MESSAGE & (GLM_MESSAGE_SETUP | GLM_MESSAGE_NOTIFICATION)))\r
+#      if !defined(GLM_SWIZZLE)|| (defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_NONE)\r
+#              pragma message("GLM message: No swizzling operator used")\r
+#      elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE == GLM_SWIZZLE_FULL)\r
+#              pragma message("GLM message: Full swizzling operator support enabled")\r
+#      elif(defined(GLM_SWIZZLE) && GLM_SWIZZLE & GLM_SWIZZLE_FULL)\r
+#              pragma message("GLM message: Partial swizzling operator support enabled")\r
+#      endif//GLM_SWIZZLE\r
+#endif//GLM_MESSAGE\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#endif//glm_setup\r
diff --git a/glm/virtrev.hpp b/glm/virtrev.hpp
new file mode 100644 (file)
index 0000000..ec368e4
--- /dev/null
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2008 G-Truc Creation (www.g-truc.net)\r
+// Virtrev SDK copyright matrem (matrem84.free.fr)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-05-29\r
+// Updated : 2008-10-06\r
+// Licence : This source is under MIT License\r
+// File    : glm/virtrev.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Note:\r
+// Virtrev SDK extensions\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#ifndef glm_virtrev\r
+#define glm_virtrev\r
+\r
+#define GLM_VIRTREV_GLOBAL 1\r
+\r
+#if(defined(GLM_DEPENDENCE) && (                               \\r
+       (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEW) ||       \\r
+       (GLM_DEPENDENCE & GLM_DEPENDENCE_GLEE) ||       \\r
+       (GLM_DEPENDENCE & GLM_DEPENDENCE_GL)))\r
+#include "./virtrev/gl.hpp"\r
+#endif\r
+#include "./virtrev/address.hpp"\r
+#include "./virtrev/equal_operator.hpp"\r
+#include "./virtrev/xstream.hpp"\r
+\r
+#endif//glm_virtrev\r
diff --git a/glm/virtrev/address.hpp b/glm/virtrev/address.hpp
new file mode 100644 (file)
index 0000000..70c77e8
--- /dev/null
@@ -0,0 +1,192 @@
+#ifndef GLM_EXT_VIRTREV_ADDRESS_HPP\r
+#define GLM_EXT_VIRTREV_ADDRESS_HPP\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+// Virtrev SDK copyright matrem (matrem84.free.fr)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-10-07\r
+// Updated : \r
+// Licence : This source is under MIT License\r
+// File    : glm/ext/virtrev/address.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include "../glm.hpp"\r
+\r
+\r
+namespace glm\r
+{\r
+       namespace virtrev_glmext\r
+       {\r
+       //! GLM_VIRTREV_address extension: Vector & matrix content address (T const * type pointer).\r
+       namespace address\r
+       {\r
+               /** Get the const address of the vector content. */\r
+               template<typename T>\r
+               T const * address(detail::tvec2<T> const & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+               /** Get the address of the vector content. */\r
+               template<typename T>\r
+               T * address(detail::tvec2<T> & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+\r
+               /** Get the const address of the vector content. */\r
+               template<typename T>\r
+               T const * address(detail::tvec3<T> const & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+               /** Get the address of the vector content. */\r
+               template<typename T>\r
+               T * address(detail::tvec3<T>  & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+               \r
+               /** Get the const address of the vector content. */\r
+               template<typename T>\r
+               T const * address(detail::tvec4<T> const & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+               /** Get the address of the vector content. */\r
+               template<typename T>\r
+               T * address(detail::tvec4<T> & vec)\r
+               {\r
+                       return &(vec.x);\r
+               }\r
+\r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat2x2<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat2x2<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat3x3<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat3x3<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat4x4<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat4x4<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+\r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat2x3<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat2x3<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat3x2<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat3x2<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat2x4<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat2x4<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat4x2<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat4x2<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat3x4<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat3x4<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               \r
+               /** Get the const address of the matrix content. */\r
+               template<typename T>\r
+               T const * address(detail::tmat4x3<T> const & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+               /** Get the address of the matrix content. */\r
+               template<typename T>\r
+               T * address(detail::tmat4x3<T> & mat)\r
+               {\r
+                       return &(mat[0].x);\r
+               }\r
+       }\r
+       }\r
+}\r
+\r
+#define GLM_VIRTREV_address namespace virtrev_glmext::address\r
+#ifndef GLM_VIRTREV_GLOBAL\r
+namespace glm {using GLM_VIRTREV_address;}\r
+#endif//GLM_VIRTREV_GLOBAL\r
+\r
+#endif//GLM_EXT_VIRTREV_ADDRESS_HPP\r
+\r
diff --git a/glm/virtrev/equal_operator.hpp b/glm/virtrev/equal_operator.hpp
new file mode 100644 (file)
index 0000000..c252bc4
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef GLM_EXT_VIRTREV_EQUAL_OPERATOR_HPP\r
+#define GLM_EXT_VIRTREV_EQUAL_OPERATOR_HPP\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+// VirtreV SDK copyright matrem (matrem84.free.fr)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-09-23\r
+// Updated : \r
+// Licence : This source is under MIT License\r
+// File    : glm/ext/virtrev/equal_operator.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include "../glm.hpp"\r
+\r
+namespace glm\r
+{\r
+       namespace virtrev_glmext\r
+       {\r
+       //! GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL.\r
+       namespace equal_operator\r
+       {\r
+               template<typename T>\r
+               inline bool operator == (glm::detail::tvec2<T> const & v1, glm::detail::tvec2<T> const & v2)\r
+               {\r
+                       return v1.x==v2.x && v1.y==v2.y;\r
+               }\r
+\r
+               template<typename T>\r
+               inline bool operator == (glm::detail::tvec3<T> const & v1, glm::detail::tvec3<T> const & v2)\r
+               {\r
+                       return v1.x==v2.x && v1.y==v2.y && v1.z==v2.z;\r
+               }\r
+\r
+               template<typename T>\r
+               inline bool operator == (glm::detail::tvec4<T> const & v1, glm::detail::tvec4<T> const & v2)\r
+               {\r
+                       return v1.x==v2.x && v1.y==v2.y && v1.z==v2.z && v1.w==v2.w;\r
+               }\r
+\r
+               template<typename T>\r
+               inline bool operator != (glm::detail::tvec2<T> const & v1, glm::detail::tvec2<T> const & v2)\r
+               {\r
+                       return v1.x!=v2.x || v1.y!=v2.y;\r
+               }\r
+\r
+               template<typename T>\r
+               inline bool operator != (glm::detail::tvec3<T> const & v1, glm::detail::tvec3<T> const & v2)\r
+               {\r
+                       return v1.x!=v2.x || v1.y!=v2.y || v1.z!=v2.z;\r
+               }\r
+\r
+               template<typename T>\r
+               inline bool operator != (glm::detail::tvec4<T> const & v1, glm::detail::tvec4<T> const & v2)\r
+               {\r
+                       return v1.x!=v2.x || v1.y!=v2.y || v1.z!=v2.z || v1.w!=v2.w;\r
+               }\r
+       }\r
+       }\r
+}\r
+\r
+#define GLM_VIRTREV_equal_operator namespace glm::virtrev_glmext::equal_operator\r
+#ifndef GLM_VIRTREV_GLOBAL\r
+namespace glm {using GLM_VIRTREV_equal_operator;}\r
+#endif//GLM_VIRTREV_GLOBAL\r
+\r
+#endif//GLM_EXT_VIRTREV_EQUAL_OPERATOR_HPP\r
+\r
diff --git a/glm/virtrev/gl.hpp b/glm/virtrev/gl.hpp
new file mode 100644 (file)
index 0000000..e19cee3
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef GLM_EXT_VIRTREV_GL_HPP\r
+#define GLM_EXT_VIRTREV_GL_HPP\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+// Virtrev SDK copyright matrem (matrem84.free.fr)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-04-24\r
+// Updated : 2008-10-07\r
+// Licence : This source is under MIT License\r
+// File    : glm/ext/virtrev/gl.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - glew or glee or gl library header\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include "../glm.hpp"\r
+\r
+#if !defined(GLM_DEPENDENCE) || !(GLM_DEPENDENCE & (GLM_DEPENDENCE_GLEW|GLM_DEPENDENCE_GLEE|GLM_DEPENDENCE_GL))\r
+#error GLM_VIRTREV_gl requires OpenGL to build. GLM_DEPENDENCE doesn't define the dependence.\r
+#endif//GLM_DEPENDENCE\r
+\r
+namespace glm\r
+{\r
+       namespace virtrev_glmext\r
+       {\r
+       //! GLM_VIRTREV_gl extension: Vector & matrix integration with OpenGL.\r
+       namespace gl\r
+       {\r
+               typedef detail::tvec2<GLfloat> gl_vec2; ///< vec2 for GLfloat OpenGL type\r
+               typedef detail::tvec3<GLfloat> gl_vec3; ///< vec3 for GLfloat OpenGL type\r
+               typedef detail::tvec4<GLfloat> gl_vec4; ///< vec4 for GLfloat OpenGL type\r
+\r
+               typedef detail::tvec2<GLshort> gl_svec2; ///< vec2 for GLshort OpenGL type\r
+               typedef detail::tvec3<GLshort> gl_svec3; ///< vec3 for GLshort OpenGL type\r
+               typedef detail::tvec4<GLshort> gl_svec4; ///< vec4 for GLshort OpenGL type\r
+\r
+               typedef detail::tvec2<GLint> gl_ivec2; ///< vec2 for GLint OpenGL type\r
+               typedef detail::tvec3<GLint> gl_ivec3; ///< vec3 for GLint OpenGL type\r
+               typedef detail::tvec4<GLint> gl_ivec4; ///< vec4 for GLint OpenGL type\r
+\r
+               typedef detail::tmat2x2<GLfloat> gl_mat2; ///< mat2x2 for GLfloat OpenGL type\r
+               typedef detail::tmat3x3<GLfloat> gl_mat3; ///< mat3x3 for GLfloat OpenGL type\r
+               typedef detail::tmat4x4<GLfloat> gl_mat4; ///< mat4x4 for GLfloat OpenGL type\r
+\r
+               typedef detail::tmat2x3<GLfloat> gl_mat2x3; ///< mat2x3 for GLfloat OpenGL type\r
+               typedef detail::tmat3x2<GLfloat> gl_mat3x2; ///< mat3x2 for GLfloat OpenGL type\r
+               typedef detail::tmat2x4<GLfloat> gl_mat2x4; ///< mat2x4 for GLfloat OpenGL type\r
+               typedef detail::tmat4x2<GLfloat> gl_mat4x2; ///< mat4x2 for GLfloat OpenGL type\r
+               typedef detail::tmat3x4<GLfloat> gl_mat3x4; ///< mat3x4 for GLfloat OpenGL type\r
+               typedef detail::tmat4x3<GLfloat> gl_mat4x3; ///< mat4x3 for GLfloat OpenGL type\r
+\r
+       }\r
+       }\r
+}\r
+\r
+#define GLM_VIRTREV_gl namespace glm::virtrev_glmext::gl\r
+#ifndef GLM_VIRTREV_GLOBAL\r
+namespace glm {using GLM_VIRTREV_gl;}\r
+#endif//GLM_VIRTREV_GLOBAL\r
+\r
+#endif//GLM_EXT_VIRTREV_GL_HPP\r
+\r
diff --git a/glm/virtrev/xstream.hpp b/glm/virtrev/xstream.hpp
new file mode 100644 (file)
index 0000000..2bfaa68
--- /dev/null
@@ -0,0 +1,147 @@
+#ifndef GLM_EXT_VIRTREV_XSTREAM_HPP\r
+#define GLM_EXT_VIRTREV_XSTREAM_HPP\r
+\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)\r
+// Virtrev SDK copyright matrem (matrem84.free.fr)\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Created : 2008-05-24\r
+// Updated : 2008-05-26\r
+// Licence : This source is under MIT License\r
+// File    : glm/ext/virtrev/xstream.h\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Dependency:\r
+// - GLM core\r
+// - GLM_GTX_matrix_selection\r
+///////////////////////////////////////////////////////////////////////////////////////////////////\r
+\r
+#include "../glm.hpp"\r
+#include "../gtx/matrix_selection.hpp"\r
+#include <iostream>\r
+\r
+namespace glm\r
+{\r
+       namespace virtrev_glmext\r
+       {\r
+               //! GLM_VIRTREV_xstream extension: Streaming vector and matrix in a xml way\r
+               namespace xstream\r
+               {\r
+                       template<typename T>\r
+                       std::ostream & operator << (std::ostream & stream, glm::detail::tvec2<T> const & vec)\r
+                       {\r
+                               stream << "<glm_vec2 ";\r
+                               stream << "x=\"" << vec.x << "\" ";\r
+                               stream << "y=\"" << vec.y << "\" ";\r
+                               stream << "/>";\r
+\r
+                               return stream;\r
+                       }\r
+\r
+                       template<typename T>\r
+                       std::ostream & operator << (std::ostream & stream, glm::detail::tvec3<T> const & vec)\r
+                       {\r
+                               stream << "<glm_vec3 ";\r
+                               stream << "x=\"" << vec.x << "\" ";\r
+                               stream << "y=\"" << vec.y << "\" ";\r
+                               stream << "z=\"" << vec.z << "\" ";\r
+                               stream << "/>";\r
+\r
+                               return stream;\r
+                       }\r
+\r
+                       template<typename T>\r
+                       std::ostream & operator << (std::ostream & stream, glm::detail::tvec4<T> const & vec)\r
+                       {\r
+                               stream << "<glm_vec4 ";\r
+                               stream << "x=\"" << vec.x << "\" ";\r
+                               stream << "y=\"" << vec.y << "\" ";\r
+                               stream << "z=\"" << vec.z << "\" ";\r
+                               stream << "w=\"" << vec.w << "\" ";\r
+                               stream << "/>";\r
+\r
+                               return stream;\r
+                       }\r
+\r
+                       template<typename T>\r
+                       std::ostream & operator << (std::ostream & stream, glm::detail::tmat2x2<T> const & mat)\r
+                       {\r
+                               stream << "<glm_mat2>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 0)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 0)[1] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 1)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 1)[1] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "</glm_mat2>";\r
+\r
+                               return stream;\r
+                       }\r
+\r
+                       template<typename T>\r
+                       std::ostream & operator << (std::ostream & stream, glm::detail::tmat3x3<T> const & mat)\r
+                       {\r
+                               stream << "<glm_mat3>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 0)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 0)[1] << "\" ";\r
+                               stream << "z=\"" << glm::row(mat, 0)[2] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 1)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 1)[1] << "\" ";\r
+                               stream << "z=\"" << glm::row(mat, 1)[2] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 2)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 2)[1] << "\" ";\r
+                               stream << "z=\"" << glm::row(mat, 2)[2] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "</glm_mat3>";\r
+\r
+                               return stream;\r
+                       }\r
+\r
+                       template<typename T>\r
+                       std::ostream & operator << (std::ostream & stream, glm::detail::tmat4x4<T> const & mat)\r
+                       {\r
+                               stream << "<glm_mat4>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 0)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 0)[1] << "\" ";\r
+                               stream << "z=\"" << glm::row(mat, 0)[2] << "\" ";\r
+                               stream << "w=\"" << glm::row(mat, 0)[3] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 1)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 1)[1] << "\" ";\r
+                               stream << "z=\"" << glm::row(mat, 1)[2] << "\" ";\r
+                               stream << "w=\"" << glm::row(mat, 1)[3] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 2)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 2)[1] << "\" ";\r
+                               stream << "z=\"" << glm::row(mat, 2)[2] << "\" ";\r
+                               stream << "w=\"" << glm::row(mat, 2)[3] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "<row ";\r
+                               stream << "x=\"" << glm::row(mat, 3)[0] << "\" ";\r
+                               stream << "y=\"" << glm::row(mat, 3)[1] << "\" ";\r
+                               stream << "z=\"" << glm::row(mat, 3)[2] << "\" ";\r
+                               stream << "w=\"" << glm::row(mat, 3)[3] << "\" ";\r
+                               stream << "/>" << std::endl;\r
+                               stream << "</glm_mat3>";\r
+                       \r
+                               return stream;\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+#define GLM_VIRTREV_xstream namespace glm::virtrev_glmext::xstream\r
+#ifndef GLM_VIRTREV_GLOBAL\r
+namespace glm {using GLM_VIRTREV_xstream;}\r
+#endif//GLM_VIRTREV_GLOBAL\r
+\r
+#endif\r
index 99d63ef95c6ee5c3db0fade3f9b9e637ece0f6ed..589322cf92514e323324d88838b6d6ecac8f45ba 100644 (file)
@@ -6,7 +6,9 @@ TARGET = md5view
 TEMPLATE = app
 SOURCES += main.cpp \
     mainwindow.cpp \
-    viewerwidget.cpp
+    viewerwidget.cpp \
+    md5model.cpp
 HEADERS += mainwindow.h \
-    viewerwidget.h
+    viewerwidget.h \
+    md5model.h
 FORMS += mainwindow.ui
diff --git a/meshes/imp.md5mesh b/meshes/imp.md5mesh
new file mode 100644 (file)
index 0000000..2d82518
--- /dev/null
@@ -0,0 +1,3728 @@
+MD5Version 10\r
+commandline "mesh models/monsters/imp/animation/cycles/imp.mb -dest models/md5/monsters/imp/imp.md5mesh -game Doom -prefix IMP1_ -keep Lknee Rknee Lelbow Relbow camera Body -keep Rmissile Lmissile -parent Rmissile Rhand -parent Lmissile Lhand -parent Rwing Chest -parent Lwing Chest -parent Hips Body -parent Waist Body -parent camera Head -prefix IMP2_ -prefix IMP_ -align ALL"\r
+\r
+numJoints 71\r
+numMeshes 1\r
+\r
+joints {\r
+       "origin"        -1 ( 0 0 0 ) ( -0.5 -0.5 -0.5 )         // \r
+       "Body"  0 ( -0.0000002384 0 56.5783920288 ) ( -0.5 -0.5 -0.5 )          // origin\r
+       "Hips"  1 ( 3.3494229317 -0.0225959271 62.0168151855 ) ( -0.5 -0.5 -0.5 )               // Body\r
+       "Lupleg"        2 ( -0.1500415802 4.8255143166 54.5172233582 ) ( 0.5614669323 -0.3771466613 -0.4900334179 )             // Hips\r
+       "Lloleg"        3 ( 3.5001502037 6.8211932182 31.0613594055 ) ( 0.4744751453 -0.4736278951 -0.590847671 )               // Lupleg\r
+       "Lankle_r"      4 ( -0.7495136261 9.0730142593 5.5066628456 ) ( -0.5868187547 -0.481595099 0.296489656 )                // Lloleg\r
+       "Lball_r"       5 ( 2.1382782459 9.4164094925 -1.6956970692 ) ( 0.0728539601 -0.1073002592 0.3467582464 )               // Lankle_r\r
+       "Ltoe1_r"       6 ( 5.8043384552 8.8547563553 -2.1653971672 ) ( -0.9890788794 -0.0974018201 0.0795167163 )              // Lball_r\r
+       "Ltip1_r"       7 ( 11.4689292908 10.2455282211 -2.7404873371 ) ( 0.0728536099 -0.1073002964 0.3467582762 )             // Ltoe1_r\r
+       "Ltoe2_r"       6 ( 4.7200937271 13.4133682251 -2.7574617863 ) ( -0.9792345166 -0.1698939353 0.0849573314 )             // Lball_r\r
+       "Lknee" 4 ( 18.8344936371 6.8211922646 42.936958313 ) ( -0.4999999702 -0.5 -0.5 )               // Lloleg\r
+       "Rupleg"        2 ( -0.1500415802 -4.5701680183 54.5172233582 ) ( 0.5689209104 -0.4676292539 -0.421169579 )             // Hips\r
+       "Rloleg"        11 ( 4.3707418442 -6.3708400726 31.0744743347 ) ( 0.4559702575 -0.5845044851 -0.5221133232 )            // Rupleg\r
+       "Rankle_r"      12 ( -0.524418354 -9.0240345001 5.7276988029 ) ( -0.6380540133 -0.4521044493 0.3826819658 )             // Rloleg\r
+       "Rball_r"       13 ( 2.6161766052 -9.5887231827 -1.316108942 ) ( -0.0830028579 -0.1591864675 0.3980002105 )             // Rankle_r\r
+       "Rtoe1_r"       14 ( 5.9368748665 -11.5404500961 -2.141885519 ) ( 0.9940758348 0.0303506274 -0.0628471076 )             // Rball_r\r
+       "Rtip1_r"       15 ( 12.3385314941 -9.8679914474 -2.1791322231 ) ( -0.0830028877 -0.1591864675 0.3980002403 )           // Rtoe1_r\r
+       "Rtoe2_r"       14 ( 6.4745693207 -6.8747558594 -1.3658405542 ) ( 0.9891501069 0.1033919677 -0.0565476157 )             // Rball_r\r
+       "Rtip2_r"       17 ( 11.753780365 -6.8669633865 -1.6503264904 ) ( -0.0830032304 -0.1591864973 0.3980002105 )            // Rtoe2_r\r
+       "Rknee" 12 ( 19.7050857544 -6.3708386421 42.9500770569 ) ( -0.4999999702 -0.5 -0.5 )            // Rloleg\r
+       "Waist" 1 ( 0.2927730083 0 59.4694366455 ) ( -0.5 -0.5 -0.5 )           // Body\r
+       "Chest" 20 ( -2.3445606232 0 66.5029754639 ) ( -0.5 -0.5 -0.5 )         // Waist\r
+       "Lrib"  21 ( 7.3695240021 5.5330324173 71.9951324463 ) ( -0.5 -0.5 -0.5 )               // Chest\r
+       "Rrib"  21 ( 7.3695240021 -5.1057934761 71.8560638428 ) ( -0.5 -0.5 -0.5 )              // Chest\r
+       "Shoulders"     21 ( -0.9038720131 0 73.4102478027 ) ( -0.5 -0.5 -0.5 )         // Chest\r
+       "Lshldr"        24 ( 4.8692617416 1.357098937 78.6024856567 ) ( -0.5 -0.5 -0.5 )                // Shoulders\r
+       "Luparm"        25 ( 1.0166268349 5.5905423164 81.2515563965 ) ( -0.5 -0.5 -0.5 )               // Lshldr\r
+       "Lloarm"        26 ( -3.8193283081 21.1066417694 72.8406829834 ) ( -0.5 -0.5 -0.5 )             // Luparm\r
+       "Lelbow"        27 ( -14.6793737411 21.1066417694 67.7180480957 ) ( -0.5 -0.5 -0.5 )            // Lloarm\r
+       "Lhand" 27 ( 1.9877896309 37.2198066711 71.9780807495 ) ( -0.3105591238 -0.5108622909 -0.6902129054 )           // Lloarm\r
+       "Lindex_lo"     29 ( 3.908916235 42.5809516907 72.9746627808 ) ( -0.3105591238 -0.5108622909 -0.6902129054 )            // Lhand\r
+       "Lindex_base"   30 ( 5.0472903252 44.2703590393 75.9137496948 ) ( -0.3105591238 -0.5108622909 -0.6902129054 )           // Lindex_lo\r
+       "Lindex_mid"    31 ( 5.7127923965 46.560295105 76.6713256836 ) ( -0.3105591238 -0.5108622909 -0.6902129054 )            // Lindex_base\r
+       "Lindex_tip"    32 ( 4.9341306686 49.7012405396 76.9152145386 ) ( -0.3105591238 -0.5108622909 -0.6902129054 )           // Lindex_mid\r
+       "Lmissile"      29 ( 2.0349760056 45.0360450745 70.9159393311 ) ( -0.4999999702 -0.4999999702 -0.5 )            // Lhand\r
+       "Lpinky_base"   29 ( -0.3004188538 41.9372177124 73.1500167847 ) ( -0.1526525021 -0.5874319673 -0.7413083315 )          // Lhand\r
+       "Lpinky_mid"    35 ( -1.852424264 45.7090415955 74.587348938 ) ( -0.1526525021 -0.5874319673 -0.7413083315 )            // Lpinky_base\r
+       "Lpinky_tip"    36 ( -1.6164255142 48.6077842712 73.5294952393 ) ( -0.1526525021 -0.5874319673 -0.7413083315 )          // Lpinky_mid\r
+       "Lring_lo"      29 ( 2.1891980171 42.5758743286 74.5430450439 ) ( -0.1526525021 -0.5874319673 -0.7413083315 )           // Lhand\r
+       "Lring_base"    38 ( 1.830731988 45.3891906738 77.0519714355 ) ( -0.1526525021 -0.5874319673 -0.7413083315 )            // Lring_lo\r
+       "Lring_mid"     39 ( 1.262499094 48.2335281372 78.4642181396 ) ( -0.1526525021 -0.5874319673 -0.7413083315 )            // Lring_base\r
+       "Lring_tip"     40 ( 0.4961673617 51.3678245544 78.1024780273 ) ( -0.1526525021 -0.5874319673 -0.7413083315 )           // Lring_mid\r
+       "Lthumb_lo"     29 ( 3.357609272 37.4952087402 71.1309204102 ) ( -0.2624037266 -0.7686331272 -0.4722203016 )            // Lhand\r
+       "Lthumb_base"   42 ( 4.7565379143 40.4100418091 69.7664642334 ) ( -0.2624037266 -0.7686331272 -0.4722203016 )           // Lthumb_lo\r
+       "Lthumb_mid"    43 ( 4.9935097694 43.29895401 68.390296936 ) ( -0.2624037266 -0.7686331272 -0.4722203016 )              // Lthumb_base\r
+       "Lthumb_tip"    44 ( 3.333419323 45.0855636597 67.994178772 ) ( -0.2624037266 -0.7686331272 -0.4722203016 )             // Lthumb_mid\r
+       "Neck"  24 ( 1.6579480171 0 80.5833435059 ) ( -0.5 -0.5 -0.5 )          // Shoulders\r
+       "Head"  46 ( 4.1499004364 0 83.8904190063 ) ( -0.5 -0.5 -0.5 )          // Neck\r
+       "Jaw"   47 ( 6.4089598656 0 84.8219909668 ) ( -0.5 -0.5 -0.5 )          // Head\r
+       "camera"        47 ( 12.2084655762 -0.0402986743 85.314956665 ) ( 0.0090039046 -0.1247913837 -0.0010257054 )            // Head\r
+       "Rshldr"        24 ( 4.8692622185 -1.3571000099 78.6024932861 ) ( -0.5 -0.5 -0.5 )              // Shoulders\r
+       "Ruparm"        50 ( 1.0166249275 -5.5905375481 81.2514953613 ) ( -0.5 -0.5 -0.5 )              // Rshldr\r
+       "Rloarm"        51 ( -3.8193254471 -21.1066246033 72.8407440186 ) ( -0.5 -0.5 -0.5 )            // Ruparm\r
+       "Relbow"        52 ( -14.6793699265 -21.1066246033 67.7181091309 ) ( -0.5 -0.5 -0.5 )           // Rloarm\r
+       "Rhand" 52 ( 1.9877872467 -37.2197494507 71.9781188965 ) ( -0.6679188013 -0.2811743915 -0.460739851 )           // Rloarm\r
+       "Rindex_lo"     54 ( 5.608399868 -41.4205284119 73.5562438965 ) ( -0.6715649962 -0.3042283654 -0.4568676353 )           // Rhand\r
+       "Rindex_base"   55 ( 7.5318174362 -43.3202056885 74.7202148438 ) ( -0.6715649962 -0.3042283654 -0.4568676353 )          // Rindex_lo\r
+       "Rindex_mid"    56 ( 9.0574998856 -45.2582817078 75.9236450195 ) ( -0.7008211613 -0.2686780095 -0.4510940909 )          // Rindex_base\r
+       "Rindex_tip"    57 ( 9.0185976028 -47.9933700562 75.2492294312 ) ( -0.7008211613 -0.2686780095 -0.4510940909 )          // Rindex_mid\r
+       "Rmissile"      54 ( 3.612036705 -43.5896911621 69.6388015747 ) ( -0.6817477942 -0.0655400082 -0.1850441098 )           // Rhand\r
+       "Rpinky_base"   54 ( 1.2438013554 -42.7748680115 72.7645950317 ) ( -0.4426555634 -0.3011793494 -0.7501675487 )          // Rhand\r
+       "Rpinky_mid"    60 ( 1.4834923744 -45.5311279297 73.8436965942 ) ( -0.4426555634 -0.3011793494 -0.7501675487 )          // Rpinky_base\r
+       "Rpinky_tip"    61 ( 3.2868413925 -49.1914558411 73.0318069458 ) ( -0.4426555634 -0.3011793494 -0.7501675487 )          // Rpinky_mid\r
+       "Rring_lo"      54 ( 3.7522134781 -42.0048370361 74.3459777832 ) ( -0.5458689928 -0.3377533853 -0.6405339241 )          // Rhand\r
+       "Rring_base"    63 ( 4.4562039375 -45.54479599 76.5597915649 ) ( -0.5458689928 -0.3377533853 -0.6405339241 )            // Rring_lo\r
+       "Rring_mid"     64 ( 4.8783464432 -48.4118385315 77.7644424438 ) ( -0.5458689928 -0.3377533853 -0.6405339241 )          // Rring_base\r
+       "Rring_tip"     65 ( 5.1997308731 -51.8249702454 76.8283843994 ) ( -0.5458689928 -0.3377533853 -0.6405339241 )          // Rring_mid\r
+       "Rthumb_lo"     54 ( 4.0275745392 -36.9916038513 71.0148696899 ) ( -0.5852108002 -0.1316827238 -0.7178010345 )          // Rhand\r
+       "Rthumb_base"   67 ( 6.2269821167 -39.4013442993 69.4674758911 ) ( -0.5142287612 -0.096853286 -0.8463736176 )           // Rthumb_lo\r
+       "Rthumb_mid"    68 ( 8.3318214417 -40.2367553711 67.5116119385 ) ( -0.5142287612 -0.096853286 -0.8463736176 )           // Rthumb_base\r
+       "Rthumb_tip"    69 ( 8.5969076157 -42.6055335999 65.892364502 ) ( -0.5142287612 -0.096853286 -0.8463736176 )            // Rthumb_mid\r
+}\r
+\r
+mesh {\r
+       // meshes: polySurface1\r
+       shader "models/monsters/imp/imp"\r
+\r
+       numverts 891\r
+       vert 0 ( 0.8658549786 0.3910109997 ) 1377 2\r
+       vert 1 ( 0.9047420025 0.3801220059 ) 764 2\r
+       vert 2 ( 0.892663002 0.4162740111 ) 762 2\r
+       vert 3 ( 0.8819209933 0.4923700094 ) 1230 1\r
+       vert 4 ( 0.8432620168 0.4713640213 ) 1211 1\r
+       vert 5 ( 0.9089090228 0.3466039896 ) 1379 2\r
+       vert 6 ( 0.9402530193 0.356589973 ) 622 2\r
+       vert 7 ( 0.936702013 0.3991870284 ) 642 2\r
+       vert 8 ( 0.9622219801 0.4039859772 ) 644 2\r
+       vert 9 ( 0.9113950133 0.4784160256 ) 646 1\r
+       vert 10 ( 0.4455760121 0.3779770136 ) 211 2\r
+       vert 11 ( 0.4935880005 0.3773649931 ) 395 2\r
+       vert 12 ( 0.4725199938 0.407877028 ) 202 2\r
+       vert 13 ( 0.46083799 0.3574039936 ) 414 2\r
+       vert 14 ( 0.4226379991 0.3312609792 ) 416 3\r
+       vert 15 ( 0.5098860264 0.395851016 ) 397 1\r
+       vert 16 ( 0.4714680016 0.4320170283 ) 204 2\r
+       vert 17 ( 0.4320049882 0.2953100204 ) 419 3\r
+       vert 18 ( 0.4699369967 0.3354099989 ) 422 2\r
+       vert 19 ( 0.502448976 0.3553580046 ) 398 2\r
+       vert 20 ( 0.5594859719 0.3856170177 ) 400 2\r
+       vert 21 ( 0.5534120202 0.3623949885 ) 402 3\r
+       vert 22 ( 0.4762170017 0.272973001 ) 424 3\r
+       vert 23 ( 0.5603200197 0.2951329947 ) 405 4\r
+       vert 24 ( 0.5784839988 0.2735880017 ) 624 4\r
+       vert 25 ( 0.5618100166 0.2347249985 ) 628 2\r
+       vert 26 ( 0.484780997 0.1441540122 ) 644 2\r
+       vert 27 ( 0.5036510229 0.1811059713 ) 650 3\r
+       vert 28 ( 0.4721060097 0.2094669938 ) 647 3\r
+       vert 29 ( 0.4011240005 0.1726250052 ) 653 1\r
+       vert 30 ( 0.4260840118 0.1079699993 ) 646 1\r
+       vert 31 ( 0.4066579938 0.1979320049 ) 654 2\r
+       vert 32 ( 0.4309540093 0.3848189712 ) 213 2\r
+       vert 33 ( 0.3752120137 0.406431973 ) 974 4\r
+       vert 34 ( 0.4444699883 0.4874569774 ) 206 3\r
+       vert 35 ( 0.4021719992 0.3311830163 ) 1082 4\r
+       vert 36 ( 0.4467209876 0.2578369975 ) 656 4\r
+       vert 37 ( 0.3922060132 0.2356569767 ) 1212 3\r
+       vert 38 ( 0.378320992 0.2664020061 ) 1215 4\r
+       vert 39 ( 0.4111439884 0.3003469706 ) 427 4\r
+       vert 40 ( 0.5890610218 0.3038640022 ) 368 1\r
+       vert 41 ( 0.5908010006 0.3545749784 ) 364 4\r
+       vert 42 ( 0.5940819979 0.3766099811 ) 369 4\r
+       vert 43 ( 0.486315012 0.4641780257 ) 209 2\r
+       vert 44 ( 0.5296769738 0.4387519956 ) 409 1\r
+       vert 45 ( 0.5646640062 0.4159449935 ) 410 2\r
+       vert 46 ( 0.5531259775 0.4516389966 ) 412 2\r
+       vert 47 ( 0.5929830074 0.4274849892 ) 373 3\r
+       vert 48 ( 0.5581700206 0.5044209957 ) 140 2\r
+       vert 49 ( 0.3342550099 0.3271899819 ) 1086 2\r
+       vert 50 ( 0.3446899951 0.3903080225 ) 982 5\r
+       vert 51 ( 0.2906930149 0.4331480265 ) 978 4\r
+       vert 52 ( 0.2780939937 0.36629498 ) 1088 4\r
+       vert 53 ( 0.350165993 0.4602569938 ) 987 3\r
+       vert 54 ( 0.2415779978 0.469456017 ) 964 2\r
+       vert 55 ( 0.6278759837 0.4150900245 ) 1212 3\r
+       vert 56 ( 0.6617609859 0.3855559826 ) 1215 4\r
+       vert 57 ( 0.7017890215 0.4796990156 ) 1095 2\r
+       vert 58 ( 0.6637650132 0.4906160235 ) 1097 1\r
+       vert 59 ( 0.6110360026 0.4584259987 ) 660 2\r
+       vert 60 ( 0.9401680231 0.4473029971 ) 653 1\r
+       vert 61 ( 0.9440479875 0.4652580023 ) 654 2\r
+       vert 62 ( 0.9164919853 0.587051034 ) 431 2\r
+       vert 63 ( 0.8897489905 0.5668550134 ) 1231 1\r
+       vert 64 ( 0.9509649873 0.589779973 ) 1098 2\r
+       vert 65 ( 0.9744719863 0.4522749782 ) 660 2\r
+       vert 66 ( 0.9928060174 0.472630024 ) 1097 1\r
+       vert 67 ( 0.8674150109 0.6261509657 ) 1236 2\r
+       vert 68 ( 0.7217270136 0.4029960036 ) 1092 3\r
+       vert 69 ( 0.7304599881 0.4685429931 ) 1100 2\r
+       vert 70 ( 0.3617520034 0.2754740119 ) 1092 3\r
+       vert 71 ( 0.7648109794 0.4058899879 ) 1219 2\r
+       vert 72 ( 0.3319259882 0.2511690259 ) 1219 2\r
+       vert 73 ( 0.992644012 0.6031559706 ) 1102 2\r
+       vert 74 ( 0.8997570276 0.6710929871 ) 1110 2\r
+       vert 75 ( 0.6808909774 0.5813779831 ) 1102 2\r
+       vert 76 ( 0.8233590126 0.5001620054 ) 1232 1\r
+       vert 77 ( 0.8196020126 0.4549049735 ) 1221 1\r
+       vert 78 ( 0.8037059903 0.3945549726 ) 1222 2\r
+       vert 79 ( 0.8531119823 0.3535869718 ) 1381 2\r
+       vert 80 ( 0.5623360276 0.1429389715 ) 622 2\r
+       vert 81 ( 0.6112840176 0.1612300277 ) 736 2\r
+       vert 82 ( 0.5552790165 0.192900002 ) 630 3\r
+       vert 83 ( 0.614297986 0.2496349812 ) 585 3\r
+       vert 84 ( 0.5711550117 0.0786780119 ) 1379 2\r
+       vert 85 ( 0.6336380243 0.106226027 ) 1341 1\r
+       vert 86 ( 0.6061859727 0.130810976 ) 738 1\r
+       vert 87 ( 0.1456640065 0.0616189837 ) 1342 1\r
+       vert 88 ( 0.1655959934 0.004290998 ) 1379 2\r
+       vert 89 ( 0.2381079942 0.059795022 ) 1381 2\r
+       vert 90 ( 0.0592989996 0.0097569823 ) 1341 1\r
+       vert 91 ( 0.6810920238 0.1442700028 ) 740 1\r
+       vert 92 ( 0.6632720232 0.171431005 ) 739 1\r
+       vert 93 ( 0.1714700013 0.0926010013 ) 1343 3\r
+       vert 94 ( 0.0638689995 0.0808969736 ) 1346 1\r
+       vert 95 ( 0.1359560043 0.1618999839 ) 1351 1\r
+       vert 96 ( 0.1298909932 0.1286990047 ) 1350 1\r
+       vert 97 ( 0.1932709962 0.1180869937 ) 1347 3\r
+       vert 98 ( 0.0523019992 0.1063830256 ) 1353 4\r
+       vert 99 ( 0.0725580007 0.1149970293 ) 1352 1\r
+       vert 100 ( 0.0086899996 0.0989540219 ) 1261 4\r
+       vert 101 ( 0.6630539894 0.2133560181 ) 741 1\r
+       vert 102 ( 0.6120910048 0.1978889704 ) 633 2\r
+       vert 103 ( 0.6431419849 0.2242379785 ) 635 3\r
+       vert 104 ( 0.6822400093 0.2476969957 ) 592 2\r
+       vert 105 ( 0.6627140045 0.2565180063 ) 588 4\r
+       vert 106 ( 0.6318609715 0.2558209896 ) 594 3\r
+       vert 107 ( 0.5955960155 0.261187017 ) 638 3\r
+       vert 108 ( 0.5960209966 0.2845410109 ) 597 3\r
+       vert 109 ( 0.0387790017 0.1839280128 ) 1357 5\r
+       vert 110 ( 0.0081359996 0.1850200295 ) 1269 5\r
+       vert 111 ( 0.0297909994 0.145811975 ) 1265 4\r
+       vert 112 ( 0.0441460013 0.2091749907 ) 1274 5\r
+       vert 113 ( 0.0748410001 0.1921110153 ) 1279 5\r
+       vert 114 ( 0.0733010024 0.1601880193 ) 1362 5\r
+       vert 115 ( 0.0693050027 0.137567997 ) 1367 1\r
+       vert 116 ( 0.0396150015 0.1270449758 ) 1368 3\r
+       vert 117 ( 0.1337530017 0.1994839907 ) 1371 6\r
+       vert 118 ( 0.2137950063 0.1536509991 ) 1383 3\r
+       vert 119 ( 0.209691003 0.20184201 ) 1190 3\r
+       vert 120 ( 0.225722 0.1374539733 ) 1386 3\r
+       vert 121 ( 0.2373339981 0.160359025 ) 1389 3\r
+       vert 122 ( 0.1154550016 0.2254359722 ) 1284 5\r
+       vert 123 ( 0.1344970018 0.2540029883 ) 1161 5\r
+       vert 124 ( 0.189914003 0.2325739861 ) 1193 5\r
+       vert 125 ( 0.2663919926 0.134995997 ) 1392 3\r
+       vert 126 ( 0.8136450052 0.3329290152 ) 1392 3\r
+       vert 127 ( 0.3206700087 0.2083330154 ) 1222 2\r
+       vert 128 ( 0.3068070114 0.2415360212 ) 1224 3\r
+       vert 129 ( 0.1939010024 0.2994419932 ) 1198 4\r
+       vert 130 ( 0.2351350039 0.2487829924 ) 1227 3\r
+       vert 131 ( 0.2311999947 0.292764008 ) 1202 4\r
+       vert 132 ( 0.218197003 0.3390269876 ) 1066 4\r
+       vert 133 ( 0.7738569975 0.4659230113 ) 1233 2\r
+       vert 134 ( 0.2145709991 0.4182940125 ) 966 3\r
+       vert 135 ( 0.1918659955 0.3579739928 ) 1070 3\r
+       vert 136 ( 0.1817969978 0.4129549861 ) 1073 3\r
+       vert 137 ( 0.2277680039 0.4995999932 ) 969 2\r
+       vert 138 ( 0.3483670056 0.5014640093 ) 971 3\r
+       vert 139 ( 0.3023670018 0.5384190083 ) 918 3\r
+       vert 140 ( 0.415775001 0.5519819856 ) 151 2\r
+       vert 141 ( 0.3364549875 0.5936729908 ) 916 2\r
+       vert 142 ( 0.4975549877 0.5117490292 ) 153 3\r
+       vert 143 ( 0.526736021 0.593520999 ) 142 1\r
+       vert 144 ( 0.1624359936 0.2635220289 ) 1206 5\r
+       vert 145 ( 0.1370539963 0.2855669856 ) 1166 3\r
+       vert 146 ( 0.1553609967 0.3155130148 ) 1076 3\r
+       vert 147 ( 0.1354340017 0.3553630114 ) 1042 3\r
+       vert 148 ( 0.1748200059 0.3456419706 ) 1079 3\r
+       vert 149 ( 0.152936995 0.4044020176 ) 1048 3\r
+       vert 150 ( 0.1349190027 0.389113009 ) 1045 3\r
+       vert 151 ( 0.1743330061 0.468438983 ) 951 2\r
+       vert 152 ( 0.2426660061 0.6310210228 ) 921 4\r
+       vert 153 ( 0.1981779933 0.561604023 ) 898 2\r
+       vert 154 ( 0.1950149983 0.5101790428 ) 953 2\r
+       vert 155 ( 0.2358549982 0.5534809828 ) 925 3\r
+       vert 156 ( 0.2165379971 0.6001880169 ) 900 2\r
+       vert 157 ( 0.2024459988 0.6367000341 ) 902 4\r
+       vert 158 ( 0.8699700236 0.062681973 ) 775 1\r
+       vert 159 ( 0.7933419943 0.0067750216 ) 766 1\r
+       vert 160 ( 0.8175349832 0.0708159804 ) 774 1\r
+       vert 161 ( 0.8546739817 0.008400023 ) 767 1\r
+       vert 162 ( 0.7171040177 0.0504220128 ) 768 1\r
+       vert 163 ( 0.7510849833 0.099018991 ) 776 1\r
+       vert 164 ( 0.6812340021 0.1054490209 ) 697 1\r
+       vert 165 ( 0.7195789814 0.1319010258 ) 742 1\r
+       vert 166 ( 0.6884329915 0.1544950008 ) 698 1\r
+       vert 167 ( 0.8483690023 0.2963799834 ) 741 1\r
+       vert 168 ( 0.8496410251 0.259962976 ) 739 1\r
+       vert 169 ( 0.7789930105 0.3217620254 ) 641 1\r
+       vert 170 ( 0.7764490247 0.3626620173 ) 592 2\r
+       vert 171 ( 0.8296459913 0.1979560256 ) 746 2\r
+       vert 172 ( 0.7968490124 0.1361960173 ) 745 1\r
+       vert 173 ( 0.7839310169 0.1836779714 ) 743 2\r
+       vert 174 ( 0.7251989841 0.3290519714 ) 600 1\r
+       vert 175 ( 0.7437710166 0.2796570063 ) 748 1\r
+       vert 176 ( 0.711763978 0.2806159854 ) 699 1\r
+       vert 177 ( 0.718125999 0.1712639928 ) 749 1\r
+       vert 178 ( 0.7508630157 0.2160159945 ) 751 1\r
+       vert 179 ( 0.719013989 0.2146760225 ) 750 1\r
+       vert 180 ( 0.7891539931 0.2574819922 ) 752 1\r
+       vert 181 ( 0.3591209948 0.7251099944 ) 106 1\r
+       vert 182 ( 0.3927290142 0.6674389839 ) 105 1\r
+       vert 183 ( 0.3162479997 0.7084549665 ) 92 2\r
+       vert 184 ( 0.3360419869 0.7445850372 ) 94 2\r
+       vert 185 ( 0.4709730148 0.7174290419 ) 109 1\r
+       vert 186 ( 0.5518569946 0.6541960239 ) 126 3\r
+       vert 187 ( 0.5285440087 0.7387089729 ) 114 1\r
+       vert 188 ( 0.5532469749 0.7149789929 ) 129 1\r
+       vert 189 ( 0.3170320094 0.7504550219 ) 96 2\r
+       vert 190 ( 0.3135139942 0.7971960306 ) 100 2\r
+       vert 191 ( 0.258810997 0.7782310247 ) 81 1\r
+       vert 192 ( 0.2556129992 0.7467960119 ) 79 1\r
+       vert 193 ( 0.2687860131 0.684746027 ) 80 1\r
+       vert 194 ( 0.5329959989 0.7829660177 ) 134 1\r
+       vert 195 ( 0.4004510045 0.7816889882 ) 107 1\r
+       vert 196 ( 0.5319129825 0.8484209776 ) 889 1\r
+       vert 197 ( 0.3534800112 0.8119220138 ) 877 2\r
+       vert 198 ( 0.3721509874 0.8658800125 ) 876 1\r
+       vert 199 ( 0.3290500045 0.8738279939 ) 867 2\r
+       vert 200 ( 0.1511140019 0.7662889957 ) 67 1\r
+       vert 201 ( 0.1949339956 0.7039160132 ) 72 1\r
+       vert 202 ( 0.128057003 0.7114620209 ) 844 1\r
+       vert 203 ( 0.1920520067 0.7645189762 ) 73 1\r
+       vert 204 ( 0.2178730071 0.6518000364 ) 851 1\r
+       vert 205 ( 0.2710539997 0.8663890362 ) 861 1\r
+       vert 206 ( 0.3133589923 0.9429730177 ) 858 1\r
+       vert 207 ( 0.2530179918 0.9317960143 ) 860 1\r
+       vert 208 ( 0.2457190007 0.98517102 ) 851 1\r
+       vert 209 ( 0.5787479877 0.5270869732 ) 51 2\r
+       vert 210 ( 0.5919589996 0.4690170288 ) 40 2\r
+       vert 211 ( 0.554445982 0.5257560015 ) 49 2\r
+       vert 212 ( 0.6098080277 0.5212370157 ) 44 2\r
+       vert 213 ( 0.6399019957 0.5217280388 ) 30 3\r
+       vert 214 ( 0.6255040169 0.4680550098 ) 42 2\r
+       vert 215 ( 0.6059569716 0.4835230112 ) 46 1\r
+       vert 216 ( 0.8890010118 0.3160259724 ) 46 1\r
+       vert 217 ( 0.9252679944 0.3106799722 ) 33 3\r
+       vert 218 ( 0.8620030284 0.2712230086 ) 49 2\r
+       vert 219 ( 0.8997160196 0.339312017 ) 42 2\r
+       vert 220 ( 0.6338729858 0.6179389954 ) 820 2\r
+       vert 221 ( 0.5853270292 0.6541830301 ) 796 5\r
+       vert 222 ( 0.6633300185 0.6478710175 ) 791 5\r
+       vert 223 ( 0.6105780005 0.6199960113 ) 832 2\r
+       vert 224 ( 0.6069740057 0.6015210152 ) 834 4\r
+       vert 225 ( 0.8651260138 0.3174859881 ) 40 2\r
+       vert 226 ( 0.0562979989 0.9080989957 ) 824 2\r
+       vert 227 ( 0.0805179998 0.8763459921 ) 822 2\r
+       vert 228 ( 0.039241001 0.881411016 ) 832 2\r
+       vert 229 ( 0.0206809994 0.8567830324 ) 834 4\r
+       vert 230 ( 0.0703490004 0.8341609836 ) 838 2\r
+       vert 231 ( 0.0693550035 0.7821719646 ) 59 2\r
+       vert 232 ( 0.0415229984 0.7456760406 ) 826 2\r
+       vert 233 ( 0.6154680252 0.5810270309 ) 63 3\r
+       vert 234 ( 0.6318259835 0.5838260055 ) 36 2\r
+       vert 235 ( 0.641735971 0.6090250015 ) 801 2\r
+       vert 236 ( 0.0369510017 0.7082769871 ) 61 2\r
+       vert 237 ( 0.0161380004 0.674703002 ) 801 2\r
+       vert 238 ( 0.0481689982 0.6478599906 ) 828 2\r
+       vert 239 ( 0.0270489994 0.7911729813 ) 47 2\r
+       vert 240 ( 0.0620450005 0.942456007 ) 830 2\r
+       vert 241 ( 0.6179710031 0.5927380323 ) 47 2\r
+       vert 242 ( 0.9776629806 0.2034860253 ) 791 5\r
+       vert 243 ( 0.9466549754 0.1849660277 ) 796 5\r
+       vert 244 ( 0.9366390109 0.2703830004 ) 38 2\r
+       vert 245 ( 0.6658239961 0.5564789772 ) 38 2\r
+       vert 246 ( 0.6554399729 0.5084289908 ) 33 3\r
+       vert 247 ( 0.5747799873 0.7488210201 ) 135 1\r
+       vert 248 ( 0.6027539968 0.7422770262 ) 160 2\r
+       vert 249 ( 0.6170430183 0.7931050062 ) 928 2\r
+       vert 250 ( 0.5646809936 0.9009640217 ) 892 2\r
+       vert 251 ( 0.6111860275 0.8431279659 ) 930 2\r
+       vert 252 ( 0.6461409926 0.7729799747 ) 151 2\r
+       vert 253 ( 0.6089860201 0.7124739885 ) 156 2\r
+       vert 254 ( 0.6387400031 0.9051539898 ) 921 4\r
+       vert 255 ( 0.216564998 0.7628619671 ) 74 1\r
+       vert 256 ( 0.5731310248 0.9904959798 ) 126 3\r
+       vert 257 ( 0.5315089822 0.9500119686 ) 886 1\r
+       vert 258 ( 0.4229629934 0.9944400191 ) 105 1\r
+       vert 259 ( 0.6274639964 0.6811360121 ) 158 2\r
+       vert 260 ( 0.4683719873 0.5763419867 ) 158 2\r
+       vert 261 ( 0.4571210146 0.5950269699 ) 130 3\r
+       vert 262 ( 0.5894079804 0.6624879837 ) 130 3\r
+       vert 263 ( 0.4750989974 0.923658967 ) 880 1\r
+       vert 264 ( 0.3598459959 0.9482370019 ) 869 2\r
+       vert 265 ( 0.4910649955 0.6453230381 ) 118 3\r
+       vert 266 ( 0.4177440107 0.5978900194 ) 126 3\r
+       vert 267 ( 0.220660001 0.8181809783 ) 852 1\r
+       vert 268 ( 0.4234629869 0.6556029916 ) 111 3\r
+       vert 269 ( 0.352609992 0.6611759663 ) 883 1\r
+       vert 270 ( 0.3488979936 0.6011179686 ) 886 1\r
+       vert 271 ( 0.5621669888 0.939233005 ) 883 1\r
+       vert 272 ( 0.5293869972 0.9176909924 ) 887 2\r
+       vert 273 ( 0.5633839965 0.7838380337 ) 136 2\r
+       vert 274 ( 0.1028470024 0.7701100111 ) 846 1\r
+       vert 275 ( 0.1076949984 0.8272809982 ) 847 1\r
+       vert 276 ( 0.1552740037 0.8225290179 ) 853 1\r
+       vert 277 ( 0.3299930096 0.6695460081 ) 98 2\r
+       vert 278 ( 0.3602269888 0.9965459704 ) 98 2\r
+       vert 279 ( 0.0040460001 0.7464909554 ) 36 2\r
+       vert 280 ( 0.0390960015 0.9554070234 ) 820 2\r
+       vert 281 ( 0.0653230026 0.9697819948 ) 828 2\r
+       vert 282 ( 0.0236259997 0.6419839859 ) 820 2\r
+       vert 283 ( 0.1939560026 0.800639987 ) 75 1\r
+       vert 284 ( 0.6380659938 0.8520100117 ) 916 2\r
+       vert 285 ( 0.6465619802 0.9309120178 ) 902 4\r
+       vert 286 ( 0.5762540102 0.7065330148 ) 133 1\r
+       vert 287 ( 0.3161180019 0.974815011 ) 859 1\r
+       vert 288 ( 0.2858850062 0.6478140354 ) 859 1\r
+       vert 289 ( 0.3197619915 0.9033539891 ) 871 1\r
+       vert 290 ( 0.1184799969 0.6740809679 ) 845 1\r
+       vert 291 ( 0.1428450048 0.9657809734 ) 845 1\r
+       vert 292 ( 0.8408759832 0.6830760241 ) 1238 2\r
+       vert 293 ( 0.8901820183 0.7600290179 ) 1117 1\r
+       vert 294 ( 0.8206200004 0.6564400196 ) 1242 2\r
+       vert 295 ( 0.8459489942 0.7727829814 ) 1244 1\r
+       vert 296 ( 0.7961320281 0.6472159624 ) 1240 2\r
+       vert 297 ( 0.8983619809 0.8628740311 ) 434 1\r
+       vert 298 ( 0.8143669963 0.5759320259 ) 1235 1\r
+       vert 299 ( 0.7627589703 0.6211520433 ) 1112 2\r
+       vert 300 ( 0.779073 0.5567619801 ) 1104 2\r
+       vert 301 ( 0.8393570185 0.8992350101 ) 436 1\r
+       vert 302 ( 0.7980229855 0.788064003 ) 1245 1\r
+       vert 303 ( 0.8703290224 0.9544910192 ) 662 2\r
+       vert 304 ( 0.835457027 0.9562709928 ) 437 2\r
+       vert 305 ( 0.8181689978 0.937714994 ) 1121 1\r
+       vert 306 ( 0.9660210013 0.7194709778 ) 1114 1\r
+       vert 307 ( 0.9539650083 0.8656380177 ) 435 1\r
+       vert 308 ( 0.7467960119 0.541285038 ) 1106 2\r
+       vert 309 ( 0.7331050038 0.621508956 ) 1115 2\r
+       vert 310 ( 0.7109590173 0.5591279864 ) 1108 2\r
+       vert 311 ( 0.9777879715 0.959363997 ) 439 2\r
+       vert 312 ( 0.9401940107 0.968922019 ) 441 2\r
+       vert 313 ( 0.9942640066 0.7332969904 ) 433 1\r
+       vert 314 ( 0.6586520076 0.729196012 ) 433 1\r
+       vert 315 ( 0.7038180232 0.7743589878 ) 990 1\r
+       vert 316 ( 0.6476070285 0.7901499867 ) 1118 1\r
+       vert 317 ( 0.9832199812 0.7942509651 ) 1118 1\r
+       vert 318 ( 0.6696500182 0.8830670118 ) 435 1\r
+       vert 319 ( 0.7198809981 0.993309021 ) 443 2\r
+       vert 320 ( 0.6647819877 0.9921709895 ) 439 2\r
+       vert 321 ( 0.739601016 0.7770649791 ) 1119 1\r
+       vert 322 ( 0.7652369738 0.8088859916 ) 1120 1\r
+       vert 323 ( 0.7581189871 0.9959750175 ) 1123 2\r
+       vert 324 ( 0.9850739837 0.1069149971 ) 1395 1\r
+       vert 325 ( 0.9403719902 0.1295740008 ) 1399 1\r
+       vert 326 ( 0.9505029917 0.1768910289 ) 753 1\r
+       vert 327 ( 0.9950500131 0.1763929725 ) 1289 1\r
+       vert 328 ( 0.9075570107 0.0354380012 ) 769 1\r
+       vert 329 ( 0.9097959995 0.1049000025 ) 777 1\r
+       vert 330 ( 0.9432600141 0.1070929766 ) 1400 1\r
+       vert 331 ( 0.9840530157 0.0859479904 ) 1396 1\r
+       vert 332 ( 0.9125699997 0.1805279851 ) 740 1\r
+       vert 333 ( 0.6656240225 0.0728669763 ) 753 1\r
+       vert 334 ( 0.8040570021 0.9843299985 ) 445 2\r
+       vert 335 ( 0.7865899801 0.9478669763 ) 1122 1\r
+       vert 336 ( 0.9080340266 0.9559050202 ) 449 2\r
+       vert 337 ( 0.8686590195 0.9862880111 ) 447 2\r
+       vert 338 ( 0.3373509943 0.1445180178 ) 670 2\r
+       vert 339 ( 0.3347780108 0.0907649994 ) 453 2\r
+       vert 340 ( 0.327560991 0.1075019836 ) 451 2\r
+       vert 341 ( 0.3435400128 0.1323050261 ) 664 2\r
+       vert 342 ( 0.3465929925 0.0791910291 ) 458 2\r
+       vert 343 ( 0.3712880015 0.1355190277 ) 672 2\r
+       vert 344 ( 0.3593690097 0.0873770118 ) 455 3\r
+       vert 345 ( 0.3597230017 0.1277499795 ) 666 2\r
+       vert 346 ( 0.4457809925 0.0659499764 ) 672 2\r
+       vert 347 ( 0.4533370137 0.0418220162 ) 670 2\r
+       vert 348 ( 0.4853880107 0.0488749743 ) 451 2\r
+       vert 349 ( 0.4816879928 0.0832319856 ) 455 3\r
+       vert 350 ( 0.4245269895 0.0573260188 ) 676 2\r
+       vert 351 ( 0.4303619862 0.0334470272 ) 674 2\r
+       vert 352 ( 0.3526870012 0.1682530046 ) 678 2\r
+       vert 353 ( 0.348623991 0.1910809875 ) 674 2\r
+       vert 354 ( 0.3685989976 0.1636440158 ) 680 2\r
+       vert 355 ( 0.382562995 0.1823400259 ) 676 2\r
+       vert 356 ( 0.3985010087 0.0333930254 ) 682 2\r
+       vert 357 ( 0.3596839905 0.1896600127 ) 684 2\r
+       vert 358 ( 0.3702119887 0.2058439851 ) 682 2\r
+       vert 359 ( 0.3717960119 0.18700701 ) 686 2\r
+       vert 360 ( 0.3089720011 0.1347830296 ) 464 2\r
+       vert 361 ( 0.303245008 0.0918400288 ) 462 2\r
+       vert 362 ( 0.2927460074 0.0936490297 ) 460 2\r
+       vert 363 ( 0.3002550006 0.1380410194 ) 466 2\r
+       vert 364 ( 0.3222639859 0.1323840022 ) 470 2\r
+       vert 365 ( 0.3310190141 0.1299099922 ) 468 2\r
+       vert 366 ( 0.3172639906 0.0896959901 ) 472 2\r
+       vert 367 ( 0.4602299929 0.0382009745 ) 468 2\r
+       vert 368 ( 0.4652990103 0.0162109733 ) 466 2\r
+       vert 369 ( 0.4916099906 0.0249140263 ) 460 2\r
+       vert 370 ( 0.4315260053 0.0279629827 ) 476 2\r
+       vert 371 ( 0.4363319874 0.006716013 ) 474 2\r
+       vert 372 ( 0.3073540032 0.1744940281 ) 474 2\r
+       vert 373 ( 0.3161199987 0.1741930246 ) 478 2\r
+       vert 374 ( 0.3299629986 0.1716979742 ) 668 2\r
+       vert 375 ( 0.337199986 0.1560660005 ) 476 2\r
+       vert 376 ( 0.4057050049 0.0110350251 ) 504 2\r
+       vert 377 ( 0.3230539858 0.1907969713 ) 506 2\r
+       vert 378 ( 0.3302969933 0.1877800226 ) 508 2\r
+       vert 379 ( 0.3317849934 0.2105469704 ) 504 2\r
+       vert 380 ( 0.3863030076 0.1229060292 ) 514 2\r
+       vert 381 ( 0.383284986 0.1455370188 ) 512 2\r
+       vert 382 ( 0.3926460147 0.130226016 ) 510 2\r
+       vert 383 ( 0.3804560006 0.1284040213 ) 688 3\r
+       vert 384 ( 0.3766250014 0.1047739983 ) 691 2\r
+       vert 385 ( 0.3859379888 0.1626679897 ) 516 2\r
+       vert 386 ( 0.3886300027 0.0971239805 ) 518 1\r
+       vert 387 ( 0.407709986 0.1334480047 ) 519 2\r
+       vert 388 ( 0.4417879879 0.0739430189 ) 521 3\r
+       vert 389 ( 0.4393959939 0.0885879993 ) 519 2\r
+       vert 390 ( 0.427233994 0.0775799751 ) 516 2\r
+       vert 391 ( 0.3728730083 0.1242009997 ) 521 3\r
+       vert 392 ( 0.3601149917 0.0712159872 ) 480 2\r
+       vert 393 ( 0.3679949939 0.1086779833 ) 524 2\r
+       vert 394 ( 0.4090180099 0.1032549739 ) 528 2\r
+       vert 395 ( 0.4169389904 0.1050739884 ) 526 2\r
+       vert 396 ( 0.3994820118 0.0794129968 ) 530 2\r
+       vert 397 ( 0.3812460005 0.0424799919 ) 482 2\r
+       vert 398 ( 0.3389190137 0.0120249987 ) 445 2\r
+       vert 399 ( 0.3200539947 0.025052011 ) 447 2\r
+       vert 400 ( 0.3000009954 0.0298609734 ) 441 2\r
+       vert 401 ( 0.2879619896 0.0760909915 ) 484 3\r
+       vert 402 ( 0.2902429998 0.0590929985 ) 487 3\r
+       vert 403 ( 0.2706010044 0.0740609765 ) 218 2\r
+       vert 404 ( 0.273950994 0.087511003 ) 215 3\r
+       vert 405 ( 0.2582120001 0.0876759887 ) 220 3\r
+       vert 406 ( 0.256716013 0.072142005 ) 223 2\r
+       vert 407 ( 0.2830049992 0.0309460163 ) 439 2\r
+       vert 408 ( 0.351229012 -0.0008690357 ) 1123 2\r
+       vert 409 ( 0.3690010011 0.0031449795 ) 1125 3\r
+       vert 410 ( 0.2570660114 0.0305629969 ) 443 2\r
+       vert 411 ( 0.5449799895 0.1229529977 ) 1123 2\r
+       vert 412 ( 0.5312179923 0.1350970268 ) 1125 3\r
+       vert 413 ( 0.5371990204 0.0950000286 ) 490 2\r
+       vert 414 ( 0.5640779734 0.0809000134 ) 443 2\r
+       vert 415 ( 0.5405970216 0.0565090179 ) 229 3\r
+       vert 416 ( 0.5238739848 0.028726995 ) 227 2\r
+       vert 417 ( 0.5366640091 0.0342630148 ) 225 2\r
+       vert 418 ( 0.5216439962 0.0386400223 ) 492 4\r
+       vert 419 ( 0.5549640059 0.0246229768 ) 220 3\r
+       vert 420 ( 0.5408449769 0.0149279833 ) 232 2\r
+       vert 421 ( 0.2775950134 0.1015840173 ) 234 2\r
+       vert 422 ( 0.2625280023 0.1049659848 ) 232 2\r
+       vert 423 ( 0.291613996 0.1033419967 ) 227 2\r
+       vert 424 ( 0.2894070148 0.0893080235 ) 492 4\r
+       vert 425 ( 0.5155829787 0.0192989707 ) 238 2\r
+       vert 426 ( 0.5262960196 0.0097550154 ) 236 2\r
+       vert 427 ( 0.526786983 0.0039979815 ) 240 2\r
+       vert 428 ( 0.2690129876 0.1203039885 ) 240 2\r
+       vert 429 ( 0.282882005 0.1167050004 ) 242 2\r
+       vert 430 ( 0.2931900024 0.1148449779 ) 238 2\r
+       vert 431 ( 0.5072339773 0.0048000216 ) 244 2\r
+       vert 432 ( 0.2871229947 0.1299539804 ) 244 2\r
+       vert 433 ( 0.5637699962 0.0322920084 ) 223 2\r
+       vert 434 ( 0.4546880126 0.0763549805 ) 524 2\r
+       vert 435 ( 0.455471009 0.0957729816 ) 532 2\r
+       vert 436 ( 0.4164020121 0.1195030212 ) 532 2\r
+       vert 437 ( 0.4120169878 0.0711200237 ) 534 3\r
+       vert 438 ( 0.4609180093 0.1166200042 ) 534 3\r
+       vert 439 ( 0.4403850138 0.094950974 ) 526 2\r
+       vert 440 ( 0.3920710087 0.0341650248 ) 496 2\r
+       vert 441 ( 0.4966470003 0.125048995 ) 496 2\r
+       vert 442 ( 0.4959709942 0.0842580199 ) 498 4\r
+       vert 443 ( 0.5032070279 0.044878006 ) 502 2\r
+       vert 444 ( 0.5148689747 0.0256670117 ) 484 3\r
+       vert 445 ( 0.6944620013 0.214230001 ) 701 1\r
+       vert 446 ( 0.6946520209 0.2473229766 ) 700 1\r
+       vert 447 ( 0.6684259772 0.1738259792 ) 702 1\r
+       vert 448 ( 0.3892169893 0.2115769982 ) 660 2\r
+       vert 449 ( 0.6264640093 0.0478910208 ) 1261 4\r
+       vert 450 ( 0.6539670229 0.0441989899 ) 1289 1\r
+       vert 451 ( 0.7198489904 0.2486060262 ) 754 1\r
+       vert 452 ( 0.7547780275 0.2374569774 ) 755 1\r
+       vert 453 ( 0.6504539847 0.0100640059 ) 756 1\r
+       vert 454 ( 0.6260309815 0.0222219825 ) 751 1\r
+       vert 455 ( 0.6270130277 0.040103972 ) 755 1\r
+       vert 456 ( 0.6537860036 0.0274119973 ) 0 1\r
+       vert 457 ( 0.7295759916 0.2524539828 ) 757 1\r
+       vert 458 ( 0.6972550154 0.2525650263 ) 703 1\r
+       vert 459 ( 0.7659860253 0.2378540039 ) 758 1\r
+       vert 460 ( 0.9725189805 0.0084909797 ) 759 1\r
+       vert 461 ( 0.95559901 0.0141710043 ) 758 1\r
+       vert 462 ( 0.963958025 0.0304809809 ) 752 1\r
+       vert 463 ( 0.9821529984 0.0269889832 ) 1 1\r
+       vert 464 ( 0.6499459743 0.2994199991 ) 761 1\r
+       vert 465 ( 0.6556820273 0.3456320167 ) 760 1\r
+       vert 466 ( 0.7014049888 0.3363400102 ) 752 1\r
+       vert 467 ( 0.693911016 0.2944120169 ) 751 1\r
+       vert 468 ( 0.6077020168 0.2812240124 ) 704 1\r
+       vert 469 ( 0.6587949991 0.2668409944 ) 705 1\r
+       vert 470 ( 0.6287959814 0.3809159994 ) 707 1\r
+       vert 471 ( 0.6849489808 0.3723090291 ) 706 1\r
+       vert 472 ( 0.6045209765 0.3379330039 ) 708 1\r
+       vert 473 ( 0.9047420025 0.3801220059 ) 695 2\r
+       vert 474 ( 0.8658549786 0.3910109997 ) 1246 2\r
+       vert 475 ( 0.892663002 0.4162740111 ) 693 2\r
+       vert 476 ( 0.8819209933 0.4923700094 ) 1138 1\r
+       vert 477 ( 0.8432620168 0.4713640213 ) 1143 1\r
+       vert 478 ( 0.9402530193 0.356589973 ) 601 2\r
+       vert 479 ( 0.9089090228 0.3466039896 ) 1248 2\r
+       vert 480 ( 0.936702013 0.3991870284 ) 567 2\r
+       vert 481 ( 0.9622219801 0.4039859772 ) 569 2\r
+       vert 482 ( 0.9113950133 0.4784160256 ) 571 1\r
+       vert 483 ( 0.4935880005 0.3773649931 ) 376 2\r
+       vert 484 ( 0.4455760121 0.3779770136 ) 190 2\r
+       vert 485 ( 0.4725199938 0.407877028 ) 194 2\r
+       vert 486 ( 0.46083799 0.3574039936 ) 347 2\r
+       vert 487 ( 0.4226379991 0.3312609792 ) 349 2\r
+       vert 488 ( 0.5098860264 0.395851016 ) 378 2\r
+       vert 489 ( 0.4714680016 0.4320170283 ) 196 2\r
+       vert 490 ( 0.4320049882 0.2953100204 ) 351 3\r
+       vert 491 ( 0.4699369967 0.3354099989 ) 354 3\r
+       vert 492 ( 0.502448976 0.3553580046 ) 380 3\r
+       vert 493 ( 0.5594859719 0.3856170177 ) 383 2\r
+       vert 494 ( 0.5534120202 0.3623949885 ) 385 2\r
+       vert 495 ( 0.4762170017 0.272973001 ) 357 3\r
+       vert 496 ( 0.5603200197 0.2951329947 ) 387 3\r
+       vert 497 ( 0.5784839988 0.2735880017 ) 603 4\r
+       vert 498 ( 0.5618100166 0.2347249985 ) 607 3\r
+       vert 499 ( 0.5036510229 0.1811059713 ) 575 3\r
+       vert 500 ( 0.484780997 0.1441540122 ) 569 2\r
+       vert 501 ( 0.4721060097 0.2094669938 ) 572 3\r
+       vert 502 ( 0.4011240005 0.1726250052 ) 578 1\r
+       vert 503 ( 0.4260840118 0.1079699993 ) 571 1\r
+       vert 504 ( 0.4066579938 0.1979320049 ) 579 1\r
+       vert 505 ( 0.4309540093 0.3848189712 ) 192 2\r
+       vert 506 ( 0.3752120137 0.406431973 ) 934 5\r
+       vert 507 ( 0.4444699883 0.4874569774 ) 198 2\r
+       vert 508 ( 0.4021719992 0.3311830163 ) 1026 5\r
+       vert 509 ( 0.4467209876 0.2578369975 ) 580 4\r
+       vert 510 ( 0.3922060132 0.2356569767 ) 1144 3\r
+       vert 511 ( 0.378320992 0.2664020061 ) 1147 4\r
+       vert 512 ( 0.4111439884 0.3003469706 ) 360 4\r
+       vert 513 ( 0.486315012 0.4641780257 ) 200 2\r
+       vert 514 ( 0.5296769738 0.4387519956 ) 390 1\r
+       vert 515 ( 0.5646640062 0.4159449935 ) 391 2\r
+       vert 516 ( 0.5531259775 0.4516389966 ) 393 2\r
+       vert 517 ( 0.3446899951 0.3903080225 ) 943 5\r
+       vert 518 ( 0.3342550099 0.3271899819 ) 1031 2\r
+       vert 519 ( 0.2906930149 0.4331480265 ) 939 4\r
+       vert 520 ( 0.2780939937 0.36629498 ) 1033 5\r
+       vert 521 ( 0.350165993 0.4602569938 ) 948 3\r
+       vert 522 ( 0.2415779978 0.469456017 ) 955 2\r
+       vert 523 ( 0.6617609859 0.3855559826 ) 1147 4\r
+       vert 524 ( 0.6278759837 0.4150900245 ) 1144 3\r
+       vert 525 ( 0.7017890215 0.4796990156 ) 1013 2\r
+       vert 526 ( 0.6637650132 0.4906160235 ) 1015 1\r
+       vert 527 ( 0.6110360026 0.4584259987 ) 584 1\r
+       vert 528 ( 0.9401680231 0.4473029971 ) 578 1\r
+       vert 529 ( 0.9440479875 0.4652580023 ) 579 1\r
+       vert 530 ( 0.9164919853 0.587051034 ) 346 1\r
+       vert 531 ( 0.8897489905 0.5668550134 ) 1139 1\r
+       vert 532 ( 0.9509649873 0.589779973 ) 1016 1\r
+       vert 533 ( 0.9744719863 0.4522749782 ) 584 1\r
+       vert 534 ( 0.9928060174 0.472630024 ) 1015 1\r
+       vert 535 ( 0.8674150109 0.6261509657 ) 1130 2\r
+       vert 536 ( 0.7304599881 0.4685429931 ) 1017 1\r
+       vert 537 ( 0.7217270136 0.4029960036 ) 1038 4\r
+       vert 538 ( 0.3617520034 0.2754740119 ) 1038 4\r
+       vert 539 ( 0.7648109794 0.4058899879 ) 1151 2\r
+       vert 540 ( 0.3319259882 0.2511690259 ) 1151 2\r
+       vert 541 ( 0.992644012 0.6031559706 ) 1018 2\r
+       vert 542 ( 0.8997570276 0.6710929871 ) 1005 2\r
+       vert 543 ( 0.6808909774 0.5813779831 ) 1018 2\r
+       vert 544 ( 0.8233590126 0.5001620054 ) 1140 1\r
+       vert 545 ( 0.8196020126 0.4549049735 ) 1153 1\r
+       vert 546 ( 0.8037059903 0.3945549726 ) 1154 2\r
+       vert 547 ( 0.8531119823 0.3535869718 ) 1250 2\r
+       vert 548 ( 0.6112840176 0.1612300277 ) 709 2\r
+       vert 549 ( 0.5623360276 0.1429389715 ) 601 2\r
+       vert 550 ( 0.5552790165 0.192900002 ) 610 3\r
+       vert 551 ( 0.6336380243 0.106226027 ) 1290 2\r
+       vert 552 ( 0.5711550117 0.0786780119 ) 1248 2\r
+       vert 553 ( 0.6061859727 0.130810976 ) 711 2\r
+       vert 554 ( 0.1655959934 0.004290998 ) 1248 2\r
+       vert 555 ( 0.1456640065 0.0616189837 ) 1292 2\r
+       vert 556 ( 0.2381079942 0.059795022 ) 1250 2\r
+       vert 557 ( 0.0592989996 0.0097569823 ) 1290 2\r
+       vert 558 ( 0.6632720232 0.171431005 ) 714 1\r
+       vert 559 ( 0.6810920238 0.1442700028 ) 713 1\r
+       vert 560 ( 0.1714700013 0.0926010013 ) 1294 2\r
+       vert 561 ( 0.0638689995 0.0808969736 ) 1296 4\r
+       vert 562 ( 0.1298909932 0.1286990047 ) 1307 4\r
+       vert 563 ( 0.1359560043 0.1618999839 ) 1303 4\r
+       vert 564 ( 0.1932709962 0.1180869937 ) 1300 3\r
+       vert 565 ( 0.0523019992 0.1063830256 ) 1315 4\r
+       vert 566 ( 0.0725580007 0.1149970293 ) 1311 4\r
+       vert 567 ( 0.6630539894 0.2133560181 ) 715 1\r
+       vert 568 ( 0.6120910048 0.1978889704 ) 613 2\r
+       vert 569 ( 0.6431419849 0.2242379785 ) 615 3\r
+       vert 570 ( 0.5955960155 0.261187017 ) 618 3\r
+       vert 571 ( 0.0387790017 0.1839280128 ) 1319 5\r
+       vert 572 ( 0.0733010024 0.1601880193 ) 1324 5\r
+       vert 573 ( 0.0693050027 0.137567997 ) 1329 4\r
+       vert 574 ( 0.0396150015 0.1270449758 ) 1333 3\r
+       vert 575 ( 0.1337530017 0.1994839907 ) 1336 5\r
+       vert 576 ( 0.2137950063 0.1536509991 ) 1252 2\r
+       vert 577 ( 0.209691003 0.20184201 ) 1169 3\r
+       vert 578 ( 0.225722 0.1374539733 ) 1254 2\r
+       vert 579 ( 0.2373339981 0.160359025 ) 1256 2\r
+       vert 580 ( 0.189914003 0.2325739861 ) 1172 6\r
+       vert 581 ( 0.2663919926 0.134995997 ) 1258 3\r
+       vert 582 ( 0.8136450052 0.3329290152 ) 1258 3\r
+       vert 583 ( 0.3206700087 0.2083330154 ) 1154 2\r
+       vert 584 ( 0.3068070114 0.2415360212 ) 1156 2\r
+       vert 585 ( 0.1939010024 0.2994419932 ) 1178 3\r
+       vert 586 ( 0.2351350039 0.2487829924 ) 1158 3\r
+       vert 587 ( 0.2311999947 0.292764008 ) 1181 4\r
+       vert 588 ( 0.218197003 0.3390269876 ) 1051 3\r
+       vert 589 ( 0.7738569975 0.4659230113 ) 1141 1\r
+       vert 590 ( 0.2145709991 0.4182940125 ) 957 3\r
+       vert 591 ( 0.1918659955 0.3579739928 ) 1054 3\r
+       vert 592 ( 0.1817969978 0.4129549861 ) 1057 3\r
+       vert 593 ( 0.2277680039 0.4995999932 ) 960 2\r
+       vert 594 ( 0.3483670056 0.5014640093 ) 962 2\r
+       vert 595 ( 0.415775001 0.5519819856 ) 143 2\r
+       vert 596 ( 0.3023670018 0.5384190083 ) 908 2\r
+       vert 597 ( 0.3364549875 0.5936729908 ) 906 2\r
+       vert 598 ( 0.4975549877 0.5117490292 ) 145 2\r
+       vert 599 ( 0.1624359936 0.2635220289 ) 1185 5\r
+       vert 600 ( 0.1553609967 0.3155130148 ) 1060 3\r
+       vert 601 ( 0.1748200059 0.3456419706 ) 1063 3\r
+       vert 602 ( 0.2426660061 0.6310210228 ) 910 3\r
+       vert 603 ( 0.2358549982 0.5534809828 ) 913 3\r
+       vert 604 ( 0.8699700236 0.062681973 ) 771 1\r
+       vert 605 ( 0.8175349832 0.0708159804 ) 770 1\r
+       vert 606 ( 0.7510849833 0.099018991 ) 772 1\r
+       vert 607 ( 0.7195789814 0.1319010258 ) 716 1\r
+       vert 608 ( 0.8496410251 0.259962976 ) 714 1\r
+       vert 609 ( 0.8483690023 0.2963799834 ) 715 1\r
+       vert 610 ( 0.7789930105 0.3217620254 ) 621 1\r
+       vert 611 ( 0.7968490124 0.1361960173 ) 721 1\r
+       vert 612 ( 0.8296459913 0.1979560256 ) 719 2\r
+       vert 613 ( 0.7839310169 0.1836779714 ) 717 2\r
+       vert 614 ( 0.7437710166 0.2796570063 ) 722 1\r
+       vert 615 ( 0.718125999 0.1712639928 ) 723 1\r
+       vert 616 ( 0.7508630157 0.2160159945 ) 725 1\r
+       vert 617 ( 0.719013989 0.2146760225 ) 724 1\r
+       vert 618 ( 0.7891539931 0.2574819922 ) 726 1\r
+       vert 619 ( 0.3927290142 0.6674389839 ) 104 1\r
+       vert 620 ( 0.3591209948 0.7251099944 ) 103 1\r
+       vert 621 ( 0.3162479997 0.7084549665 ) 84 2\r
+       vert 622 ( 0.3360419869 0.7445850372 ) 86 2\r
+       vert 623 ( 0.4709730148 0.7174290419 ) 108 1\r
+       vert 624 ( 0.5518569946 0.6541960239 ) 121 1\r
+       vert 625 ( 0.5532469749 0.7149789929 ) 122 1\r
+       vert 626 ( 0.5285440087 0.7387089729 ) 110 1\r
+       vert 627 ( 0.3170320094 0.7504550219 ) 88 2\r
+       vert 628 ( 0.3135139942 0.7971960306 ) 82 2\r
+       vert 629 ( 0.258810997 0.7782310247 ) 76 1\r
+       vert 630 ( 0.2556129992 0.7467960119 ) 77 1\r
+       vert 631 ( 0.2687860131 0.684746027 ) 78 1\r
+       vert 632 ( 0.5329959989 0.7829660177 ) 115 1\r
+       vert 633 ( 0.4004510045 0.7816889882 ) 102 1\r
+       vert 634 ( 0.5319129825 0.8484209776 ) 881 2\r
+       vert 635 ( 0.3534800112 0.8119220138 ) 872 2\r
+       vert 636 ( 0.3721509874 0.8658800125 ) 874 2\r
+       vert 637 ( 0.3290500045 0.8738279939 ) 862 2\r
+       vert 638 ( 0.1949339956 0.7039160132 ) 71 1\r
+       vert 639 ( 0.1511140019 0.7662889957 ) 66 1\r
+       vert 640 ( 0.128057003 0.7114620209 ) 842 1\r
+       vert 641 ( 0.1920520067 0.7645189762 ) 68 1\r
+       vert 642 ( 0.2178730071 0.6518000364 ) 850 1\r
+       vert 643 ( 0.2710539997 0.8663890362 ) 854 1\r
+       vert 644 ( 0.2530179918 0.9317960143 ) 855 1\r
+       vert 645 ( 0.3133589923 0.9429730177 ) 856 1\r
+       vert 646 ( 0.2457190007 0.98517102 ) 850 1\r
+       vert 647 ( 0.5919589996 0.4690170288 ) 9 1\r
+       vert 648 ( 0.5787479877 0.5270869732 ) 7 2\r
+       vert 649 ( 0.554445982 0.5257560015 ) 4 3\r
+       vert 650 ( 0.6399019957 0.5217280388 ) 20 2\r
+       vert 651 ( 0.6098080277 0.5212370157 ) 12 4\r
+       vert 652 ( 0.6255040169 0.4680550098 ) 10 2\r
+       vert 653 ( 0.6059569716 0.4835230112 ) 16 3\r
+       vert 654 ( 0.9252679944 0.3106799722 ) 22 2\r
+       vert 655 ( 0.8890010118 0.3160259724 ) 16 3\r
+       vert 656 ( 0.8620030284 0.2712230086 ) 4 3\r
+       vert 657 ( 0.8997160196 0.339312017 ) 10 2\r
+       vert 658 ( 0.5853270292 0.6541830301 ) 783 5\r
+       vert 659 ( 0.6338729858 0.6179389954 ) 809 2\r
+       vert 660 ( 0.6633300185 0.6478710175 ) 778 5\r
+       vert 661 ( 0.6105780005 0.6199960113 ) 803 2\r
+       vert 662 ( 0.6069740057 0.6015210152 ) 805 2\r
+       vert 663 ( 0.8651260138 0.3174859881 ) 9 1\r
+       vert 664 ( 0.0805179998 0.8763459921 ) 813 1\r
+       vert 665 ( 0.0562979989 0.9080989957 ) 811 2\r
+       vert 666 ( 0.039241001 0.881411016 ) 803 2\r
+       vert 667 ( 0.0206809994 0.8567830324 ) 805 2\r
+       vert 668 ( 0.0693550035 0.7821719646 ) 55 2\r
+       vert 669 ( 0.0703490004 0.8341609836 ) 807 2\r
+       vert 670 ( 0.0415229984 0.7456760406 ) 814 2\r
+       vert 671 ( 0.6154680252 0.5810270309 ) 53 2\r
+       vert 672 ( 0.6318259835 0.5838260055 ) 24 2\r
+       vert 673 ( 0.641735971 0.6090250015 ) 788 3\r
+       vert 674 ( 0.0369510017 0.7082769871 ) 57 2\r
+       vert 675 ( 0.0161380004 0.674703002 ) 788 3\r
+       vert 676 ( 0.0481689982 0.6478599906 ) 816 2\r
+       vert 677 ( 0.0270489994 0.7911729813 ) 19 1\r
+       vert 678 ( 0.0620450005 0.942456007 ) 818 2\r
+       vert 679 ( 0.6179710031 0.5927380323 ) 19 1\r
+       vert 680 ( 0.9466549754 0.1849660277 ) 783 5\r
+       vert 681 ( 0.9776629806 0.2034860253 ) 778 5\r
+       vert 682 ( 0.9366390109 0.2703830004 ) 26 4\r
+       vert 683 ( 0.6658239961 0.5564789772 ) 26 4\r
+       vert 684 ( 0.6554399729 0.5084289908 ) 22 2\r
+       vert 685 ( 0.6027539968 0.7422770262 ) 138 2\r
+       vert 686 ( 0.5747799873 0.7488210201 ) 116 1\r
+       vert 687 ( 0.6170430183 0.7931050062 ) 894 2\r
+       vert 688 ( 0.6111860275 0.8431279659 ) 896 2\r
+       vert 689 ( 0.5646809936 0.9009640217 ) 890 2\r
+       vert 690 ( 0.6461409926 0.7729799747 ) 143 2\r
+       vert 691 ( 0.6089860201 0.7124739885 ) 147 2\r
+       vert 692 ( 0.6387400031 0.9051539898 ) 910 3\r
+       vert 693 ( 0.216564998 0.7628619671 ) 69 1\r
+       vert 694 ( 0.5315089822 0.9500119686 ) 884 1\r
+       vert 695 ( 0.5731310248 0.9904959798 ) 121 1\r
+       vert 696 ( 0.4229629934 0.9944400191 ) 104 1\r
+       vert 697 ( 0.6274639964 0.6811360121 ) 149 2\r
+       vert 698 ( 0.4683719873 0.5763419867 ) 149 2\r
+       vert 699 ( 0.4571210146 0.5950269699 ) 123 2\r
+       vert 700 ( 0.5894079804 0.6624879837 ) 123 2\r
+       vert 701 ( 0.4750989974 0.923658967 ) 879 1\r
+       vert 702 ( 0.3598459959 0.9482370019 ) 864 1\r
+       vert 703 ( 0.4177440107 0.5978900194 ) 121 1\r
+       vert 704 ( 0.220660001 0.8181809783 ) 848 1\r
+       vert 705 ( 0.3488979936 0.6011179686 ) 884 1\r
+       vert 706 ( 0.5293869972 0.9176909924 ) 885 1\r
+       vert 707 ( 0.5633839965 0.7838380337 ) 117 1\r
+       vert 708 ( 0.1028470024 0.7701100111 ) 840 1\r
+       vert 709 ( 0.1076949984 0.8272809982 ) 841 1\r
+       vert 710 ( 0.1552740037 0.8225290179 ) 849 1\r
+       vert 711 ( 0.3299930096 0.6695460081 ) 90 2\r
+       vert 712 ( 0.3602269888 0.9965459704 ) 90 2\r
+       vert 713 ( 0.0040460001 0.7464909554 ) 24 2\r
+       vert 714 ( 0.0390960015 0.9554070234 ) 809 2\r
+       vert 715 ( 0.0653230026 0.9697819948 ) 816 2\r
+       vert 716 ( 0.0236259997 0.6419839859 ) 809 2\r
+       vert 717 ( 0.1939560026 0.800639987 ) 70 1\r
+       vert 718 ( 0.6380659938 0.8520100117 ) 906 2\r
+       vert 719 ( 0.5762540102 0.7065330148 ) 125 1\r
+       vert 720 ( 0.3161180019 0.974815011 ) 857 1\r
+       vert 721 ( 0.2858850062 0.6478140354 ) 857 1\r
+       vert 722 ( 0.3197619915 0.9033539891 ) 865 2\r
+       vert 723 ( 0.1184799969 0.6740809679 ) 843 1\r
+       vert 724 ( 0.1428450048 0.9657809734 ) 843 1\r
+       vert 725 ( 0.8408759832 0.6830760241 ) 1132 2\r
+       vert 726 ( 0.8901820183 0.7600290179 ) 999 2\r
+       vert 727 ( 0.8459489942 0.7727829814 ) 1128 1\r
+       vert 728 ( 0.8206200004 0.6564400196 ) 1136 2\r
+       vert 729 ( 0.7961320281 0.6472159624 ) 1134 2\r
+       vert 730 ( 0.8983619809 0.8628740311 ) 342 1\r
+       vert 731 ( 0.8143669963 0.5759320259 ) 1142 1\r
+       vert 732 ( 0.7627589703 0.6211520433 ) 1007 2\r
+       vert 733 ( 0.779073 0.5567619801 ) 1020 2\r
+       vert 734 ( 0.8393570185 0.8992350101 ) 333 2\r
+       vert 735 ( 0.7980229855 0.788064003 ) 1129 1\r
+       vert 736 ( 0.8703290224 0.9544910192 ) 566 1\r
+       vert 737 ( 0.835457027 0.9562709928 ) 335 1\r
+       vert 738 ( 0.8181689978 0.937714994 ) 995 2\r
+       vert 739 ( 0.9660210013 0.7194709778 ) 1009 2\r
+       vert 740 ( 0.9539650083 0.8656380177 ) 343 1\r
+       vert 741 ( 0.7467960119 0.541285038 ) 1022 2\r
+       vert 742 ( 0.7331050038 0.621508956 ) 1011 2\r
+       vert 743 ( 0.7109590173 0.5591279864 ) 1024 2\r
+       vert 744 ( 0.9777879715 0.959363997 ) 336 1\r
+       vert 745 ( 0.9401940107 0.968922019 ) 337 1\r
+       vert 746 ( 0.9942640066 0.7332969904 ) 344 2\r
+       vert 747 ( 0.6586520076 0.729196012 ) 344 2\r
+       vert 748 ( 0.7038180232 0.7743589878 ) 932 2\r
+       vert 749 ( 0.6476070285 0.7901499867 ) 1001 1\r
+       vert 750 ( 0.9832199812 0.7942509651 ) 1001 1\r
+       vert 751 ( 0.6696500182 0.8830670118 ) 343 1\r
+       vert 752 ( 0.7198809981 0.993309021 ) 338 1\r
+       vert 753 ( 0.6647819877 0.9921709895 ) 336 1\r
+       vert 754 ( 0.739601016 0.7770649791 ) 1002 2\r
+       vert 755 ( 0.7652369738 0.8088859916 ) 1004 1\r
+       vert 756 ( 0.7581189871 0.9959750175 ) 991 1\r
+       vert 757 ( 0.9403719902 0.1295740008 ) 1397 1\r
+       vert 758 ( 0.9505029917 0.1768910289 ) 727 1\r
+       vert 759 ( 0.9097959995 0.1049000025 ) 773 1\r
+       vert 760 ( 0.9432600141 0.1070929766 ) 1398 1\r
+       vert 761 ( 0.9125699997 0.1805279851 ) 713 1\r
+       vert 762 ( 0.6656240225 0.0728669763 ) 727 1\r
+       vert 763 ( 0.8040570021 0.9843299985 ) 339 1\r
+       vert 764 ( 0.7865899801 0.9478669763 ) 997 2\r
+       vert 765 ( 0.9080340266 0.9559050202 ) 341 1\r
+       vert 766 ( 0.8686590195 0.9862880111 ) 340 1\r
+       vert 767 ( 0.3347780108 0.0907649994 ) 280 2\r
+       vert 768 ( 0.3373509943 0.1445180178 ) 537 2\r
+       vert 769 ( 0.327560991 0.1075019836 ) 278 2\r
+       vert 770 ( 0.3435400128 0.1323050261 ) 560 2\r
+       vert 771 ( 0.3712880015 0.1355190277 ) 539 2\r
+       vert 772 ( 0.3465929925 0.0791910291 ) 284 2\r
+       vert 773 ( 0.3593690097 0.0873770118 ) 282 2\r
+       vert 774 ( 0.3597230017 0.1277499795 ) 562 2\r
+       vert 775 ( 0.4533370137 0.0418220162 ) 537 2\r
+       vert 776 ( 0.4457809925 0.0659499764 ) 539 2\r
+       vert 777 ( 0.4853880107 0.0488749743 ) 278 2\r
+       vert 778 ( 0.4816879928 0.0832319856 ) 282 2\r
+       vert 779 ( 0.4303619862 0.0334470272 ) 543 2\r
+       vert 780 ( 0.4245269895 0.0573260188 ) 541 2\r
+       vert 781 ( 0.3526870012 0.1682530046 ) 545 2\r
+       vert 782 ( 0.348623991 0.1910809875 ) 543 2\r
+       vert 783 ( 0.3685989976 0.1636440158 ) 547 2\r
+       vert 784 ( 0.382562995 0.1823400259 ) 541 2\r
+       vert 785 ( 0.3985010087 0.0333930254 ) 549 2\r
+       vert 786 ( 0.3596839905 0.1896600127 ) 551 2\r
+       vert 787 ( 0.3702119887 0.2058439851 ) 549 2\r
+       vert 788 ( 0.3717960119 0.18700701 ) 553 2\r
+       vert 789 ( 0.303245008 0.0918400288 ) 291 2\r
+       vert 790 ( 0.3089720011 0.1347830296 ) 289 2\r
+       vert 791 ( 0.2927460074 0.0936490297 ) 286 3\r
+       vert 792 ( 0.3002550006 0.1380410194 ) 293 2\r
+       vert 793 ( 0.3310190141 0.1299099922 ) 297 2\r
+       vert 794 ( 0.3222639859 0.1323840022 ) 295 2\r
+       vert 795 ( 0.3172639906 0.0896959901 ) 299 2\r
+       vert 796 ( 0.4652990103 0.0162109733 ) 293 2\r
+       vert 797 ( 0.4602299929 0.0382009745 ) 297 2\r
+       vert 798 ( 0.4916099906 0.0249140263 ) 286 3\r
+       vert 799 ( 0.4363319874 0.006716013 ) 303 2\r
+       vert 800 ( 0.4315260053 0.0279629827 ) 301 2\r
+       vert 801 ( 0.3073540032 0.1744940281 ) 303 2\r
+       vert 802 ( 0.3161199987 0.1741930246 ) 305 2\r
+       vert 803 ( 0.3299629986 0.1716979742 ) 564 2\r
+       vert 804 ( 0.337199986 0.1560660005 ) 301 2\r
+       vert 805 ( 0.4057050049 0.0110350251 ) 246 2\r
+       vert 806 ( 0.3230539858 0.1907969713 ) 248 2\r
+       vert 807 ( 0.3302969933 0.1877800226 ) 250 2\r
+       vert 808 ( 0.3317849934 0.2105469704 ) 246 2\r
+       vert 809 ( 0.383284986 0.1455370188 ) 257 2\r
+       vert 810 ( 0.3863030076 0.1229060292 ) 254 3\r
+       vert 811 ( 0.3926460147 0.130226016 ) 252 2\r
+       vert 812 ( 0.3804560006 0.1284040213 ) 555 3\r
+       vert 813 ( 0.3766250014 0.1047739983 ) 558 2\r
+       vert 814 ( 0.3859379888 0.1626679897 ) 259 2\r
+       vert 815 ( 0.3886300027 0.0971239805 ) 261 2\r
+       vert 816 ( 0.407709986 0.1334480047 ) 263 1\r
+       vert 817 ( 0.4393959939 0.0885879993 ) 263 1\r
+       vert 818 ( 0.4417879879 0.0739430189 ) 264 3\r
+       vert 819 ( 0.427233994 0.0775799751 ) 259 2\r
+       vert 820 ( 0.3728730083 0.1242009997 ) 264 3\r
+       vert 821 ( 0.3601149917 0.0712159872 ) 307 2\r
+       vert 822 ( 0.3679949939 0.1086779833 ) 267 2\r
+       vert 823 ( 0.4090180099 0.1032549739 ) 271 2\r
+       vert 824 ( 0.4169389904 0.1050739884 ) 269 2\r
+       vert 825 ( 0.3994820118 0.0794129968 ) 273 2\r
+       vert 826 ( 0.3812460005 0.0424799919 ) 309 2\r
+       vert 827 ( 0.3389190137 0.0120249987 ) 339 1\r
+       vert 828 ( 0.3200539947 0.025052011 ) 340 1\r
+       vert 829 ( 0.3000009954 0.0298609734 ) 337 1\r
+       vert 830 ( 0.2879619896 0.0760909915 ) 311 4\r
+       vert 831 ( 0.2902429998 0.0590929985 ) 315 3\r
+       vert 832 ( 0.2706010044 0.0740609765 ) 163 2\r
+       vert 833 ( 0.273950994 0.087511003 ) 162 1\r
+       vert 834 ( 0.2582120001 0.0876759887 ) 165 1\r
+       vert 835 ( 0.256716013 0.072142005 ) 166 2\r
+       vert 836 ( 0.2830049992 0.0309460163 ) 336 1\r
+       vert 837 ( 0.351229012 -0.0008690357 ) 991 1\r
+       vert 838 ( 0.3690010011 0.0031449795 ) 992 3\r
+       vert 839 ( 0.2570660114 0.0305629969 ) 338 1\r
+       vert 840 ( 0.5312179923 0.1350970268 ) 992 3\r
+       vert 841 ( 0.5449799895 0.1229529977 ) 991 1\r
+       vert 842 ( 0.5371990204 0.0950000286 ) 318 2\r
+       vert 843 ( 0.5640779734 0.0809000134 ) 338 1\r
+       vert 844 ( 0.5238739848 0.028726995 ) 174 2\r
+       vert 845 ( 0.5405970216 0.0565090179 ) 171 3\r
+       vert 846 ( 0.5366640091 0.0342630148 ) 168 3\r
+       vert 847 ( 0.5216439962 0.0386400223 ) 320 3\r
+       vert 848 ( 0.5549640059 0.0246229768 ) 165 1\r
+       vert 849 ( 0.5408449769 0.0149279833 ) 176 2\r
+       vert 850 ( 0.2775950134 0.1015840173 ) 178 2\r
+       vert 851 ( 0.2625280023 0.1049659848 ) 176 2\r
+       vert 852 ( 0.291613996 0.1033419967 ) 174 2\r
+       vert 853 ( 0.2894070148 0.0893080235 ) 320 3\r
+       vert 854 ( 0.5155829787 0.0192989707 ) 182 2\r
+       vert 855 ( 0.5262960196 0.0097550154 ) 180 2\r
+       vert 856 ( 0.526786983 0.0039979815 ) 184 2\r
+       vert 857 ( 0.2690129876 0.1203039885 ) 184 2\r
+       vert 858 ( 0.282882005 0.1167050004 ) 186 2\r
+       vert 859 ( 0.2931900024 0.1148449779 ) 182 2\r
+       vert 860 ( 0.5072339773 0.0048000216 ) 188 2\r
+       vert 861 ( 0.2871229947 0.1299539804 ) 188 2\r
+       vert 862 ( 0.5637699962 0.0322920084 ) 166 2\r
+       vert 863 ( 0.4546880126 0.0763549805 ) 267 2\r
+       vert 864 ( 0.455471009 0.0957729816 ) 275 1\r
+       vert 865 ( 0.4164020121 0.1195030212 ) 275 1\r
+       vert 866 ( 0.4120169878 0.0711200237 ) 276 2\r
+       vert 867 ( 0.4609180093 0.1166200042 ) 276 2\r
+       vert 868 ( 0.4403850138 0.094950974 ) 269 2\r
+       vert 869 ( 0.3920710087 0.0341650248 ) 323 2\r
+       vert 870 ( 0.4966470003 0.125048995 ) 323 2\r
+       vert 871 ( 0.4959709942 0.0842580199 ) 325 4\r
+       vert 872 ( 0.5032070279 0.044878006 ) 329 4\r
+       vert 873 ( 0.5148689747 0.0256670117 ) 311 4\r
+       vert 874 ( 0.3892169893 0.2115769982 ) 584 1\r
+       vert 875 ( 0.7198489904 0.2486060262 ) 728 1\r
+       vert 876 ( 0.7547780275 0.2374569774 ) 729 1\r
+       vert 877 ( 0.6260309815 0.0222219825 ) 725 1\r
+       vert 878 ( 0.6504539847 0.0100640059 ) 730 1\r
+       vert 879 ( 0.6270130277 0.040103972 ) 729 1\r
+       vert 880 ( 0.6537860036 0.0274119973 ) 2 1\r
+       vert 881 ( 0.7295759916 0.2524539828 ) 731 1\r
+       vert 882 ( 0.7659860253 0.2378540039 ) 732 1\r
+       vert 883 ( 0.95559901 0.0141710043 ) 732 1\r
+       vert 884 ( 0.9725189805 0.0084909797 ) 733 1\r
+       vert 885 ( 0.963958025 0.0304809809 ) 726 1\r
+       vert 886 ( 0.9821529984 0.0269889832 ) 3 1\r
+       vert 887 ( 0.6556820273 0.3456320167 ) 735 1\r
+       vert 888 ( 0.6499459743 0.2994199991 ) 734 1\r
+       vert 889 ( 0.7014049888 0.3363400102 ) 726 1\r
+       vert 890 ( 0.693911016 0.2944120169 ) 725 1\r
+\r
+       numtris 1346\r
+       tri 0 2 1 0\r
+       tri 1 3 2 0\r
+       tri 2 3 0 4\r
+       tri 3 7 6 5\r
+       tri 4 7 5 1\r
+       tri 5 8 6 7\r
+       tri 6 7 1 2\r
+       tri 7 3 7 2\r
+       tri 8 9 7 3\r
+       tri 9 9 8 7\r
+       tri 10 12 11 10\r
+       tri 11 10 11 13\r
+       tri 12 10 13 14\r
+       tri 13 16 15 12\r
+       tri 14 12 15 11\r
+       tri 15 13 17 14\r
+       tri 16 13 18 17\r
+       tri 17 19 18 13\r
+       tri 18 11 19 13\r
+       tri 19 15 20 11\r
+       tri 20 11 20 21\r
+       tri 21 19 22 18\r
+       tri 22 19 23 22\r
+       tri 23 22 23 24\r
+       tri 24 22 24 25\r
+       tri 25 28 27 26\r
+       tri 26 25 27 28\r
+       tri 27 22 25 28\r
+       tri 28 28 26 29\r
+       tri 29 29 26 30\r
+       tri 30 31 28 29\r
+       tri 31 22 28 31\r
+       tri 32 12 10 32\r
+       tri 33 16 12 32\r
+       tri 34 34 16 33\r
+       tri 35 16 32 33\r
+       tri 36 10 14 32\r
+       tri 37 33 32 14\r
+       tri 38 33 14 35\r
+       tri 39 17 22 36\r
+       tri 40 18 22 17\r
+       tri 41 17 36 37\r
+       tri 42 17 37 38\r
+       tri 43 17 38 39\r
+       tri 44 14 17 39\r
+       tri 45 35 14 39\r
+       tri 46 35 39 38\r
+       tri 47 41 40 21\r
+       tri 48 21 40 23\r
+       tri 49 19 21 23\r
+       tri 50 41 21 42\r
+       tri 51 20 42 21\r
+       tri 52 34 43 16\r
+       tri 53 43 44 16\r
+       tri 54 15 45 20\r
+       tri 55 15 44 45\r
+       tri 56 44 46 45\r
+       tri 57 47 42 20\r
+       tri 58 47 45 46\r
+       tri 59 43 46 44\r
+       tri 60 48 47 46\r
+       tri 61 48 46 43\r
+       tri 62 47 20 45\r
+       tri 63 51 50 49\r
+       tri 64 51 49 52\r
+       tri 65 50 33 49\r
+       tri 66 33 35 49\r
+       tri 67 53 50 51\r
+       tri 68 53 51 54\r
+       tri 69 34 33 53\r
+       tri 70 53 33 50\r
+       tri 71 57 56 55\r
+       tri 72 57 55 58\r
+       tri 73 58 55 59\r
+       tri 74 61 60 9\r
+       tri 75 62 61 9\r
+       tri 76 62 9 63\r
+       tri 77 64 61 62\r
+       tri 78 64 65 61\r
+       tri 79 64 66 65\r
+       tri 80 63 9 3\r
+       tri 81 62 63 67\r
+       tri 82 57 69 68\r
+       tri 83 35 38 70\r
+       tri 84 35 70 49\r
+       tri 85 57 68 56\r
+       tri 86 69 71 68\r
+       tri 87 49 70 72\r
+       tri 88 73 66 64\r
+       tri 89 64 62 74\r
+       tri 90 73 64 74\r
+       tri 91 74 62 67\r
+       tri 92 57 58 75\r
+       tri 93 63 3 4\r
+       tri 94 63 4 76\r
+       tri 95 77 76 4\r
+       tri 96 78 77 4\r
+       tri 97 4 0 79\r
+       tri 98 79 0 5\r
+       tri 99 1 5 0\r
+       tri 100 82 81 80\r
+       tri 101 82 80 26\r
+       tri 102 83 82 25\r
+       tri 103 86 85 84\r
+       tri 104 80 86 84\r
+       tri 105 89 88 87\r
+       tri 106 87 88 90\r
+       tri 107 81 92 91\r
+       tri 108 89 87 93\r
+       tri 109 87 90 94\r
+       tri 110 97 96 95\r
+       tri 111 99 94 98\r
+       tri 112 81 91 86\r
+       tri 113 86 91 85\r
+       tri 114 94 100 98\r
+       tri 115 90 100 94\r
+       tri 116 102 101 81\r
+       tri 117 81 101 92\r
+       tri 118 103 101 102\r
+       tri 119 105 104 103\r
+       tri 120 103 104 101\r
+       tri 121 83 106 102\r
+       tri 122 106 103 102\r
+       tri 123 106 105 103\r
+       tri 124 83 25 107\r
+       tri 125 108 83 107\r
+       tri 126 40 108 24\r
+       tri 127 40 24 23\r
+       tri 128 108 107 24\r
+       tri 129 24 107 25\r
+       tri 130 111 110 109\r
+       tri 131 112 109 110\r
+       tri 132 113 109 112\r
+       tri 133 113 114 109\r
+       tri 134 114 95 96\r
+       tri 135 99 96 94\r
+       tri 136 93 94 96\r
+       tri 137 115 114 96\r
+       tri 138 115 96 99\r
+       tri 139 115 99 116\r
+       tri 140 116 99 98\r
+       tri 141 114 116 111\r
+       tri 142 115 116 114\r
+       tri 143 116 100 111\r
+       tri 144 116 98 100\r
+       tri 145 117 97 95\r
+       tri 146 117 95 114\r
+       tri 147 87 94 93\r
+       tri 148 80 81 86\r
+       tri 149 119 118 97\r
+       tri 150 118 120 97\r
+       tri 151 121 120 118\r
+       tri 152 97 93 96\r
+       tri 153 89 93 97\r
+       tri 154 123 117 122\r
+       tri 155 124 119 117\r
+       tri 156 119 97 117\r
+       tri 157 125 97 120\r
+       tri 158 125 120 121\r
+       tri 159 4 79 126\r
+       tri 160 125 89 97\r
+       tri 161 78 4 126\r
+       tri 162 127 125 121\r
+       tri 163 128 127 121\r
+       tri 164 119 121 118\r
+       tri 165 129 124 117\r
+       tri 166 129 119 124\r
+       tri 167 129 130 119\r
+       tri 168 131 130 129\r
+       tri 169 130 121 119\r
+       tri 170 128 121 130\r
+       tri 171 131 128 130\r
+       tri 172 71 77 78\r
+       tri 173 72 127 128\r
+       tri 174 49 72 128\r
+       tri 175 132 131 129\r
+       tri 176 52 131 132\r
+       tri 177 69 133 71\r
+       tri 178 133 77 71\r
+       tri 179 133 76 77\r
+       tri 180 54 51 134\r
+       tri 181 51 52 134\r
+       tri 182 134 52 132\r
+       tri 183 134 132 135\r
+       tri 184 54 134 136\r
+       tri 185 54 136 137\r
+       tri 186 134 135 136\r
+       tri 187 135 132 129\r
+       tri 188 138 53 137\r
+       tri 189 53 54 137\r
+       tri 190 141 140 139\r
+       tri 191 140 138 139\r
+       tri 192 48 43 142\r
+       tri 193 142 43 34\r
+       tri 194 143 48 142\r
+       tri 195 145 144 123\r
+       tri 196 129 117 144\r
+       tri 197 144 117 123\r
+       tri 198 146 144 145\r
+       tri 199 147 146 145\r
+       tri 200 114 111 109\r
+       tri 201 135 129 148\r
+       tri 202 148 129 144\r
+       tri 203 148 144 146\r
+       tri 204 136 135 148\r
+       tri 205 150 149 148\r
+       tri 206 136 148 149\r
+       tri 207 139 138 137\r
+       tri 208 151 136 149\r
+       tri 209 137 136 151\r
+       tri 210 152 141 139\r
+       tri 211 11 21 19\r
+       tri 212 147 148 146\r
+       tri 213 150 148 147\r
+       tri 214 155 154 153\r
+       tri 215 156 155 153\r
+       tri 216 152 139 155\r
+       tri 217 154 137 151\r
+       tri 218 155 137 154\r
+       tri 219 152 155 156\r
+       tri 220 152 156 157\r
+       tri 221 16 44 15\r
+       tri 222 83 102 82\r
+       tri 223 82 102 81\r
+       tri 224 160 159 158\r
+       tri 225 158 159 161\r
+       tri 226 163 162 160\r
+       tri 227 164 162 163\r
+       tri 228 162 159 160\r
+       tri 229 166 164 165\r
+       tri 230 169 168 167\r
+       tri 231 169 167 170\r
+       tri 232 173 172 171\r
+       tri 233 174 169 170\r
+       tri 234 174 175 169\r
+       tri 235 174 176 175\r
+       tri 236 165 164 163\r
+       tri 237 172 163 160\r
+       tri 238 177 166 165\r
+       tri 239 165 163 172\r
+       tri 240 173 165 172\r
+       tri 241 177 165 173\r
+       tri 242 179 177 178\r
+       tri 243 178 177 173\r
+       tri 244 52 128 131\r
+       tri 245 52 49 128\r
+       tri 246 25 82 27\r
+       tri 247 82 26 27\r
+       tri 248 180 173 171\r
+       tri 249 180 178 173\r
+       tri 250 171 160 158\r
+       tri 251 171 172 160\r
+       tri 252 168 171 158\r
+       tri 253 117 114 113\r
+       tri 254 122 117 113\r
+       tri 255 183 182 181\r
+       tri 256 183 181 184\r
+       tri 257 181 182 185\r
+       tri 258 182 186 185\r
+       tri 259 185 188 187\r
+       tri 260 185 186 188\r
+       tri 261 183 184 189\r
+       tri 262 191 189 190\r
+       tri 263 192 183 189\r
+       tri 264 192 193 183\r
+       tri 265 195 187 194\r
+       tri 266 197 195 196\r
+       tri 267 197 196 198\r
+       tri 268 184 181 195\r
+       tri 269 184 195 197\r
+       tri 270 189 184 197\r
+       tri 271 181 185 195\r
+       tri 272 195 185 187\r
+       tri 273 190 197 199\r
+       tri 274 190 189 197\r
+       tri 275 202 201 200\r
+       tri 276 200 201 203\r
+       tri 277 201 204 193\r
+       tri 278 205 190 199\r
+       tri 279 208 207 206\r
+       tri 280 211 210 209\r
+       tri 281 214 213 212\r
+       tri 282 215 214 212\r
+       tri 283 218 217 216\r
+       tri 284 217 219 216\r
+       tri 285 210 212 209\r
+       tri 286 222 221 220\r
+       tri 287 221 223 220\r
+       tri 288 221 224 223\r
+       tri 289 211 209 224\r
+       tri 290 215 212 210\r
+       tri 291 218 216 225\r
+       tri 292 228 227 226\r
+       tri 293 229 227 228\r
+       tri 294 232 231 230\r
+       tri 295 209 233 224\r
+       tri 296 213 234 233\r
+       tri 297 213 235 234\r
+       tri 298 237 202 236\r
+       tri 299 237 238 202\r
+       tri 300 239 232 230\r
+       tri 301 239 230 229\r
+       tri 302 229 230 227\r
+       tri 303 202 204 201\r
+       tri 304 240 226 205\r
+       tri 305 226 227 205\r
+       tri 306 241 224 233\r
+       tri 307 234 241 233\r
+       tri 308 222 220 235\r
+       tri 309 218 243 242\r
+       tri 310 218 242 244\r
+       tri 311 218 244 217\r
+       tri 312 246 245 213\r
+       tri 313 245 235 213\r
+       tri 314 222 235 245\r
+       tri 315 211 224 221\r
+       tri 316 199 197 198\r
+       tri 317 188 248 247\r
+       tri 318 247 248 249\r
+       tri 319 196 251 250\r
+       tri 320 253 252 248\r
+       tri 321 248 252 249\r
+       tri 322 251 249 252\r
+       tri 323 250 251 254\r
+       tri 324 201 193 192\r
+       tri 325 201 192 255\r
+       tri 326 203 201 255\r
+       tri 327 258 257 256\r
+       tri 328 253 259 252\r
+       tri 329 261 143 260\r
+       tri 330 187 188 247\r
+       tri 331 262 259 253\r
+       tri 332 264 263 258\r
+       tri 333 258 263 257\r
+       tri 334 198 196 263\r
+       tri 335 265 143 261\r
+       tri 336 266 265 261\r
+       tri 337 196 249 251\r
+       tri 338 267 190 205\r
+       tri 339 195 194 196\r
+       tri 340 187 247 194\r
+       tri 341 270 269 268\r
+       tri 342 272 250 271\r
+       tri 343 257 272 271\r
+       tri 344 263 272 257\r
+       tri 345 263 196 272\r
+       tri 346 272 196 250\r
+       tri 347 194 247 273\r
+       tri 348 273 247 249\r
+       tri 349 196 273 249\r
+       tri 350 196 194 273\r
+       tri 351 268 265 266\r
+       tri 352 270 268 266\r
+       tri 353 264 198 263\r
+       tri 354 192 189 191\r
+       tri 355 213 233 212\r
+       tri 356 209 212 233\r
+       tri 357 236 202 232\r
+       tri 358 274 202 200\r
+       tri 359 232 202 274\r
+       tri 360 232 274 231\r
+       tri 361 231 274 275\r
+       tri 362 231 275 230\r
+       tri 363 230 275 227\r
+       tri 364 275 200 276\r
+       tri 365 274 200 275\r
+       tri 366 227 275 276\r
+       tri 367 227 276 205\r
+       tri 368 276 267 205\r
+       tri 369 183 277 182\r
+       tri 370 193 277 183\r
+       tri 371 278 264 258\r
+       tri 372 246 213 214\r
+       tri 373 237 236 279\r
+       tri 374 279 232 239\r
+       tri 375 279 236 232\r
+       tri 376 280 228 226\r
+       tri 377 280 226 240\r
+       tri 378 280 240 281\r
+       tri 379 237 282 238\r
+       tri 380 276 283 267\r
+       tri 381 200 283 276\r
+       tri 382 200 203 283\r
+       tri 383 203 255 283\r
+       tri 384 283 255 267\r
+       tri 385 260 143 142\r
+       tri 386 260 142 140\r
+       tri 387 251 252 284\r
+       tri 388 251 284 254\r
+       tri 389 271 250 254\r
+       tri 390 271 254 285\r
+       tri 391 188 286 248\r
+       tri 392 186 286 188\r
+       tri 393 186 262 286\r
+       tri 394 286 262 253\r
+       tri 395 286 253 248\r
+       tri 396 138 34 53\r
+       tri 397 140 142 34\r
+       tri 398 140 34 138\r
+       tri 399 139 137 155\r
+       tri 400 208 206 287\r
+       tri 401 287 206 264\r
+       tri 402 287 264 278\r
+       tri 403 193 288 277\r
+       tri 404 204 288 193\r
+       tri 405 199 198 264\r
+       tri 406 207 205 289\r
+       tri 407 205 199 289\r
+       tri 408 289 199 264\r
+       tri 409 206 289 264\r
+       tri 410 207 289 206\r
+       tri 411 290 204 202\r
+       tri 412 238 290 202\r
+       tri 413 291 207 208\r
+       tri 414 240 205 207\r
+       tri 415 281 240 291\r
+       tri 416 240 207 291\r
+       tri 417 255 192 191\r
+       tri 418 267 255 191\r
+       tri 419 267 191 190\r
+       tri 420 293 67 292\r
+       tri 421 296 295 294\r
+       tri 422 293 292 295\r
+       tri 423 295 292 294\r
+       tri 424 297 293 295\r
+       tri 425 296 294 298\r
+       tri 426 67 294 292\r
+       tri 427 67 63 298\r
+       tri 428 298 63 76\r
+       tri 429 299 296 298\r
+       tri 430 67 298 294\r
+       tri 431 298 76 133\r
+       tri 432 69 300 133\r
+       tri 433 300 298 133\r
+       tri 434 297 295 301\r
+       tri 435 301 295 302\r
+       tri 436 296 302 295\r
+       tri 437 297 301 303\r
+       tri 438 304 303 301\r
+       tri 439 305 304 301\r
+       tri 440 307 306 293\r
+       tri 441 306 74 293\r
+       tri 442 74 67 293\r
+       tri 443 299 302 296\r
+       tri 444 299 298 300\r
+       tri 445 299 300 308\r
+       tri 446 309 299 308\r
+       tri 447 310 57 75\r
+       tri 448 310 308 57\r
+       tri 449 57 308 69\r
+       tri 450 308 300 69\r
+       tri 451 309 308 310\r
+       tri 452 311 307 297\r
+       tri 453 311 297 312\r
+       tri 454 73 74 306\r
+       tri 455 313 73 306\r
+       tri 456 314 310 75\r
+       tri 457 315 310 314\r
+       tri 458 315 314 316\r
+       tri 459 317 306 307\r
+       tri 460 317 313 306\r
+       tri 461 307 293 297\r
+       tri 462 315 316 318\r
+       tri 463 315 318 319\r
+       tri 464 319 318 320\r
+       tri 465 315 321 309\r
+       tri 466 315 309 310\r
+       tri 467 321 299 309\r
+       tri 468 322 302 299\r
+       tri 469 321 322 299\r
+       tri 470 319 323 321\r
+       tri 471 305 301 302\r
+       tri 472 322 305 302\r
+       tri 473 315 319 321\r
+       tri 474 321 323 322\r
+       tri 475 326 325 324\r
+       tri 476 326 324 327\r
+       tri 477 329 158 328\r
+       tri 478 331 330 328\r
+       tri 479 330 329 328\r
+       tri 480 158 161 328\r
+       tri 481 324 325 331\r
+       tri 482 325 330 331\r
+       tri 483 325 329 330\r
+       tri 484 332 325 326\r
+       tri 485 332 329 325\r
+       tri 486 168 329 332\r
+       tri 487 168 158 329\r
+       tri 488 85 91 333\r
+       tri 489 334 304 305\r
+       tri 490 335 334 305\r
+       tri 491 337 336 303\r
+       tri 492 312 336 337\r
+       tri 493 337 303 304\r
+       tri 494 334 337 304\r
+       tri 495 323 334 335\r
+       tri 496 340 339 338\r
+       tri 497 339 341 338\r
+       tri 498 344 343 342\r
+       tri 499 342 343 345\r
+       tri 500 339 342 345\r
+       tri 501 339 345 341\r
+       tri 502 348 347 346\r
+       tri 503 348 346 349\r
+       tri 504 347 351 350\r
+       tri 505 347 350 346\r
+       tri 506 338 341 352\r
+       tri 507 338 352 353\r
+       tri 508 341 345 354\r
+       tri 509 341 354 352\r
+       tri 510 343 355 354\r
+       tri 511 343 354 345\r
+       tri 512 356 350 351\r
+       tri 513 358 353 357\r
+       tri 514 353 352 357\r
+       tri 515 357 352 354\r
+       tri 516 357 354 359\r
+       tri 517 358 359 355\r
+       tri 518 355 359 354\r
+       tri 519 358 357 359\r
+       tri 520 362 361 360\r
+       tri 521 362 360 363\r
+       tri 522 340 365 364\r
+       tri 523 340 364 366\r
+       tri 524 361 366 364\r
+       tri 525 361 364 360\r
+       tri 526 369 368 367\r
+       tri 527 369 367 348\r
+       tri 528 368 371 370\r
+       tri 529 368 370 367\r
+       tri 530 363 360 372\r
+       tri 531 372 360 373\r
+       tri 532 360 364 374\r
+       tri 533 360 374 373\r
+       tri 534 365 375 364\r
+       tri 535 375 374 364\r
+       tri 536 371 376 370\r
+       tri 537 377 373 374\r
+       tri 538 377 374 378\r
+       tri 539 379 377 378\r
+       tri 540 382 381 380\r
+       tri 541 381 383 380\r
+       tri 542 380 383 384\r
+       tri 543 385 381 382\r
+       tri 544 382 380 386\r
+       tri 545 385 382 387\r
+       tri 546 390 389 388\r
+       tri 547 385 391 381\r
+       tri 548 387 382 386\r
+       tri 549 393 392 384\r
+       tri 550 344 392 393\r
+       tri 551 393 383 391\r
+       tri 552 393 384 383\r
+       tri 553 381 391 383\r
+       tri 554 344 342 392\r
+       tri 555 340 366 339\r
+       tri 556 395 387 394\r
+       tri 557 397 396 386\r
+       tri 558 397 384 392\r
+       tri 559 397 386 384\r
+       tri 560 386 380 384\r
+       tri 561 397 392 398\r
+       tri 562 342 399 392\r
+       tri 563 398 392 399\r
+       tri 564 339 399 342\r
+       tri 565 361 400 366\r
+       tri 566 401 361 362\r
+       tri 567 401 402 361\r
+       tri 568 404 403 401\r
+       tri 569 403 402 401\r
+       tri 570 405 403 404\r
+       tri 571 405 406 403\r
+       tri 572 402 400 361\r
+       tri 573 402 407 400\r
+       tri 574 403 407 402\r
+       tri 575 406 407 403\r
+       tri 576 409 397 408\r
+       tri 577 408 397 398\r
+       tri 578 406 410 407\r
+       tri 579 413 412 411\r
+       tri 580 414 413 411\r
+       tri 581 417 416 415\r
+       tri 582 415 416 418\r
+       tri 583 420 417 419\r
+       tri 584 417 415 419\r
+       tri 585 422 405 421\r
+       tri 586 421 405 404\r
+       tri 587 421 404 423\r
+       tri 588 404 424 423\r
+       tri 589 426 425 416\r
+       tri 590 426 416 417\r
+       tri 591 427 426 420\r
+       tri 592 420 426 417\r
+       tri 593 428 422 421\r
+       tri 594 428 421 429\r
+       tri 595 429 421 430\r
+       tri 596 421 423 430\r
+       tri 597 427 431 426\r
+       tri 598 428 429 432\r
+       tri 599 429 430 432\r
+       tri 600 426 431 425\r
+       tri 601 404 401 424\r
+       tri 602 415 413 414\r
+       tri 603 433 415 414\r
+       tri 604 419 415 433\r
+       tri 605 435 434 388\r
+       tri 606 389 435 388\r
+       tri 607 395 436 387\r
+       tri 608 387 386 396\r
+       tri 609 394 387 396\r
+       tri 610 395 394 437\r
+       tri 611 437 394 396\r
+       tri 612 439 438 435\r
+       tri 613 437 396 397\r
+       tri 614 440 437 397\r
+       tri 615 349 434 435\r
+       tri 616 441 349 435\r
+       tri 617 441 435 438\r
+       tri 618 441 442 349\r
+       tri 619 443 369 348\r
+       tri 620 443 348 442\r
+       tri 621 442 348 349\r
+       tri 622 418 444 443\r
+       tri 623 444 369 443\r
+       tri 624 413 442 441\r
+       tri 625 415 418 413\r
+       tri 626 413 443 442\r
+       tri 627 418 443 413\r
+       tri 628 409 440 397\r
+       tri 629 413 441 412\r
+       tri 630 297 303 336\r
+       tri 631 312 297 336\r
+       tri 632 323 335 322\r
+       tri 633 322 335 305\r
+       tri 634 372 373 377\r
+       tri 635 372 377 379\r
+       tri 636 379 378 375\r
+       tri 637 375 378 374\r
+       tri 638 169 175 180\r
+       tri 639 169 180 168\r
+       tri 640 180 171 168\r
+       tri 641 179 446 445\r
+       tri 642 179 445 177\r
+       tri 643 445 166 447\r
+       tri 644 445 447 177\r
+       tri 645 177 447 166\r
+       tri 646 366 400 399\r
+       tri 647 366 399 339\r
+       tri 648 36 448 37\r
+       tri 649 36 31 448\r
+       tri 650 22 31 36\r
+       tri 651 85 333 449\r
+       tri 652 449 333 450\r
+       tri 653 451 446 179\r
+       tri 654 452 179 178\r
+       tri 655 451 179 452\r
+       tri 656 455 454 453\r
+       tri 657 455 453 456\r
+       tri 658 176 458 457\r
+       tri 659 176 457 175\r
+       tri 660 175 457 180\r
+       tri 661 457 459 180\r
+       tri 662 462 461 460\r
+       tri 663 462 460 463\r
+       tri 664 466 465 464\r
+       tri 665 466 464 467\r
+       tri 666 467 464 468\r
+       tri 667 467 468 469\r
+       tri 668 471 470 466\r
+       tri 669 470 465 466\r
+       tri 670 470 472 465\r
+       tri 671 465 472 464\r
+       tri 672 472 468 464\r
+       tri 673 475 474 473\r
+       tri 674 476 474 475\r
+       tri 675 476 477 474\r
+       tri 676 480 479 478\r
+       tri 677 480 473 479\r
+       tri 678 481 480 478\r
+       tri 679 480 475 473\r
+       tri 680 476 475 480\r
+       tri 681 482 476 480\r
+       tri 682 482 480 481\r
+       tri 683 485 484 483\r
+       tri 684 484 486 483\r
+       tri 685 484 487 486\r
+       tri 686 489 485 488\r
+       tri 687 485 483 488\r
+       tri 688 486 487 490\r
+       tri 689 486 490 491\r
+       tri 690 492 486 491\r
+       tri 691 483 486 492\r
+       tri 692 488 483 493\r
+       tri 693 483 494 493\r
+       tri 694 492 491 495\r
+       tri 695 492 495 496\r
+       tri 696 495 497 496\r
+       tri 697 495 498 497\r
+       tri 698 501 500 499\r
+       tri 699 498 501 499\r
+       tri 700 495 501 498\r
+       tri 701 501 502 500\r
+       tri 702 502 503 500\r
+       tri 703 504 502 501\r
+       tri 704 495 504 501\r
+       tri 705 485 505 484\r
+       tri 706 489 505 485\r
+       tri 707 507 506 489\r
+       tri 708 489 506 505\r
+       tri 709 484 505 487\r
+       tri 710 506 487 505\r
+       tri 711 506 508 487\r
+       tri 712 490 509 495\r
+       tri 713 491 490 495\r
+       tri 714 490 510 509\r
+       tri 715 490 511 510\r
+       tri 716 490 512 511\r
+       tri 717 487 512 490\r
+       tri 718 508 512 487\r
+       tri 719 508 511 512\r
+       tri 720 41 494 40\r
+       tri 721 494 496 40\r
+       tri 722 492 496 494\r
+       tri 723 41 42 494\r
+       tri 724 493 494 42\r
+       tri 725 507 489 513\r
+       tri 726 513 489 514\r
+       tri 727 488 493 515\r
+       tri 728 488 515 514\r
+       tri 729 514 515 516\r
+       tri 730 47 493 42\r
+       tri 731 47 516 515\r
+       tri 732 513 514 516\r
+       tri 733 48 516 47\r
+       tri 734 48 513 516\r
+       tri 735 47 515 493\r
+       tri 736 519 518 517\r
+       tri 737 519 520 518\r
+       tri 738 517 518 506\r
+       tri 739 506 518 508\r
+       tri 740 521 519 517\r
+       tri 741 521 522 519\r
+       tri 742 507 521 506\r
+       tri 743 521 517 506\r
+       tri 744 525 524 523\r
+       tri 745 525 526 524\r
+       tri 746 526 527 524\r
+       tri 747 529 482 528\r
+       tri 748 530 482 529\r
+       tri 749 530 531 482\r
+       tri 750 532 530 529\r
+       tri 751 532 529 533\r
+       tri 752 532 533 534\r
+       tri 753 531 476 482\r
+       tri 754 530 535 531\r
+       tri 755 525 537 536\r
+       tri 756 508 538 511\r
+       tri 757 508 518 538\r
+       tri 758 525 523 537\r
+       tri 759 536 537 539\r
+       tri 760 518 540 538\r
+       tri 761 541 532 534\r
+       tri 762 532 542 530\r
+       tri 763 541 542 532\r
+       tri 764 542 535 530\r
+       tri 765 525 543 526\r
+       tri 766 531 477 476\r
+       tri 767 531 544 477\r
+       tri 768 545 477 544\r
+       tri 769 546 477 545\r
+       tri 770 477 547 474\r
+       tri 771 547 479 474\r
+       tri 772 473 474 479\r
+       tri 773 550 549 548\r
+       tri 774 550 500 549\r
+       tri 775 83 498 550\r
+       tri 776 553 552 551\r
+       tri 777 549 552 553\r
+       tri 778 556 555 554\r
+       tri 779 555 557 554\r
+       tri 780 548 559 558\r
+       tri 781 556 560 555\r
+       tri 782 555 561 557\r
+       tri 783 564 563 562\r
+       tri 784 566 565 561\r
+       tri 785 548 553 559\r
+       tri 786 553 551 559\r
+       tri 787 561 565 100\r
+       tri 788 557 561 100\r
+       tri 789 568 548 567\r
+       tri 790 548 558 567\r
+       tri 791 569 568 567\r
+       tri 792 105 569 104\r
+       tri 793 569 567 104\r
+       tri 794 83 568 106\r
+       tri 795 106 568 569\r
+       tri 796 106 569 105\r
+       tri 797 83 570 498\r
+       tri 798 108 570 83\r
+       tri 799 40 497 108\r
+       tri 800 40 496 497\r
+       tri 801 108 497 570\r
+       tri 802 497 498 570\r
+       tri 803 111 571 110\r
+       tri 804 112 110 571\r
+       tri 805 113 112 571\r
+       tri 806 113 571 572\r
+       tri 807 572 562 563\r
+       tri 808 566 561 562\r
+       tri 809 560 562 561\r
+       tri 810 573 562 572\r
+       tri 811 573 566 562\r
+       tri 812 573 574 566\r
+       tri 813 574 565 566\r
+       tri 814 572 111 574\r
+       tri 815 573 572 574\r
+       tri 816 574 111 100\r
+       tri 817 574 100 565\r
+       tri 818 575 563 564\r
+       tri 819 575 572 563\r
+       tri 820 555 560 561\r
+       tri 821 549 553 548\r
+       tri 822 577 564 576\r
+       tri 823 576 564 578\r
+       tri 824 579 576 578\r
+       tri 825 564 562 560\r
+       tri 826 556 564 560\r
+       tri 827 123 122 575\r
+       tri 828 580 575 577\r
+       tri 829 577 575 564\r
+       tri 830 581 578 564\r
+       tri 831 581 579 578\r
+       tri 832 477 582 547\r
+       tri 833 581 564 556\r
+       tri 834 546 582 477\r
+       tri 835 583 579 581\r
+       tri 836 584 579 583\r
+       tri 837 577 576 579\r
+       tri 838 585 575 580\r
+       tri 839 585 580 577\r
+       tri 840 585 577 586\r
+       tri 841 587 585 586\r
+       tri 842 586 577 579\r
+       tri 843 584 586 579\r
+       tri 844 587 586 584\r
+       tri 845 539 546 545\r
+       tri 846 540 584 583\r
+       tri 847 518 584 540\r
+       tri 848 588 585 587\r
+       tri 849 520 588 587\r
+       tri 850 536 539 589\r
+       tri 851 589 539 545\r
+       tri 852 589 545 544\r
+       tri 853 522 590 519\r
+       tri 854 519 590 520\r
+       tri 855 590 588 520\r
+       tri 856 590 591 588\r
+       tri 857 522 592 590\r
+       tri 858 522 593 592\r
+       tri 859 590 592 591\r
+       tri 860 591 585 588\r
+       tri 861 594 593 521\r
+       tri 862 521 593 522\r
+       tri 863 597 596 595\r
+       tri 864 595 596 594\r
+       tri 865 48 598 513\r
+       tri 866 598 507 513\r
+       tri 867 143 598 48\r
+       tri 868 145 123 599\r
+       tri 869 585 599 575\r
+       tri 870 599 123 575\r
+       tri 871 600 145 599\r
+       tri 872 147 145 600\r
+       tri 873 572 571 111\r
+       tri 874 591 601 585\r
+       tri 875 601 599 585\r
+       tri 876 601 600 599\r
+       tri 877 592 601 591\r
+       tri 878 150 601 149\r
+       tri 879 592 149 601\r
+       tri 880 596 593 594\r
+       tri 881 151 149 592\r
+       tri 882 593 151 592\r
+       tri 883 602 596 597\r
+       tri 884 483 492 494\r
+       tri 885 147 600 601\r
+       tri 886 150 147 601\r
+       tri 887 603 153 154\r
+       tri 888 156 153 603\r
+       tri 889 602 603 596\r
+       tri 890 154 151 593\r
+       tri 891 603 154 593\r
+       tri 892 602 156 603\r
+       tri 893 602 157 156\r
+       tri 894 489 488 514\r
+       tri 895 83 550 568\r
+       tri 896 550 548 568\r
+       tri 897 605 604 159\r
+       tri 898 604 161 159\r
+       tri 899 606 605 162\r
+       tri 900 164 606 162\r
+       tri 901 162 605 159\r
+       tri 902 166 607 164\r
+       tri 903 610 609 608\r
+       tri 904 610 170 609\r
+       tri 905 613 612 611\r
+       tri 906 174 170 610\r
+       tri 907 174 610 614\r
+       tri 908 174 614 176\r
+       tri 909 607 606 164\r
+       tri 910 611 605 606\r
+       tri 911 615 607 166\r
+       tri 912 607 611 606\r
+       tri 913 613 611 607\r
+       tri 914 615 613 607\r
+       tri 915 617 616 615\r
+       tri 916 616 613 615\r
+       tri 917 520 587 584\r
+       tri 918 520 584 518\r
+       tri 919 498 499 550\r
+       tri 920 550 499 500\r
+       tri 921 618 612 613\r
+       tri 922 618 613 616\r
+       tri 923 612 604 605\r
+       tri 924 612 605 611\r
+       tri 925 608 604 612\r
+       tri 926 575 113 572\r
+       tri 927 122 113 575\r
+       tri 928 621 620 619\r
+       tri 929 621 622 620\r
+       tri 930 620 623 619\r
+       tri 931 619 623 624\r
+       tri 932 623 626 625\r
+       tri 933 623 625 624\r
+       tri 934 621 627 622\r
+       tri 935 629 628 627\r
+       tri 936 630 627 621\r
+       tri 937 630 621 631\r
+       tri 938 633 632 626\r
+       tri 939 635 634 633\r
+       tri 940 635 636 634\r
+       tri 941 622 633 620\r
+       tri 942 622 635 633\r
+       tri 943 627 635 622\r
+       tri 944 620 633 623\r
+       tri 945 633 626 623\r
+       tri 946 628 637 635\r
+       tri 947 628 635 627\r
+       tri 948 640 639 638\r
+       tri 949 639 641 638\r
+       tri 950 638 631 642\r
+       tri 951 643 637 628\r
+       tri 952 646 645 644\r
+       tri 953 649 648 647\r
+       tri 954 652 651 650\r
+       tri 955 653 651 652\r
+       tri 956 656 655 654\r
+       tri 957 654 655 657\r
+       tri 958 647 648 651\r
+       tri 959 660 659 658\r
+       tri 960 658 659 661\r
+       tri 961 658 661 662\r
+       tri 962 649 662 648\r
+       tri 963 653 647 651\r
+       tri 964 656 663 655\r
+       tri 965 666 665 664\r
+       tri 966 667 666 664\r
+       tri 967 670 669 668\r
+       tri 968 648 662 671\r
+       tri 969 650 671 672\r
+       tri 970 650 672 673\r
+       tri 971 675 674 640\r
+       tri 972 675 640 676\r
+       tri 973 677 669 670\r
+       tri 974 677 667 669\r
+       tri 975 667 664 669\r
+       tri 976 640 638 642\r
+       tri 977 678 643 665\r
+       tri 978 665 643 664\r
+       tri 979 679 671 662\r
+       tri 980 672 671 679\r
+       tri 981 660 673 659\r
+       tri 982 656 681 680\r
+       tri 983 656 682 681\r
+       tri 984 656 654 682\r
+       tri 985 684 650 683\r
+       tri 986 683 650 673\r
+       tri 987 660 683 673\r
+       tri 988 649 658 662\r
+       tri 989 637 636 635\r
+       tri 990 625 686 685\r
+       tri 991 686 687 685\r
+       tri 992 634 689 688\r
+       tri 993 691 685 690\r
+       tri 994 685 687 690\r
+       tri 995 688 690 687\r
+       tri 996 689 692 688\r
+       tri 997 638 630 631\r
+       tri 998 638 693 630\r
+       tri 999 641 693 638\r
+       tri 1000 696 695 694\r
+       tri 1001 691 690 697\r
+       tri 1002 699 698 143\r
+       tri 1003 626 686 625\r
+       tri 1004 700 691 697\r
+       tri 1005 702 696 701\r
+       tri 1006 696 694 701\r
+       tri 1007 636 701 634\r
+       tri 1008 265 699 143\r
+       tri 1009 703 699 265\r
+       tri 1010 634 688 687\r
+       tri 1011 704 643 628\r
+       tri 1012 633 634 632\r
+       tri 1013 626 632 686\r
+       tri 1014 705 268 269\r
+       tri 1015 706 271 689\r
+       tri 1016 694 271 706\r
+       tri 1017 701 694 706\r
+       tri 1018 701 706 634\r
+       tri 1019 706 689 634\r
+       tri 1020 632 707 686\r
+       tri 1021 707 687 686\r
+       tri 1022 634 687 707\r
+       tri 1023 634 707 632\r
+       tri 1024 268 703 265\r
+       tri 1025 705 703 268\r
+       tri 1026 702 701 636\r
+       tri 1027 630 629 627\r
+       tri 1028 650 651 671\r
+       tri 1029 648 671 651\r
+       tri 1030 674 670 640\r
+       tri 1031 708 639 640\r
+       tri 1032 670 708 640\r
+       tri 1033 670 668 708\r
+       tri 1034 668 709 708\r
+       tri 1035 668 669 709\r
+       tri 1036 669 664 709\r
+       tri 1037 709 710 639\r
+       tri 1038 708 709 639\r
+       tri 1039 664 710 709\r
+       tri 1040 664 643 710\r
+       tri 1041 710 643 704\r
+       tri 1042 621 619 711\r
+       tri 1043 631 621 711\r
+       tri 1044 712 696 702\r
+       tri 1045 684 652 650\r
+       tri 1046 675 713 674\r
+       tri 1047 713 677 670\r
+       tri 1048 713 670 674\r
+       tri 1049 714 665 666\r
+       tri 1050 714 678 665\r
+       tri 1051 714 715 678\r
+       tri 1052 675 676 716\r
+       tri 1053 710 704 717\r
+       tri 1054 639 710 717\r
+       tri 1055 639 717 641\r
+       tri 1056 641 717 693\r
+       tri 1057 717 704 693\r
+       tri 1058 698 598 143\r
+       tri 1059 698 595 598\r
+       tri 1060 688 718 690\r
+       tri 1061 688 692 718\r
+       tri 1062 271 692 689\r
+       tri 1063 271 285 692\r
+       tri 1064 625 685 719\r
+       tri 1065 624 625 719\r
+       tri 1066 624 719 700\r
+       tri 1067 719 691 700\r
+       tri 1068 719 685 691\r
+       tri 1069 594 521 507\r
+       tri 1070 595 507 598\r
+       tri 1071 595 594 507\r
+       tri 1072 596 603 593\r
+       tri 1073 646 720 645\r
+       tri 1074 720 702 645\r
+       tri 1075 720 712 702\r
+       tri 1076 631 711 721\r
+       tri 1077 642 631 721\r
+       tri 1078 637 702 636\r
+       tri 1079 644 722 643\r
+       tri 1080 643 722 637\r
+       tri 1081 722 702 637\r
+       tri 1082 645 702 722\r
+       tri 1083 644 645 722\r
+       tri 1084 723 640 642\r
+       tri 1085 676 640 723\r
+       tri 1086 724 646 644\r
+       tri 1087 678 644 643\r
+       tri 1088 715 724 678\r
+       tri 1089 678 724 644\r
+       tri 1090 693 629 630\r
+       tri 1091 704 629 693\r
+       tri 1092 704 628 629\r
+       tri 1093 726 725 535\r
+       tri 1094 729 728 727\r
+       tri 1095 726 727 725\r
+       tri 1096 727 728 725\r
+       tri 1097 730 727 726\r
+       tri 1098 729 731 728\r
+       tri 1099 535 725 728\r
+       tri 1100 535 731 531\r
+       tri 1101 731 544 531\r
+       tri 1102 732 731 729\r
+       tri 1103 535 728 731\r
+       tri 1104 731 589 544\r
+       tri 1105 536 589 733\r
+       tri 1106 733 589 731\r
+       tri 1107 730 734 727\r
+       tri 1108 734 735 727\r
+       tri 1109 729 727 735\r
+       tri 1110 730 736 734\r
+       tri 1111 737 734 736\r
+       tri 1112 738 734 737\r
+       tri 1113 740 726 739\r
+       tri 1114 739 726 542\r
+       tri 1115 542 726 535\r
+       tri 1116 732 729 735\r
+       tri 1117 732 733 731\r
+       tri 1118 732 741 733\r
+       tri 1119 742 741 732\r
+       tri 1120 743 543 525\r
+       tri 1121 743 525 741\r
+       tri 1122 525 536 741\r
+       tri 1123 741 536 733\r
+       tri 1124 742 743 741\r
+       tri 1125 744 730 740\r
+       tri 1126 744 745 730\r
+       tri 1127 541 739 542\r
+       tri 1128 746 739 541\r
+       tri 1129 747 543 743\r
+       tri 1130 748 747 743\r
+       tri 1131 748 749 747\r
+       tri 1132 750 740 739\r
+       tri 1133 750 739 746\r
+       tri 1134 740 730 726\r
+       tri 1135 748 751 749\r
+       tri 1136 748 752 751\r
+       tri 1137 752 753 751\r
+       tri 1138 748 742 754\r
+       tri 1139 748 743 742\r
+       tri 1140 754 742 732\r
+       tri 1141 755 732 735\r
+       tri 1142 754 732 755\r
+       tri 1143 752 754 756\r
+       tri 1144 738 735 734\r
+       tri 1145 755 735 738\r
+       tri 1146 748 754 752\r
+       tri 1147 754 755 756\r
+       tri 1148 758 324 757\r
+       tri 1149 758 327 324\r
+       tri 1150 759 328 604\r
+       tri 1151 331 328 760\r
+       tri 1152 760 328 759\r
+       tri 1153 604 328 161\r
+       tri 1154 324 331 757\r
+       tri 1155 757 331 760\r
+       tri 1156 757 760 759\r
+       tri 1157 761 758 757\r
+       tri 1158 761 757 759\r
+       tri 1159 608 761 759\r
+       tri 1160 608 759 604\r
+       tri 1161 551 762 559\r
+       tri 1162 763 738 737\r
+       tri 1163 764 738 763\r
+       tri 1164 766 736 765\r
+       tri 1165 745 766 765\r
+       tri 1166 766 737 736\r
+       tri 1167 763 737 766\r
+       tri 1168 756 764 763\r
+       tri 1169 769 768 767\r
+       tri 1170 767 768 770\r
+       tri 1171 773 772 771\r
+       tri 1172 772 774 771\r
+       tri 1173 767 774 772\r
+       tri 1174 767 770 774\r
+       tri 1175 777 776 775\r
+       tri 1176 777 778 776\r
+       tri 1177 775 780 779\r
+       tri 1178 775 776 780\r
+       tri 1179 768 781 770\r
+       tri 1180 768 782 781\r
+       tri 1181 770 783 774\r
+       tri 1182 770 781 783\r
+       tri 1183 771 783 784\r
+       tri 1184 771 774 783\r
+       tri 1185 785 779 780\r
+       tri 1186 787 786 782\r
+       tri 1187 782 786 781\r
+       tri 1188 786 783 781\r
+       tri 1189 786 788 783\r
+       tri 1190 787 784 788\r
+       tri 1191 784 783 788\r
+       tri 1192 787 788 786\r
+       tri 1193 791 790 789\r
+       tri 1194 791 792 790\r
+       tri 1195 769 794 793\r
+       tri 1196 769 795 794\r
+       tri 1197 789 794 795\r
+       tri 1198 789 790 794\r
+       tri 1199 798 797 796\r
+       tri 1200 798 777 797\r
+       tri 1201 796 800 799\r
+       tri 1202 796 797 800\r
+       tri 1203 792 801 790\r
+       tri 1204 801 802 790\r
+       tri 1205 790 803 794\r
+       tri 1206 790 802 803\r
+       tri 1207 793 794 804\r
+       tri 1208 804 794 803\r
+       tri 1209 799 800 805\r
+       tri 1210 806 803 802\r
+       tri 1211 806 807 803\r
+       tri 1212 808 807 806\r
+       tri 1213 811 810 809\r
+       tri 1214 809 810 812\r
+       tri 1215 810 813 812\r
+       tri 1216 814 811 809\r
+       tri 1217 811 815 810\r
+       tri 1218 814 816 811\r
+       tri 1219 819 818 817\r
+       tri 1220 814 809 820\r
+       tri 1221 816 815 811\r
+       tri 1222 822 813 821\r
+       tri 1223 773 822 821\r
+       tri 1224 822 820 812\r
+       tri 1225 822 812 813\r
+       tri 1226 809 812 820\r
+       tri 1227 773 821 772\r
+       tri 1228 769 767 795\r
+       tri 1229 824 823 816\r
+       tri 1230 826 815 825\r
+       tri 1231 826 821 813\r
+       tri 1232 826 813 815\r
+       tri 1233 815 813 810\r
+       tri 1234 826 827 821\r
+       tri 1235 772 821 828\r
+       tri 1236 827 828 821\r
+       tri 1237 767 772 828\r
+       tri 1238 789 795 829\r
+       tri 1239 830 791 789\r
+       tri 1240 830 789 831\r
+       tri 1241 833 830 832\r
+       tri 1242 832 830 831\r
+       tri 1243 834 833 832\r
+       tri 1244 834 832 835\r
+       tri 1245 831 789 829\r
+       tri 1246 831 829 836\r
+       tri 1247 832 831 836\r
+       tri 1248 835 832 836\r
+       tri 1249 838 837 826\r
+       tri 1250 837 827 826\r
+       tri 1251 835 836 839\r
+       tri 1252 842 841 840\r
+       tri 1253 843 841 842\r
+       tri 1254 846 845 844\r
+       tri 1255 845 847 844\r
+       tri 1256 849 848 846\r
+       tri 1257 846 848 845\r
+       tri 1258 851 850 834\r
+       tri 1259 850 833 834\r
+       tri 1260 850 852 833\r
+       tri 1261 833 852 853\r
+       tri 1262 855 844 854\r
+       tri 1263 855 846 844\r
+       tri 1264 856 849 855\r
+       tri 1265 849 846 855\r
+       tri 1266 857 850 851\r
+       tri 1267 857 858 850\r
+       tri 1268 858 859 850\r
+       tri 1269 850 859 852\r
+       tri 1270 856 855 860\r
+       tri 1271 857 861 858\r
+       tri 1272 858 861 859\r
+       tri 1273 855 854 860\r
+       tri 1274 833 853 830\r
+       tri 1275 845 843 842\r
+       tri 1276 862 843 845\r
+       tri 1277 848 862 845\r
+       tri 1278 864 818 863\r
+       tri 1279 817 818 864\r
+       tri 1280 824 816 865\r
+       tri 1281 816 825 815\r
+       tri 1282 823 825 816\r
+       tri 1283 824 866 823\r
+       tri 1284 866 825 823\r
+       tri 1285 868 864 867\r
+       tri 1286 866 826 825\r
+       tri 1287 869 826 866\r
+       tri 1288 778 864 863\r
+       tri 1289 870 864 778\r
+       tri 1290 870 867 864\r
+       tri 1291 870 778 871\r
+       tri 1292 872 777 798\r
+       tri 1293 872 871 777\r
+       tri 1294 871 778 777\r
+       tri 1295 847 872 873\r
+       tri 1296 873 872 798\r
+       tri 1297 842 870 871\r
+       tri 1298 845 842 847\r
+       tri 1299 842 871 872\r
+       tri 1300 847 842 872\r
+       tri 1301 838 826 869\r
+       tri 1302 842 840 870\r
+       tri 1303 730 765 736\r
+       tri 1304 745 765 730\r
+       tri 1305 756 755 764\r
+       tri 1306 755 738 764\r
+       tri 1307 801 806 802\r
+       tri 1308 801 808 806\r
+       tri 1309 808 804 807\r
+       tri 1310 804 803 807\r
+       tri 1311 610 618 614\r
+       tri 1312 610 608 618\r
+       tri 1313 618 608 612\r
+       tri 1314 617 445 446\r
+       tri 1315 617 615 445\r
+       tri 1316 445 447 166\r
+       tri 1317 445 615 447\r
+       tri 1318 615 166 447\r
+       tri 1319 795 828 829\r
+       tri 1320 795 767 828\r
+       tri 1321 509 510 874\r
+       tri 1322 509 874 504\r
+       tri 1323 495 509 504\r
+       tri 1324 551 449 762\r
+       tri 1325 449 450 762\r
+       tri 1326 875 617 446\r
+       tri 1327 876 616 617\r
+       tri 1328 875 876 617\r
+       tri 1329 879 878 877\r
+       tri 1330 879 880 878\r
+       tri 1331 176 881 458\r
+       tri 1332 176 614 881\r
+       tri 1333 614 618 881\r
+       tri 1334 881 618 882\r
+       tri 1335 885 884 883\r
+       tri 1336 885 886 884\r
+       tri 1337 889 888 887\r
+       tri 1338 889 890 888\r
+       tri 1339 890 468 888\r
+       tri 1340 890 469 468\r
+       tri 1341 471 889 470\r
+       tri 1342 470 889 887\r
+       tri 1343 470 887 472\r
+       tri 1344 887 888 472\r
+       tri 1345 472 888 468\r
+\r
+       numweights 1401\r
+       weight 0 47 1 ( 1.5918749571 -0.9465401769 4.3310847282 )\r
+       weight 1 47 1 ( 1.6758500338 -1.577014327 4.0544595718 )\r
+       weight 2 47 1 ( -1.5918749571 -0.9465401769 4.3310847282 )\r
+       weight 3 47 1 ( -1.6758500338 -1.577014327 4.0544595718 )\r
+       weight 4 13 0.053187836 ( 8.4481897354 3.2544219494 6.9728450775 )\r
+       weight 5 14 0.4734061062 ( 5.2661533356 -1.6828705072 0.4450342655 )\r
+       weight 6 15 0.4734061062 ( -1.2594890594 2.9372439384 0.3122821152 )\r
+       weight 7 14 0.5 ( 4.4865937233 -0.5485437512 2.8395075798 )\r
+       weight 8 15 0.5 ( -0.6507510543 1.9244441986 -2.1840326786 )\r
+       weight 9 15 1 ( 5.4889202118 -1.1939901114 0.0387593247 )\r
+       weight 10 17 0.7487224936 ( 4.1981225014 1.0838154554 0.8668574691 )\r
+       weight 11 18 0.2512775064 ( -0.2796498835 -0.85005337 -1.3222959042 )\r
+       weight 12 13 0.0615583919 ( 6.9452548027 5.4839982986 0.9795920253 )\r
+       weight 13 14 0.4294690788 ( 1.6521060467 3.3780589104 2.5603511333 )\r
+       weight 14 15 0.1900289804 ( 0.631133616 -2.7499701977 -2.3765933514 )\r
+       weight 15 17 0.3189435899 ( -0.4228499234 1.9056279659 -2.3026473522 )\r
+       weight 16 15 0.7028055191 ( 3.4897100925 -2.3128495216 0.6414083838 )\r
+       weight 17 16 0.0632485002 ( -2.4303045273 -1.7097656727 -1.533432126 )\r
+       weight 18 17 0.2339460105 ( 2.3406567574 2.7574291229 0.7153545022 )\r
+       weight 19 13 1 ( 2.5890426636 0.9712347984 0.6955299973 )\r
+       weight 20 14 0.5 ( -1.4184651375 5.0567121506 0.8234506249 )\r
+       weight 21 17 0.5 ( -0.6260279417 -1.7949299812 -1.0666476488 )\r
+       weight 22 14 0.5 ( -1.3168833256 5.1115264893 -1.7182623148 )\r
+       weight 23 17 0.5 ( -0.6990675926 -2.0803804398 1.4605665207 )\r
+       weight 24 12 0.1611201018 ( 27.9446182251 -2.7854254246 2.1179125309 )\r
+       weight 25 13 0.8388799429 ( 3.1051416397 0.575112164 -1.5763118267 )\r
+       weight 26 12 0.0601770245 ( 31.6341896057 -1.9060554504 2.9381074905 )\r
+       weight 27 13 0.5841425061 ( 6.2316036224 -1.6949044466 -1.214058876 )\r
+       weight 28 14 0.3033334315 ( -4.350912571 0.0375959501 -0.5482037067 )\r
+       weight 29 17 0.0523469523 ( -6.5181436539 -1.949338913 -0.1015867963 )\r
+       weight 30 5 0.0853635073 ( 6.8468904495 3.6976914406 5.5451822281 )\r
+       weight 31 6 0.4573182464 ( 5.2122297287 -0.5132954717 2.3583621979 )\r
+       weight 32 7 0.4573182464 ( -0.495713681 3.396679163 -1.5696406364 )\r
+       weight 33 5 0.0840295702 ( 8.7717876434 2.2822639942 6.4198098183 )\r
+       weight 34 6 0.4579852223 ( 5.6759700775 -0.7160676718 -0.1351220459 )\r
+       weight 35 7 0.4579852223 ( -0.5821356177 3.5710999966 0.96723634 )\r
+       weight 36 4 0.0821894556 ( 27.8181304932 -1.7949742079 -1.1694817543 )\r
+       weight 37 5 0.9178105593 ( 2.4283726215 1.1873240471 1.6665122509 )\r
+       weight 38 5 0.6676149368 ( 5.4009561539 -1.672555089 3.3675887585 )\r
+       weight 39 6 0.3323850632 ( 0.2716099322 -3.3065977097 0.4982741773 )\r
+       weight 40 7 0.5 ( 6.3368601799 -0.1076524705 -0.7284914255 )\r
+       weight 41 8 0.5 ( 0.3947378397 0.2946861386 0.3103610575 )\r
+       weight 42 7 0.5402719378 ( 5.1529350281 2.6981573105 0.1341468841 )\r
+       weight 43 8 0.4597280324 ( 1.9520330429 -2.3932673931 -0.2963772118 )\r
+       weight 44 6 0.3959079087 ( 3.5102162361 2.8287758827 3.452352047 )\r
+       weight 45 7 0.6040921211 ( 1.1508774757 0.1306394041 -2.9425301552 )\r
+       weight 46 7 1 ( 4.1347055435 0.4154888988 -0.0293651782 )\r
+       weight 47 4 0.0706800967 ( 28.3183269501 -2.2837436199 1.0878134966 )\r
+       weight 48 5 0.9293199182 ( 3.2922086716 1.5207448006 -0.5076752305 )\r
+       weight 49 6 0.3453502953 ( -0.8724885583 6.4404673576 0.1513461918 )\r
+       weight 50 9 0.6546496749 ( 1.2548179626 -1.0199227333 -0.3463726938 )\r
+       weight 51 6 0.3758432567 ( -0.1918802857 5.8881764412 2.7704436779 )\r
+       weight 52 9 0.6241567135 ( 1.2947156429 0.1939728111 -2.8268544674 )\r
+       weight 53 12 0.2124085128 ( 26.8055114746 -4.070306778 -1.0478919744 )\r
+       weight 54 13 0.7875914574 ( 1.6918153763 2.5464425087 1.0858620405 )\r
+       weight 55 12 0.6253005266 ( 24.6087245941 -3.1580626965 0.6038689017 )\r
+       weight 56 13 0.374699533 ( -0.1082467362 2.3272726536 -1.1720380783 )\r
+       weight 57 12 0.4979476035 ( 26.1836776733 -0.9200876951 2.9216632843 )\r
+       weight 58 13 0.5020523667 ( 1.0726652145 -0.5859983563 -2.8981552124 )\r
+       weight 59 4 0.5886960626 ( 24.7740364075 -2.408575058 -0.4452747703 )\r
+       weight 60 5 0.4113039672 ( -0.0128848245 3.0426537991 0.7915845513 )\r
+       weight 61 4 0.4728768468 ( 26.312877655 0.1611661017 -2.4174807072 )\r
+       weight 62 5 0.5271231532 ( 0.1434828043 -0.0170211941 2.6557555199 )\r
+       weight 63 4 0.2854039669 ( 27.2705039978 -3.570245266 1.9158481359 )\r
+       weight 64 5 0.6396251917 ( 2.9475605488 3.1610751152 -1.3008930683 )\r
+       weight 65 6 0.0749708563 ( -1.6356470585 0.7260810733 6.0909228325 )\r
+       weight 66 12 1 ( 15.9022769928 -1.0461764336 0.1106846035 )\r
+       weight 67 4 1 ( 15.9783229828 -0.7058268189 0.0462598726 )\r
+       weight 68 12 1 ( 11.8548564911 -3.2612600327 0.0844356939 )\r
+       weight 69 12 1 ( 10.7426919937 -1.8521358967 -0.2785775065 )\r
+       weight 70 12 1 ( 11.7758760452 -2.4535136223 -2.0854225159 )\r
+       weight 71 12 1 ( 11.1056470871 -0.3666875958 1.7613815069 )\r
+       weight 72 4 1 ( 11.2005519867 -0.0056098253 -1.649836421 )\r
+       weight 73 4 1 ( 12.026263237 -3.0578436852 -0.3254128695 )\r
+       weight 74 4 1 ( 10.8482265472 -1.7486162186 0.1770529151 )\r
+       weight 75 4 1 ( 11.8598070145 -2.533162117 1.9249126911 )\r
+       weight 76 12 1 ( 6.0867600441 -1.6896793842 -1.7174838781 )\r
+       weight 77 12 1 ( 5.939453125 -2.0253684521 0.2332832664 )\r
+       weight 78 12 1 ( 4.020611763 0.2968726158 3.5981557369 )\r
+       weight 79 4 1 ( 6.0705180168 -2.0373017788 -0.4962054491 )\r
+       weight 80 4 1 ( 4.1423454285 0.6158214211 -3.6010718346 )\r
+       weight 81 4 1 ( 6.1550211906 -1.9444662333 1.4847310781 )\r
+       weight 82 11 0.44023633 ( 25.6103229523 -0.3287914395 -3.7324855328 )\r
+       weight 83 12 0.55976367 ( 1.4012981653 -1.2112002373 -3.9970128536 )\r
+       weight 84 11 0.5261281133 ( 23.2936515808 -1.613378644 2.2243275642 )\r
+       weight 85 12 0.4738718569 ( -1.1678849459 -1.8399035931 1.9615757465 )\r
+       weight 86 11 0.6838532686 ( 21.8507728577 -2.567274332 -0.7070226669 )\r
+       weight 87 12 0.3161467016 ( -2.813308239 -2.379347086 -0.9686493874 )\r
+       weight 88 11 0.4959532022 ( 25.0810661316 -3.0262124538 -0.564443469 )\r
+       weight 89 12 0.5040467978 ( 0.1817469001 -3.6738395691 -0.8282930851 )\r
+       weight 90 11 0.7535571456 ( 21.9286689758 0.6332171559 2.5199785233 )\r
+       weight 91 12 0.2464428693 ( -1.8919529915 0.6870872378 2.2579329014 )\r
+       weight 92 3 0.5178353786 ( 23.2522373199 -0.039865531 -2.9057381153 )\r
+       weight 93 4 0.4821645916 ( -0.9930627942 -1.9281506538 -2.38931036 )\r
+       weight 94 3 0.6677844524 ( 21.8719787598 -1.417304039 -0.1060412601 )\r
+       weight 95 4 0.3322155178 ( -2.6876761913 -2.9062848091 0.4057363868 )\r
+       weight 96 3 0.4972632229 ( 25.1040668488 -1.7163251638 -0.3420876563 )\r
+       weight 97 4 0.5027367473 ( 0.3609082401 -4.0224943161 0.1782921702 )\r
+       weight 98 3 0.7104444504 ( 21.811756134 2.1975412369 -2.9111247063 )\r
+       weight 99 4 0.2895555496 ( -1.8129787445 0.6033856273 -2.3971800804 )\r
+       weight 100 3 0.446364224 ( 25.5818843842 0.5703861713 3.1414940357 )\r
+       weight 101 4 0.553635776 ( 1.3982713223 -1.9339448214 3.6646277905 )\r
+       weight 102 11 1 ( 17.3874206543 -2.4439070225 -4.1909017563 )\r
+       weight 103 11 1 ( 19.4429759979 -4.9851694107 1.6527723074 )\r
+       weight 104 11 1 ( 16.6395587921 -1.6049283743 3.0770223141 )\r
+       weight 105 3 1 ( 16.5977191925 -0.1014638767 -3.7165145874 )\r
+       weight 106 3 1 ( 19.5340309143 -3.6067090034 -2.7237975597 )\r
+       weight 107 3 1 ( 17.3854560852 -1.8722593784 3.3556091785 )\r
+       weight 108 11 1 ( 10.8868865967 -6.7459335327 1.1776483059 )\r
+       weight 109 3 1 ( 11.0142002106 -5.6325101852 -2.4598770142 )\r
+       weight 110 11 1 ( 6.0520648956 -7.3734288216 -2.1165277958 )\r
+       weight 111 2 0.155758068 ( 0.0225959271 -11.9973735809 -2.18385005 )\r
+       weight 112 11 0.4663512409 ( 4.2098612785 -0.5591109991 4.9811387062 )\r
+       weight 113 3 0.3778907359 ( 4.085129261 0.3075269461 -5.3351268768 )\r
+       weight 114 3 1 ( 6.226858139 -6.8359003067 0.7576401234 )\r
+       weight 115 11 1 ( 5.5991148949 -3.3546543121 -5.3993344307 )\r
+       weight 116 11 1 ( 1.9934148788 -3.6342060566 -2.676869154 )\r
+       weight 117 11 1 ( 2.0487115383 -1.6355319023 -3.8487095833 )\r
+       weight 118 2 0.316247046 ( 0.0225959271 -10.1363353729 2.8364374638 )\r
+       weight 119 11 0.3584067822 ( 3.1888957024 -5.8143692017 4.8996477127 )\r
+       weight 120 3 0.3253461719 ( 3.3694503307 -4.9728798866 -5.8565268517 )\r
+       weight 121 11 1 ( 3.4229240417 -4.814221859 2.8404312134 )\r
+       weight 122 11 1 ( 2.6637368202 -5.8190793991 -0.4367515743 )\r
+       weight 123 2 0.200000003 ( -2.6205668449 -5.8852128983 2.3104748726 )\r
+       weight 124 11 0.8000000119 ( -0.8292854428 -5.9898080826 1.873357892 )\r
+       weight 125 11 1 ( 0.7808116674 -6.703142643 0.7876654863 )\r
+       weight 126 2 0.3315732479 ( 2.092133522 -10.3415222168 1.8513749838 )\r
+       weight 127 11 0.1196316853 ( 3.0411221981 -4.8039560318 6.9618468285 )\r
+       weight 128 3 0.548795104 ( 3.594884634 -4.2077159882 -3.6980230808 )\r
+       weight 129 3 1 ( 2.9731080532 -5.631746769 -0.5497601032 )\r
+       weight 130 2 0.5014616251 ( 2.6657583714 -5.8852128983 2.3104748726 )\r
+       weight 131 11 0.0887071341 ( -1.3169134855 -5.9766969681 7.13712883 )\r
+       weight 132 3 0.4098312259 ( -0.5585843921 -5.7401132584 -2.8041698933 )\r
+       weight 133 3 1 ( 1.1152558327 -6.4777898788 -1.8376920223 )\r
+       weight 134 3 1 ( 5.6206140518 -3.310931921 4.5146589279 )\r
+       weight 135 3 1 ( 2.2323229313 -3.7672386169 1.9434252977 )\r
+       weight 136 2 0.4008542597 ( 9.0259542465 -8.9648418427 -1.6588504314 )\r
+       weight 137 3 0.5991457105 ( 2.3039045334 -1.9154121876 3.7433154583 )\r
+       weight 138 2 0.200000003 ( -8.4313907623 -4.2338733673 1.4430127144 )\r
+       weight 139 11 0.8000000119 ( -2.0555427074 -5.4154109955 -4.0773949623 )\r
+       weight 140 21 0.2000620514 ( 0 -4.627289772 6.8499207497 )\r
+       weight 141 2 0.7999379635 ( 0.0225959271 -0.1411370933 1.1559374332 )\r
+       weight 142 2 1 ( 0.0225959271 -2.4174098969 2.1181750298 )\r
+       weight 143 2 0.7035011649 ( -5.5259790421 -0.7542257309 -2.4487373829 )\r
+       weight 144 11 0.2964988351 ( -6.3690209389 -2.1308312416 -1.5673086643 )\r
+       weight 145 21 0.1011939198 ( -2.9804124832 -4.4355010986 6.1831336021 )\r
+       weight 146 2 0.8988060355 ( -2.9578166008 0.0506515801 0.4891499877 )\r
+       weight 147 2 0.200000003 ( -5.1491789818 -4.249461174 2.5607750416 )\r
+       weight 148 11 0.8000000119 ( -2.1631352901 -6.5077753067 -0.7883653641 )\r
+       weight 149 2 0.7011694312 ( -4.3949165344 -4.1122465134 0.211800009 )\r
+       weight 150 11 0.2988305986 ( -2.7455039024 -4.2100992203 -0.0905433968 )\r
+       weight 151 2 0.6000000238 ( 5.5711708069 -0.7542257309 -2.4487373829 )\r
+       weight 152 3 0.400000006 ( -6.2266879082 -2.6470460892 1.1611907482 )\r
+       weight 153 21 0.100283742 ( 2.9804124832 -4.4355010986 6.1831336021 )\r
+       weight 154 2 0.8094608784 ( 3.0030083656 0.0506515801 0.4891499877 )\r
+       weight 155 3 0.0902553648 ( -6.6679382324 -5.3812556267 -1.7030479908 )\r
+       weight 156 2 0.3000000119 ( 5.1943712234 -4.249461174 2.5607750416 )\r
+       weight 157 3 0.6999999881 ( -1.7965431213 -6.6439666748 -0.19980371 )\r
+       weight 158 2 0.75 ( 4.4401082993 -4.1122465134 0.211800009 )\r
+       weight 159 3 0.25 ( -2.5262258053 -4.3194832802 -0.6118287444 )\r
+       weight 160 2 0.200000003 ( 8.4765834808 -4.2338733673 1.4430127144 )\r
+       weight 161 3 0.8000000119 ( -1.6731982231 -5.9384698868 3.1927781105 )\r
+       weight 162 68 1 ( -1.0395760536 0.1000350341 0.9358190298 )\r
+       weight 163 67 0.4616160095 ( -2.89077425 -0.2625672221 2.8819909096 )\r
+       weight 164 68 0.5383840203 ( 0.0027371221 -0.2766872048 0.7218831778 )\r
+       weight 165 68 1 ( -1.4338085651 -0.4351946115 0.0209905468 )\r
+       weight 166 67 0.4760879278 ( -3.2765827179 -0.9459189177 1.8811788559 )\r
+       weight 167 68 0.5239120722 ( -0.3830712736 -0.9600389004 -0.2789289057 )\r
+       weight 168 68 0.4535934627 ( -2.7274606228 0.7459554672 -0.6416669488 )\r
+       weight 169 69 0.4927748442 ( 0.1111897677 0.6066168547 -1.5777660608 )\r
+       weight 170 70 0.0536316484 ( 2.2429513931 -1.2223278284 -0.9344015121 )\r
+       weight 171 67 0.3018705547 ( -4.4608612061 0.7101285458 0.8618986607 )\r
+       weight 172 68 0.5631368756 ( -1.5673499107 0.6960085034 -1.2982091904 )\r
+       weight 173 69 0.1349925399 ( 1.2713004351 0.5566698909 -2.2343082428 )\r
+       weight 174 68 0.5701111555 ( -2.1352438927 1.5202844143 0.6470522881 )\r
+       weight 175 69 0.4298888147 ( 0.7034062743 1.3809456825 -0.2890468538 )\r
+       weight 176 68 0.3942388296 ( -3.4299592972 -0.1460768878 0.3467696607 )\r
+       weight 177 69 0.6057611704 ( -0.591309011 -0.2854155302 -0.5893294215 )\r
+       weight 178 68 0.4613237977 ( -2.9241416454 0.6859830022 1.6594445705 )\r
+       weight 179 69 0.5386762023 ( -0.08549124 0.5466443896 0.7233453989 )\r
+       weight 180 69 0.7539294362 ( -1.2403182983 1.5594754219 -1.1925787926 )\r
+       weight 181 70 0.2460705638 ( 0.8914432526 -0.269469291 -0.5492142439 )\r
+       weight 182 69 0.7581167817 ( -0.8320684433 2.0295872688 -0.4538404942 )\r
+       weight 183 70 0.2418832779 ( 1.2996931076 0.200642705 0.1895240396 )\r
+       weight 184 69 0.8665252328 ( -1.9434342384 1.1999920607 -0.7391021848 )\r
+       weight 185 70 0.1334747821 ( 0.1883274913 -0.6289525032 -0.0957376659 )\r
+       weight 186 69 0.7573544383 ( -1.6176607609 1.7227889299 0.1443075538 )\r
+       weight 187 70 0.2426455766 ( 0.5141008496 -0.1061555818 0.7876721025 )\r
+       weight 188 69 0.5 ( -1.6936619282 2.4764661789 -1.1229035854 )\r
+       weight 189 70 0.5 ( 0.4380996823 0.647521615 -0.4795390069 )\r
+       weight 190 21 0.6049628854 ( -7.7385001183 1.8537855148 7.5749835968 )\r
+       weight 191 23 0.3950371444 ( -2.6327066422 -3.4993028641 -2.1391019821 )\r
+       weight 192 21 0.7395432591 ( -7.078499794 1.9775247574 6.4612336159 )\r
+       weight 193 23 0.2604567111 ( -1.9727063179 -3.3755636215 -3.252851963 )\r
+       weight 194 21 0.7290982008 ( -5.5824999809 0.2120256126 8.0314836502 )\r
+       weight 195 23 0.2709017396 ( -0.476706624 -5.1410627365 -1.6826020479 )\r
+       weight 196 21 0.8070091605 ( -5.3703999519 0.0106715783 7.2138333321 )\r
+       weight 197 23 0.1929908395 ( -0.2646064758 -5.3424167633 -2.5002520084 )\r
+       weight 198 20 0.4457392693 ( -4.9759998322 5.2310991287 1.8968998194 )\r
+       weight 199 21 0.5542606711 ( -4.9759998322 -1.8024396896 4.5342335701 )\r
+       weight 200 20 0.2131802291 ( -3.8960874081 6.3706874847 2.7697873116 )\r
+       weight 201 21 0.786819756 ( -3.8960874081 -0.6628513932 5.4071207047 )\r
+       weight 202 21 0.7523798347 ( 5.5824999809 0.2120256126 8.0314836502 )\r
+       weight 203 22 0.2476201952 ( 0.0494676828 -5.2801318169 -1.6826020479 )\r
+       weight 204 21 0.8269272447 ( 5.3703999519 0.0106715783 7.2138333321 )\r
+       weight 205 22 0.1730727553 ( -0.1626324654 -5.4814858437 -2.5002520084 )\r
+       weight 206 20 0.4301334023 ( 4.9759998322 5.2310991287 1.8968998194 )\r
+       weight 207 21 0.4857027531 ( 4.9759998322 -1.8024396896 4.5342335701 )\r
+       weight 208 3 0.084163852 ( -9.3461141586 -4.6180176735 0.7216362953 )\r
+       weight 209 20 0.2122401148 ( 3.8960874081 6.3706874847 2.7697873116 )\r
+       weight 210 21 0.7877599001 ( 3.8960874081 -0.6628513932 5.4071207047 )\r
+       weight 211 21 0.6288941503 ( 7.7385001183 1.8537855148 7.5749835968 )\r
+       weight 212 22 0.3711058497 ( 2.205467701 -3.6383714676 -2.1391019821 )\r
+       weight 213 21 0.7719958425 ( 7.078499794 1.9775247574 6.4612336159 )\r
+       weight 214 22 0.2280042022 ( 1.5454673767 -3.514632225 -3.252851963 )\r
+       weight 215 42 0.0670943782 ( 2.1667346954 0.4200339615 5.0092563629 )\r
+       weight 216 43 0.8406767249 ( 0.5454059243 0.3306784928 1.8982644081 )\r
+       weight 217 44 0.0922289193 ( -1.78956604 0.355511874 -0.3024424314 )\r
+       weight 218 42 0.4065153301 ( 1.1848820448 0.4039087594 4.452650547 )\r
+       weight 219 43 0.5934846997 ( -0.4364467859 0.3145532608 1.341658473 )\r
+       weight 220 42 0.0528391302 ( 2.3949644566 -0.6315246224 4.6614966393 )\r
+       weight 221 43 0.8885747194 ( 0.7736355662 -0.7208800912 1.550504446 )\r
+       weight 222 44 0.0585861206 ( -1.5613363981 -0.69604671 -0.6502023339 )\r
+       weight 223 42 0.4351715147 ( 1.3432525396 -0.8027890921 4.0835413933 )\r
+       weight 224 43 0.5648284554 ( -0.2780762911 -0.8921445012 0.9725490808 )\r
+       weight 225 43 0.5412924886 ( 2.6226649284 -0.6821227074 1.2549462318 )\r
+       weight 226 44 0.4587075114 ( 0.2876930237 -0.6572893858 -0.9457606077 )\r
+       weight 227 43 0.5752940774 ( 2.2837176323 0.8279749155 1.7195134163 )\r
+       weight 228 44 0.4247059226 ( -0.0512543619 0.8528082967 -0.4811933637 )\r
+       weight 229 42 0.1481243521 ( 3.4624328613 -0.5666723251 3.2852530479 )\r
+       weight 230 43 0.7544951439 ( 1.8411041498 -0.6560278535 0.1742607653 )\r
+       weight 231 44 0.0973804742 ( -0.4938677251 -0.6311944723 -2.026446104 )\r
+       weight 232 43 0.5 ( 2.4288897514 -1.05935359 2.6993772984 )\r
+       weight 233 44 0.5 ( 0.0939178541 -1.0345202684 0.4986704886 )\r
+       weight 234 43 0.5 ( 2.1848678589 0.4753195047 3.2058575153 )\r
+       weight 235 44 0.5 ( -0.1501041353 0.5001528859 1.005150795 )\r
+       weight 236 44 0.9197841287 ( 1.798312664 -0.2298886329 -0.29904598 )\r
+       weight 237 45 0.0802158937 ( -0.652690053 -0.48235026 -0.1156174093 )\r
+       weight 238 44 0.9299392104 ( 1.5648198128 0.6806627512 -0.0759208724 )\r
+       weight 239 45 0.0700608119 ( -0.8861828446 0.428201139 0.1075076982 )\r
+       weight 240 44 0.6290175915 ( 2.0372204781 -0.5059825778 0.53518188 )\r
+       weight 241 45 0.3709823787 ( -0.4137822688 -0.7584441304 0.7186104655 )\r
+       weight 242 44 0.6460066438 ( 1.8634063005 0.493686825 0.8961632848 )\r
+       weight 243 45 0.3539933562 ( -0.5875963569 0.2412251979 1.0795918703 )\r
+       weight 244 44 0.5 ( 2.6586465836 0.3265955448 -0.3364367485 )\r
+       weight 245 45 0.5 ( 0.2076440305 0.0741338953 -0.1530081779 )\r
+       weight 246 57 0.5 ( -2.7713627815 0.5875270963 1.6177377701 )\r
+       weight 247 58 0.5 ( -0.2809449732 0.1404728144 0.3787926733 )\r
+       weight 248 57 0.6219800711 ( -1.3772597313 0.7917348146 1.9143089056 )\r
+       weight 249 58 0.3780199289 ( 1.1131579876 0.3446805775 0.6753637195 )\r
+       weight 250 57 0.587695539 ( -1.7254037857 1.6001403332 1.084712863 )\r
+       weight 251 58 0.4123044908 ( 0.7650139332 1.153085947 -0.1542322189 )\r
+       weight 252 61 0.510533154 ( -3.7330980301 1.859791398 0.3115520775 )\r
+       weight 253 62 0.489466846 ( 0.2769410312 1.1808936596 -0.5647704601 )\r
+       weight 254 60 0.1616790891 ( -3.429381609 4.0842399597 0.4938007891 )\r
+       weight 255 61 0.7634017467 ( -1.4805371761 1.875474453 0.1166702956 )\r
+       weight 256 62 0.0749191493 ( 2.5295016766 1.1965765953 -0.7596521974 )\r
+       weight 257 61 0.5032861829 ( -3.5199680328 1.886251092 1.6090922356 )\r
+       weight 258 62 0.4967138767 ( 0.4900707006 1.2073533535 0.7327697277 )\r
+       weight 259 61 0.5 ( -4.5605211258 1.0312472582 1.0713018179 )\r
+       weight 260 62 0.5 ( -0.5504823327 0.3523494601 0.1949792802 )\r
+       weight 261 60 0.1813702881 ( -2.4417381287 2.7686288357 0.2842504978 )\r
+       weight 262 61 0.8186296821 ( -0.4928939044 0.5598632693 -0.0928800032 )\r
+       weight 263 61 1 ( -2.7542662621 0.5748164654 0.6100765467 )\r
+       weight 264 60 0.0580386668 ( -3.7644145489 3.0628700256 2.0378191471 )\r
+       weight 265 61 0.8524241447 ( -1.8155703545 0.8541043997 1.6606885195 )\r
+       weight 266 62 0.0895371661 ( 2.1944684982 0.1752065867 0.7843660116 )\r
+       weight 267 60 0.3058627248 ( -2.6117250919 2.3118133545 1.9362158775 )\r
+       weight 268 61 0.6941372752 ( -0.6628807783 0.1030476764 1.5590853691 )\r
+       weight 269 61 0.7101962566 ( -3.5542309284 -0.2622278631 0.6173524261 )\r
+       weight 270 62 0.2898037434 ( 0.4558079243 -0.9411256313 -0.2589701116 )\r
+       weight 271 61 0.9090378284 ( -3.0096867085 0.2843372524 -0.1926835477 )\r
+       weight 272 62 0.0909621492 ( 1.0003519058 -0.3945605159 -1.0690060854 )\r
+       weight 273 60 0.311775744 ( -3.2107815742 2.5370719433 -0.8293616176 )\r
+       weight 274 61 0.6882243156 ( -1.2619371414 0.3283065557 -1.2064921856 )\r
+       weight 275 61 1 ( -0.8601444364 -0.1662086695 0.3438849449 )\r
+       weight 276 60 0.3610310555 ( -3.3041632175 1.3710100651 -0.6678417325 )\r
+       weight 277 61 0.6389689445 ( -1.3553190231 -0.8377555013 -1.0449721813 )\r
+       weight 278 54 0.4594660997 ( -3.2438788414 2.525652647 5.1648283005 )\r
+       weight 279 55 0.5405339003 ( -1.710138917 0.0553930998 0.1857370138 )\r
+       weight 280 54 0.4171014428 ( -2.2478528023 3.6906957626 4.4456977844 )\r
+       weight 281 63 0.5828985572 ( -0.1452506781 0.0455142893 0.975689888 )\r
+       weight 282 54 0.4769215584 ( -4.3294830322 2.9572627544 3.5671267509 )\r
+       weight 283 63 0.5230785012 ( -1.6738576889 -0.3816465735 -0.791762948 )\r
+       weight 284 54 0.389734 ( -3.0817329884 3.8850939274 3.1684253216 )\r
+       weight 285 63 0.6102659702 ( -0.2892436981 0.3828265667 -0.5176478028 )\r
+       weight 286 54 0.3395999074 ( -2.5298743248 1.7867136002 6.2920155525 )\r
+       weight 287 55 0.5843383074 ( -0.9961344004 -0.6835460663 1.3129241467 )\r
+       weight 288 56 0.0760618076 ( -0.4821526408 -2.3032956123 -1.0902748108 )\r
+       weight 289 55 0.4950400591 ( 0.4890114069 1.7273800373 2.7976408005 )\r
+       weight 290 56 0.5049599409 ( 1.0029932261 0.1076303422 0.3944419026 )\r
+       weight 291 54 0.4328585565 ( -1.1708829403 1.988902688 5.8379764557 )\r
+       weight 292 55 0.5671414137 ( 0.3628570139 -0.4813568592 0.8588849306 )\r
+       weight 293 55 0.4486292005 ( -0.8716393113 1.2403411865 2.8949155807 )\r
+       weight 294 56 0.5513707995 ( -0.357657522 -0.3794085383 0.4917165041 )\r
+       weight 295 55 0.4989314675 ( -0.0058581936 2.700428009 1.7701866627 )\r
+       weight 296 56 0.5010685921 ( 0.5081235766 1.080678463 -0.6330123544 )\r
+       weight 297 55 0.4854052663 ( -1.3327713013 2.1470458508 1.937522769 )\r
+       weight 298 56 0.5145947337 ( -0.8187894821 0.5272961259 -0.4656762481 )\r
+       weight 299 54 0.4394061863 ( -1.8224964142 3.0290915966 4.8107347488 )\r
+       weight 300 55 0.5605938435 ( -0.28875646 0.5588319898 -0.168356657 )\r
+       weight 301 56 0.5856215358 ( -1.4077911377 1.7714693546 0.9887248874 )\r
+       weight 302 57 0.414378494 ( -0.7708082199 0.1174184233 -1.0182901621 )\r
+       weight 303 56 0.6465825438 ( -0.9609650373 0.7695883512 2.0353055 )\r
+       weight 304 57 0.3534174562 ( -0.3344224393 -0.8959318399 0.0216322113 )\r
+       weight 305 56 0.5 ( -0.0443166159 1.7214983702 2.6266515255 )\r
+       weight 306 57 0.5 ( 0.6836009026 -0.0039592097 0.5355195403 )\r
+       weight 307 54 0.4738064408 ( -3.8623600006 3.9406208992 2.4635570049 )\r
+       weight 308 63 0.5261935592 ( -0.6583564878 0.5601946712 -1.4880073071 )\r
+       weight 309 54 0.5 ( -5.639193058 2.2191514969 0.5531668067 )\r
+       weight 310 60 0.5 ( -0.0542565025 0.095743902 -1.4449288845 )\r
+       weight 311 54 0.2885072827 ( -1.6454265118 0.0502118506 5.5385136604 )\r
+       weight 312 67 0.3271217644 ( -2.6467990875 2.1712169647 3.0733158588 )\r
+       weight 313 68 0.3298664689 ( 0.2467122674 2.1570971012 0.913208127 )\r
+       weight 314 69 0.0545044206 ( 3.0853626728 2.0177583694 -0.0228909608 )\r
+       weight 315 54 0.4018228948 ( -0.2864444554 0.2523858249 5.084467411 )\r
+       weight 316 67 0.352889657 ( -1.3162412643 1.603010416 3.0982334614 )\r
+       weight 317 55 0.2452874482 ( 1.2472954988 -2.2178738117 0.1053763106 )\r
+       weight 318 54 0.7998598218 ( -2.3799781799 -1.0421098471 1.1964527369 )\r
+       weight 319 67 0.2001401931 ( -2.1254079342 1.8707454205 -1.4238046408 )\r
+       weight 320 67 0.4174389839 ( -3.4178996086 1.772376895 2.2076632977 )\r
+       weight 321 68 0.5209175944 ( -0.5243881345 1.7582569122 0.0475554317 )\r
+       weight 322 69 0.0616434962 ( 2.3142621517 1.6189181805 -0.8885436654 )\r
+       weight 323 54 0.5 ( -5.8431010246 1.1755847931 1.6658787727 )\r
+       weight 324 60 0.5 ( -1.0985194445 -0.9474959373 -1.0091500282 )\r
+       weight 325 54 0.411233604 ( -4.2994709015 1.4474301338 3.4130120277 )\r
+       weight 326 60 0.3847137094 ( -0.9549801946 -1.4227459431 1.284907937 )\r
+       weight 327 63 0.1389154792 ( -1.7387869358 -1.8774635792 -1.0418868065 )\r
+       weight 328 55 0.065137282 ( -2.7657313347 -1.0228295326 -1.5660791397 )\r
+       weight 329 54 0.4218311012 ( -2.9583892822 0.711068809 5.1654872894 )\r
+       weight 330 67 0.0748788193 ( -3.1961035728 3.4671702385 2.5089380741 )\r
+       weight 331 63 0.0888980106 ( -1.4166228771 -2.8317129612 1.0551384687 )\r
+       weight 332 55 0.4143920541 ( -1.4246493578 -1.7591906786 0.1863958538 )\r
+       weight 333 52 0.8625713587 ( -13.1781005859 1.8281533718 5.0887727737 )\r
+       weight 334 54 0.1374286115 ( 3.0549631119 1.4906463623 -2.1944954395 )\r
+       weight 335 52 1 ( -16.0200881958 1.6692044735 5.5842604637 )\r
+       weight 336 52 1 ( -14.7297000885 -1.5155575275 8.7642850876 )\r
+       weight 337 52 1 ( -14.6001739502 0.3788546026 8.2367229462 )\r
+       weight 338 52 1 ( -15.8221626282 -3.5096189976 5.7821354866 )\r
+       weight 339 52 1 ( -16.4721260071 0.8592442274 5.0787477493 )\r
+       weight 340 52 1 ( -15.7450885773 1.2291935682 6.8492603302 )\r
+       weight 341 52 1 ( -14.5249509811 1.2919547558 8.4333972931 )\r
+       weight 342 52 1 ( -10.2603244781 0.6809071302 5.6612477303 )\r
+       weight 343 52 1 ( -10.2370262146 -1.2293931246 6.3164730072 )\r
+       weight 344 51 0.1528514028 ( -18.557762146 -10.2321329117 0.1420730352 )\r
+       weight 345 52 0.8471485972 ( -3.0416750908 -1.8213818073 4.9780225754 )\r
+       weight 346 51 1 ( -12.5416622162 -6.5576739311 0.3419481218 )\r
+       weight 347 21 0.5517092347 ( -6.6989998817 3.9052724838 8.7423582077 )\r
+       weight 348 23 0.4482907951 ( -1.5932065248 -1.4478160143 -0.9717270732 )\r
+       weight 349 21 0.5897940993 ( -8.2767877579 5.0687122345 5.4984207153 )\r
+       weight 350 23 0.4102058709 ( -3.1709938049 -0.2843762636 -4.2156643867 )\r
+       weight 351 21 0.4541349113 ( -8.9402503967 5.8715248108 6.6592335701 )\r
+       weight 352 51 0.1050690785 ( -3.349711895 -8.8769950867 3.2980480194 )\r
+       weight 353 23 0.4407960474 ( -3.8344569206 0.5184363127 -3.0548520088 )\r
+       weight 354 21 0.4498602748 ( -7.3315000534 4.7027730942 9.271733284 )\r
+       weight 355 51 0.1002794802 ( -1.7409616709 -10.0457468033 5.9105482101 )\r
+       weight 356 23 0.4498602748 ( -2.2257065773 -0.6503154039 -0.4423519969 )\r
+       weight 357 21 0.3977741599 ( -6.717212677 7.8329229355 8.427195549 )\r
+       weight 358 51 0.2044516653 ( -1.1266744137 -6.9155974388 5.0660104752 )\r
+       weight 359 23 0.3977741599 ( -1.6114193201 2.4798343182 -1.2868895531 )\r
+       weight 360 21 0.4424972832 ( -7.4587001801 6.209025383 4.9213585854 )\r
+       weight 361 24 0.0737952366 ( -7.4587001801 -0.6982547045 3.4806699753 )\r
+       weight 362 51 0.2046934217 ( -1.8681615591 -8.5394945145 1.5601731539 )\r
+       weight 363 23 0.2790140808 ( -2.3529064655 0.8559368849 -4.7927269936 )\r
+       weight 364 21 0.4247496724 ( 0 4.2112112045 10.3921089172 )\r
+       weight 365 24 0.0560087487 ( 0 -2.6960687637 8.9514198303 )\r
+       weight 366 23 0.3012194037 ( 5.1057934761 -1.1418772936 0.6780230999 )\r
+       weight 367 22 0.2180222124 ( -5.5330324173 -1.2809457779 0.6780230999 )\r
+       weight 368 21 1 ( 0 7.8568601608 11.1890707016 )\r
+       weight 369 21 0.5777522326 ( 0 4.4999599457 8.5633583069 )\r
+       weight 370 24 0.0826512948 ( 0 -2.4073200226 7.1226701736 )\r
+       weight 371 23 0.1963478476 ( 5.1057934761 -0.8531285524 -1.1507270336 )\r
+       weight 372 22 0.1432486773 ( -5.5330324173 -0.992197156 -1.1507270336 )\r
+       weight 373 20 0.3280990422 ( -0.02575 10.2916765213 4.8680500984 )\r
+       weight 374 21 0.601125598 ( -0.02575 3.2581377029 7.5053834915 )\r
+       weight 375 23 0.0707753748 ( 5.0800437927 -2.0949509144 -2.2087020874 )\r
+       weight 376 21 0.7391816974 ( -4.6026625633 2.928109169 9.3043708801 )\r
+       weight 377 23 0.2608183324 ( 0.5031308532 -2.4249794483 -0.4097145796 )\r
+       weight 378 21 0.9489344358 ( -3.9362373352 2.8745126724 8.2949581146 )\r
+       weight 379 23 0.051065553 ( 1.1695561409 -2.4785759449 -1.4191269875 )\r
+       weight 380 21 0.7520155311 ( -3.3007750511 3.8584470749 10.3562088013 )\r
+       weight 381 51 0.051452022 ( 2.2897634506 -10.8900728226 6.9950232506 )\r
+       weight 382 23 0.196532473 ( 1.805018425 -1.4946414232 0.6421229243 )\r
+       weight 383 21 0.8876138926 ( -1.8014250994 4.4724607468 8.1371088028 )\r
+       weight 384 23 0.1123861521 ( 3.3043682575 -0.8806277514 -1.5769770145 )\r
+       weight 385 21 0.6761295199 ( -1.3572250605 4.4835090637 9.4744329453 )\r
+       weight 386 23 0.3238704205 ( 3.7485682964 -0.8695794344 -0.2396520972 )\r
+       weight 387 21 0.3764711916 ( -1.5492124557 8.0568504333 10.1685829163 )\r
+       weight 388 24 0.2470576614 ( -1.5492124557 1.1495703459 8.727894783 )\r
+       weight 389 23 0.3764711916 ( 3.5565810204 2.7037620544 0.4544979334 )\r
+       weight 390 21 1 ( -5.1198000908 4.1400623322 6.8882460594 )\r
+       weight 391 21 0.9301754832 ( -2.7639248371 5.3386974335 7.5046086311 )\r
+       weight 392 23 0.069824487 ( 2.341868639 -0.0143910628 -2.2094769478 )\r
+       weight 393 20 0.102906324 ( -4.8666000366 11.219625473 3.2355122566 )\r
+       weight 394 21 0.8970936537 ( -4.8666000366 4.1860866547 5.8728461266 )\r
+       weight 395 21 0.7719119787 ( 4.6026625633 2.928109169 9.3043708801 )\r
+       weight 396 22 0.2280880511 ( -0.9303697944 -2.5640478134 -0.4097145796 )\r
+       weight 397 21 1 ( 3.9362373352 2.8745126724 8.2949581146 )\r
+       weight 398 21 0.5990643501 ( 3.3007750511 3.8584470749 10.3562088013 )\r
+       weight 399 22 0.4009356499 ( -2.2322573662 -1.6337099075 0.6421229243 )\r
+       weight 400 21 0.8842225075 ( 1.8014250994 4.4724607468 8.1371088028 )\r
+       weight 401 22 0.1157775521 ( -3.7316071987 -1.0196963549 -1.5769770145 )\r
+       weight 402 21 0.6547270417 ( 1.3572250605 4.4835090637 9.4744329453 )\r
+       weight 403 23 0.0548789017 ( 6.4630184174 -0.8695794344 -0.2396520972 )\r
+       weight 404 22 0.2903940976 ( -4.1758069992 -1.0086480379 -0.2396520972 )\r
+       weight 405 21 0.332770139 ( 1.5492124557 8.0568504333 10.1685829163 )\r
+       weight 406 24 0.2736468017 ( 1.5492124557 1.1495703459 8.727894783 )\r
+       weight 407 23 0.0631841868 ( 6.6550059319 2.7037620544 0.4544979334 )\r
+       weight 408 22 0.3303989172 ( -3.9838199615 2.5646934509 0.4544979334 )\r
+       weight 409 21 1 ( 5.1198000908 4.1400623322 6.8882460594 )\r
+       weight 410 21 0.9300834537 ( 2.7639248371 5.3386974335 7.5046086311 )\r
+       weight 411 22 0.0699165389 ( -2.7691075802 -0.1534596682 -2.2094769478 )\r
+       weight 412 20 0.1013805494 ( 4.8666000366 11.219625473 3.2355122566 )\r
+       weight 413 21 0.8986194134 ( 4.8666000366 4.1860866547 5.8728461266 )\r
+       weight 414 21 0.5997615457 ( 6.6989998817 3.9052724838 8.7423582077 )\r
+       weight 415 22 0.4002384841 ( 1.1659675837 -1.5868844986 -0.9717270732 )\r
+       weight 416 21 0.5451080203 ( 8.2767877579 5.0687122345 5.4984207153 )\r
+       weight 417 26 0.1057546735 ( 2.6862454414 -9.6798763275 2.1372332573 )\r
+       weight 418 22 0.3491372764 ( 2.7437548637 -0.4234448671 -4.2156643867 )\r
+       weight 419 21 0.4586661756 ( 8.9402503967 5.8715248108 6.6592335701 )\r
+       weight 420 26 0.1038354486 ( 3.3497083187 -8.8770637512 3.2980458736 )\r
+       weight 421 22 0.4374984205 ( 3.4072179794 0.3793677092 -3.0548520088 )\r
+       weight 422 21 0.5 ( 7.3315000534 4.7027730942 9.271733284 )\r
+       weight 423 22 0.5 ( 1.7984676361 -0.7893840075 -0.4423519969 )\r
+       weight 424 21 0.3984822035 ( 6.717212677 7.8329229355 8.427195549 )\r
+       weight 425 26 0.2030356228 ( 1.1266708374 -6.9156656265 5.066008091 )\r
+       weight 426 22 0.3984822035 ( 1.1841803789 2.3407659531 -1.2868895531 )\r
+       weight 427 21 0.4073142409 ( 7.4587001801 6.209025383 4.9213585854 )\r
+       weight 428 24 0.0535066128 ( 7.4587001801 -0.6982547045 3.4806699753 )\r
+       weight 429 26 0.305274874 ( 1.8681579828 -8.539563179 1.5601708889 )\r
+       weight 430 22 0.2339043021 ( 1.9256675243 0.7168682814 -4.7927269936 )\r
+       weight 431 26 0.8471531272 ( 12.5416574478 -6.5577421188 0.3419458866 )\r
+       weight 432 27 0.1528468728 ( -2.9744410515 1.8531388044 5.1779007912 )\r
+       weight 433 27 1 ( 3.0416584015 -1.821320653 4.9780259132 )\r
+       weight 434 27 1 ( 10.260307312 0.6809681654 5.6612505913 )\r
+       weight 435 27 1 ( 10.2370090485 -1.2293320894 6.3164758682 )\r
+       weight 436 27 1 ( 13.1780834198 1.8282145262 5.0887756348 )\r
+       weight 437 27 0.8000000119 ( 16.0200710297 1.6692656279 5.5842633247 )\r
+       weight 438 29 0.200000003 ( -0.0930952653 2.5318601131 -0.2228548378 )\r
+       weight 439 27 0.8000000119 ( 14.7296829224 -1.5154963732 8.7642879486 )\r
+       weight 440 29 0.200000003 ( -1.3834834099 -0.6529016495 2.957170248 )\r
+       weight 441 27 0.8000000119 ( 14.6001577377 0.3789156675 8.2367258072 )\r
+       weight 442 29 0.200000003 ( -1.5130090714 1.2415103912 2.4296078682 )\r
+       weight 443 27 0.8000000119 ( 15.822145462 -3.509557724 5.7821383476 )\r
+       weight 444 29 0.200000003 ( -0.2910209 -2.6469633579 -0.0249796379 )\r
+       weight 445 27 0.8000000119 ( 16.4721088409 0.8593052626 5.0787506104 )\r
+       weight 446 29 0.200000003 ( 0.3589415848 1.7218997478 -0.7283673286 )\r
+       weight 447 27 0.8000000119 ( 15.7450723648 1.2292546034 6.8492631912 )\r
+       weight 448 29 0.200000003 ( -0.3680944145 2.0918493271 1.0421452522 )\r
+       weight 449 27 0.8000000119 ( 14.5249347687 1.2920159101 8.4334011078 )\r
+       weight 450 29 0.200000003 ( -1.5882325172 2.1546106339 2.626282692 )\r
+       weight 451 29 0.4070542455 ( 5.0816273689 0.1709345877 4.2100324631 )\r
+       weight 452 30 0.5929456949 ( 1.2635183334 0.468313098 -0.1211783439 )\r
+       weight 453 29 0.4839746654 ( 4.3259549141 1.6827230453 4.110045433 )\r
+       weight 454 38 0.5160253644 ( -0.6275441647 0.0541600026 0.5750962496 )\r
+       weight 455 29 0.3788121641 ( 5.7887434959 0.7864741087 2.4668827057 )\r
+       weight 456 35 0.2423756868 ( -0.3373393714 -0.2110615671 1.9789270163 )\r
+       weight 457 38 0.3788121641 ( 1.3953293562 -0.8420889378 -0.2896093726 )\r
+       weight 458 29 0.5059761405 ( 4.8151803017 2.0418097973 2.6971452236 )\r
+       weight 459 38 0.4940238595 ( 0.4163054228 0.4132469296 -0.4954203367 )\r
+       weight 460 29 0.347406745 ( 4.5010304451 -0.6801147461 5.3347578049 )\r
+       weight 461 30 0.652593255 ( 0.6829214096 -0.3827362955 1.0035467148 )\r
+       weight 462 29 0.2958801687 ( 3.1947779655 -0.0613517985 5.4035077095 )\r
+       weight 463 30 0.7041198611 ( -0.6233310699 0.2360266745 1.0722967386 )\r
+       weight 464 30 0.4914405942 ( 0.4258823693 1.7741270065 3.3497092724 )\r
+       weight 465 31 0.5085594058 ( -0.556268692 -0.5172091722 0.7858490944 )\r
+       weight 466 30 0.4820699394 ( 1.555480957 0.9905404449 2.8935966492 )\r
+       weight 467 31 0.5179300904 ( 0.5733298659 -1.3007956743 0.329736501 )\r
+       weight 468 30 0.4973025024 ( 1.9983100891 2.0059509277 2.0425965786 )\r
+       weight 469 31 0.5026975274 ( 1.0161590576 -0.2853853106 -0.5212634802 )\r
+       weight 470 30 0.5 ( 0.9011078477 2.8638381958 2.436434269 )\r
+       weight 471 31 0.5 ( -0.081043236 0.5725019574 -0.1274258047 )\r
+       weight 472 29 0.2015999556 ( 3.8339543343 1.0561876297 4.4525203705 )\r
+       weight 473 30 0.7984000444 ( 0.0158453193 1.3535660505 0.1213091239 )\r
+       weight 474 31 0.4876291156 ( 1.8732690811 -0.8008366823 1.788173914 )\r
+       weight 475 32 0.5123708844 ( 0.1647424549 -1.0299779177 -0.0254052598 )\r
+       weight 476 31 0.4792023897 ( 2.3079681396 0.3318518102 0.8788865805 )\r
+       weight 477 32 0.5207976103 ( 0.5994415283 0.1027105376 -0.9346926212 )\r
+       weight 478 31 0.4995842576 ( 1.4699172974 0.122515589 2.827786684 )\r
+       weight 479 32 0.5004157424 ( -0.238609314 -0.1066256762 1.0142076015 )\r
+       weight 480 29 0.4201823771 ( 5.3639435768 2.1206595898 1.801632762 )\r
+       weight 481 35 0.5798176527 ( -0.4387514293 1.1231240034 1.1961575747 )\r
+       weight 482 29 0.4792615175 ( 5.9826922417 0.663159132 -0.8933672309 )\r
+       weight 483 35 0.5207384825 ( 1.2677747011 -0.334376514 -0.9795361757 )\r
+       weight 484 29 0.4503417313 ( 2.9747796059 -1.8901128769 4.5785079002 )\r
+       weight 485 42 0.1218775883 ( 2.3283843994 2.4171648026 3.6410861015 )\r
+       weight 486 30 0.4277806878 ( -0.8433294296 -1.5927344561 0.2472967356 )\r
+       weight 487 29 0.4771116972 ( 1.6685295105 -1.271364212 4.6472454071 )\r
+       weight 488 42 0.2373011559 ( 0.9531123042 2.4964613914 3.198138237 )\r
+       weight 489 30 0.2855871022 ( -2.149579525 -0.9739857316 0.3160342872 )\r
+       weight 490 29 0.6421558261 ( 2.1876907349 -1.8393537998 0.1103827879 )\r
+       weight 491 42 0.3578441739 ( 2.8390617371 -0.1063229069 -0.0948802829 )\r
+       weight 492 29 0.0663180426 ( 3.1474423409 -2.7581284046 3.7301204205 )\r
+       weight 493 42 0.223845154 ( 2.9185607433 1.3559621572 3.4720754623 )\r
+       weight 494 43 0.6402391195 ( 1.297232151 1.2666068077 0.3610831797 )\r
+       weight 495 44 0.0695976689 ( -1.0377397537 1.2914401293 -1.8396235704 )\r
+       weight 496 29 0.4919970334 ( 6.1503052711 -0.671441257 -0.145379737 )\r
+       weight 497 35 0.5080029368 ( 1.1012363434 -1.6689770222 -0.2313086838 )\r
+       weight 498 29 0.3513863683 ( 5.2712655067 -0.5716248751 2.028670311 )\r
+       weight 499 35 0.3490789533 ( -0.61921525 -1.5691604614 1.3621940613 )\r
+       weight 500 38 0.1619547904 ( 1.1134536266 -2.2001879215 -0.9063423872 )\r
+       weight 501 30 0.1375798434 ( 1.4531564713 -0.2742463946 -2.3025407791 )\r
+       weight 502 29 0.5 ( 4.2793536186 -1.4587659836 3.9368076324 )\r
+       weight 503 30 0.5 ( 0.4612445831 -1.1613875628 -0.3944033086 )\r
+       weight 504 32 0.5 ( 3.3421039581 -0.8488274813 0.7218825817 )\r
+       weight 505 33 0.5 ( 0.2053165287 -0.8160973787 -0.1092594638 )\r
+       weight 506 32 0.6568899751 ( 2.2878932953 -0.3796006739 1.583070159 )\r
+       weight 507 33 0.3431100249 ( -0.8488941193 -0.3468705416 0.751928091 )\r
+       weight 508 32 0.7460076213 ( 2.6346921921 0.5240009427 0.8576822281 )\r
+       weight 509 33 0.2539923191 ( -0.5020952225 0.5567311049 0.0265401453 )\r
+       weight 510 36 0.5 ( 2.0928714275 -0.787088573 2.395442009 )\r
+       weight 511 37 0.5 ( 0.4112956226 0.7069758177 0.2699961066 )\r
+       weight 512 36 0.5 ( 1.191590786 -0.4158374071 3.2783920765 )\r
+       weight 513 37 0.5 ( -0.4899850786 1.0782269239 1.1529459953 )\r
+       weight 514 35 0.2074988335 ( 4.1960978508 1.5768725872 3.3598520756 )\r
+       weight 515 36 0.7925011516 ( 0.8510862589 0.3679111898 0.9000496864 )\r
+       weight 516 36 0.5 ( 1.7090237141 -1.7702124119 3.3089315891 )\r
+       weight 517 37 0.5 ( 0.0274478719 -0.2761479616 1.1834857464 )\r
+       weight 518 35 1 ( 3.0462133884 0.9595497847 2.3366894722 )\r
+       weight 519 36 0.8959507942 ( 0.6565356255 -1.2903997898 1.7773758173 )\r
+       weight 520 37 0.1040491909 ( -1.0250402689 0.2036646754 -0.3480701149 )\r
+       weight 521 35 0.2160084844 ( 2.9392633438 0.8343752623 4.5466547012 )\r
+       weight 522 36 0.6350401044 ( -0.4057483673 -0.3745862246 2.0868523121 )\r
+       weight 523 37 0.1489514261 ( -2.0873241425 1.1194781065 -0.0385936573 )\r
+       weight 524 35 0.5389071703 ( 1.9143278599 0.7931240797 3.6242077351 )\r
+       weight 525 36 0.4610928297 ( -1.4306836128 -0.4158374071 1.1644053459 )\r
+       weight 526 36 0.50370121 ( 0.7071566582 -2.4041483402 2.0898520947 )\r
+       weight 527 37 0.49629879 ( -0.9744191766 -0.91008389 -0.0355939865 )\r
+       weight 528 36 0.7817896605 ( 1.1481140852 -1.8128845692 1.2487909794 )\r
+       weight 529 37 0.2182103097 ( -0.5334618092 -0.3188201487 -0.8766549826 )\r
+       weight 530 35 0.4311522841 ( 4.0681786537 0.1606233418 1.8867099285 )\r
+       weight 531 36 0.5688476563 ( 0.7231671214 -1.0483381748 -0.573092401 )\r
+       weight 532 35 0.6388587952 ( 2.6311872005 0.2431257665 2.7457211018 )\r
+       weight 533 36 0.361141175 ( -0.7138245106 -0.9658356905 0.2859187126 )\r
+       weight 534 35 0.5118147135 ( 3.4270551205 -0.829362154 1.8284094334 )\r
+       weight 535 36 0.4201770723 ( 0.0820436403 -2.0383236408 -0.6313930154 )\r
+       weight 536 37 0.0680082068 ( -1.5995322466 -0.5442591906 -2.7568390369 )\r
+       weight 537 63 0.4804960489 ( -2.9213833809 2.8258795738 1.8977241516 )\r
+       weight 538 64 0.5195039511 ( -0.588047564 -0.5046357512 0.7182685733 )\r
+       weight 539 63 0.465957731 ( -3.0091021061 3.2149977684 0.5589788556 )\r
+       weight 540 64 0.5340422988 ( -0.6757662296 -0.1155175641 -0.6204766631 )\r
+       weight 541 64 0.5538153648 ( -2.2936551571 1.874404192 -0.2026361227 )\r
+       weight 542 65 0.446184665 ( -0.1671712995 -0.3230467737 -0.9087409377 )\r
+       weight 543 64 0.5162335634 ( -2.4363567829 1.3369954824 1.2078951597 )\r
+       weight 544 65 0.4837664366 ( -0.3098728359 -0.860455513 0.5017904043 )\r
+       weight 545 64 0.5 ( -1.823032856 2.2833793163 1.7142357826 )\r
+       weight 546 65 0.5 ( 0.3034510016 0.0859282538 1.008130908 )\r
+       weight 547 64 0.5 ( -1.673936367 2.8449342251 0.24031353 )\r
+       weight 548 65 0.5 ( 0.4525475204 0.6474831104 -0.4657912552 )\r
+       weight 549 65 0.5 ( -3.5347781181 0.5211555362 0.0948775038 )\r
+       weight 550 66 0.5 ( -0.0295017865 -0.0096685458 -0.15053913 )\r
+       weight 551 65 0.7818934917 ( -2.3798279762 0.9922417402 1.0134284496 )\r
+       weight 552 66 0.2181065679 ( 1.1254482269 0.4614176154 0.7680118084 )\r
+       weight 553 65 0.7930441499 ( -2.2591664791 1.4466814995 -0.1793385297 )\r
+       weight 554 66 0.2069558203 ( 1.2461098433 0.9158573151 -0.424755156 )\r
+       weight 555 60 0.1971554756 ( -3.1909976006 3.9894371033 1.8950116634 )\r
+       weight 556 61 0.690261066 ( -1.2421532869 1.7806715965 1.517881155 )\r
+       weight 557 62 0.1125834435 ( 2.767885685 1.1017738581 0.6415585876 )\r
+       weight 558 60 0.5 ( -1.3233346939 3.0896756649 1.5547190905 )\r
+       weight 559 61 0.5 ( 0.6255095601 0.8809099197 1.177588582 )\r
+       weight 560 63 0.5076596141 ( -1.5867857933 3.3710412979 2.0379889011 )\r
+       weight 561 64 0.4923403859 ( 0.746549964 0.0405263379 0.8585333824 )\r
+       weight 562 63 0.5134094357 ( -1.6809191704 3.7886562347 0.6012696028 )\r
+       weight 563 64 0.4865905643 ( 0.6524164677 0.4581411183 -0.5781859159 )\r
+       weight 564 56 0.5 ( -0.51122576 2.7684140205 1.5330371857 )\r
+       weight 565 57 0.5 ( 0.2276019901 1.0549412966 -0.5511373878 )\r
+       weight 566 52 1 ( -15.5043010712 2.1040418148 7.0040979385 )\r
+       weight 567 50 0.3212496042 ( -7.5528998375 1.381247282 -0.8460896611 )\r
+       weight 568 51 0.6787503362 ( -3.3194613457 -1.2677471638 3.0065481663 )\r
+       weight 569 50 0.2573358119 ( -7.5905752182 0.4257848561 -1.0995396376 )\r
+       weight 570 51 0.7426642179 ( -3.3571367264 -2.2232096195 2.753098011 )\r
+       weight 571 51 1 ( -6.7522363663 -3.3724589348 0.1993106306 )\r
+       weight 572 24 0.0804704204 ( -8.6104621887 4.2860050201 4.921807766 )\r
+       weight 573 50 0.2791217268 ( -7.2533626556 -0.9062407017 -0.8513271213 )\r
+       weight 574 51 0.6404078603 ( -3.0199241638 -3.5552353859 3.0013105869 )\r
+       weight 575 24 0.1006708071 ( -8.1202754974 5.5577201843 5.6395573616 )\r
+       weight 576 50 0.3974681795 ( -6.7631750107 0.3654744923 -0.1335771382 )\r
+       weight 577 51 0.5018610358 ( -2.5297367573 -2.2835199833 3.7190606594 )\r
+       weight 578 51 1 ( -4.9449248314 -3.417734623 0.0450606644 )\r
+       weight 579 51 1 ( -5.302423954 -4.6002335548 0.512560606 )\r
+       weight 580 21 0.2623895109 ( -8.1743001938 8.2897758484 6.2597084045 )\r
+       weight 581 24 0.0705087855 ( -8.1743001938 1.3824957609 4.8190202713 )\r
+       weight 582 51 0.4052641094 ( -2.583761692 -6.4587445259 2.8985230923 )\r
+       weight 583 23 0.2618375123 ( -3.0685067177 2.9366874695 -3.454376936 )\r
+       weight 584 51 1 ( -4.4497113228 -5.5219979286 0.2317981422 )\r
+       weight 585 24 0.6289612055 ( 0 3.3605308533 5.631632328 )\r
+       weight 586 25 0.1855207086 ( -1.357098937 -1.8317072392 -0.1415015757 )\r
+       weight 587 50 0.1855180115 ( 1.3571000099 -1.8317148685 -0.1415021718 )\r
+       weight 588 24 0.2653520405 ( 0 5.9862060547 5.5093574524 )\r
+       weight 589 47 0.2039463222 ( 0 -4.4939656258 0.4555847645 )\r
+       weight 590 25 0.2653495669 ( -1.357098937 0.7939679623 -0.2637764812 )\r
+       weight 591 50 0.2653520405 ( 1.3571000099 0.7939603329 -0.2637770772 )\r
+       weight 592 46 0.150000006 ( 0 -0.2269566059 4.3573498726 )\r
+       weight 593 48 0.8500000238 ( 0 -4.4656119347 -0.3936624527 )\r
+       weight 594 24 0.8235675097 ( 0 4.1987056732 4.8218574524 )\r
+       weight 595 25 0.0882167742 ( -1.357098937 -0.9935324192 -0.9512765408 )\r
+       weight 596 50 0.0882156938 ( 1.3571000099 -0.9935400486 -0.9512771368 )\r
+       weight 597 24 0.4192993045 ( 0 1.734520793 7.0116825104 )\r
+       weight 598 25 0.2903516591 ( -1.357098937 -3.4577174187 1.2385486364 )\r
+       weight 599 50 0.2903490961 ( 1.3571000099 -3.4577248096 1.2385480404 )\r
+       weight 600 48 1 ( 0 -5.7413749695 1.8165999651 )\r
+       weight 601 50 0.6327644587 ( -4.6123247147 1.4814593792 -2.6700270176 )\r
+       weight 602 51 0.3672355711 ( -0.3788864613 -1.1675350666 1.182610631 )\r
+       weight 603 21 0.062998414 ( -1.3854250908 9.0623855591 8.7352457047 )\r
+       weight 604 24 0.4281026125 ( -1.3854250908 2.1551055908 7.2945575714 )\r
+       weight 605 25 0.1365017444 ( -2.742524147 -3.03713274 1.5214235783 )\r
+       weight 606 50 0.3723973036 ( -0.0283250213 -3.037140131 1.5214229822 )\r
+       weight 607 24 0.2114852369 ( -2.7388124466 3.7096567154 6.1604952812 )\r
+       weight 608 50 0.6091372967 ( -1.3817125559 -1.4825890064 0.3873604536 )\r
+       weight 609 51 0.1793774813 ( 2.8517258167 -4.1315836906 4.2399983406 )\r
+       weight 610 24 0.0918184072 ( -4.8694248199 4.5424575806 4.4093575478 )\r
+       weight 611 50 0.7616632581 ( -3.5123250484 -0.6497881413 -1.3637771606 )\r
+       weight 612 51 0.1465183645 ( 0.7211133838 -3.2987828255 2.4888606071 )\r
+       weight 613 47 0.1558059454 ( -2.587887764 -3.8667769432 0.1955346763 )\r
+       weight 614 50 0.8441940546 ( -1.2307876348 1.4211490154 -0.5238271356 )\r
+       weight 615 24 0.1363941282 ( -1.4319250584 6.3986940384 4.4781074524 )\r
+       weight 616 47 0.1038375199 ( -1.4319250584 -4.0814776421 -0.5756652951 )\r
+       weight 617 50 0.7597683668 ( -0.0748249888 1.2064483166 -1.2950271368 )\r
+       weight 618 24 0.4579410255 ( -0.7769999504 4.4697446823 7.2913827896 )\r
+       weight 619 25 0.0841179937 ( -2.1340990067 -0.7224934101 1.5182484388 )\r
+       weight 620 50 0.4579410255 ( 0.5801000595 -0.7225010395 1.5182478428 )\r
+       weight 621 48 1 ( -1.5358998775 -5.3192644119 1.3113377094 )\r
+       weight 622 25 0.6327667832 ( 4.6123261452 1.4814670086 -2.6700265408 )\r
+       weight 623 26 0.3672332466 ( 0.378882885 -1.1676037312 1.182608366 )\r
+       weight 624 21 0.0560914427 ( 1.3854250908 9.0623855591 8.7352457047 )\r
+       weight 625 24 0.4312586784 ( 1.3854250908 2.1551055908 7.2945575714 )\r
+       weight 626 25 0.375143677 ( 0.0283260643 -3.03713274 1.5214235783 )\r
+       weight 627 50 0.1375061721 ( 2.7425251007 -3.037140131 1.5214229822 )\r
+       weight 628 24 0.5243620872 ( 2.7388124466 3.7096567154 6.1604952812 )\r
+       weight 629 25 0.4756379426 ( 1.3817136288 -1.482581377 0.3873610497 )\r
+       weight 630 24 0.1460785866 ( 4.8694248199 4.5424575806 4.4093575478 )\r
+       weight 631 25 0.7615744472 ( 3.5123257637 -0.6497805119 -1.3637765646 )\r
+       weight 632 26 0.0923469812 ( -0.72111696 -3.2988512516 2.4888584614 )\r
+       weight 633 47 0.1558056474 ( 2.587887764 -3.8667769432 0.1955346763 )\r
+       weight 634 25 0.844194293 ( 1.2307887077 1.4211566448 -0.5238265395 )\r
+       weight 635 24 0.136391148 ( 1.4319250584 6.3986940384 4.4781074524 )\r
+       weight 636 47 0.1038374901 ( 1.4319250584 -4.0814776421 -0.5756652951 )\r
+       weight 637 25 0.759771347 ( 0.0748260319 1.206455946 -1.2950265408 )\r
+       weight 638 24 0.4579415023 ( 0.7769999504 4.4697446823 7.2913827896 )\r
+       weight 639 25 0.4579415023 ( -0.5800989866 -0.7224934101 1.5182484388 )\r
+       weight 640 50 0.0841169953 ( 2.1340999603 -0.7225010395 1.5182478428 )\r
+       weight 641 48 1 ( 1.5358998775 -5.3192644119 1.3113377094 )\r
+       weight 642 25 0.3212469816 ( 7.5529007912 1.3812549114 -0.8460890651 )\r
+       weight 643 26 0.6787530184 ( 3.3194577694 -1.2678158283 3.0065457821 )\r
+       weight 644 25 0.2573338151 ( 7.5905761719 0.4257924855 -1.0995390415 )\r
+       weight 645 26 0.7426661849 ( 3.3571333885 -2.2232782841 2.7530958652 )\r
+       weight 646 26 1 ( 6.7522330284 -3.3725273609 0.1993083954 )\r
+       weight 647 21 0.4213606715 ( 8.6104621887 11.1932849884 6.3624958992 )\r
+       weight 648 25 0.1756447554 ( 7.2533636093 -0.9062330723 -0.8513265252 )\r
+       weight 649 26 0.4029945433 ( 3.0199205875 -3.555303812 3.0013084412 )\r
+       weight 650 24 0.1006716043 ( 8.1202754974 5.5577201843 5.6395573616 )\r
+       weight 651 25 0.3974677324 ( 6.7631764412 0.3654821217 -0.1335765421 )\r
+       weight 652 26 0.5018606782 ( 2.529733181 -2.2835886478 3.7190582752 )\r
+       weight 653 26 1 ( 4.9449210167 -3.4178030491 0.0450584292 )\r
+       weight 654 21 0.1540683657 ( 10.8929624557 10.1482868195 3.8737459183 )\r
+       weight 655 26 0.8459316492 ( 5.3024201393 -4.6003017426 0.5125584006 )\r
+       weight 656 21 0.3154204786 ( 8.1743001938 8.2897758484 6.2597084045 )\r
+       weight 657 24 0.0671664178 ( 8.1743001938 1.3824957609 4.8190202713 )\r
+       weight 658 26 0.3039355278 ( 2.5837583542 -6.4588127136 2.8985209465 )\r
+       weight 659 22 0.3134775758 ( 2.6412677765 2.797618866 -3.454376936 )\r
+       weight 660 21 0.1591278017 ( 10.0402498245 9.2265224457 3.5929834843 )\r
+       weight 661 26 0.8408722281 ( 4.4497079849 -5.5220661163 0.231795907 )\r
+       weight 662 27 0.8000000119 ( 15.504283905 2.1041030884 7.0041007996 )\r
+       weight 663 29 0.200000003 ( -0.6088828444 2.9666974545 1.1969827414 )\r
+       weight 664 38 0.5 ( 0.9417665601 2.3623857498 3.1196968555 )\r
+       weight 665 39 0.5 ( -0.7640467882 0.2796829641 0.4568932056 )\r
+       weight 666 38 0.5 ( 1.9410784245 2.8106842041 2.0960612297 )\r
+       weight 667 39 0.5 ( 0.2352650762 0.7279813886 -0.5667425394 )\r
+       weight 668 31 0.4807309508 ( 1.9241571426 1.3061159849 1.8776369095 )\r
+       weight 669 32 0.5192690492 ( 0.2156305462 1.0769747496 0.064057678 )\r
+       weight 670 38 0.4241735041 ( 1.877091527 1.3157997131 3.4772601128 )\r
+       weight 671 39 0.5758265257 ( 0.1712781489 -0.7669031024 0.8144565225 )\r
+       weight 672 38 0.4112786055 ( 2.8082549572 1.7335088253 2.5234260559 )\r
+       weight 673 39 0.5887213945 ( 1.1024416685 -0.3491937816 -0.1393777281 )\r
+       weight 674 39 0.4625679255 ( 1.9046292305 0.0741327479 2.6408572197 )\r
+       weight 675 40 0.5374320745 ( -0.1064162031 -1.0044653416 0.3605245948 )\r
+       weight 676 39 0.4925095141 ( 2.7444911003 0.7288587093 1.5616278648 )\r
+       weight 677 40 0.5074904561 ( 0.7334458828 -0.3497393131 -0.7187047601 )\r
+       weight 678 39 0.4999943078 ( 1.4489982128 1.1488713026 3.0477068424 )\r
+       weight 679 40 0.500005722 ( -0.5620471835 0.0702732354 0.7673742175 )\r
+       weight 680 39 0.5 ( 2.3266167641 1.8330085278 1.9199826717 )\r
+       weight 681 40 0.5 ( 0.3155714869 0.7544105649 -0.3603499532 )\r
+       weight 682 40 0.5 ( 3.040106535 -1.0923893452 1.9624311924 )\r
+       weight 683 41 0.5 ( 0.5019233227 -0.4771701992 0.0334265046 )\r
+       weight 684 40 0.6190677881 ( 1.7891420126 -0.2490551025 2.3137755394 )\r
+       weight 685 41 0.3809322715 ( -0.7490411997 0.3661640286 0.3847707808 )\r
+       weight 686 40 0.6329517961 ( 2.4993488789 0.3045861721 1.4011665583 )\r
+       weight 687 41 0.3670482337 ( -0.038834326 0.9198052883 -0.5278382301 )\r
+       weight 688 35 0.3712126315 ( 3.1543228626 1.879373312 4.2831096649 )\r
+       weight 689 36 0.550209105 ( -0.1906888336 0.6704119444 1.8233070374 )\r
+       weight 690 37 0.0785782039 ( -1.8722647429 2.1644763947 -0.3021389246 )\r
+       weight 691 35 0.6203890443 ( 1.763201952 2.0443735123 2.7175130844 )\r
+       weight 692 36 0.3796109259 ( -1.5818096399 0.8354119062 0.2577106655 )\r
+       weight 693 50 0.0883802846 ( -10.8129873276 2.314589262 -3.0148646832 )\r
+       weight 694 51 0.9116197228 ( -6.5795488358 -0.3344051838 0.8377730846 )\r
+       weight 695 50 0.2916485369 ( -8.4479999542 3.6483314037 -2.4098646641 )\r
+       weight 696 51 0.7083514929 ( -4.2145614624 0.9993368983 1.4427731037 )\r
+       weight 697 47 1 ( 0 2.3202710152 7.8124594688 )\r
+       weight 698 47 1 ( 0 0.8872324824 7.7641220093 )\r
+       weight 699 48 1 ( 0 -3.9435706139 3.2441627979 )\r
+       weight 700 47 1 ( 0 -2.0042128563 6.2143592834 )\r
+       weight 701 47 1 ( 0 -0.8316987157 6.7518596649 )\r
+       weight 702 47 1 ( 0 0.4436880946 8.2173595428 )\r
+       weight 703 48 1 ( 0 -3.3677134514 3.9039373398 )\r
+       weight 704 47 1 ( 0 0.2909762263 4.943584919 )\r
+       weight 705 47 1 ( 0 -0.6840413213 6.7435851097 )\r
+       weight 706 48 1 ( 0 -3.9835963249 2.9953999519 )\r
+       weight 707 48 1 ( 0 -3.4335837364 1.695400238 )\r
+       weight 708 47 1 ( 0 -0.6145184636 3.3419597149 )\r
+       weight 709 50 0.9445517063 ( -2.5498249531 2.7877070904 -1.6387771368 )\r
+       weight 710 51 0.0554482937 ( 1.6836133003 0.1387126297 2.2138605118 )\r
+       weight 711 50 0.7114670873 ( -2.1863875389 2.9564025402 -3.8483772278 )\r
+       weight 712 51 0.2885329127 ( 2.0470509529 0.3074080646 0.00426054 )\r
+       weight 713 47 1 ( -2.8920249939 1.337261796 -0.9684528112 )\r
+       weight 714 47 1 ( -3.4319248199 -1.4992135763 1.3325097561 )\r
+       weight 715 47 1 ( -2.7037250996 -2.2827143669 0.806984663 )\r
+       weight 716 47 1 ( -0.7795625329 1.8288332224 8.0242977142 )\r
+       weight 717 47 0.8999999762 ( -2.9840373993 0.4502016902 6.278734684 )\r
+       weight 718 48 0.1000000015 ( -2.9840373993 -0.4813702703 4.0196752548 )\r
+       weight 719 47 0.8000000119 ( -3.5864248276 0.4557139277 3.9103348255 )\r
+       weight 720 48 0.200000003 ( -3.5864248276 -0.4758580327 1.6512751579 )\r
+       weight 721 47 1 ( -3.0743000507 2.240334034 6.1703224182 )\r
+       weight 722 48 1 ( -0.8532249928 -3.6822543144 3.0003750324 )\r
+       weight 723 47 1 ( -0.8000124693 0.4426867366 7.6177220345 )\r
+       weight 724 47 1 ( -0.7419250011 -1.1249248981 6.4988970757 )\r
+       weight 725 47 1 ( -1.5668749809 -1.0340397358 5.7935848236 )\r
+       weight 726 48 1 ( -1.6758500338 -2.8835902214 2.695400238 )\r
+       weight 727 47 1 ( -1.3132125139 1.8324095011 -3.0736904144 )\r
+       weight 728 47 1 ( -0.7419250011 -2.0124239922 6.0988969803 )\r
+       weight 729 47 1 ( -1.3418750763 -1.8090432882 5.3310847282 )\r
+       weight 730 47 1 ( -1.5668749809 -0.359038651 4.9185848236 )\r
+       weight 731 48 1 ( -0.8532249928 -3.1328616142 3.6610002518 )\r
+       weight 732 48 1 ( -1.5258500576 -2.5582633018 2.9858498573 )\r
+       weight 733 47 1 ( -1.5258500576 -1.17669034 4.4449095726 )\r
+       weight 734 47 1 ( -1.5668749809 -0.0590317845 4.1185846329 )\r
+       weight 735 47 1 ( -1.6758500338 -0.977019608 3.0544598103 )\r
+       weight 736 25 0.9445561171 ( 2.5498261452 2.7877144814 -1.6387765408 )\r
+       weight 737 26 0.0554438978 ( -1.6836168766 0.1386439651 2.213858366 )\r
+       weight 738 25 1 ( 2.1863884926 2.9564099312 -3.8483765125 )\r
+       weight 739 47 1 ( 3.4319248199 -1.4992135763 1.3325097561 )\r
+       weight 740 47 1 ( 2.8920249939 1.337261796 -0.9684528112 )\r
+       weight 741 47 1 ( 2.7037250996 -2.2827143669 0.806984663 )\r
+       weight 742 47 1 ( 0.7795625329 1.8288332224 8.0242977142 )\r
+       weight 743 47 0.8999999762 ( 2.9840373993 0.4502016902 6.278734684 )\r
+       weight 744 48 0.1000000015 ( 2.9840373993 -0.4813702703 4.0196752548 )\r
+       weight 745 47 1 ( 3.0743000507 2.240334034 6.1703224182 )\r
+       weight 746 47 0.8000000119 ( 3.5864248276 0.4557139277 3.9103348255 )\r
+       weight 747 48 0.200000003 ( 3.5864248276 -0.4758580327 1.6512751579 )\r
+       weight 748 48 1 ( 0.8532249928 -3.6822543144 3.0003750324 )\r
+       weight 749 47 1 ( 0.8000124693 0.4426867366 7.6177220345 )\r
+       weight 750 47 1 ( 0.7419250011 -1.1249248981 6.4988970757 )\r
+       weight 751 47 1 ( 1.5668749809 -1.0340397358 5.7935848236 )\r
+       weight 752 48 1 ( 1.6758500338 -2.8835902214 2.695400238 )\r
+       weight 753 47 1 ( 1.3132125139 1.8324095011 -3.0736904144 )\r
+       weight 754 47 1 ( 0.7419250011 -2.0124239922 6.0988969803 )\r
+       weight 755 47 1 ( 1.3418750763 -1.8090432882 5.3310847282 )\r
+       weight 756 47 1 ( 1.5668749809 -0.359038651 4.9185848236 )\r
+       weight 757 48 1 ( 0.8532249928 -3.1328616142 3.6610002518 )\r
+       weight 758 48 1 ( 1.5258500576 -2.5582633018 2.9858498573 )\r
+       weight 759 47 1 ( 1.5258500576 -1.17669034 4.4449095726 )\r
+       weight 760 47 1 ( 1.6758500338 -0.977019608 3.0544598103 )\r
+       weight 761 47 1 ( 1.5668749809 -0.0590317845 4.1185846329 )\r
+       weight 762 25 0.0883786827 ( 10.8129882813 2.3145968914 -3.0148639679 )\r
+       weight 763 26 0.9116213322 ( 6.5795450211 -0.3344738781 0.8377708793 )\r
+       weight 764 25 0.2916448414 ( 8.4480009079 3.6483387947 -2.4098639488 )\r
+       weight 765 26 0.7083551288 ( 4.2145581245 0.9992682934 1.4427708387 )\r
+       weight 766 47 1 ( 0 7.6300435066 5.4676346779 )\r
+       weight 767 47 1 ( 0 8.2345685959 1.537022233 )\r
+       weight 768 47 1 ( 0 5.2705674171 7.8135347366 )\r
+       weight 769 47 1 ( 0 7.2720627785 -2.0379776955 )\r
+       weight 770 47 1 ( -3.1431498528 5.5902867317 5.392660141 )\r
+       weight 771 47 1 ( -3.3329999447 7.2662262917 1.2024096251 )\r
+       weight 772 47 1 ( -1.9900125265 2.6769070625 7.5505223274 )\r
+       weight 773 47 1 ( -3.3467502594 6.1783699989 -2.2641026974 )\r
+       weight 774 47 1 ( 3.1431498528 5.5902867317 5.392660141 )\r
+       weight 775 47 1 ( 3.3329999447 7.2662262917 1.2024096251 )\r
+       weight 776 47 1 ( 1.9900125265 2.6769070625 7.5505223274 )\r
+       weight 777 47 1 ( 3.3467502594 6.1783699989 -2.2641026974 )\r
+       weight 778 12 0.2563629746 ( 33.0398216248 3.9326167107 3.2865693569 )\r
+       weight 779 13 0.3614273369 ( 5.3008437157 -7.6376085281 -1.1414731741 )\r
+       weight 780 14 0.243688643 ( -8.0842981339 -4.1430191994 -2.7326040268 )\r
+       weight 781 15 0.0622054599 ( -11.7274675369 -6.1995387077 1.4633332491 )\r
+       weight 782 17 0.076315634 ( -12.14158535 -3.3198654652 1.5372794867 )\r
+       weight 783 12 0.2469138503 ( 33.4638900757 4.0751185417 -0.9710928798 )\r
+       weight 784 13 0.3727410734 ( 4.388001442 -7.4342656136 3.0362296104 )\r
+       weight 785 14 0.2544984818 ( -5.2937240601 -7.1971740723 -1.6313937902 )\r
+       weight 786 15 0.0715020001 ( -12.284954071 -2.0027599335 0.8276562691 )\r
+       weight 787 17 0.0543446392 ( -13.3087902069 0.7497013807 0.9016023874 )\r
+       weight 788 12 0.461424619 ( 28.4237709045 1.8707973957 3.1209115982 )\r
+       weight 789 13 0.4821410775 ( 2.0102367401 -4.0104074478 -2.4070935249 )\r
+       weight 790 14 0.0564343035 ( -8.1523790359 -2.0404076576 1.8674902916 )\r
+       weight 791 4 0.2059161365 ( 32.97889328 5.3328409195 -2.2511792183 )\r
+       weight 792 5 0.3872070313 ( 4.0783443451 -7.4809956551 2.5308735371 )\r
+       weight 793 6 0.282189697 ( -3.7736308575 -7.0362429619 -1.9334219694 )\r
+       weight 794 7 0.0708162263 ( -11.5240097046 0.0249091741 1.3836282492 )\r
+       weight 795 9 0.0538709164 ( -11.9716377258 3.0223984718 1.4157617092 )\r
+       weight 796 4 0.1954126805 ( 33.2664337158 4.9352502823 2.0017166138 )\r
+       weight 797 5 0.3839006722 ( 4.8968849182 -7.05560112 -1.6496655941 )\r
+       weight 798 6 0.2782916129 ( -6.7500119209 -3.9712131023 -1.660249114 )\r
+       weight 799 7 0.0603468344 ( -10.9543218613 -4.1511259079 0.6325853467 )\r
+       weight 800 9 0.0820481181 ( -10.7954072952 -1.02485919 0.6647187471 )\r
+       weight 801 4 0.4696669579 ( 27.9249668121 2.9757020473 -1.5506597757 )\r
+       weight 802 5 0.5303330421 ( 0.5289005041 -3.2067444324 1.6816196442 )\r
+       weight 803 12 0.4995803833 ( 27.4030590057 1.0917562246 -4.1636161804 )\r
+       weight 804 13 0.5004196167 ( -0.6842263937 -2.0736737251 4.2036581039 )\r
+       weight 805 12 0.2888435721 ( 28.2362918854 -1.8141095638 -3.2144472599 )\r
+       weight 806 13 0.7111564279 ( 1.445081234 0.1874292791 3.576987505 )\r
+       weight 807 12 0.5639333129 ( 25.0300426483 -2.4374024868 -1.934784174 )\r
+       weight 808 13 0.4360666871 ( -0.75131464 1.8001717329 1.3676960468 )\r
+       weight 809 12 0.5 ( 27.3999042511 4.152566433 0.2964366376 )\r
+       weight 810 13 0.5 ( -0.5854756832 -5.4091472626 -0.053748183 )\r
+       weight 811 12 0.5 ( 26.4205570221 2.5024900436 -2.7500724792 )\r
+       weight 812 13 0.5 ( -1.6830064058 -3.1740114689 2.5467689037 )\r
+       weight 813 12 1 ( 23.7825508118 0.7723487616 -3.2343652248 )\r
+       weight 814 12 0.5658426881 ( 25.3213291168 -1.3371442556 1.3829892874 )\r
+       weight 815 13 0.4341573119 ( 0.0350914486 0.2950773239 -1.7013905048 )\r
+       weight 816 12 0.5018610358 ( 25.7993812561 5.5255198479 0.9808458686 )\r
+       weight 817 13 0.4981389642 ( -2.3211855888 -6.1618895531 -1.209510088 )\r
+       weight 818 12 0.5 ( 26.3584022522 5.50238657 -1.3689215183 )\r
+       weight 819 13 0.5 ( -2.5010063648 -6.0760374069 1.1977162361 )\r
+       weight 820 4 0.5 ( 27.2529239655 4.905377388 0.8553846478 )\r
+       weight 821 5 0.5 ( -0.6506701708 -4.5757417679 -0.9065843225 )\r
+       weight 822 4 0.6556488872 ( 23.6908054352 0.9735138416 3.8268201351 )\r
+       weight 823 5 0.3443511724 ( -1.9893512726 0.6062523127 -3.7931990623 )\r
+       weight 824 4 0.5 ( 26.2665348053 2.8492202759 3.6414778233 )\r
+       weight 825 5 0.5 ( -0.4416750371 -2.1772317886 -3.583622694 )\r
+       weight 826 4 0.5747679472 ( 25.4302387238 -0.4784819484 -0.9694106579 )\r
+       weight 827 5 0.4252320528 ( -0.2597645819 0.99386096 1.2064049244 )\r
+       weight 828 4 0.5012171865 ( 25.6147861481 6.2921228409 0.299933821 )\r
+       weight 829 5 0.4987828135 ( -2.7578024864 -5.1776695251 -0.5707840323 )\r
+       weight 830 4 0.5 ( 26.1153335571 5.9945816994 2.6441447735 )\r
+       weight 831 5 0.5 ( -1.9641931057 -5.0143260956 -2.8462855816 )\r
+       weight 832 4 0.4966793656 ( 27.2706890106 1.3099222183 4.8967885971 )\r
+       weight 833 5 0.5033206344 ( 1.2181107998 -1.1426680088 -4.6458654404 )\r
+       weight 834 4 0.2354369462 ( 28.9388275146 -1.539992094 4.135371685 )\r
+       weight 835 5 0.5586854219 ( 3.8317890167 0.7188010216 -3.5558774471 )\r
+       weight 836 6 0.1300537437 ( -4.521273613 1.060931921 4.2490348816 )\r
+       weight 837 9 0.0758239105 ( -4.9383764267 -0.8622139096 -4.8920912743 )\r
+       weight 838 4 0.5420322418 ( 25.1016616821 -1.9977445602 2.1749322414 )\r
+       weight 839 5 0.457967788 ( 0.3583128452 2.6464865208 -1.8250672817 )\r
+       weight 840 12 1 ( 20.2926540375 -1.1805739403 0.2672938406 )\r
+       weight 841 12 1 ( 20.4784469604 -1.0883660316 -1.9001260996 )\r
+       weight 842 12 1 ( 18.1030540466 2.4979526997 1.5719373226 )\r
+       weight 843 12 1 ( 18.9970493317 5.1889996529 1.0115466118 )\r
+       weight 844 4 1 ( 18.0669937134 3.0745797157 -0.894759655 )\r
+       weight 845 4 1 ( 18.8350028992 5.7055282593 0.0235389266 )\r
+       weight 846 4 1 ( 20.3730506897 -0.6535661817 0.0058187065 )\r
+       weight 847 4 1 ( 20.500617981 -0.8279169798 2.1723999977 )\r
+       weight 848 12 1 ( 11.8831167221 0.1869213581 -3.1364681721 )\r
+       weight 849 12 1 ( 16.2461433411 -0.3440243602 -2.4856424332 )\r
+       weight 850 12 1 ( 9.0186033249 5.1412606239 3.4751112461 )\r
+       weight 851 4 1 ( 8.9317502975 5.5914502144 -2.7247984409 )\r
+       weight 852 4 1 ( 11.831788063 -0.0438425355 3.2999060154 )\r
+       weight 853 4 1 ( 16.2279052734 -0.3235298097 2.7190408707 )\r
+       weight 854 12 1 ( 6.0769815445 4.6632561684 -5.441163063 )\r
+       weight 855 12 1 ( 8.9296302795 8.3799762726 -2.1540257931 )\r
+       weight 856 12 1 ( 2.9792709351 6.4228219986 1.6259762049 )\r
+       weight 857 12 1 ( 2.4289197922 3.0714464188 3.7876582146 )\r
+       weight 858 4 1 ( 2.8003621101 6.401137352 -0.9121413231 )\r
+       weight 859 4 1 ( 2.4428694248 3.3300886154 -3.4905781746 )\r
+       weight 860 4 1 ( 8.5685768127 8.090294838 3.2592010498 )\r
+       weight 861 4 1 ( 5.7664699554 3.870998621 5.9697170258 )\r
+       weight 862 11 0.2017851472 ( 23.953754425 5.4816861153 -4.2567720413 )\r
+       weight 863 12 0.7982148528 ( 1.3351318836 4.8304901123 -4.5207910538 )\r
+       weight 864 11 1 ( 21.5682239532 3.6848404408 0.1614092141 )\r
+       weight 865 11 0.1000000015 ( 24.5447998047 7.6976623535 -2.5103619099 )\r
+       weight 866 12 0.9000000358 ( 2.4908194542 6.8120555878 -2.775049448 )\r
+       weight 867 3 0.2987317443 ( 23.7528076172 6.2109322548 4.414083004 )\r
+       weight 868 4 0.7012682557 ( 1.07003057 3.9869499207 4.9358553886 )\r
+       weight 869 3 0.6999999881 ( 21.3794727325 4.9174704552 -0.1830838025 )\r
+       weight 870 4 0.3000000119 ( -1.5424296856 3.3435750008 0.3314196765 )\r
+       weight 871 4 1 ( 2.1863532066 6.2146782875 3.4864151478 )\r
+       weight 872 11 0.6574106216 ( 21.8477420807 0.2163063884 -3.1866276264 )\r
+       weight 873 12 0.3425893784 ( -2.0839955807 0.3067061007 -3.448567152 )\r
+       weight 874 11 0.8000000119 ( 20.2093315125 3.0000197887 -3.6163527966 )\r
+       weight 875 12 0.200000003 ( -2.9306974411 3.4239597321 -3.8774540424 )\r
+       weight 876 3 1 ( 20.0802135468 3.71352911 3.4842710495 )\r
+       weight 877 3 0.6844632626 ( 21.7590427399 1.0700935125 2.4820022583 )\r
+       weight 878 4 0.3155367374 ( -2.1675322056 -0.4726192057 2.9950587749 )\r
+       weight 879 11 1 ( 12.5082921982 4.6858158112 -0.390771687 )\r
+       weight 880 3 1 ( 12.0061321259 5.2245082855 0.769251883 )\r
+       weight 881 2 0.1454662234 ( -9.2759513855 -12.5913352966 -3.9848918915 )\r
+       weight 882 11 0.8545337915 ( 5.3614530563 1.2912409306 -4.2551789284 )\r
+       weight 883 2 1 ( 0.0225959271 -11.5908985138 -6.3940753937 )\r
+       weight 884 11 1 ( 6.0733480453 0.9716901779 3.68196702 )\r
+       weight 885 11 1 ( 5.3426604271 3.4533233643 1.883769989 )\r
+       weight 886 3 1 ( 5.8869261742 1.7861583233 -3.9078969955 )\r
+       weight 887 2 0.1054315343 ( 3.1896224022 -13.4790973663 -6.0149002075 )\r
+       weight 888 3 0.8945685029 ( 5.0583124161 3.992834568 -1.8174667358 )\r
+       weight 889 3 1 ( 5.2553291321 1.4280443192 3.982131958 )\r
+       weight 890 2 0.3000000119 ( -3.6239292622 -10.1202754974 -9.6666002274 )\r
+       weight 891 11 0.6999999881 ( 1.4976956844 6.5122027397 1.0501244068 )\r
+       weight 892 2 0.6000000238 ( 3.6691191196 -10.1202754974 -9.6666002274 )\r
+       weight 893 3 0.3999999762 ( 1.0666370392 6.6969323158 -0.5522003174 )\r
+       weight 894 2 0.3000000119 ( -8.1770324707 -2.5972967148 -3.218075037 )\r
+       weight 895 11 0.6999999881 ( -4.4371743202 -1.0799667835 -4.053375721 )\r
+       weight 896 2 0.5137676597 ( -7.1727237701 -4.0464859009 -8.1888504028 )\r
+       weight 897 11 0.4862323105 ( -3.9055857658 4.0622777939 -3.0083267689 )\r
+       weight 898 20 0.6397548318 ( 0 3.6565637589 -5.418337822 )\r
+       weight 899 21 0.360245198 ( 0 -3.3769750595 -2.7810044289 )\r
+       weight 900 20 0.8339756131 ( 0 0.4829645753 -5.1986751556 )\r
+       weight 901 21 0.1660244167 ( 0 -6.5505743027 -2.5613415241 )\r
+       weight 902 20 0.5734935403 ( 0 -0.8307742476 -6.1539378166 )\r
+       weight 903 21 0.1398577392 ( 0 -7.8643131256 -3.5166044235 )\r
+       weight 904 11 0.1842741519 ( -5.3904371262 4.9802436829 4.0779838562 )\r
+       weight 905 3 0.1023745313 ( -5.7926998138 5.1199798584 -3.6220397949 )\r
+       weight 906 2 0.7162027359 ( -5.2711539268 -2.2043352127 -6.8062500954 )\r
+       weight 907 11 0.2837972641 ( -5.6687164307 2.4045250416 -1.2578134537 )\r
+       weight 908 20 0.6338254213 ( -5.84375 2.6118135452 -4.024600029 )\r
+       weight 909 21 0.3661745489 ( -5.84375 -4.4217252731 -1.3872665167 )\r
+       weight 910 20 0.5014402866 ( -0.9352249503 -1.3096618652 -5.6607999802 )\r
+       weight 911 21 0.0917243659 ( -0.9352249503 -8.3432006836 -3.0234665871 )\r
+       weight 912 11 0.4068352878 ( -4.7542424202 4.5687804222 3.1987123489 )\r
+       weight 913 20 0.6273728013 ( -1.3855500221 3.2577610016 -4.5619125366 )\r
+       weight 914 21 0.2173846215 ( -1.3855500221 -3.7757778168 -1.9245791435 )\r
+       weight 915 11 0.1552425772 ( -9.0240659714 2.7441666126 2.3554522991 )\r
+       weight 916 2 0.6999999881 ( 5.3163461685 -2.2043352127 -6.8062500954 )\r
+       weight 917 3 0.3000000119 ( -5.7952170372 1.9271235466 1.3767755032 )\r
+       weight 918 20 0.5663692951 ( 5.84375 2.6118135452 -4.024600029 )\r
+       weight 919 21 0.3272037506 ( 5.84375 -4.4217252731 -1.3872665167 )\r
+       weight 920 3 0.1064269841 ( -7.990152359 1.6095404625 2.1557557583 )\r
+       weight 921 20 0.4674762785 ( 0.9352249503 -1.3096618652 -5.6607999802 )\r
+       weight 922 21 0.0855116248 ( 0.9352249503 -8.3432006836 -3.0234665871 )\r
+       weight 923 2 0.24382478 ( 0.9578208923 -3.8570480347 -8.7174501419 )\r
+       weight 924 3 0.2031873167 ( -5.1131248474 4.6474642754 -2.808362484 )\r
+       weight 925 20 0.6677618623 ( 1.3855500221 3.2577610016 -4.5619125366 )\r
+       weight 926 21 0.2313794196 ( 1.3855500221 -3.7757778168 -1.9245791435 )\r
+       weight 927 3 0.100858666 ( -9.2499141693 2.4850404263 -2.1136705875 )\r
+       weight 928 2 0.3000000119 ( 8.2222251892 -2.5972967148 -3.218075037 )\r
+       weight 929 3 0.6999999881 ( -4.2994232178 -1.779967308 3.7206242085 )\r
+       weight 930 2 0.200000003 ( 7.2179164886 -4.0464859009 -8.1888504028 )\r
+       weight 931 3 0.8000000119 ( -4.0887227058 3.4716165066 3.2803218365 )\r
+       weight 932 51 0.0677773133 ( -21.3410739899 -12.6467218399 -2.5789518356 )\r
+       weight 933 52 0.9322226644 ( -5.8249878883 -4.2359704971 2.2569978237 )\r
+       weight 934 20 0.1189067513 ( -7.3782248497 8.2387495041 0.384849906 )\r
+       weight 935 21 0.6058146954 ( -7.3782248497 1.2052105665 3.0221834183 )\r
+       weight 936 24 0.0628303811 ( -7.3782248497 -5.7020692825 1.5814950466 )\r
+       weight 937 51 0.1009515449 ( -1.787686348 -13.5433092117 -0.3390018642 )\r
+       weight 938 23 0.1114965528 ( -2.2724313736 -4.1478776932 -6.6919021606 )\r
+       weight 939 20 0.3950642347 ( -6.5456871986 7.5363731384 -6.4710626602 )\r
+       weight 940 21 0.3950642347 ( -6.5456871986 0.5028342605 -3.8337290287 )\r
+       weight 941 24 0.105803296 ( -6.5456871986 -6.4044456482 -5.2744174004 )\r
+       weight 942 51 0.1040681973 ( -0.9551489353 -14.2456855774 -7.194914341 )\r
+       weight 943 20 0.2767947912 ( -8.6624994278 7.6993131638 -2.8558502197 )\r
+       weight 944 21 0.416950345 ( -8.6624994278 0.6657742858 -0.2185165882 )\r
+       weight 945 24 0.1158498451 ( -8.6624994278 -6.2415056229 -1.6592049599 )\r
+       weight 946 51 0.1015091911 ( -3.0719614029 -14.0827455521 -3.5797019005 )\r
+       weight 947 23 0.0888958126 ( -3.5567064285 -4.6873140335 -9.9326019287 )\r
+       weight 948 20 0.4345740378 ( -6.875 5.5680608749 -2.6496002674 )\r
+       weight 949 21 0.4966184199 ( -6.875 -1.4654779434 -0.0122666359 )\r
+       weight 950 24 0.0688075498 ( -6.875 -8.3727579117 -1.4529550076 )\r
+       weight 951 20 0.5 ( 0 7.5307607651 -6.5861001015 )\r
+       weight 952 21 0.5 ( 0 0.4972219169 -3.9487667084 )\r
+       weight 953 20 0.5 ( 0 6.6857004166 -5.14234972 )\r
+       weight 954 21 0.5 ( 0 -0.3478384316 -2.5050163269 )\r
+       weight 955 20 0.5 ( -3.9187500477 6.805562973 -5.5371003151 )\r
+       weight 956 21 0.5 ( -3.9187500477 -0.2279758751 -2.8997664452 )\r
+       weight 957 20 0.4308815897 ( -1.5812499523 9.2118120193 -7.3246006966 )\r
+       weight 958 21 0.4747116566 ( -1.5812499523 2.178273201 -4.6872668266 )\r
+       weight 959 24 0.0944068208 ( -1.5812499523 -4.7290067673 -6.1279554367 )\r
+       weight 960 20 0.5 ( -2.8029251099 7.3282384872 -4.8295502663 )\r
+       weight 961 21 0.5 ( -2.8029251099 0.2946996391 -2.1922163963 )\r
+       weight 962 20 0.5685037374 ( -5.5687499046 4.3993139267 -2.5808503628 )\r
+       weight 963 21 0.4314962626 ( -5.5687499046 -2.6342248917 0.0564831495 )\r
+       weight 964 20 0.5 ( 3.9187500477 6.805562973 -5.5371003151 )\r
+       weight 965 21 0.5 ( 3.9187500477 -0.2279758751 -2.8997664452 )\r
+       weight 966 20 0.4308815598 ( 1.5812499523 9.2118120193 -7.3246006966 )\r
+       weight 967 21 0.4747116566 ( 1.5812499523 2.178273201 -4.6872668266 )\r
+       weight 968 24 0.0944068134 ( 1.5812499523 -4.7290067673 -6.1279554367 )\r
+       weight 969 20 0.5 ( 2.8029251099 7.3282384872 -4.8295502663 )\r
+       weight 970 21 0.5 ( 2.8029251099 0.2946996391 -2.1922163963 )\r
+       weight 971 20 0.5039508343 ( 5.5687499046 4.3993139267 -2.5808503628 )\r
+       weight 972 21 0.3900420666 ( 5.5687499046 -2.6342248917 0.0564831495 )\r
+       weight 973 3 0.1060071066 ( -9.4417304993 -0.1655712575 1.8441540003 )\r
+       weight 974 20 0.1207661703 ( 7.3782248497 8.2387495041 0.384849906 )\r
+       weight 975 21 0.7001775503 ( 7.3782248497 1.2052105665 3.0221834183 )\r
+       weight 976 24 0.0638128966 ( 7.3782248497 -5.7020692825 1.5814950466 )\r
+       weight 977 22 0.1152433231 ( 1.8451923132 -4.2869462967 -6.6919021606 )\r
+       weight 978 20 0.3949199617 ( 6.5456871986 7.5363731384 -6.4710626602 )\r
+       weight 979 21 0.395186156 ( 6.5456871986 0.5028342605 -3.8337290287 )\r
+       weight 980 24 0.1057646647 ( 6.5456871986 -6.4044456482 -5.2744174004 )\r
+       weight 981 26 0.1041292027 ( 0.955145359 -14.2457542419 -7.1949167252 )\r
+       weight 982 20 0.2686091065 ( 8.6624994278 7.6993131638 -2.8558502197 )\r
+       weight 983 21 0.4290876389 ( 8.6624994278 0.6657742858 -0.2185165882 )\r
+       weight 984 24 0.1124238074 ( 8.6624994278 -6.2415056229 -1.6592049599 )\r
+       weight 985 26 0.1015925556 ( 3.0719578266 -14.0828142166 -3.5797040462 )\r
+       weight 986 22 0.088286899 ( 3.1294674873 -4.826382637 -9.9326019287 )\r
+       weight 987 20 0.4266230762 ( 6.875 5.5680608749 -2.6496002674 )\r
+       weight 988 21 0.5058282614 ( 6.875 -1.4654779434 -0.0122666359 )\r
+       weight 989 24 0.067548655 ( 6.875 -8.3727579117 -1.4529550076 )\r
+       weight 990 27 1 ( 5.824971199 -4.235909462 2.2570009232 )\r
+       weight 991 52 1 ( -17.0866374969 -1.1426469088 4.0192975998 )\r
+       weight 992 54 0.7646281719 ( -3.8610150814 -0.5479852557 -0.5159529448 )\r
+       weight 993 67 0.057570219 ( -2.3829722404 3.1826353073 -3.3165719509 )\r
+       weight 994 60 0.1778016686 ( 1.4335156679 -2.9536817074 -2.1153883934 )\r
+       weight 995 52 0.6832698584 ( -14.9613494873 1.4354541302 4.6217603683 )\r
+       weight 996 54 0.3167301714 ( 1.1772814989 1.560696125 -2.0471975803 )\r
+       weight 997 52 0.8033875823 ( -14.904624939 0.6254938841 4.4462480545 )\r
+       weight 998 54 0.1966124475 ( 0.9921308756 0.7526433468 -1.994017601 )\r
+       weight 999 51 0.0563565195 ( -20.3143863678 -6.5835089684 -0.3125394881 )\r
+       weight 1000 52 0.9436435103 ( -4.7983002663 1.8272426128 4.5234103203 )\r
+       weight 1001 52 1 ( -6.0767889023 -2.5572082996 4.5871853828 )\r
+       weight 1002 51 0.0646225363 ( -22.8756351471 -11.2107982635 -5.6109271049 )\r
+       weight 1003 52 0.9353774786 ( -7.3595499992 -2.8000471592 -0.7749772072 )\r
+       weight 1004 52 1 ( -9.4349765778 -0.5189439058 -0.7386773825 )\r
+       weight 1005 51 0.443610549 ( -15.8119115829 -7.7483458519 -2.2668268681 )\r
+       weight 1006 52 0.556389451 ( -0.2958250046 0.6624058485 2.5691227913 )\r
+       weight 1007 51 0.5 ( -15.5509243011 -8.7922325134 -8.6094646454 )\r
+       weight 1008 52 0.5 ( -0.0348377228 -0.3814813197 -3.7735145092 )\r
+       weight 1009 51 0.0700971037 ( -18.5416107178 -8.496846199 -1.0481519699 )\r
+       weight 1010 52 0.9299028516 ( -3.0255246162 -0.0860949904 3.7877976894 )\r
+       weight 1011 51 0.5 ( -15.6336126328 -11.0858097076 -7.2224640846 )\r
+       weight 1012 52 0.5 ( -0.1175260544 -2.6750586033 -2.3865144253 )\r
+       weight 1013 51 0.8932833076 ( -7.4059610367 -9.5094957352 -3.6182017326 )\r
+       weight 1014 52 0.1067166552 ( 8.110124588 -1.0987445116 1.2177479267 )\r
+       weight 1015 51 1 ( -8.0247125626 -7.9282469749 -1.6244519949 )\r
+       weight 1016 51 1 ( -11.7487001419 -8.3534851074 -0.3205893934 )\r
+       weight 1017 51 1 ( -7.4059610367 -8.4094944 -5.8182020187 )\r
+       weight 1018 51 0.8746582866 ( -12.5468740463 -8.9144220352 -3.0657393932 )\r
+       weight 1019 52 0.1253416836 ( 2.969212532 -0.5036708117 1.7702102661 )\r
+       weight 1020 51 0.9074385166 ( -10.7643871307 -7.1964831352 -6.2548646927 )\r
+       weight 1021 52 0.0925614834 ( 4.7517004013 1.2142685652 -1.4189147949 )\r
+       weight 1022 51 0.8426001668 ( -10.8331375122 -8.7777318954 -5.6361145973 )\r
+       weight 1023 52 0.1573998779 ( 4.6829500198 -0.3669807017 -0.800164938 )\r
+       weight 1024 51 0.7721979618 ( -11.6199741364 -9.7301712036 -4.4819016457 )\r
+       weight 1025 52 0.2278020829 ( 3.896112442 -1.3194200993 0.3540480137 )\r
+       weight 1026 20 0.0529855229 ( -7.2898750305 11.1931228638 0.2629622817 )\r
+       weight 1027 21 0.441654712 ( -7.2898750305 4.1595840454 2.9002957344 )\r
+       weight 1028 24 0.0841899365 ( -7.2898750305 -2.7476959229 1.459607482 )\r
+       weight 1029 51 0.3021862507 ( -1.6993367672 -10.5889358521 -0.4608894885 )\r
+       weight 1030 23 0.1189835742 ( -2.1840815544 -1.1935044527 -6.8137893677 )\r
+       weight 1031 21 0.6599999666 ( -10.5187501907 5.1345252991 -2.6935167313 )\r
+       weight 1032 51 0.3400000036 ( -4.928211689 -9.6139945984 -6.0547018051 )\r
+       weight 1033 20 0.2792472839 ( -7.5480623245 11.3684988022 -9.2093877792 )\r
+       weight 1034 21 0.3234107494 ( -7.5480623245 4.3349599838 -6.5720539093 )\r
+       weight 1035 24 0.2419621795 ( -7.5480623245 -2.5723199844 -8.0127420425 )\r
+       weight 1036 51 0.1020626798 ( -1.9575238228 -10.4135599136 -9.9332389832 )\r
+       weight 1037 23 0.0533170924 ( -2.4422688484 -1.0181285143 -16.2861404419 )\r
+       weight 1038 21 0.4054434896 ( -8.4589996338 7.3015213013 0.5679833889 )\r
+       weight 1039 24 0.0701758042 ( -8.4589996338 0.394241184 -0.8727049828 )\r
+       weight 1040 50 0.0698308721 ( -7.1019001007 -4.7980041504 -6.6458396912 )\r
+       weight 1041 51 0.4545497596 ( -2.8684616089 -7.446999073 -2.7932019234 )\r
+       weight 1042 20 0.1663649976 ( 0 13.6869764328 -8.1812257767 )\r
+       weight 1043 21 0.4414319396 ( 0 6.6534376144 -5.5438919067 )\r
+       weight 1044 24 0.3922030628 ( 0 -0.2538425028 -6.98458004 )\r
+       weight 1045 20 0.3243005872 ( 0 11.0100364685 -8.2019634247 )\r
+       weight 1046 21 0.4622890353 ( 0 3.9764976501 -5.5646295547 )\r
+       weight 1047 24 0.2134103775 ( 0 -2.9307823181 -7.005317688 )\r
+       weight 1048 20 0.2323906422 ( 0 11.0339975357 -6.0516252518 )\r
+       weight 1049 21 0.5941882133 ( 0 4.0004587173 -3.4142918587 )\r
+       weight 1050 24 0.1734211594 ( 0 -2.9068212509 -4.8549799919 )\r
+       weight 1051 20 0.2494123876 ( -3.0105624199 13.4310007095 -10.1718883514 )\r
+       weight 1052 21 0.3986799717 ( -3.0105624199 6.3974618912 -7.5345544815 )\r
+       weight 1053 24 0.3519076407 ( -3.0105624199 -0.5098182559 -8.9752426147 )\r
+       weight 1054 20 0.2238887697 ( -0.9624999762 12.8555631638 -8.6308507919 )\r
+       weight 1055 21 0.435683161 ( -0.9624999762 5.8220243454 -5.993516922 )\r
+       weight 1056 24 0.3404280245 ( -0.9624999762 -1.0852557421 -7.4342055321 )\r
+       weight 1057 20 0.311350286 ( -1.0175000429 10.1193141937 -5.7983503342 )\r
+       weight 1058 21 0.5916436911 ( -1.0175000429 3.0857753754 -3.1610167027 )\r
+       weight 1059 24 0.0970060155 ( -1.0175000429 -3.8215045929 -4.6017050743 )\r
+       weight 1060 20 0.1802195758 ( -0.5469875336 14.3477487564 -9.2691249847 )\r
+       weight 1061 21 0.419763118 ( -0.5469875336 7.314209938 -6.6317911148 )\r
+       weight 1062 24 0.4000172615 ( -0.5469875336 0.4069298208 -8.072479248 )\r
+       weight 1063 20 0.1424077898 ( -1.1350374222 13.7795257568 -7.5940375328 )\r
+       weight 1064 21 0.4511080384 ( -1.1350374222 6.7459869385 -4.9567036629 )\r
+       weight 1065 24 0.406484127 ( -1.1350374222 -0.1612931639 -6.3973922729 )\r
+       weight 1066 20 0.2233095318 ( 3.0105624199 13.4310007095 -10.1718883514 )\r
+       weight 1067 21 0.3569551408 ( 3.0105624199 6.3974618912 -7.5345544815 )\r
+       weight 1068 24 0.3150779009 ( 3.0105624199 -0.5098182559 -8.9752426147 )\r
+       weight 1069 26 0.1046574339 ( -2.5799796581 -8.3511266708 -10.8957424164 )\r
+       weight 1070 20 0.2238887846 ( 0.9624999762 12.8555631638 -8.6308507919 )\r
+       weight 1071 21 0.4356832206 ( 0.9624999762 5.8220243454 -5.993516922 )\r
+       weight 1072 24 0.3404280543 ( 0.9624999762 -1.0852557421 -7.4342055321 )\r
+       weight 1073 20 0.311350286 ( 1.0175000429 10.1193141937 -5.7983503342 )\r
+       weight 1074 21 0.5916436911 ( 1.0175000429 3.0857753754 -3.1610167027 )\r
+       weight 1075 24 0.0970060304 ( 1.0175000429 -3.8215045929 -4.6017050743 )\r
+       weight 1076 20 0.1802195758 ( 0.5469875336 14.3477487564 -9.2691249847 )\r
+       weight 1077 21 0.4197631478 ( 0.5469875336 7.314209938 -6.6317911148 )\r
+       weight 1078 24 0.4000172913 ( 0.5469875336 0.4069298208 -8.072479248 )\r
+       weight 1079 20 0.1424078196 ( 1.1350374222 13.7795257568 -7.5940375328 )\r
+       weight 1080 21 0.451108098 ( 1.1350374222 6.7459869385 -4.9567036629 )\r
+       weight 1081 24 0.4064841568 ( 1.1350374222 -0.1612931639 -6.3973922729 )\r
+       weight 1082 21 0.4149694741 ( 7.2898750305 4.1595840454 2.9002957344 )\r
+       weight 1083 24 0.0666067749 ( 7.2898750305 -2.7476959229 1.459607482 )\r
+       weight 1084 26 0.4193356335 ( 1.6993331909 -10.5890045166 -0.4608917236 )\r
+       weight 1085 22 0.0990880728 ( 1.7568427324 -1.332572937 -6.8137893677 )\r
+       weight 1086 21 0.6827453971 ( 10.5187501907 5.1345252991 -2.6935167313 )\r
+       weight 1087 26 0.3172545731 ( 4.9282078743 -9.6140632629 -6.0547041893 )\r
+       weight 1088 20 0.2598383129 ( 7.5480623245 11.3684988022 -9.2093877792 )\r
+       weight 1089 21 0.3009322584 ( 7.5480623245 4.3349599838 -6.5720539093 )\r
+       weight 1090 24 0.2251446694 ( 7.5480623245 -2.5723199844 -8.0127420425 )\r
+       weight 1091 26 0.2140847892 ( 1.9575202465 -10.4136285782 -9.9332418442 )\r
+       weight 1092 24 0.1180321574 ( 8.4589996338 0.394241184 -0.8727049828 )\r
+       weight 1093 25 0.1174490154 ( 7.1019010544 -4.7979969978 -6.6458392143 )\r
+       weight 1094 26 0.7645187974 ( 2.8684580326 -7.4470672607 -2.7932040691 )\r
+       weight 1095 26 0.8932843804 ( 7.4059576988 -9.5095643997 -3.6182038784 )\r
+       weight 1096 27 0.1067156196 ( -8.1101417542 -1.0986834764 1.2177509069 )\r
+       weight 1097 26 1 ( 8.0247087479 -7.9283151627 -1.6244542599 )\r
+       weight 1098 26 0.8398555517 ( 11.7486953735 -8.353553772 -0.3205916286 )\r
+       weight 1099 27 0.1601444781 ( -3.7674033642 0.0573271364 4.5153632164 )\r
+       weight 1100 26 0.8942742944 ( 7.4059576988 -8.4095630646 -5.8182044029 )\r
+       weight 1101 27 0.1057257205 ( -8.1101417542 0.0013178461 -0.9822493792 )\r
+       weight 1102 26 0.8746653199 ( 12.546869278 -8.9144906998 -3.065741539 )\r
+       weight 1103 27 0.1253346652 ( -2.9692292213 -0.5036097765 1.7702132463 )\r
+       weight 1104 26 0.9074409604 ( 10.7643814087 -7.1965513229 -6.2548666 )\r
+       weight 1105 27 0.0925590619 ( -4.7517166138 1.2143296003 -1.4189118147 )\r
+       weight 1106 26 0.8426043987 ( 10.8331317902 -8.77780056 -5.6361169815 )\r
+       weight 1107 27 0.1573956013 ( -4.6829662323 -0.3669196367 -0.8001619577 )\r
+       weight 1108 26 0.7722041011 ( 11.619969368 -9.7302398682 -4.4819040298 )\r
+       weight 1109 27 0.2277958691 ( -3.8961291313 -1.3193589449 0.3540509939 )\r
+       weight 1110 26 0.4436197281 ( 15.8119068146 -7.7484140396 -2.2668290138 )\r
+       weight 1111 27 0.5563802719 ( 0.2958083153 0.6624668837 2.5691258907 )\r
+       weight 1112 26 0.5 ( 15.5509195328 -8.792301178 -8.6094665527 )\r
+       weight 1113 27 0.5 ( 0.0348210335 -0.3814202547 -3.7735116482 )\r
+       weight 1114 27 1 ( 3.0255079269 -0.0860339478 3.7878005505 )\r
+       weight 1115 26 0.5 ( 15.6336078644 -11.0858783722 -7.2224664688 )\r
+       weight 1116 27 0.5 ( 0.1175093651 -2.6749973297 -2.3865115643 )\r
+       weight 1117 27 1 ( 4.798283577 1.8273037672 4.5234131813 )\r
+       weight 1118 27 1 ( 6.076772213 -2.5571470261 4.5871882439 )\r
+       weight 1119 27 1 ( 7.3595333099 -2.7999858856 -0.774974227 )\r
+       weight 1120 27 1 ( 9.4349594116 -0.5188828707 -0.7386744022 )\r
+       weight 1121 27 1 ( 14.9613332748 1.4355152845 4.6217632294 )\r
+       weight 1122 27 1 ( 14.9046087265 0.6255549192 4.4462509155 )\r
+       weight 1123 27 0.8000000119 ( 17.0866203308 -1.1425858736 4.0193004608 )\r
+       weight 1124 29 0.200000003 ( 0.9734535217 -0.2799913287 -1.787817359 )\r
+       weight 1125 29 0.7061453462 ( 3.2464432716 -1.2205908298 -1.8558670282 )\r
+       weight 1126 42 0.0916166157 ( 4.2458744049 -0.269906342 -1.9290235043 )\r
+       weight 1127 35 0.2022380084 ( -0.799002409 -2.2181265354 -3.014701128 )\r
+       weight 1128 52 1 ( -6.6526389122 2.5121285915 2.3073351383 )\r
+       weight 1129 52 1 ( -8.5794372559 2.4464919567 0.3922730684 )\r
+       weight 1130 51 0.8552805185 ( -14.4409503937 -5.9630961418 -2.8180017471 )\r
+       weight 1131 52 0.1447194815 ( 1.0751366615 2.4476554394 2.0179479122 )\r
+       weight 1132 51 0.4274499714 ( -16.9476261139 -4.908346653 -3.3817269802 )\r
+       weight 1133 52 0.5725500584 ( -1.4315390587 3.5024049282 1.4542227983 )\r
+       weight 1134 51 0.4358375371 ( -16.9942989349 -6.2754864693 -5.7808270454 )\r
+       weight 1135 52 0.5641624331 ( -1.4782118797 2.1352651119 -0.9448772669 )\r
+       weight 1136 51 0.4160711765 ( -17.1152000427 -5.2185482979 -4.600464344 )\r
+       weight 1137 52 0.5839288235 ( -1.5991139412 3.1922032833 0.2354854345 )\r
+       weight 1138 51 1 ( -8.6407117844 -3.3577485085 -0.9672020078 )\r
+       weight 1139 51 1 ( -11.4328870773 -4.4769711494 -1.1207019091 )\r
+       weight 1140 51 1 ( -8.7782115936 -2.120246172 -4.9547019005 )\r
+       weight 1141 51 1 ( -7.5791115761 -5.6705708504 -7.3187894821 )\r
+       weight 1142 51 1 ( -12.5766620636 -5.9159703255 -5.5380268097 )\r
+       weight 1143 51 1 ( -7.090461731 -2.2040455341 -4.3488397598 )\r
+       weight 1144 21 0.2071216553 ( -8.7274875641 9.0198850632 3.0605082512 )\r
+       weight 1145 50 0.0757352263 ( -7.3703870773 -3.0796406269 -4.1533145905 )\r
+       weight 1146 51 0.7171431184 ( -3.1369490623 -5.7286353111 -0.3006769717 )\r
+       weight 1147 21 0.3016123176 ( -7.702750206 8.6077737808 1.9429836273 )\r
+       weight 1148 24 0.0663812757 ( -7.702750206 1.7004936934 0.5022951961 )\r
+       weight 1149 50 0.1016175151 ( -6.3456497192 -3.4917519093 -5.2708396912 )\r
+       weight 1150 51 0.5303889513 ( -2.1122117043 -6.1407465935 -1.4182018042 )\r
+       weight 1151 21 0.3238199353 ( -10.1284999847 9.1954612732 -2.2236537933 )\r
+       weight 1152 51 0.6761800647 ( -4.5379619598 -5.5530591011 -5.584839344 )\r
+       weight 1153 51 1 ( -6.2290363312 -2.5541348457 -5.5225143433 )\r
+       weight 1154 21 0.3141192496 ( -10.0468006134 11.6795110703 -1.7254543304 )\r
+       weight 1155 51 0.6858807206 ( -4.4562621117 -3.069009304 -5.0866398811 )\r
+       weight 1156 21 0.483761996 ( -9.7927494049 10.1120376587 -3.147954464 )\r
+       weight 1157 51 0.5162379742 ( -4.20221138 -4.6364827156 -6.5091395378 )\r
+       weight 1158 24 0.2345368713 ( -6.4885997772 3.9747543335 -7.2829551697 )\r
+       weight 1159 50 0.2774702609 ( -5.1314997673 -1.2174913883 -13.0560894012 )\r
+       weight 1160 51 0.4879929125 ( -0.8980613947 -3.8664860725 -9.2034521103 )\r
+       weight 1161 21 0.2748776376 ( 0 12.0645236969 -5.5260162354 )\r
+       weight 1162 24 0.3276728392 ( 0 5.1572437286 -6.9667048454 )\r
+       weight 1163 46 0.1724479198 ( 0 -2.0158445835 -9.5285253525 )\r
+       weight 1164 25 0.1125003695 ( -1.357098937 -0.0349943414 -12.7398386002 )\r
+       weight 1165 50 0.1125011891 ( 1.3571000099 -0.0350019746 -12.7398395538 )\r
+       weight 1166 20 0.1643134952 ( 0 16.8068351746 -10.9376754761 )\r
+       weight 1167 21 0.4178432226 ( 0 9.7732973099 -8.3003416061 )\r
+       weight 1168 24 0.4178432226 ( 0 2.8660173416 -9.7410306931 )\r
+       weight 1169 24 0.2036246806 ( -5.7985754013 6.8579645157 -7.9275555611 )\r
+       weight 1170 50 0.3535286486 ( -4.4414753914 1.6657187939 -13.7006902695 )\r
+       weight 1171 51 0.442846626 ( -0.2080368996 -0.9832757115 -9.8480520248 )\r
+       weight 1172 21 0.223519817 ( -3.3398499489 12.4632740021 -7.8635163307 )\r
+       weight 1173 24 0.2397254258 ( -3.3398499489 5.5559940338 -9.3042049408 )\r
+       weight 1174 46 0.154696703 ( -3.3398499489 -1.6170942783 -11.866024971 )\r
+       weight 1175 25 0.0830514953 ( -4.6969490051 0.3637559712 -15.0773382187 )\r
+       weight 1176 50 0.1990065128 ( -1.982749939 0.3637483418 -15.0773391724 )\r
+       weight 1177 51 0.1000000015 ( 2.2506883144 -2.2852461338 -11.2247018814 )\r
+       weight 1178 20 0.1500628889 ( -2.2811000347 15.908074379 -9.4833498001 )\r
+       weight 1179 21 0.4249685705 ( -2.2811000347 8.8745355606 -6.8460159302 )\r
+       weight 1180 24 0.4249685705 ( -2.2811000347 1.9672554731 -8.2867040634 )\r
+       weight 1181 20 0.1871334761 ( -5.1411004066 15.6605768204 -10.8583498001 )\r
+       weight 1182 21 0.3529328108 ( -5.1411004066 8.627038002 -8.2210168839 )\r
+       weight 1183 24 0.3524519503 ( -5.1411004066 1.7197579145 -9.6617050171 )\r
+       weight 1184 51 0.1074817702 ( 0.4494380951 -6.1214823723 -11.5822019577 )\r
+       weight 1185 21 0.3106785715 ( -0.9336999655 11.2736129761 -6.0618667603 )\r
+       weight 1186 24 0.3323185146 ( -0.9336999655 4.3663330078 -7.5025553703 )\r
+       weight 1187 46 0.1490715742 ( -0.9336999655 -2.8067553043 -10.0643758774 )\r
+       weight 1188 25 0.0877479613 ( -2.2907991409 -0.8259050846 -13.2756891251 )\r
+       weight 1189 50 0.1201833263 ( 0.4234000444 -0.825912714 -13.2756900787 )\r
+       weight 1190 24 0.2036249638 ( 5.7985754013 6.8579645157 -7.9275555611 )\r
+       weight 1191 25 0.353527993 ( 4.4414763451 1.6657264233 -13.7006893158 )\r
+       weight 1192 26 0.4428470731 ( 0.2080333233 -0.9833443165 -9.8480548859 )\r
+       weight 1193 21 0.2483555377 ( 3.3398499489 12.4632740021 -7.8635163307 )\r
+       weight 1194 24 0.2663618028 ( 3.3398499489 5.5559940338 -9.3042049408 )\r
+       weight 1195 46 0.1718853712 ( 3.3398499489 -1.6170942783 -11.866024971 )\r
+       weight 1196 25 0.2211173922 ( 1.9827510118 0.3637559712 -15.0773382187 )\r
+       weight 1197 50 0.0922798589 ( 4.6969499588 0.3637483418 -15.0773391724 )\r
+       weight 1198 20 0.1343669146 ( 2.2811000347 15.908074379 -9.4833498001 )\r
+       weight 1199 21 0.3805185854 ( 2.2811000347 8.8745355606 -6.8460159302 )\r
+       weight 1200 24 0.3805185854 ( 2.2811000347 1.9672554731 -8.2867040634 )\r
+       weight 1201 26 0.1045959145 ( -3.3094420433 -5.8740530014 -10.2072038651 )\r
+       weight 1202 20 0.1649255604 ( 5.1411004066 15.6605768204 -10.8583498001 )\r
+       weight 1203 21 0.3110487759 ( 5.1411004066 8.627038002 -8.2210168839 )\r
+       weight 1204 24 0.3106249571 ( 5.1411004066 1.7197579145 -9.6617050171 )\r
+       weight 1205 26 0.2134006619 ( -0.4494416714 -6.12155056 -11.5822038651 )\r
+       weight 1206 21 0.3106787205 ( 0.9336999655 11.2736129761 -6.0618667603 )\r
+       weight 1207 24 0.3323186636 ( 0.9336999655 4.3663330078 -7.5025553703 )\r
+       weight 1208 46 0.1490716487 ( 0.9336999655 -2.8067553043 -10.0643758774 )\r
+       weight 1209 25 0.1201823652 ( -0.4233989716 -0.8259050846 -13.2756891251 )\r
+       weight 1210 50 0.0877486393 ( 2.2907998562 -0.825912714 -13.2756900787 )\r
+       weight 1211 26 1 ( 7.0904583931 -2.2041141987 -4.3488416672 )\r
+       weight 1212 21 0.1556877494 ( 8.7274875641 9.0198850632 3.0605082512 )\r
+       weight 1213 25 0.0806478783 ( 7.3703885078 -3.0796332359 -4.1533141136 )\r
+       weight 1214 26 0.7636643648 ( 3.1369452477 -5.7287034988 -0.3006792068 )\r
+       weight 1215 21 0.2012292743 ( 7.702750206 8.6077737808 1.9429836273 )\r
+       weight 1216 24 0.075924471 ( 7.702750206 1.7004936934 0.5022951961 )\r
+       weight 1217 25 0.1162227169 ( 6.3456511497 -3.4917445183 -5.2708387375 )\r
+       weight 1218 26 0.6066235304 ( 2.1122078896 -6.1408147812 -1.4182039499 )\r
+       weight 1219 21 0.1647123843 ( 10.1284999847 9.1954612732 -2.2236537933 )\r
+       weight 1220 26 0.835287571 ( 4.537958622 -5.5531272888 -5.5848412514 )\r
+       weight 1221 26 1 ( 6.2290329933 -2.5542032719 -5.5225162506 )\r
+       weight 1222 21 0.1586596668 ( 10.0468006134 11.6795110703 -1.7254543304 )\r
+       weight 1223 26 0.841340363 ( 4.456258297 -3.0690777302 -5.0866417885 )\r
+       weight 1224 21 0.3147997856 ( 9.7927494049 10.1120376587 -3.147954464 )\r
+       weight 1225 25 0.0657253787 ( 8.4356508255 -1.987480402 -10.3617763519 )\r
+       weight 1226 26 0.6194748282 ( 4.2022080421 -4.6365509033 -6.509141922 )\r
+       weight 1227 24 0.2345379889 ( 6.4885997772 3.9747543335 -7.2829551697 )\r
+       weight 1228 25 0.2774687409 ( 5.1315011978 -1.2174837589 -13.0560894012 )\r
+       weight 1229 26 0.4879932702 ( 0.8980578184 -3.8665544987 -9.2034540176 )\r
+       weight 1230 26 1 ( 8.6407079697 -3.3578169346 -0.9672042727 )\r
+       weight 1231 26 1 ( 11.432882309 -4.4770393372 -1.1207040548 )\r
+       weight 1232 26 1 ( 8.7782077789 -2.1203148365 -4.9547038078 )\r
+       weight 1233 26 0.9282349944 ( 7.5791077614 -5.6706390381 -7.3187918663 )\r
+       weight 1234 27 0.0717649981 ( -7.9369916916 2.7402420044 -2.4828369617 )\r
+       weight 1235 26 1 ( 12.5766572952 -5.9160385132 -5.5380291939 )\r
+       weight 1236 26 0.8552837372 ( 14.4409456253 -5.9631643295 -2.8180038929 )\r
+       weight 1237 27 0.1447162926 ( -1.0751533508 2.447716713 2.0179510117 )\r
+       weight 1238 26 0.4274564981 ( 16.9476203918 -4.9084148407 -3.381729126 )\r
+       weight 1239 27 0.5725434422 ( 1.4315223694 3.5024662018 1.4542257786 )\r
+       weight 1240 26 0.4358413815 ( 16.9942932129 -6.275554657 -5.7808289528 )\r
+       weight 1241 27 0.5641586185 ( 1.4781951904 2.1353263855 -0.9448742867 )\r
+       weight 1242 26 0.4160760641 ( 17.115196228 -5.2186164856 -4.6004662514 )\r
+       weight 1243 27 0.5839239359 ( 1.5990972519 3.1922645569 0.2354884148 )\r
+       weight 1244 27 1 ( 6.6526222229 2.5121898651 2.3073379993 )\r
+       weight 1245 27 1 ( 8.5794210434 2.4465532303 0.3922760487 )\r
+       weight 1246 50 0.1157932505 ( -9.8835258484 3.6568763256 -5.9885897636 )\r
+       weight 1247 51 0.8842067719 ( -5.6500868797 1.0078818798 -2.1359519958 )\r
+       weight 1248 50 0.3045143485 ( -6.0404005051 3.6499812603 -5.0398397446 )\r
+       weight 1249 51 0.6954856515 ( -1.806961894 1.0009868145 -1.1872018576 )\r
+       weight 1250 50 0.3076488078 ( -7.3725500107 3.6193015575 -9.2214393616 )\r
+       weight 1251 51 0.6923511624 ( -3.1391115189 0.9703070521 -5.3688020706 )\r
+       weight 1252 50 0.6000000238 ( -5.4680995941 3.805239439 -13.061665535 )\r
+       weight 1253 51 0.400000006 ( -1.2346613407 1.1562449932 -9.2090272903 )\r
+       weight 1254 50 0.6000000238 ( -5.1522374153 4.6804838181 -11.5433645248 )\r
+       weight 1255 51 0.400000006 ( -0.9187990427 2.0314891338 -7.690726757 )\r
+       weight 1256 50 0.6000000238 ( -6.9112248421 3.6745193005 -12.8399896622 )\r
+       weight 1257 51 0.400000006 ( -2.6777863503 1.0255248547 -8.9873514175 )\r
+       weight 1258 24 0.0710144043 ( -8.170249939 8.4572477341 -5.2623920441 )\r
+       weight 1259 50 0.3363700807 ( -6.813149929 3.2650020123 -11.0355272293 )\r
+       weight 1260 51 0.5926155448 ( -2.5797116756 0.6160075665 -7.1828889847 )\r
+       weight 1261 24 0.21481134 ( 0 11.628900528 0.8429574966 )\r
+       weight 1262 46 0.4136288464 ( 0 4.4558134079 -1.718862772 )\r
+       weight 1263 47 0.3079245389 ( 0 1.1487300396 -4.2108154297 )\r
+       weight 1264 48 0.0636352748 ( 0 0.2171580195 -6.4698748589 )\r
+       weight 1265 24 0.3458175957 ( 0 10.4097423553 -3.0067050457 )\r
+       weight 1266 46 0.3458175957 ( 0 3.2366549969 -5.5685253143 )\r
+       weight 1267 25 0.1541830152 ( -1.357098937 5.2175049782 -8.7798395157 )\r
+       weight 1268 50 0.1541817784 ( 1.3571000099 5.2174973488 -8.7798395157 )\r
+       weight 1269 21 0.0567029305 ( 0 18.9532699585 -3.1060166359 )\r
+       weight 1270 24 0.2824631631 ( 0 12.0459899902 -4.5467047691 )\r
+       weight 1271 46 0.2824631631 ( 0 4.8729028702 -7.1085252762 )\r
+       weight 1272 25 0.1891863197 ( -1.357098937 6.8537526131 -10.3198385239 )\r
+       weight 1273 50 0.1891844869 ( 1.3571000099 6.8537449837 -10.3198394775 )\r
+       weight 1274 21 0.0947859734 ( 0 18.0161514282 -5.357404232 )\r
+       weight 1275 24 0.2565671802 ( 0 11.10887146 -6.7980928421 )\r
+       weight 1276 46 0.2565671802 ( 0 3.9357841015 -9.3599128723 )\r
+       weight 1277 25 0.1960403323 ( -1.357098937 5.9166340828 -12.5712270737 )\r
+       weight 1278 50 0.1960392743 ( 1.3571000099 5.9166264534 -12.5712270737 )\r
+       weight 1279 21 0.1081030741 ( 0 16.1907157898 -4.5433421135 )\r
+       weight 1280 24 0.2734754682 ( 0 9.2834348679 -5.9840302467 )\r
+       weight 1281 46 0.2679514885 ( 0 2.1103465557 -8.5458507538 )\r
+       weight 1282 25 0.175235182 ( -1.357098937 4.091196537 -11.7571640015 )\r
+       weight 1283 50 0.1752348393 ( 1.3571000099 4.0911893845 -11.7571649551 )\r
+       weight 1284 21 0.1953482777 ( 0 14.3023824692 -6.8105416298 )\r
+       weight 1285 24 0.2659406066 ( 0 7.3951025009 -8.2512302399 )\r
+       weight 1286 46 0.2151979059 ( 0 0.2220141888 -10.8130502701 )\r
+       weight 1287 25 0.1617564112 ( -1.357098937 2.2028644085 -14.0243644714 )\r
+       weight 1288 50 0.1617567837 ( 1.3571000099 2.2028567791 -14.0243644714 )\r
+       weight 1289 47 1 ( 0 2.2212319374 -3.6333150864 )\r
+       weight 1290 50 0.8509328961 ( -2.0745501518 4.6375207901 -4.5531520844 )\r
+       weight 1291 51 0.1490670592 ( 2.15888834 1.9885261059 -0.7005144954 )\r
+       weight 1292 50 0.6615877151 ( -3.2931752205 3.6311938763 -7.8413896561 )\r
+       weight 1293 51 0.3384123147 ( 0.9402632713 0.9821993709 -3.9887518883 )\r
+       weight 1294 50 0.7316260338 ( -4.8716497421 5.2724957466 -8.9585895538 )\r
+       weight 1295 51 0.268373996 ( -0.6382113695 2.6235013008 -5.1059522629 )\r
+       weight 1296 24 0.0693065748 ( -3.8571250439 11.3172683716 -0.8431047201 )\r
+       weight 1297 46 0.0746436641 ( -3.8571250439 4.1441812515 -3.404925108 )\r
+       weight 1298 50 0.6004034281 ( -2.500025034 6.125023365 -6.6162395477 )\r
+       weight 1299 51 0.2556463778 ( 1.7334133387 3.4760289192 -2.7636017799 )\r
+       weight 1300 24 0.1309292912 ( -5.9093999863 9.0852708817 -5.6865797043 )\r
+       weight 1301 50 0.4126920998 ( -4.5522999763 3.8930251598 -11.4597148895 )\r
+       weight 1302 51 0.4563786387 ( -0.3188616037 1.244030714 -7.6070771217 )\r
+       weight 1303 24 0.2120236903 ( -2.6262500286 10.1484928131 -5.6054549217 )\r
+       weight 1304 46 0.2120236903 ( -2.6262500286 2.9754054546 -8.1672754288 )\r
+       weight 1305 50 0.2879763246 ( -1.2691500187 4.9562482834 -11.3785896301 )\r
+       weight 1306 51 0.2879763246 ( 2.9642882347 2.3072535992 -7.5259518623 )\r
+       weight 1307 24 0.102869682 ( -3.267275095 11.4106140137 -3.6056799889 )\r
+       weight 1308 46 0.102869682 ( -3.267275095 4.2375268936 -6.1675000191 )\r
+       weight 1309 50 0.6012839675 ( -1.9101750851 6.2183690071 -9.3788146973 )\r
+       weight 1310 51 0.1929766387 ( 2.3232631683 3.5693745613 -5.5261769295 )\r
+       weight 1311 24 0.0571199618 ( -2.5456750393 11.2799510956 -1.7368924618 )\r
+       weight 1312 46 0.0584545359 ( -2.5456750393 4.1068639755 -4.2987127304 )\r
+       weight 1313 50 0.8003379703 ( -1.1885750294 6.087706089 -7.5100269318 )\r
+       weight 1314 51 0.0840874538 ( 3.044863224 3.4387116432 -3.6573894024 )\r
+       weight 1315 24 0.3466432691 ( -0.7719249725 11.458688736 -1.5718924999 )\r
+       weight 1316 46 0.3640886843 ( -0.7719249725 4.2856016159 -4.1337127686 )\r
+       weight 1317 47 0.2180555016 ( -0.7719249725 0.978518188 -6.6256651878 )\r
+       weight 1318 48 0.0712125599 ( -0.7719249725 0.0469462164 -8.884724617 )\r
+       weight 1319 21 0.059975449 ( -1.3127000332 18.6825904846 -3.3249788284 )\r
+       weight 1320 24 0.2719159424 ( -1.3127000332 11.775308609 -4.7656674385 )\r
+       weight 1321 46 0.2719159424 ( -1.3127000332 4.602221489 -7.3274874687 )\r
+       weight 1322 25 0.1371879131 ( -2.6697990894 6.5830712318 -10.5388011932 )\r
+       weight 1323 50 0.2590048015 ( 0.0443999469 6.5830636024 -10.5388021469 )\r
+       weight 1324 21 0.0560896993 ( -0.8055125475 16.7786750793 -2.2916042805 )\r
+       weight 1325 24 0.3113728762 ( -0.8055125475 9.8713941574 -3.7322926521 )\r
+       weight 1326 46 0.3113728762 ( -0.8055125475 2.6983058453 -6.2941131592 )\r
+       weight 1327 25 0.1187654585 ( -2.1626114845 4.6791558266 -9.5054264069 )\r
+       weight 1328 50 0.2023991197 ( 0.5515874624 4.679148674 -9.5054273605 )\r
+       weight 1329 24 0.0630461648 ( -2.2981748581 9.7949476242 -1.2968921661 )\r
+       weight 1330 46 0.0630461648 ( -2.2981748581 2.6218593121 -3.8587124348 )\r
+       weight 1331 50 0.8001715541 ( -0.9410749674 4.6027021408 -7.0700268745 )\r
+       weight 1332 51 0.073736161 ( 3.2923636436 1.9537074566 -3.2173891068 )\r
+       weight 1333 24 0.4195119739 ( -0.7581750154 10.3036937714 -1.2831425667 )\r
+       weight 1334 46 0.4206725657 ( -0.7581750154 3.1306064129 -3.8449628353 )\r
+       weight 1335 47 0.1598154306 ( -0.7581750154 -0.1764767766 -6.336915493 )\r
+       weight 1336 21 0.1281623244 ( -1.4293000698 15.1101446152 -4.3985171318 )\r
+       weight 1337 24 0.2779042721 ( -1.4293000698 8.2028646469 -5.839205265 )\r
+       weight 1338 46 0.2525319755 ( -1.4293000698 1.0297763348 -8.4010257721 )\r
+       weight 1339 25 0.1140847057 ( -2.7863988876 3.0106263161 -11.6123390198 )\r
+       weight 1340 50 0.2273167372 ( -0.0722000003 3.0106189251 -11.6123399734 )\r
+       weight 1341 25 1 ( 2.0745511055 4.6375279427 -4.5531516075 )\r
+       weight 1342 25 1 ( 3.2931761742 3.6312012672 -7.8413891792 )\r
+       weight 1343 24 0.0743158236 ( 6.228749752 10.4647407532 -3.1854553223 )\r
+       weight 1344 25 0.456292659 ( 4.8716506958 5.272503376 -8.9585895538 )\r
+       weight 1345 26 0.4693915546 ( 0.6382077932 2.6234328747 -5.1059546471 )\r
+       weight 1346 25 1 ( 2.500026226 6.1250309944 -6.6162385941 )\r
+       weight 1347 24 0.1309287101 ( 5.9093999863 9.0852708817 -5.6865797043 )\r
+       weight 1348 25 0.4126920104 ( 4.5523014069 3.8930325508 -11.4597139359 )\r
+       weight 1349 26 0.4563792944 ( 0.3188580275 1.2439620495 -7.6070790291 )\r
+       weight 1350 25 1 ( 1.910176158 6.2183766365 -9.3788137436 )\r
+       weight 1351 25 1 ( 1.2691510916 4.9562554359 -11.3785886765 )\r
+       weight 1352 25 1 ( 1.1885761023 6.0877137184 -7.5100264549 )\r
+       weight 1353 24 0.3466432691 ( 0.7719249725 11.458688736 -1.5718924999 )\r
+       weight 1354 46 0.3640886843 ( 0.7719249725 4.2856016159 -4.1337127686 )\r
+       weight 1355 47 0.2180555016 ( 0.7719249725 0.978518188 -6.6256651878 )\r
+       weight 1356 48 0.0712125599 ( 0.7719249725 0.0469462164 -8.884724617 )\r
+       weight 1357 21 0.059975341 ( 1.3127000332 18.6825904846 -3.3249788284 )\r
+       weight 1358 24 0.2719154656 ( 1.3127000332 11.775308609 -4.7656674385 )\r
+       weight 1359 46 0.2719154656 ( 1.3127000332 4.602221489 -7.3274874687 )\r
+       weight 1360 25 0.2590071261 ( -0.0443989038 6.5830712318 -10.5388011932 )\r
+       weight 1361 50 0.1371866614 ( 2.6698002815 6.5830636024 -10.5388021469 )\r
+       weight 1362 21 0.0560896583 ( 0.8055125475 16.7786750793 -2.2916042805 )\r
+       weight 1363 24 0.3113726079 ( 0.8055125475 9.8713941574 -3.7322926521 )\r
+       weight 1364 46 0.3113726079 ( 0.8055125475 2.6983058453 -6.2941131592 )\r
+       weight 1365 25 0.2024002373 ( -0.5515864491 4.6791558266 -9.5054264069 )\r
+       weight 1366 50 0.1187648475 ( 2.1626124382 4.679148674 -9.5054273605 )\r
+       weight 1367 25 1 ( 0.9410759807 4.6027092934 -7.0700263977 )\r
+       weight 1368 24 0.4195119739 ( 0.7581750154 10.3036937714 -1.2831425667 )\r
+       weight 1369 46 0.4206725657 ( 0.7581750154 3.1306064129 -3.8449628353 )\r
+       weight 1370 47 0.1598154306 ( 0.7581750154 -0.1764767766 -6.336915493 )\r
+       weight 1371 21 0.1153460816 ( 1.4293000698 15.1101446152 -4.3985171318 )\r
+       weight 1372 24 0.2501138151 ( 1.4293000698 8.2028646469 -5.839205265 )\r
+       weight 1373 46 0.2272787541 ( 1.4293000698 1.0297763348 -8.4010257721 )\r
+       weight 1374 25 0.2045848966 ( 0.0722010434 3.0106263161 -11.6123390198 )\r
+       weight 1375 26 0.0999999866 ( -4.1612420082 0.3615557849 -7.7597045898 )\r
+       weight 1376 50 0.102676332 ( 2.7864000797 3.0106189251 -11.6123399734 )\r
+       weight 1377 25 0.1157909781 ( 9.8835268021 3.6568837166 -5.9885892868 )\r
+       weight 1378 26 0.8842089772 ( 5.6500835419 1.0078132153 -2.1359541416 )\r
+       weight 1379 25 0.6999999881 ( 6.0404014587 3.6499886513 -5.0398387909 )\r
+       weight 1380 26 0.3000000119 ( 1.8069583178 1.0009181499 -1.1872041225 )\r
+       weight 1381 25 0.3076472282 ( 7.3725509644 3.6193089485 -9.2214393616 )\r
+       weight 1382 26 0.6923528314 ( 3.1391077042 0.9702384472 -5.3688044548 )\r
+       weight 1383 24 0.4800000191 ( 6.825199604 8.9974851608 -7.2885303497 )\r
+       weight 1384 25 0.1200000048 ( 5.4681010246 3.80524683 -13.0616645813 )\r
+       weight 1385 26 0.400000006 ( 1.2346577644 1.1561763287 -9.2090301514 )\r
+       weight 1386 24 0.4800000191 ( 6.5093374252 9.8727293015 -5.7702298164 )\r
+       weight 1387 25 0.1200000048 ( 5.1522388458 4.6804909706 -11.5433635712 )\r
+       weight 1388 26 0.400000006 ( 0.9187954664 2.0314204693 -7.6907291412 )\r
+       weight 1389 24 0.4800000191 ( 8.268324852 8.8667650223 -7.0668549538 )\r
+       weight 1390 25 0.1200000048 ( 6.9112257957 3.6745266914 -12.8399887085 )\r
+       weight 1391 26 0.400000006 ( 2.677782774 1.0254561901 -8.9873542786 )\r
+       weight 1392 24 0.071014069 ( 8.170249939 8.4572477341 -5.2623920441 )\r
+       weight 1393 25 0.3363693058 ( 6.8131513596 3.2650094032 -11.0355262756 )\r
+       weight 1394 26 0.5926166773 ( 2.5797080994 0.6159388423 -7.1828913689 )\r
+       weight 1395 47 1 ( 0 4.4533257484 -4.1004776955 )\r
+       weight 1396 47 1 ( 0 4.934568882 -4.7879776955 )\r
+       weight 1397 47 1 ( -2.0978500843 4.5203881264 -3.6376028061 )\r
+       weight 1398 47 1 ( -2.427850008 5.2766232491 -4.2563529015 )\r
+       weight 1399 47 1 ( 2.0978500843 4.5203881264 -3.6376028061 )\r
+       weight 1400 47 1 ( 2.427850008 5.2766232491 -4.2563529015 )\r
+}\r
index 7856195fabbffdd1d630fec26cbf69ab1e5efe98..a5353332bc93944d941314d758d7866c8d4ee83c 100644 (file)
@@ -1,6 +1,9 @@
 #include "viewerwidget.h"
+
+#include <QFile>
 #include "mainwindow.h"
 
+
 ViewerWidget::ViewerWidget(MainWindow *parent):
         QGLWidget(parent)
 {
@@ -12,6 +15,28 @@ void ViewerWidget::initializeGL()
     mainWindow->writeLog("Initializing...\n");
     if (context()->format().openGLVersionFlags() & QGLFormat::OpenGL_Version_2_1)
         mainWindow->writeLog("OpenGL 2.1 is available :)\n");
+
+    // Shader setup
+    vertexShaderSource = readFile("default.vert");
+    fragmentShaderSource = readFile("default.frag");
+    const GLchar *vertSrc = vertexShaderSource.data();
+    const GLchar *fragSrc = fragmentShaderSource.data();
+    vertexShaderID = glCreateShader(GL_VERTEX_SHADER);
+    fragmentShaderID = glCreateShader(GL_FRAGMENT_SHADER);
+    glShaderSource(vertexShaderID, 1, &vertSrc, 0);
+    glShaderSource(fragmentShaderID, 1, &fragSrc, 0);
+    glCompileShader(vertexShaderID);
+    glCompileShader(fragmentShaderID);
+    shaderProgramID=glCreateProgram();
+    glAttachShader(shaderProgramID, vertexShaderID);
+    glAttachShader(shaderProgramID, fragmentShaderID);
+
+    glEnableVertexAttribArray(0);
+    glBindAttribLocation(shaderprogram, 0, "in_Position");
+
+    glLinkProgram();
+
+
     // Set up the rendering context, define display lists etc.:
     glClearColor(0.0, 0.0, 0.0, 0.0);
     glEnable(GL_DEPTH_TEST);
@@ -28,3 +53,8 @@ void ViewerWidget::paintGL()
     // draw the scene:
     glClear(GL_COLOR_BUFFER_BIT);
 }
+
+QByteArray ViewerWidget::readFile(QString filename)
+{
+    return QFile(filename).readAll();
+}
index 916809fd22f74adcac5b9b8232f31b3579019de6..d6a28cfa1b93d3cbccbfa490fed2145fe98d571f 100644 (file)
@@ -2,6 +2,8 @@
 #define VIEWERWIDGET_H
 
 #include <QGLWidget>
+#include <QString>
+#include <QByteArray>
 
 class MainWindow;
 
@@ -16,8 +18,14 @@ protected:
     void paintGL();
 
 private:
+    QByteArray readFile(QString filename);
     MainWindow *mainWindow;
 
+    QByteArray vertexShaderSource;
+    QByteArray fragmentShaderSource;
+    GLuint vertexShaderID;
+    GLuint fragmentShaderID;
+    GLuint shaderProgramID;
 };
 
 #endif // VIEWERWIDGET_H