├── .gitattributes ├── .gitignore ├── Camera.cpp ├── Camera.h ├── Mesh.cpp ├── Mesh.h ├── Pipeline.cpp ├── Pipeline.h ├── Program.cpp ├── Program.h ├── bin ├── OpenMeshCore.dll ├── OpenMeshCored.dll ├── glew32.dll └── glfw3.dll ├── bunny.txt ├── bunny_simple.txt ├── inc ├── GL │ ├── glew.h │ ├── glxew.h │ └── wglew.h ├── GLFW │ ├── glfw3.h │ └── glfw3native.h ├── OpenMesh │ └── Core │ │ ├── Geometry │ │ ├── Config.hh │ │ ├── LoopSchemeMaskT.hh │ │ ├── MathDefs.hh │ │ ├── NormalConeT.cc │ │ ├── NormalConeT.hh │ │ ├── Plane3d.hh │ │ ├── QuadricT.hh │ │ ├── VectorT.hh │ │ └── VectorT_inc.hh │ │ ├── IO │ │ ├── BinaryHelper.hh │ │ ├── IOInstances.hh │ │ ├── IOManager.hh │ │ ├── MeshIO.hh │ │ ├── OFFFormat.hh │ │ ├── OMFormat.cc │ │ ├── OMFormat.hh │ │ ├── OMFormatT.cc │ │ ├── Options.hh │ │ ├── SR_binary.hh │ │ ├── SR_binary_spec.hh │ │ ├── SR_binary_vector_of_bool.inl │ │ ├── SR_binary_vector_of_fundamentals.inl │ │ ├── SR_binary_vector_of_string.inl │ │ ├── SR_rbo.hh │ │ ├── SR_store.hh │ │ ├── SR_types.hh │ │ ├── StoreRestore.hh │ │ ├── exporter │ │ │ ├── BaseExporter.hh │ │ │ └── ExporterT.hh │ │ ├── importer │ │ │ ├── BaseImporter.hh │ │ │ └── ImporterT.hh │ │ ├── reader │ │ │ ├── BaseReader.hh │ │ │ ├── OBJReader.hh │ │ │ ├── OFFReader.hh │ │ │ ├── OMReader.hh │ │ │ ├── PLYReader.hh │ │ │ └── STLReader.hh │ │ └── writer │ │ │ ├── BaseWriter.hh │ │ │ ├── OBJWriter.hh │ │ │ ├── OFFWriter.hh │ │ │ ├── OMWriter.hh │ │ │ ├── PLYWriter.hh │ │ │ ├── STLWriter.hh │ │ │ └── VTKWriter.hh │ │ ├── Mesh │ │ ├── ArrayItems.hh │ │ ├── ArrayKernel.hh │ │ ├── ArrayKernelT.cc │ │ ├── AttribKernelT.hh │ │ ├── Attributes.hh │ │ ├── BaseKernel.hh │ │ ├── BaseMesh.hh │ │ ├── Casts.hh │ │ ├── CirculatorsT.hh │ │ ├── FinalMeshItemsT.hh │ │ ├── Handles.hh │ │ ├── IteratorsT.hh │ │ ├── PolyConnectivity.hh │ │ ├── PolyMeshT.cc │ │ ├── PolyMeshT.hh │ │ ├── PolyMesh_ArrayKernelT.hh │ │ ├── Status.hh │ │ ├── Traits.hh │ │ ├── TriConnectivity.hh │ │ ├── TriMeshT.cc │ │ ├── TriMeshT.hh │ │ ├── TriMesh_ArrayKernelT.hh │ │ └── gen │ │ │ ├── circulators_header.hh │ │ │ ├── circulators_template.hh │ │ │ ├── footer.hh │ │ │ ├── iterators_header.hh │ │ │ └── iterators_template.hh │ │ ├── System │ │ ├── OpenMeshDLLMacros.hh │ │ ├── compiler.hh │ │ ├── config.h │ │ ├── config.hh │ │ ├── mostream.hh │ │ └── omstream.hh │ │ └── Utils │ │ ├── AutoPropertyHandleT.hh │ │ ├── BaseProperty.hh │ │ ├── Endian.hh │ │ ├── GenProg.hh │ │ ├── Noncopyable.hh │ │ ├── Property.hh │ │ ├── PropertyContainer.hh │ │ ├── PropertyManager.hh │ │ ├── RandomNumberGenerator.hh │ │ ├── SingletonT.cc │ │ ├── SingletonT.hh │ │ ├── color_cast.hh │ │ ├── vector_cast.hh │ │ └── vector_traits.hh └── glm │ ├── common.hpp │ ├── detail │ ├── _features.hpp │ ├── _fixes.hpp │ ├── _noise.hpp │ ├── _swizzle.hpp │ ├── _swizzle_func.hpp │ ├── _vectorize.hpp │ ├── dummy.cpp │ ├── func_common.hpp │ ├── func_common.inl │ ├── func_exponential.hpp │ ├── func_exponential.inl │ ├── func_geometric.hpp │ ├── func_geometric.inl │ ├── func_integer.hpp │ ├── func_integer.inl │ ├── func_matrix.hpp │ ├── func_matrix.inl │ ├── func_packing.hpp │ ├── func_packing.inl │ ├── func_trigonometric.hpp │ ├── func_trigonometric.inl │ ├── func_vector_relational.hpp │ ├── func_vector_relational.inl │ ├── glm.cpp │ ├── intrinsic_common.hpp │ ├── intrinsic_common.inl │ ├── intrinsic_exponential.hpp │ ├── intrinsic_exponential.inl │ ├── intrinsic_geometric.hpp │ ├── intrinsic_geometric.inl │ ├── intrinsic_integer.hpp │ ├── intrinsic_integer.inl │ ├── intrinsic_matrix.hpp │ ├── intrinsic_matrix.inl │ ├── intrinsic_trigonometric.hpp │ ├── intrinsic_trigonometric.inl │ ├── intrinsic_vector_relational.hpp │ ├── intrinsic_vector_relational.inl │ ├── precision.hpp │ ├── setup.hpp │ ├── type_float.hpp │ ├── type_gentype.hpp │ ├── type_gentype.inl │ ├── type_half.hpp │ ├── type_half.inl │ ├── type_int.hpp │ ├── type_mat.hpp │ ├── type_mat.inl │ ├── type_mat2x2.hpp │ ├── type_mat2x2.inl │ ├── type_mat2x3.hpp │ ├── type_mat2x3.inl │ ├── type_mat2x4.hpp │ ├── type_mat2x4.inl │ ├── type_mat3x2.hpp │ ├── type_mat3x2.inl │ ├── type_mat3x3.hpp │ ├── type_mat3x3.inl │ ├── type_mat3x4.hpp │ ├── type_mat3x4.inl │ ├── type_mat4x2.hpp │ ├── type_mat4x2.inl │ ├── type_mat4x3.hpp │ ├── type_mat4x3.inl │ ├── type_mat4x4.hpp │ ├── type_mat4x4.inl │ ├── type_vec.hpp │ ├── type_vec.inl │ ├── type_vec1.hpp │ ├── type_vec1.inl │ ├── type_vec2.hpp │ ├── type_vec2.inl │ ├── type_vec3.hpp │ ├── type_vec3.inl │ ├── type_vec4.hpp │ ├── type_vec4.inl │ ├── type_vec4_avx.inl │ ├── type_vec4_avx2.inl │ └── type_vec4_sse2.inl │ ├── exponential.hpp │ ├── ext.hpp │ ├── fwd.hpp │ ├── geometric.hpp │ ├── glm.hpp │ ├── gtc │ ├── bitfield.hpp │ ├── bitfield.inl │ ├── constants.hpp │ ├── constants.inl │ ├── epsilon.hpp │ ├── epsilon.inl │ ├── integer.hpp │ ├── integer.inl │ ├── matrix_access.hpp │ ├── matrix_access.inl │ ├── matrix_integer.hpp │ ├── matrix_inverse.hpp │ ├── matrix_inverse.inl │ ├── matrix_transform.hpp │ ├── matrix_transform.inl │ ├── noise.hpp │ ├── noise.inl │ ├── packing.hpp │ ├── packing.inl │ ├── quaternion.hpp │ ├── quaternion.inl │ ├── random.hpp │ ├── random.inl │ ├── reciprocal.hpp │ ├── reciprocal.inl │ ├── round.hpp │ ├── round.inl │ ├── type_precision.hpp │ ├── type_precision.inl │ ├── type_ptr.hpp │ ├── type_ptr.inl │ ├── ulp.hpp │ ├── ulp.inl │ ├── vec1.hpp │ └── vec1.inl │ ├── gtx │ ├── associated_min_max.hpp │ ├── associated_min_max.inl │ ├── bit.hpp │ ├── bit.inl │ ├── closest_point.hpp │ ├── closest_point.inl │ ├── color_space.hpp │ ├── color_space.inl │ ├── color_space_YCoCg.hpp │ ├── color_space_YCoCg.inl │ ├── common.hpp │ ├── common.inl │ ├── compatibility.hpp │ ├── compatibility.inl │ ├── component_wise.hpp │ ├── component_wise.inl │ ├── dual_quaternion.hpp │ ├── dual_quaternion.inl │ ├── euler_angles.hpp │ ├── euler_angles.inl │ ├── extend.hpp │ ├── extend.inl │ ├── extented_min_max.hpp │ ├── extented_min_max.inl │ ├── fast_exponential.hpp │ ├── fast_exponential.inl │ ├── fast_square_root.hpp │ ├── fast_square_root.inl │ ├── fast_trigonometry.hpp │ ├── fast_trigonometry.inl │ ├── gradient_paint.hpp │ ├── gradient_paint.inl │ ├── handed_coordinate_space.hpp │ ├── handed_coordinate_space.inl │ ├── integer.hpp │ ├── integer.inl │ ├── intersect.hpp │ ├── intersect.inl │ ├── io.hpp │ ├── io.inl │ ├── log_base.hpp │ ├── log_base.inl │ ├── matrix_cross_product.hpp │ ├── matrix_cross_product.inl │ ├── matrix_decompose.hpp │ ├── matrix_decompose.inl │ ├── matrix_interpolation.hpp │ ├── matrix_interpolation.inl │ ├── matrix_major_storage.hpp │ ├── matrix_major_storage.inl │ ├── matrix_operation.hpp │ ├── matrix_operation.inl │ ├── matrix_query.hpp │ ├── matrix_query.inl │ ├── matrix_transform_2d.hpp │ ├── matrix_transform_2d.inl │ ├── mixed_product.hpp │ ├── mixed_product.inl │ ├── norm.hpp │ ├── norm.inl │ ├── normal.hpp │ ├── normal.inl │ ├── normalize_dot.hpp │ ├── normalize_dot.inl │ ├── number_precision.hpp │ ├── number_precision.inl │ ├── optimum_pow.hpp │ ├── optimum_pow.inl │ ├── orthonormalize.hpp │ ├── orthonormalize.inl │ ├── perpendicular.hpp │ ├── perpendicular.inl │ ├── polar_coordinates.hpp │ ├── polar_coordinates.inl │ ├── projection.hpp │ ├── projection.inl │ ├── quaternion.hpp │ ├── quaternion.inl │ ├── range.hpp │ ├── raw_data.hpp │ ├── raw_data.inl │ ├── rotate_normalized_axis.hpp │ ├── rotate_normalized_axis.inl │ ├── rotate_vector.hpp │ ├── rotate_vector.inl │ ├── scalar_multiplication.hpp │ ├── scalar_relational.hpp │ ├── scalar_relational.inl │ ├── simd_mat4.hpp │ ├── simd_mat4.inl │ ├── simd_quat.hpp │ ├── simd_quat.inl │ ├── simd_vec4.hpp │ ├── simd_vec4.inl │ ├── spline.hpp │ ├── spline.inl │ ├── std_based_type.hpp │ ├── std_based_type.inl │ ├── string_cast.hpp │ ├── string_cast.inl │ ├── transform.hpp │ ├── transform.inl │ ├── transform2.hpp │ ├── transform2.inl │ ├── type_aligned.hpp │ ├── type_aligned.inl │ ├── vector_angle.hpp │ ├── vector_angle.inl │ ├── vector_query.hpp │ ├── vector_query.inl │ ├── wrap.hpp │ └── wrap.inl │ ├── integer.hpp │ ├── mat2x2.hpp │ ├── mat2x3.hpp │ ├── mat2x4.hpp │ ├── mat3x2.hpp │ ├── mat3x3.hpp │ ├── mat3x4.hpp │ ├── mat4x2.hpp │ ├── mat4x3.hpp │ ├── mat4x4.hpp │ ├── matrix.hpp │ ├── packing.hpp │ ├── trigonometric.hpp │ ├── vec2.hpp │ ├── vec3.hpp │ ├── vec4.hpp │ └── vector_relational.hpp ├── lib ├── OpenMeshCore.lib ├── OpenMeshCored.lib ├── glew32.lib └── glfw3dll.lib ├── raycasting_fs.glsl ├── raycasting_vs.glsl ├── render_fs.glsl ├── render_vs.glsl ├── stdafx.cpp ├── stdafx.h ├── targetver.h ├── tetrahedron.txt ├── voxel.cpp ├── voxel.sln ├── voxel.vcxproj ├── voxel.vcxproj.filters ├── voxel_par_triangle_gs.glsl └── voxel_par_triangle_vs.glsl /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Camera.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Camera.h" 3 | #include 4 | #include 5 | 6 | Camera::Camera() 7 | { 8 | } 9 | 10 | 11 | Camera::~Camera() 12 | { 13 | } 14 | 15 | void Camera::lookAt(const glm::vec3& eye_, const glm::vec3& center, const glm::vec3& up) 16 | { 17 | view = glm::lookAt(eye_, center, up); // translation * rotation 18 | 19 | inv_view[0][0] = view[0][0]; 20 | inv_view[0][1] = view[1][0]; // transpose for inverse rotation 21 | inv_view[0][2] = view[2][0]; 22 | inv_view[1][0] = view[0][1]; 23 | inv_view[1][1] = view[1][1]; 24 | inv_view[1][2] = view[2][1]; 25 | inv_view[2][0] = view[0][2]; 26 | inv_view[2][1] = view[1][2]; 27 | inv_view[2][2] = view[2][2]; 28 | inv_view[3][0] = -dot(view[0], view[3]); // minus for inverse translation 29 | inv_view[3][1] = -dot(view[1], view[3]); 30 | inv_view[3][2] = -dot(view[2], view[3]); 31 | 32 | assert(is_identity(inv_view * view)); 33 | 34 | eye = eye_; 35 | } 36 | 37 | void Camera::perspective(float fovy, float zNear_, float zFar) 38 | { 39 | proj = glm::perspectiveFov(fovy, float(width), float(height), zNear_, zFar); 40 | 41 | inv_proj[0][0] = 1.f / proj[0][0]; 42 | inv_proj[1][1] = 1.f / proj[1][1]; 43 | inv_proj[2][2] = 0.f; 44 | inv_proj[2][3] = 1.f / proj[3][2]; 45 | inv_proj[3][0] = inv_proj[0][0] * proj[2][0]; 46 | inv_proj[3][1] = inv_proj[1][1] * proj[2][1]; 47 | inv_proj[3][2] = -1.f; 48 | inv_proj[3][3] = inv_proj[2][3] * proj[2][2]; 49 | 50 | assert(is_identity(inv_proj * proj)); 51 | 52 | zNear = zNear_; 53 | } 54 | 55 | void Camera::print(const glm::mat4& mat) const 56 | { 57 | printf("mat4(\n"); 58 | printf("\t(%4.4f, %4.4f, %4.4f, %4.4f)\n", mat[0][0], mat[1][0], mat[2][0], mat[3][0]); 59 | printf("\t(%4.4f, %4.4f, %4.4f, %4.4f)\n", mat[0][1], mat[1][1], mat[2][1], mat[3][1]); 60 | printf("\t(%4.4f, %4.4f, %4.4f, %4.4f)\n", mat[0][2], mat[1][2], mat[2][2], mat[3][2]); 61 | printf("\t(%4.4f, %4.4f, %4.4f, %4.4f))\n\n", mat[0][3], mat[1][3], mat[2][3], mat[3][3]); 62 | } 63 | 64 | bool Camera::is_identity(const glm::mat4& mat) const 65 | { 66 | static const glm::vec4 epsilon = glm::vec4(10.f * std::numeric_limits::epsilon()); 67 | glm::mat4 diff = mat - glm::mat4(); 68 | glm::bvec4 mask = 69 | glm::lessThanEqual(glm::abs(diff[0]), epsilon) & 70 | glm::lessThanEqual(glm::abs(diff[1]), epsilon) & 71 | glm::lessThanEqual(glm::abs(diff[2]), epsilon) & 72 | glm::lessThanEqual(glm::abs(diff[3]), epsilon); 73 | 74 | return glm::all(mask); 75 | } 76 | -------------------------------------------------------------------------------- /Camera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class Camera 3 | { 4 | public: 5 | Camera(); 6 | ~Camera(); 7 | 8 | static const int width = 700, height = 360; 9 | 10 | void lookAt(const glm::vec3& eye, const glm::vec3& center, const glm::vec3& up); 11 | void perspective(float fovy, float zNear, float zFar); 12 | 13 | glm::mat4 get_view() const { return view; } 14 | glm::mat4 get_proj() const { return proj; } 15 | glm::mat4 get_inv_view() const { return inv_view; } 16 | glm::mat4 get_inv_proj() const { return inv_proj; } 17 | glm::vec3 get_eye() const { return eye; } 18 | float get_zNear() const { return zNear; } 19 | // since there is no scaling in view, the upper mat3 of the transpose of 20 | // the inverse of view mat4 remains unchanged 21 | glm::mat3 get_normal() const { return glm::mat3(view); } 22 | 23 | void print(const glm::mat4& mat) const; 24 | bool is_identity(const glm::mat4& mat) const; 25 | private: 26 | glm::mat4 view; 27 | glm::mat4 proj; 28 | glm::mat4 inv_view; 29 | glm::mat4 inv_proj; 30 | 31 | glm::vec3 eye; 32 | float zNear; 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /Mesh.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum VERTEX_ATTRIB { POSITION, NORMAL, INDEX, NUM_ATTRIB }; 4 | class Mesh 5 | { 6 | public: 7 | Mesh() 8 | { // constructor body of base class is executed first 9 | glGenVertexArrays(1, &vao); 10 | glBindVertexArray(vao); // buffer data format descriptor 11 | } 12 | virtual ~Mesh() { glDeleteVertexArrays(1, &vao); } 13 | 14 | void bind() const { glBindVertexArray(vao); } 15 | virtual void draw() const = 0; 16 | protected: 17 | GLuint vao; 18 | }; 19 | 20 | class Quad : public Mesh 21 | { 22 | public: 23 | Quad(); 24 | ~Quad() { glDeleteBuffers(1, &bo); } 25 | 26 | void draw() const 27 | { 28 | glDrawArrays(GL_TRIANGLES, 0, 6); // 2 triangles 29 | } 30 | private: 31 | GLuint bo; 32 | }; 33 | 34 | typedef OpenMesh::TriMesh_ArrayKernelT<> TriMesh; 35 | class Triangles : public Mesh 36 | { 37 | public: 38 | explicit Triangles(const char* file_name); 39 | ~Triangles() { glDeleteBuffers(VERTEX_ATTRIB::NUM_ATTRIB, bo); } 40 | 41 | void draw() const { glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_INT, 0); } 42 | protected: 43 | Triangles() {}; 44 | void load_file(const char* file_name, TriMesh& mesh); 45 | void load_buffer(const TriMesh& mesh, const std::vector& indices); 46 | 47 | GLsizei count; 48 | GLuint bo[VERTEX_ATTRIB::NUM_ATTRIB]; 49 | }; 50 | 51 | class TrianglesAdj : public Triangles 52 | { 53 | public: 54 | explicit TrianglesAdj(const char* file_name); 55 | ~TrianglesAdj() {} 56 | 57 | void draw() const { glDrawElements(GL_TRIANGLES_ADJACENCY, count, GL_UNSIGNED_INT, 0); } 58 | }; 59 | 60 | class Triangle : public Mesh 61 | { 62 | public: 63 | Triangle(); 64 | ~Triangle() { glDeleteBuffers(1, &bo); } 65 | 66 | void draw() const 67 | { 68 | glDrawArrays(GL_TRIANGLES, 0, 6); // two triangle 69 | } 70 | private: 71 | GLuint bo; 72 | }; -------------------------------------------------------------------------------- /Pipeline.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Program.h" 3 | #include "Camera.h" 4 | 5 | class Pipeline 6 | { 7 | public: 8 | template // variadic template constructor 9 | Pipeline(Ts... args) 10 | { 11 | glGenProgramPipelines(1, &ppo); 12 | 13 | program_iterator(args...); 14 | } 15 | Pipeline(Pipeline&&) = delete; // no default move constructor 16 | ~Pipeline() { glDeleteProgramPipelines(1, &ppo); } 17 | 18 | void bind() const { glBindProgramPipeline(ppo); } 19 | template 20 | void set_uniform(PROGRAM_TYPE type, const char* name, const T& value) const 21 | { 22 | program_array[type].set_uniform(name, value); 23 | } 24 | private: 25 | template 26 | void program_iterator(PROGRAM_TYPE type, const char* file_name, Ts... args) 27 | { 28 | if (program_array[type].spo != 0) 29 | { 30 | throw "Duplicate shader"; 31 | } 32 | program_array[type] = Program(type, file_name); 33 | glUseProgramStages(ppo, gl_shader_bit[type], program_array[type].spo); 34 | 35 | program_iterator(args...); 36 | } 37 | void program_iterator(); 38 | 39 | GLuint ppo; 40 | static const std::array gl_shader_bit; 41 | std::array program_array; 42 | }; 43 | 44 | class Voxelize : public Pipeline 45 | { 46 | public: 47 | Voxelize(GLsizei size); 48 | ~Voxelize() { glDeleteTextures(1, &image); } 49 | 50 | GLuint get_image() const { return image; } 51 | private: 52 | GLuint image; 53 | GLsizei size; 54 | }; 55 | 56 | class Raycast : public Pipeline 57 | { 58 | public: 59 | Raycast(GLsizei size, GLuint image, const Camera* camera); 60 | Raycast(GLsizei size, const GLuint* buffer, const Camera* camera); 61 | ~Raycast() {} 62 | 63 | private: 64 | float inv_model; 65 | const Camera* camera; 66 | }; 67 | 68 | class LinkedList : public Pipeline 69 | { 70 | public: 71 | LinkedList(GLsizei size, GLsizei depth); 72 | ~LinkedList() { glDeleteBuffers(BUFFER_TYPE::NUM_TYPE, buffer); } 73 | 74 | enum BUFFER_TYPE { NEXT, COMP, DATA, COUNTER, NUM_TYPE }; 75 | const GLuint* get_buffer() const { return buffer; } 76 | 77 | void validate() const; 78 | private: 79 | GLsizei size; 80 | GLsizei depth; // average depth, including the dummy head 81 | GLuint buffer[BUFFER_TYPE::NUM_TYPE]; 82 | }; -------------------------------------------------------------------------------- /Program.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "Program.h" 3 | #include 4 | #include 5 | #include 6 | 7 | Program::Program(PROGRAM_TYPE type_, const char* file_name) 8 | { 9 | type = type_; 10 | 11 | std::ifstream in(file_name, std::ios::in); 12 | if (!in) 13 | { 14 | throw "Cannot open " + std::string(file_name); 15 | } 16 | std::ostringstream contents; 17 | contents << in.rdbuf(); 18 | in.close(); 19 | std::string src_str = contents.str(); 20 | const GLchar* src = src_str.c_str(); 21 | 22 | GLint status; 23 | spo = glCreateShaderProgramv(gl_shader[type], 1, &src); 24 | glGetProgramiv(spo, GL_LINK_STATUS, &status); 25 | if (GL_FALSE == status) 26 | { 27 | GLint length; 28 | glGetProgramiv(spo, GL_INFO_LOG_LENGTH, &length); 29 | std::string log(length, '\0'); 30 | glGetProgramInfoLog(spo, length, NULL, &log[0]); 31 | throw std::string(file_name) + " failed " + log; 32 | } 33 | } 34 | 35 | void Program::set_uniform(const char* name, const glm::mat4& mat) const 36 | { 37 | glProgramUniformMatrix4fv(spo, glGetUniformLocation(spo, name), 1, GL_FALSE, glm::value_ptr(mat)); 38 | } 39 | 40 | void Program::set_uniform(const char* name, const glm::mat3& mat) const 41 | { 42 | glProgramUniformMatrix3fv(spo, glGetUniformLocation(spo, name), 1, GL_FALSE, glm::value_ptr(mat)); 43 | } 44 | 45 | void Program::set_uniform(const char* name, const glm::mat4x2& mat) const 46 | { 47 | glProgramUniformMatrix4x2fv(spo, glGetUniformLocation(spo, name), 1, GL_FALSE, glm::value_ptr(mat)); 48 | } 49 | 50 | void Program::set_uniform(const char* name, const float& value) const 51 | { 52 | glProgramUniform1f(spo, glGetUniformLocation(spo, name), value); 53 | } 54 | 55 | void Program::set_uniform(const char* name, const glm::vec3& vec) const 56 | { 57 | glProgramUniform3fv(spo, glGetUniformLocation(spo, name), 1, glm::value_ptr(vec)); 58 | } 59 | 60 | void Program::set_uniform(const char* name, const GLuint& value) const 61 | { 62 | glProgramUniform1ui(spo, glGetUniformLocation(spo, name), value); 63 | } 64 | 65 | const std::array Program::gl_shader = { GL_VERTEX_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER }; -------------------------------------------------------------------------------- /Program.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum PROGRAM_TYPE { VERTEX, GEOMETRY, FRAGMENT, NUM_TYPE }; 4 | class Program 5 | { 6 | public: 7 | Program() { spo = 0; }; // indicates unused program 8 | Program(PROGRAM_TYPE type, const char* file_name); 9 | Program(Program&&) = delete; // no default move constructor 10 | ~Program() 11 | { 12 | glDeleteProgram(spo); 13 | } 14 | Program& operator=(Program& other) 15 | { 16 | spo = other.spo; 17 | type = other.type; 18 | other.spo = 0; 19 | 20 | return *this; 21 | } 22 | 23 | void set_uniform(const char* name, const glm::mat4& mat) const; 24 | void set_uniform(const char* name, const glm::mat3& mat) const; 25 | void set_uniform(const char* name, const glm::mat4x2& mat) const; 26 | void set_uniform(const char* name, const float& value) const; 27 | void set_uniform(const char* name, const glm::vec3& vec) const; 28 | void set_uniform(const char* name, const GLuint& value) const; 29 | 30 | friend class Pipeline; 31 | private: 32 | GLuint spo; 33 | static const std::array gl_shader; 34 | PROGRAM_TYPE type; 35 | }; -------------------------------------------------------------------------------- /bin/OpenMeshCore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhou/voxelizer/60f6fe5759a61dde3f1280540b436bdf90635880/bin/OpenMeshCore.dll -------------------------------------------------------------------------------- /bin/OpenMeshCored.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhou/voxelizer/60f6fe5759a61dde3f1280540b436bdf90635880/bin/OpenMeshCored.dll -------------------------------------------------------------------------------- /bin/glew32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhou/voxelizer/60f6fe5759a61dde3f1280540b436bdf90635880/bin/glew32.dll -------------------------------------------------------------------------------- /bin/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guozhou/voxelizer/60f6fe5759a61dde3f1280540b436bdf90635880/bin/glfw3.dll -------------------------------------------------------------------------------- /inc/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl: -------------------------------------------------------------------------------- 1 | 2 | template <> struct binary< std::vector > 3 | { 4 | 5 | typedef std::vector< bool > value_type; 6 | typedef value_type::value_type elem_type; 7 | 8 | static const bool is_streamable = true; 9 | 10 | static size_t size_of(void) { return UnknownSize; } 11 | static size_t size_of(const value_type& _v) 12 | { 13 | return _v.size() / 8 + ((_v.size() % 8)!=0); 14 | } 15 | 16 | static 17 | size_t store( std::ostream& _ostr, const value_type& _v, bool ) 18 | { 19 | size_t bytes = 0; 20 | 21 | size_t N = _v.size() / 8; 22 | size_t R = _v.size() % 8; 23 | 24 | size_t idx; // element index 25 | unsigned char bits; // bitset 26 | 27 | for (idx=0; idx < N; ++idx) 28 | { 29 | bits = static_cast(_v[idx]) 30 | | (static_cast(_v[idx+1]) << 1) 31 | | (static_cast(_v[idx+2]) << 2) 32 | | (static_cast(_v[idx+3]) << 3) 33 | | (static_cast(_v[idx+4]) << 4) 34 | | (static_cast(_v[idx+5]) << 5) 35 | | (static_cast(_v[idx+6]) << 6) 36 | | (static_cast(_v[idx+7]) << 7); 37 | _ostr << bits; 38 | } 39 | bytes = N; 40 | 41 | if (R) 42 | { 43 | bits = 0; 44 | switch(R) 45 | { 46 | case 7: bits |= (static_cast(_v[idx+6]) << 6); 47 | case 6: bits |= (static_cast(_v[idx+5]) << 5); 48 | case 5: bits |= (static_cast(_v[idx+4]) << 4); 49 | case 4: bits |= (static_cast(_v[idx+3]) << 3); 50 | case 3: bits |= (static_cast(_v[idx+2]) << 2); 51 | case 2: bits |= (static_cast(_v[idx+1]) << 1); 52 | case 1: bits |= static_cast(_v[idx+0]); 53 | } 54 | _ostr << bits; 55 | ++bytes; 56 | } 57 | 58 | assert( bytes == size_of(_v) ); 59 | 60 | return bytes; 61 | } 62 | 63 | static 64 | size_t restore( std::istream& _istr, value_type& _v, bool ) 65 | { 66 | size_t bytes = 0; 67 | 68 | size_t N = _v.size() / 8; 69 | size_t R = _v.size() % 8; 70 | 71 | size_t idx; // element index 72 | unsigned char bits; // bitset 73 | 74 | for (idx=0; idx < N; ++idx) 75 | { 76 | _istr >> bits; 77 | _v[idx+0] = ((bits & 0x01)!=0); 78 | _v[idx+1] = ((bits & 0x02)!=0); 79 | _v[idx+2] = ((bits & 0x04)!=0); 80 | _v[idx+3] = ((bits & 0x08)!=0); 81 | _v[idx+4] = ((bits & 0x10)!=0); 82 | _v[idx+5] = ((bits & 0x20)!=0); 83 | _v[idx+6] = ((bits & 0x40)!=0); 84 | _v[idx+7] = ((bits & 0x80)!=0); 85 | } 86 | bytes = N; 87 | 88 | if (R) 89 | { 90 | _istr >> bits; 91 | for(; idx < _v.size(); ++idx) 92 | _v[idx] = (bits & (1 << (idx%8)))!=0; 93 | ++bytes; 94 | } 95 | 96 | return bytes; 97 | } 98 | }; 99 | -------------------------------------------------------------------------------- /inc/OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl: -------------------------------------------------------------------------------- 1 | 2 | #define BINARY_VECTOR( T ) \ 3 | template <> struct binary< std::vector< T > > { \ 4 | typedef std::vector< T > value_type; \ 5 | typedef value_type::value_type elem_type; \ 6 | \ 7 | static const bool is_streamable = true; \ 8 | \ 9 | static size_t size_of(void) \ 10 | { return IO::UnknownSize; } \ 11 | \ 12 | static size_t size_of(const value_type& _v) \ 13 | { return sizeof(elem_type)*_v.size(); } \ 14 | \ 15 | static \ 16 | size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) { \ 17 | size_t bytes=0; \ 18 | \ 19 | if (_swap) \ 20 | bytes = std::accumulate( _v.begin(), _v.end(), bytes, \ 21 | FunctorStore(_os,_swap) ); \ 22 | else { \ 23 | bytes = size_of(_v); \ 24 | _os.write( reinterpret_cast(&_v[0]), bytes ); \ 25 | } \ 26 | return _os.good() ? bytes : 0; \ 27 | } \ 28 | \ 29 | static size_t restore(std::istream& _is, value_type& _v, bool _swap=false) { \ 30 | size_t bytes=0; \ 31 | \ 32 | if ( _swap) \ 33 | bytes = std::accumulate( _v.begin(), _v.end(), size_t(0), \ 34 | FunctorRestore(_is, _swap) ); \ 35 | else \ 36 | { \ 37 | bytes = size_of(_v); \ 38 | _is.read( reinterpret_cast(&_v[0]), bytes ); \ 39 | } \ 40 | return _is.good() ? bytes : 0; \ 41 | } \ 42 | } 43 | 44 | BINARY_VECTOR( short ); 45 | BINARY_VECTOR( unsigned short ); 46 | BINARY_VECTOR( int ); 47 | BINARY_VECTOR( unsigned int ); 48 | BINARY_VECTOR( long ); 49 | BINARY_VECTOR( unsigned long ); 50 | BINARY_VECTOR( float ); 51 | BINARY_VECTOR( double ); 52 | 53 | #undef BINARY_VECTOR 54 | -------------------------------------------------------------------------------- /inc/OpenMesh/Core/IO/SR_binary_vector_of_string.inl: -------------------------------------------------------------------------------- 1 | 2 | template <> struct binary< std::vector< std::string > > 3 | { 4 | // struct binary interface 5 | 6 | typedef std::vector< std::string > value_type; 7 | typedef value_type::value_type elem_type; 8 | 9 | static const bool is_streamable = true; 10 | 11 | // Helper 12 | 13 | struct Sum 14 | { 15 | size_t operator() ( size_t _v1, const elem_type& _s2 ) 16 | { return _v1 + binary::size_of(_s2); } 17 | }; 18 | 19 | // struct binary interface 20 | 21 | static size_t size_of(void) { return UnknownSize; } 22 | 23 | static size_t size_of(const value_type& _v) 24 | { return std::accumulate( _v.begin(), _v.end(), size_t(0), Sum() ); } 25 | 26 | static 27 | size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) 28 | { 29 | return std::accumulate( _v.begin(), _v.end(), size_t(0), 30 | FunctorStore(_os, _swap) ); 31 | } 32 | 33 | static 34 | size_t restore(std::istream& _is, value_type& _v, bool _swap=false) 35 | { 36 | return std::accumulate( _v.begin(), _v.end(), size_t(0), 37 | FunctorRestore(_is, _swap) ); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /inc/OpenMesh/Core/IO/writer/VTKWriter.hh: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | // 3 | // Implements an IOManager writer module for VTK files 4 | // 5 | //============================================================================= 6 | 7 | #ifndef __VTKWRITER_HH__ 8 | #define __VTKWRITER_HH__ 9 | 10 | //=== INCLUDES ================================================================ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | //== NAMESPACES =============================================================== 21 | 22 | namespace OpenMesh { 23 | namespace IO { 24 | 25 | //=== IMPLEMENTATION ========================================================== 26 | 27 | class OPENMESHDLLEXPORT _VTKWriter_ : public BaseWriter 28 | { 29 | public: 30 | _VTKWriter_(); 31 | 32 | std::string get_description() const { return "VTK"; } 33 | std::string get_extensions() const { return "vtk"; } 34 | 35 | bool write(const std::string&, BaseExporter&, Options, std::streamsize _precision = 6) const; 36 | bool write(std::ostream&, BaseExporter&, Options, std::streamsize _precision = 6) const; 37 | 38 | size_t binary_size(BaseExporter&, Options) const { return 0; } 39 | }; 40 | 41 | //== TYPE DEFINITION ========================================================== 42 | 43 | /// Declare the single entity of the OBJ writer 44 | extern _VTKWriter_ __VTKWriterinstance; 45 | OPENMESHDLLEXPORT _VTKWriter_& VTKWriter(); 46 | 47 | //============================================================================= 48 | } // namespace IO 49 | } // namespace OpenMesh 50 | //============================================================================= 51 | #endif 52 | //============================================================================= 53 | -------------------------------------------------------------------------------- /inc/OpenMesh/Core/Mesh/gen/footer.hh: -------------------------------------------------------------------------------- 1 | //============================================================================= 2 | } // namespace Iterators 3 | } // namespace OpenMesh 4 | //============================================================================= 5 | #endif 6 | //============================================================================= 7 | -------------------------------------------------------------------------------- /inc/glm/common.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/common.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_common.hpp" 36 | -------------------------------------------------------------------------------- /inc/glm/detail/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/_fixes.hpp 29 | /// @date 2011-02-21 / 2011-11-22 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #include 34 | 35 | //! Workaround for compatibility with other libraries 36 | #ifdef max 37 | #undef max 38 | #endif 39 | 40 | //! Workaround for compatibility with other libraries 41 | #ifdef min 42 | #undef min 43 | #endif 44 | 45 | //! Workaround for Android 46 | #ifdef isnan 47 | #undef isnan 48 | #endif 49 | 50 | //! Workaround for Android 51 | #ifdef isinf 52 | #undef isinf 53 | #endif 54 | 55 | //! Workaround for Chrone Native Client 56 | #ifdef log2 57 | #undef log2 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_common.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_common.hpp 25 | /// @date 2009-05-11 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | __m128 sse_abs_ps(__m128 x); 41 | 42 | __m128 sse_sgn_ps(__m128 x); 43 | 44 | //floor 45 | __m128 sse_flr_ps(__m128 v); 46 | 47 | //trunc 48 | __m128 sse_trc_ps(__m128 v); 49 | 50 | //round 51 | __m128 sse_nd_ps(__m128 v); 52 | 53 | //roundEven 54 | __m128 sse_rde_ps(__m128 v); 55 | 56 | __m128 sse_rnd_ps(__m128 x); 57 | 58 | __m128 sse_ceil_ps(__m128 v); 59 | 60 | __m128 sse_frc_ps(__m128 x); 61 | 62 | __m128 sse_mod_ps(__m128 x, __m128 y); 63 | 64 | __m128 sse_modf_ps(__m128 x, __m128i & i); 65 | 66 | //GLM_FUNC_QUALIFIER __m128 sse_min_ps(__m128 x, __m128 y) 67 | 68 | //GLM_FUNC_QUALIFIER __m128 sse_max_ps(__m128 x, __m128 y) 69 | 70 | __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal); 71 | 72 | __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a); 73 | 74 | __m128 sse_stp_ps(__m128 edge, __m128 x); 75 | 76 | __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x); 77 | 78 | __m128 sse_nan_ps(__m128 x); 79 | 80 | __m128 sse_inf_ps(__m128 x); 81 | 82 | }//namespace detail 83 | }//namespace glm 84 | 85 | #include "intrinsic_common.inl" 86 | 87 | #endif//GLM_ARCH 88 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_exponential.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_exponential.hpp 25 | /// @date 2009-05-11 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | /* 41 | GLM_FUNC_QUALIFIER __m128 sse_rsqrt_nr_ss(__m128 const x) 42 | { 43 | __m128 recip = _mm_rsqrt_ss( x ); // "estimate" opcode 44 | const static __m128 three = { 3, 3, 3, 3 }; // aligned consts for fast load 45 | const static __m128 half = { 0.5,0.5,0.5,0.5 }; 46 | __m128 halfrecip = _mm_mul_ss( half, recip ); 47 | __m128 threeminus_xrr = _mm_sub_ss( three, _mm_mul_ss( x, _mm_mul_ss ( recip, recip ) ) ); 48 | return _mm_mul_ss( halfrecip, threeminus_xrr ); 49 | } 50 | 51 | GLM_FUNC_QUALIFIER __m128 sse_normalize_fast_ps( float * RESTRICT vOut, float * RESTRICT vIn ) 52 | { 53 | __m128 x = _mm_load_ss(&vIn[0]); 54 | __m128 y = _mm_load_ss(&vIn[1]); 55 | __m128 z = _mm_load_ss(&vIn[2]); 56 | 57 | const __m128 l = // compute x*x + y*y + z*z 58 | _mm_add_ss( 59 | _mm_add_ss( _mm_mul_ss(x,x), 60 | _mm_mul_ss(y,y) 61 | ), 62 | _mm_mul_ss( z, z ) 63 | ); 64 | 65 | 66 | const __m128 rsqt = _mm_rsqrt_nr_ss( l ); 67 | _mm_store_ss( &vOut[0] , _mm_mul_ss( rsqt, x ) ); 68 | _mm_store_ss( &vOut[1] , _mm_mul_ss( rsqt, y ) ); 69 | _mm_store_ss( &vOut[2] , _mm_mul_ss( rsqt, z ) ); 70 | 71 | return _mm_mul_ss( l , rsqt ); 72 | } 73 | */ 74 | }//namespace detail 75 | }//namespace glm 76 | 77 | #endif//GLM_ARCH 78 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_exponential.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_exponential.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_geometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_geometric.hpp 25 | /// @date 2009-05-08 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | #include "intrinsic_common.hpp" 38 | 39 | namespace glm{ 40 | namespace detail 41 | { 42 | //length 43 | __m128 sse_len_ps(__m128 x); 44 | 45 | //distance 46 | __m128 sse_dst_ps(__m128 p0, __m128 p1); 47 | 48 | //dot 49 | __m128 sse_dot_ps(__m128 v1, __m128 v2); 50 | 51 | // SSE1 52 | __m128 sse_dot_ss(__m128 v1, __m128 v2); 53 | 54 | //cross 55 | __m128 sse_xpd_ps(__m128 v1, __m128 v2); 56 | 57 | //normalize 58 | __m128 sse_nrm_ps(__m128 v); 59 | 60 | //faceforward 61 | __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref); 62 | 63 | //reflect 64 | __m128 sse_rfe_ps(__m128 I, __m128 N); 65 | 66 | //refract 67 | __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta); 68 | 69 | }//namespace detail 70 | }//namespace glm 71 | 72 | #include "intrinsic_geometric.inl" 73 | 74 | #endif//GLM_ARCH 75 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_integer.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_integer.hpp 25 | /// @date 2009-05-11 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "glm/glm.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | __m128i _mm_bit_interleave_si128(__m128i x); 41 | __m128i _mm_bit_interleave_si128(__m128i x, __m128i y); 42 | 43 | }//namespace detail 44 | }//namespace glm 45 | 46 | #include "intrinsic_integer.inl" 47 | 48 | #endif//GLM_ARCH 49 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_matrix.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_common.hpp 25 | /// @date 2009-06-05 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | #include "intrinsic_geometric.hpp" 38 | 39 | namespace glm{ 40 | namespace detail 41 | { 42 | void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); 43 | 44 | void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); 45 | 46 | __m128 sse_mul_ps(__m128 m[4], __m128 v); 47 | 48 | __m128 sse_mul_ps(__m128 v, __m128 m[4]); 49 | 50 | void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]); 51 | 52 | void sse_transpose_ps(__m128 const in[4], __m128 out[4]); 53 | 54 | void sse_inverse_ps(__m128 const in[4], __m128 out[4]); 55 | 56 | void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]); 57 | 58 | __m128 sse_det_ps(__m128 const m[4]); 59 | 60 | __m128 sse_slow_det_ps(__m128 const m[4]); 61 | 62 | }//namespace detail 63 | }//namespace glm 64 | 65 | #include "intrinsic_matrix.inl" 66 | 67 | #endif//GLM_ARCH 68 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_trigonometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_trigonometric.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | 41 | }//namespace detail 42 | }//namespace glm 43 | 44 | #include "intrinsic_trigonometric.inl" 45 | 46 | #endif//GLM_ARCH 47 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_trigonometric.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_trigonometric.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /inc/glm/detail/intrinsic_vector_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/detail/intrinsic_vector_relational.hpp 25 | /// @date 2009-06-09 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #pragma once 30 | 31 | #include "setup.hpp" 32 | 33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2)) 34 | # error "SSE2 instructions not supported or enabled" 35 | #else 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | 41 | }//namespace detail 42 | }//namespace glm 43 | 44 | #include "intrinsic_vector_relational.inl" 45 | 46 | #endif//GLM_ARCH 47 | -------------------------------------------------------------------------------- /inc/glm/detail/precision.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/precision.hpp 29 | /// @date 2013-04-01 / 2013-04-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | namespace glm 36 | { 37 | enum precision 38 | { 39 | highp, 40 | mediump, 41 | lowp, 42 | simd, 43 | defaultp = highp 44 | }; 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /inc/glm/detail/type_half.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_half.hpp 29 | /// @date 2008-08-17 / 2011-09-20 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "setup.hpp" 36 | 37 | namespace glm{ 38 | namespace detail 39 | { 40 | typedef short hdata; 41 | 42 | GLM_FUNC_DECL float toFloat32(hdata value); 43 | GLM_FUNC_DECL hdata toFloat16(float const & value); 44 | 45 | }//namespace detail 46 | }//namespace glm 47 | 48 | #include "type_half.inl" 49 | -------------------------------------------------------------------------------- /inc/glm/detail/type_mat.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_mat.inl 29 | /// @date 2011-06-15 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | -------------------------------------------------------------------------------- /inc/glm/detail/type_vec.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_vec.inl 29 | /// @date 2011-06-15 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /inc/glm/detail/type_vec4_avx.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_tvec4_avx.inl 29 | /// @date 2014-12-01 / 2014-12-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | 37 | }//namespace detail 38 | 39 | 40 | 41 | }//namespace glm 42 | -------------------------------------------------------------------------------- /inc/glm/detail/type_vec4_avx2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_tvec4_avx2.inl 29 | /// @date 2014-12-01 / 2014-12-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | 37 | }//namespace detail 38 | 39 | 40 | 41 | }//namespace glm 42 | -------------------------------------------------------------------------------- /inc/glm/detail/type_vec4_sse2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/detail/type_tvec4_sse2.inl 29 | /// @date 2014-12-01 / 2014-12-01 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | 35 | # if !GLM_HAS_DEFAULTED_FUNCTIONS 36 | template <> 37 | GLM_FUNC_QUALIFIER tvec4::tvec4() 38 | # ifndef GLM_FORCE_NO_CTOR_INIT 39 | : data(_mm_setzero_ps()) 40 | # endif 41 | {} 42 | # endif//!GLM_HAS_DEFAULTED_FUNCTIONS 43 | 44 | template <> 45 | GLM_FUNC_QUALIFIER tvec4::tvec4(float s) : 46 | data(_mm_set1_ps(s)) 47 | {} 48 | 49 | template <> 50 | GLM_FUNC_QUALIFIER tvec4::tvec4(float a, float b, float c, float d) : 51 | data(_mm_set_ps(d, c, b, a)) 52 | {} 53 | 54 | template <> 55 | template 56 | GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(U scalar) 57 | { 58 | this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(scalar))); 59 | return *this; 60 | } 61 | 62 | template <> 63 | template <> 64 | GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(float scalar) 65 | { 66 | this->data = _mm_add_ps(this->data, _mm_set_ps1(scalar)); 67 | return *this; 68 | } 69 | 70 | template <> 71 | template 72 | GLM_FUNC_QUALIFIER tvec4 & tvec4::operator+=(tvec1 const & v) 73 | { 74 | this->data = _mm_add_ps(this->data, _mm_set_ps1(static_cast(v.x))); 75 | return *this; 76 | } 77 | }//namespace glm 78 | -------------------------------------------------------------------------------- /inc/glm/exponential.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/exponential.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_exponential.hpp" 36 | -------------------------------------------------------------------------------- /inc/glm/geometric.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref core 28 | /// @file glm/geometric.hpp 29 | /// @date 2013-12-24 / 2013-12-24 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | #pragma once 34 | 35 | #include "detail/func_geometric.hpp" 36 | -------------------------------------------------------------------------------- /inc/glm/gtc/integer.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_integer 28 | /// @file glm/gtc/integer.inl 29 | /// @date 2014-11-17 / 2014-11-17 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm{ 34 | namespace detail 35 | { 36 | template class vecType> 37 | struct compute_log2 38 | { 39 | GLM_FUNC_QUALIFIER static vecType call(vecType const & vec) 40 | { 41 | //Equivalent to return findMSB(vec); but save one function call in ASM with VC 42 | //return findMSB(vec); 43 | return vecType(detail::compute_findMSB_vec::call(vec)); 44 | } 45 | }; 46 | 47 | # if GLM_HAS_BITSCAN_WINDOWS 48 | template 49 | struct compute_log2 50 | { 51 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & vec) 52 | { 53 | tvec4 Result(glm::uninitialize); 54 | 55 | _BitScanReverse(reinterpret_cast(&Result.x), vec.x); 56 | _BitScanReverse(reinterpret_cast(&Result.y), vec.y); 57 | _BitScanReverse(reinterpret_cast(&Result.z), vec.z); 58 | _BitScanReverse(reinterpret_cast(&Result.w), vec.w); 59 | 60 | return Result; 61 | } 62 | }; 63 | # endif//GLM_HAS_BITSCAN_WINDOWS 64 | }//namespace detail 65 | }//namespace glm 66 | -------------------------------------------------------------------------------- /inc/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_swizzle 28 | /// @file glm/gtc/swizzle.inl 29 | /// @date 2009-06-14 / 2011-06-15 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /inc/glm/gtc/vec1.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtc_vec1 28 | /// @file glm/gtc/vec1.inl 29 | /// @date 2013-03-16 / 2013-03-16 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /inc/glm/gtx/closest_point.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_closest_point 28 | /// @file glm/gtx/closest_point.hpp 29 | /// @date 2005-12-30 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_closest_point GLM_GTX_closest_point 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Find the point on a straight line which is the closet of a point. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_closest_point extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_closest_point 54 | /// @{ 55 | 56 | /// Find the point on a straight line which is the closet of a point. 57 | /// @see gtx_closest_point 58 | template 59 | GLM_FUNC_DECL tvec3 closestPointOnLine( 60 | tvec3 const & point, 61 | tvec3 const & a, 62 | tvec3 const & b); 63 | 64 | /// 2d lines work as well 65 | template 66 | GLM_FUNC_DECL tvec2 closestPointOnLine( 67 | tvec2 const & point, 68 | tvec2 const & a, 69 | tvec2 const & b); 70 | 71 | /// @} 72 | }// namespace glm 73 | 74 | #include "closest_point.inl" 75 | -------------------------------------------------------------------------------- /inc/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_closest_point 28 | /// @file glm/gtx/closest_point.inl 29 | /// @date 2005-12-30 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tvec3 closestPointOnLine 37 | ( 38 | tvec3 const & point, 39 | tvec3 const & a, 40 | tvec3 const & b 41 | ) 42 | { 43 | T LineLength = distance(a, b); 44 | tvec3 Vector = point - a; 45 | tvec3 LineDirection = (b - a) / LineLength; 46 | 47 | // Project Vector to LineDirection to get the distance of point from a 48 | T Distance = dot(Vector, LineDirection); 49 | 50 | if(Distance <= T(0)) return a; 51 | if(Distance >= LineLength) return b; 52 | return a + LineDirection * Distance; 53 | } 54 | 55 | template 56 | GLM_FUNC_QUALIFIER tvec2 closestPointOnLine 57 | ( 58 | tvec2 const & point, 59 | tvec2 const & a, 60 | tvec2 const & b 61 | ) 62 | { 63 | T LineLength = distance(a, b); 64 | tvec2 Vector = point - a; 65 | tvec2 LineDirection = (b - a) / LineLength; 66 | 67 | // Project Vector to LineDirection to get the distance of point from a 68 | T Distance = dot(Vector, LineDirection); 69 | 70 | if(Distance <= T(0)) return a; 71 | if(Distance >= LineLength) return b; 72 | return a + LineDirection * Distance; 73 | } 74 | 75 | }//namespace glm 76 | -------------------------------------------------------------------------------- /inc/glm/gtx/component_wise.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_component_wise 28 | /// @file glm/gtx/component_wise.inl 29 | /// @date 2007-05-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template class vecType> 36 | GLM_FUNC_QUALIFIER T compAdd(vecType const & v) 37 | { 38 | T result(0); 39 | for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) 40 | result += v[i]; 41 | return result; 42 | } 43 | 44 | template class vecType> 45 | GLM_FUNC_QUALIFIER T compMul(vecType const & v) 46 | { 47 | T result(1); 48 | for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) 49 | result *= v[i]; 50 | return result; 51 | } 52 | 53 | template class vecType> 54 | GLM_FUNC_QUALIFIER T compMin(vecType const & v) 55 | { 56 | T result(v[0]); 57 | for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) 58 | result = min(result, v[i]); 59 | return result; 60 | } 61 | 62 | template class vecType> 63 | GLM_FUNC_QUALIFIER T compMax(vecType const & v) 64 | { 65 | T result(v[0]); 66 | for(detail::component_count_t i = 1; i < detail::component_count(v); ++i) 67 | result = max(result, v[i]); 68 | return result; 69 | } 70 | }//namespace glm 71 | -------------------------------------------------------------------------------- /inc/glm/gtx/extend.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_extend 28 | /// @file glm/gtx/extend.hpp 29 | /// @date 2006-01-07 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_extend GLM_GTX_extend 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Extend a position from a source to a position at a defined length. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_extend extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_extend 54 | /// @{ 55 | 56 | /// Extends of Length the Origin position using the (Source - Origin) direction. 57 | /// @see gtx_extend 58 | template 59 | GLM_FUNC_DECL genType extend( 60 | genType const & Origin, 61 | genType const & Source, 62 | typename genType::value_type const Length); 63 | 64 | /// @} 65 | }//namespace glm 66 | 67 | #include "extend.inl" 68 | -------------------------------------------------------------------------------- /inc/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_extend 28 | /// @file glm/gtx/extend.inl 29 | /// @date 2006-01-07 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType extend 37 | ( 38 | genType const & Origin, 39 | genType const & Source, 40 | genType const & Distance 41 | ) 42 | { 43 | return Origin + (Source - Origin) * Distance; 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER tvec2 extend 48 | ( 49 | tvec2 const & Origin, 50 | tvec2 const & Source, 51 | T const & Distance 52 | ) 53 | { 54 | return Origin + (Source - Origin) * Distance; 55 | } 56 | 57 | template 58 | GLM_FUNC_QUALIFIER tvec3 extend 59 | ( 60 | tvec3 const & Origin, 61 | tvec3 const & Source, 62 | T const & Distance 63 | ) 64 | { 65 | return Origin + (Source - Origin) * Distance; 66 | } 67 | 68 | template 69 | GLM_FUNC_QUALIFIER tvec4 extend 70 | ( 71 | tvec4 const & Origin, 72 | tvec4 const & Source, 73 | T const & Distance 74 | ) 75 | { 76 | return Origin + (Source - Origin) * Distance; 77 | } 78 | }//namespace glm 79 | -------------------------------------------------------------------------------- /inc/glm/gtx/gradient_paint.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_gradient_paint 28 | /// @file glm/gtx/gradient_paint.hpp 29 | /// @date 2009-03-06 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_optimum_pow (dependence) 34 | /// 35 | /// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Functions that return the color of procedural gradient for specific coordinates. 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | #include "../gtx/optimum_pow.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_gradient_paint extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_gradient_paint 55 | /// @{ 56 | 57 | /// Return a color from a radial gradient. 58 | /// @see - gtx_gradient_paint 59 | template 60 | GLM_FUNC_DECL T radialGradient( 61 | tvec2 const & Center, 62 | T const & Radius, 63 | tvec2 const & Focal, 64 | tvec2 const & Position); 65 | 66 | /// Return a color from a linear gradient. 67 | /// @see - gtx_gradient_paint 68 | template 69 | GLM_FUNC_DECL T linearGradient( 70 | tvec2 const & Point0, 71 | tvec2 const & Point1, 72 | tvec2 const & Position); 73 | 74 | /// @} 75 | }// namespace glm 76 | 77 | #include "gradient_paint.inl" 78 | -------------------------------------------------------------------------------- /inc/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_gradient_paint 28 | /// @file glm/gtx/gradient_paint.inl 29 | /// @date 2009-03-06 / 2013-04-09 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER T radialGradient 37 | ( 38 | tvec2 const & Center, 39 | T const & Radius, 40 | tvec2 const & Focal, 41 | tvec2 const & Position 42 | ) 43 | { 44 | tvec2 F = Focal - Center; 45 | tvec2 D = Position - Focal; 46 | T Radius2 = pow2(Radius); 47 | T Fx2 = pow2(F.x); 48 | T Fy2 = pow2(F.y); 49 | 50 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 51 | T Denominator = Radius2 - (Fx2 + Fy2); 52 | return Numerator / Denominator; 53 | } 54 | 55 | template 56 | GLM_FUNC_QUALIFIER T linearGradient 57 | ( 58 | tvec2 const & Point0, 59 | tvec2 const & Point1, 60 | tvec2 const & Position 61 | ) 62 | { 63 | tvec2 Dist = Point1 - Point0; 64 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 65 | } 66 | }//namespace glm 67 | -------------------------------------------------------------------------------- /inc/glm/gtx/handed_coordinate_space.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_handed_coordinate_space 28 | /// @file glm/gtx/handed_coordinate_space.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space 35 | /// @ingroup gtx 36 | /// 37 | /// @brief To know if a set of three basis vectors defines a right or left-handed coordinate system. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_handed_coordinate_space 54 | /// @{ 55 | 56 | //! Return if a trihedron right handed or not. 57 | //! From GLM_GTX_handed_coordinate_space extension. 58 | template 59 | GLM_FUNC_DECL bool rightHanded( 60 | tvec3 const & tangent, 61 | tvec3 const & binormal, 62 | tvec3 const & normal); 63 | 64 | //! Return if a trihedron left handed or not. 65 | //! From GLM_GTX_handed_coordinate_space extension. 66 | template 67 | GLM_FUNC_DECL bool leftHanded( 68 | tvec3 const & tangent, 69 | tvec3 const & binormal, 70 | tvec3 const & normal); 71 | 72 | /// @} 73 | }// namespace glm 74 | 75 | #include "handed_coordinate_space.inl" 76 | -------------------------------------------------------------------------------- /inc/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_handed_coordinate_space 28 | /// @file glm/gtx/handed_coordinate_space.inl 29 | /// @date 2005-12-21 / 2009-02-19 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER bool rightHanded 37 | ( 38 | tvec3 const & tangent, 39 | tvec3 const & binormal, 40 | tvec3 const & normal 41 | ) 42 | { 43 | return dot(cross(normal, tangent), binormal) > T(0); 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER bool leftHanded 48 | ( 49 | tvec3 const & tangent, 50 | tvec3 const & binormal, 51 | tvec3 const & normal 52 | ) 53 | { 54 | return dot(cross(normal, tangent), binormal) < T(0); 55 | } 56 | }//namespace glm 57 | -------------------------------------------------------------------------------- /inc/glm/gtx/log_base.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_log_base 28 | /// @file glm/gtx/log_base.hpp 29 | /// @date 2008-10-24 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_log_base GLM_GTX_log_base 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Logarithm for any base. base can be a vector or a scalar. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_log_base extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_log_base 54 | /// @{ 55 | 56 | //! Logarithm for any base. 57 | //! From GLM_GTX_log_base. 58 | template 59 | GLM_FUNC_DECL genType log( 60 | genType x, 61 | genType base); 62 | 63 | //! Logarithm for any base. 64 | //! From GLM_GTX_log_base. 65 | template class vecType> 66 | GLM_FUNC_DECL vecType sign( 67 | vecType const & x, 68 | vecType const & base); 69 | 70 | /// @} 71 | }//namespace glm 72 | 73 | #include "log_base.inl" 74 | -------------------------------------------------------------------------------- /inc/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_log_base 28 | /// @file glm/gtx/log_base.inl 29 | /// @date 2008-10-24 / 2014-11-25 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType log(genType const & x, genType const & base) 37 | { 38 | assert(x != genType(0)); 39 | return glm::log(x) / glm::log(base); 40 | } 41 | 42 | template class vecType> 43 | GLM_FUNC_QUALIFIER vecType log(vecType const & x, vecType const & base) 44 | { 45 | return glm::log(x) / glm::log(base); 46 | } 47 | }//namespace glm 48 | -------------------------------------------------------------------------------- /inc/glm/gtx/matrix_cross_product.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_matrix_cross_product 28 | /// @file glm/gtx/matrix_cross_product.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_extented_min_max (dependence) 34 | /// 35 | /// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Build cross product matrices 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_matrix_cross_product extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_matrix_cross_product 55 | /// @{ 56 | 57 | //! Build a cross product matrix. 58 | //! From GLM_GTX_matrix_cross_product extension. 59 | template 60 | GLM_FUNC_DECL tmat3x3 matrixCross3( 61 | tvec3 const & x); 62 | 63 | //! Build a cross product matrix. 64 | //! From GLM_GTX_matrix_cross_product extension. 65 | template 66 | GLM_FUNC_DECL tmat4x4 matrixCross4( 67 | tvec3 const & x); 68 | 69 | /// @} 70 | }//namespace glm 71 | 72 | #include "matrix_cross_product.inl" 73 | -------------------------------------------------------------------------------- /inc/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_matrix_cross_product 28 | /// @file glm/gtx/matrix_cross_product.inl 29 | /// @date 2005-12-21 / 2005-12-21 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat3x3 matrixCross3 37 | ( 38 | tvec3 const & x 39 | ) 40 | { 41 | tmat3x3 Result(T(0)); 42 | Result[0][1] = x.z; 43 | Result[1][0] = -x.z; 44 | Result[0][2] = -x.y; 45 | Result[2][0] = x.y; 46 | Result[1][2] = x.x; 47 | Result[2][1] = -x.x; 48 | return Result; 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER tmat4x4 matrixCross4 53 | ( 54 | tvec3 const & x 55 | ) 56 | { 57 | tmat4x4 Result(T(0)); 58 | Result[0][1] = x.z; 59 | Result[1][0] = -x.z; 60 | Result[0][2] = -x.y; 61 | Result[2][0] = x.y; 62 | Result[1][2] = x.x; 63 | Result[2][1] = -x.x; 64 | return Result; 65 | } 66 | 67 | }//namespace glm 68 | -------------------------------------------------------------------------------- /inc/glm/gtx/matrix_decompose.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_matrix_decompose 28 | /// @file glm/gtx/matrix_decompose.hpp 29 | /// @date 2014-08-29 / 2014-08-29 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Decomposes a model matrix to translations, rotation and scale components 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependencies 45 | #include "../mat4x4.hpp" 46 | #include "../vec3.hpp" 47 | #include "../vec4.hpp" 48 | #include "../gtc/quaternion.hpp" 49 | #include "../gtc/matrix_transform.hpp" 50 | 51 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 52 | # pragma message("GLM: GLM_GTX_matrix_decompose extension included") 53 | #endif 54 | 55 | namespace glm 56 | { 57 | /// @addtogroup gtx_matrix_decompose 58 | /// @{ 59 | 60 | /// Decomposes a model matrix to translations, rotation and scale components 61 | /// @see gtx_matrix_decompose 62 | template 63 | GLM_FUNC_DECL bool decompose( 64 | tmat4x4 const & modelMatrix, 65 | tvec3 & scale, tquat & orientation, tvec3 & translation, tvec3 & skew, tvec4 & perspective); 66 | 67 | /// @} 68 | }//namespace glm 69 | 70 | #include "matrix_decompose.inl" 71 | -------------------------------------------------------------------------------- /inc/glm/gtx/mixed_product.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_mixed_product 28 | /// @file glm/gtx/mixed_product.hpp 29 | /// @date 2007-04-03 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Mixed product of 3 vectors. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_mixed_product 54 | /// @{ 55 | 56 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 57 | template 58 | GLM_FUNC_DECL T mixedProduct( 59 | tvec3 const & v1, 60 | tvec3 const & v2, 61 | tvec3 const & v3); 62 | 63 | /// @} 64 | }// namespace glm 65 | 66 | #include "mixed_product.inl" 67 | -------------------------------------------------------------------------------- /inc/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_mixed_product 28 | /// @file glm/gtx/mixed_product.inl 29 | /// @date 2007-04-03 / 2008-09-17 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER T mixedProduct 37 | ( 38 | tvec3 const & v1, 39 | tvec3 const & v2, 40 | tvec3 const & v3 41 | ) 42 | { 43 | return dot(cross(v1, v2), v3); 44 | } 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /inc/glm/gtx/normal.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normal 28 | /// @file glm/gtx/normal.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_extented_min_max (dependence) 34 | /// 35 | /// @defgroup gtx_normal GLM_GTX_normal 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Compute the normal of a triangle. 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_normal extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_normal 55 | /// @{ 56 | 57 | //! Computes triangle normal from triangle points. 58 | //! From GLM_GTX_normal extension. 59 | template 60 | GLM_FUNC_DECL tvec3 triangleNormal( 61 | tvec3 const & p1, 62 | tvec3 const & p2, 63 | tvec3 const & p3); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "normal.inl" 69 | -------------------------------------------------------------------------------- /inc/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normal 28 | /// @file glm/gtx/normal.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tvec3 triangleNormal 37 | ( 38 | tvec3 const & p1, 39 | tvec3 const & p2, 40 | tvec3 const & p3 41 | ) 42 | { 43 | return normalize(cross(p1 - p2, p1 - p3)); 44 | } 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /inc/glm/gtx/normalize_dot.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normalize_dot 28 | /// @file glm/gtx/normalize_dot.hpp 29 | /// @date 2007-09-28 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_fast_square_root (dependence) 34 | /// 35 | /// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Dot product of vectors that need to be normalize with a single square root. 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../gtx/fast_square_root.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_normalize_dot extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_normalize_dot 55 | /// @{ 56 | 57 | /// Normalize parameters and returns the dot product of x and y. 58 | /// It's faster that dot(normalize(x), normalize(y)). 59 | /// 60 | /// @see gtx_normalize_dot extension. 61 | template class vecType> 62 | GLM_FUNC_DECL T normalizeDot(vecType const & x, vecType const & y); 63 | 64 | /// Normalize parameters and returns the dot product of x and y. 65 | /// Faster that dot(fastNormalize(x), fastNormalize(y)). 66 | /// 67 | /// @see gtx_normalize_dot extension. 68 | template class vecType> 69 | GLM_FUNC_DECL T fastNormalizeDot(vecType const & x, vecType const & y); 70 | 71 | /// @} 72 | }//namespace glm 73 | 74 | #include "normalize_dot.inl" 75 | -------------------------------------------------------------------------------- /inc/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_normalize_dot 28 | /// @file glm/gtx/normalize_dot.inl 29 | /// @date 2007-09-28 / 2008-10-07 30 | /// @author Christophe Riccio 31 | ////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template class vecType> 36 | GLM_FUNC_QUALIFIER T normalizeDot(vecType const & x, vecType const & y) 37 | { 38 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 39 | } 40 | 41 | template class vecType> 42 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType const & x, vecType const & y) 43 | { 44 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 45 | } 46 | }//namespace glm 47 | -------------------------------------------------------------------------------- /inc/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_number_precision 28 | /// @file glm/gtx/number_precision.inl 29 | /// @date 2007-05-10 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /inc/glm/gtx/optimum_pow.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_optimum_pow 28 | /// @file glm/gtx/optimum_pow.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Integer exponentiation of power functions. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_optimum_pow extension included") 49 | #endif 50 | 51 | namespace glm{ 52 | namespace gtx 53 | { 54 | /// @addtogroup gtx_optimum_pow 55 | /// @{ 56 | 57 | /// Returns x raised to the power of 2. 58 | /// 59 | /// @see gtx_optimum_pow 60 | template 61 | GLM_FUNC_DECL genType pow2(genType const & x); 62 | 63 | /// Returns x raised to the power of 3. 64 | /// 65 | /// @see gtx_optimum_pow 66 | template 67 | GLM_FUNC_DECL genType pow3(genType const & x); 68 | 69 | /// Returns x raised to the power of 4. 70 | /// 71 | /// @see gtx_optimum_pow 72 | template 73 | GLM_FUNC_DECL genType pow4(genType const & x); 74 | 75 | /// @} 76 | }//namespace gtx 77 | }//namespace glm 78 | 79 | #include "optimum_pow.inl" 80 | -------------------------------------------------------------------------------- /inc/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_optimum_pow 28 | /// @file glm/gtx/optimum_pow.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER genType pow2(genType const & x) 37 | { 38 | return x * x; 39 | } 40 | 41 | template 42 | GLM_FUNC_QUALIFIER genType pow3(genType const & x) 43 | { 44 | return x * x * x; 45 | } 46 | 47 | template 48 | GLM_FUNC_QUALIFIER genType pow4(genType const & x) 49 | { 50 | return (x * x) * (x * x); 51 | } 52 | }//namespace glm 53 | -------------------------------------------------------------------------------- /inc/glm/gtx/orthonormalize.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_orthonormalize 28 | /// @file glm/gtx/orthonormalize.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_extented_min_max (dependence) 34 | /// 35 | /// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Orthonormalize matrices. 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../vec3.hpp" 47 | #include "../mat3x3.hpp" 48 | #include "../geometric.hpp" 49 | 50 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 51 | # pragma message("GLM: GLM_GTX_orthonormalize extension included") 52 | #endif 53 | 54 | namespace glm 55 | { 56 | /// @addtogroup gtx_orthonormalize 57 | /// @{ 58 | 59 | /// Returns the orthonormalized matrix of m. 60 | /// 61 | /// @see gtx_orthonormalize 62 | template 63 | GLM_FUNC_DECL tmat3x3 orthonormalize(tmat3x3 const & m); 64 | 65 | /// Orthonormalizes x according y. 66 | /// 67 | /// @see gtx_orthonormalize 68 | template 69 | GLM_FUNC_DECL tvec3 orthonormalize(tvec3 const & x, tvec3 const & y); 70 | 71 | /// @} 72 | }//namespace glm 73 | 74 | #include "orthonormalize.inl" 75 | -------------------------------------------------------------------------------- /inc/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_orthonormalize 28 | /// @file glm/gtx/orthonormalize.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tmat3x3 orthonormalize(tmat3x3 const & m) 37 | { 38 | tmat3x3 r = m; 39 | 40 | r[0] = normalize(r[0]); 41 | 42 | T d0 = dot(r[0], r[1]); 43 | r[1] -= r[0] * d0; 44 | r[1] = normalize(r[1]); 45 | 46 | T d1 = dot(r[1], r[2]); 47 | d0 = dot(r[0], r[2]); 48 | r[2] -= r[0] * d0 + r[1] * d1; 49 | r[2] = normalize(r[2]); 50 | 51 | return r; 52 | } 53 | 54 | template 55 | GLM_FUNC_QUALIFIER tvec3 orthonormalize(tvec3 const & x, tvec3 const & y) 56 | { 57 | return normalize(x - y * dot(y, x)); 58 | } 59 | }//namespace glm 60 | -------------------------------------------------------------------------------- /inc/glm/gtx/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_perpendicular 28 | /// @file glm/gtx/perpendicular.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtx_projection (dependence) 34 | /// 35 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular 36 | /// @ingroup gtx 37 | /// 38 | /// @brief Perpendicular of a vector from other one 39 | /// 40 | /// need to be included to use these functionalities. 41 | /////////////////////////////////////////////////////////////////////////////////// 42 | 43 | #pragma once 44 | 45 | // Dependency: 46 | #include "../glm.hpp" 47 | #include "../gtx/projection.hpp" 48 | 49 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 50 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 51 | #endif 52 | 53 | namespace glm 54 | { 55 | /// @addtogroup gtx_perpendicular 56 | /// @{ 57 | 58 | //! Projects x a perpendicular axis of Normal. 59 | //! From GLM_GTX_perpendicular extension. 60 | template 61 | GLM_FUNC_DECL vecType perp( 62 | vecType const & x, 63 | vecType const & Normal); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "perpendicular.inl" 69 | -------------------------------------------------------------------------------- /inc/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_perpendicular 28 | /// @file glm/gtx/perpendicular.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER vecType perp 37 | ( 38 | vecType const & x, 39 | vecType const & Normal 40 | ) 41 | { 42 | return x - proj(x, Normal); 43 | } 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /inc/glm/gtx/polar_coordinates.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_polar_coordinates 28 | /// @file glm/gtx/polar_coordinates.hpp 29 | /// @date 2007-03-06 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Conversion from Euclidean space to polar space and revert. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_polar_coordinates extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_polar_coordinates 54 | /// @{ 55 | 56 | /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. 57 | /// 58 | /// @see gtx_polar_coordinates 59 | template 60 | GLM_FUNC_DECL tvec3 polar( 61 | tvec3 const & euclidean); 62 | 63 | /// Convert Polar to Euclidean coordinates. 64 | /// 65 | /// @see gtx_polar_coordinates 66 | template 67 | GLM_FUNC_DECL tvec3 euclidean( 68 | tvec2 const & polar); 69 | 70 | /// @} 71 | }//namespace glm 72 | 73 | #include "polar_coordinates.inl" 74 | -------------------------------------------------------------------------------- /inc/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_polar_coordinates 28 | /// @file glm/gtx/polar_coordinates.inl 29 | /// @date 2007-03-06 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER tvec3 polar 37 | ( 38 | tvec3 const & euclidean 39 | ) 40 | { 41 | T const Length(length(euclidean)); 42 | tvec3 const tmp(euclidean / Length); 43 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 44 | 45 | return tvec3( 46 | atan(xz_dist, tmp.y), // latitude 47 | atan(tmp.x, tmp.z), // longitude 48 | xz_dist); // xz distance 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER tvec3 euclidean 53 | ( 54 | tvec2 const & polar 55 | ) 56 | { 57 | T const latitude(polar.x); 58 | T const longitude(polar.y); 59 | 60 | return tvec3( 61 | cos(latitude) * sin(longitude), 62 | sin(latitude), 63 | cos(latitude) * cos(longitude)); 64 | } 65 | 66 | }//namespace glm 67 | -------------------------------------------------------------------------------- /inc/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_projection 28 | /// @file glm/gtx/projection.hpp 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_projection GLM_GTX_projection 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Projection of a vector to other one 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../geometric.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_projection extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_projection 54 | /// @{ 55 | 56 | /// Projects x on Normal. 57 | /// 58 | /// @see gtx_projection 59 | template 60 | GLM_FUNC_DECL vecType proj(vecType const & x, vecType const & Normal); 61 | 62 | /// @} 63 | }//namespace glm 64 | 65 | #include "projection.inl" 66 | -------------------------------------------------------------------------------- /inc/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_projection 28 | /// @file glm/gtx/projection.inl 29 | /// @date 2005-12-21 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER vecType proj(vecType const & x, vecType const & Normal) 37 | { 38 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 39 | } 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /inc/glm/gtx/raw_data.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_raw_data 28 | /// @file glm/gtx/raw_data.hpp 29 | /// @date 2008-11-19 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_raw_data GLM_GTX_raw_data 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Projection of a vector to other one 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependencies 45 | #include "../detail/setup.hpp" 46 | #include "../detail/type_int.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_raw_data extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_raw_data 55 | /// @{ 56 | 57 | //! Type for byte numbers. 58 | //! From GLM_GTX_raw_data extension. 59 | typedef detail::uint8 byte; 60 | 61 | //! Type for word numbers. 62 | //! From GLM_GTX_raw_data extension. 63 | typedef detail::uint16 word; 64 | 65 | //! Type for dword numbers. 66 | //! From GLM_GTX_raw_data extension. 67 | typedef detail::uint32 dword; 68 | 69 | //! Type for qword numbers. 70 | //! From GLM_GTX_raw_data extension. 71 | typedef detail::uint64 qword; 72 | 73 | /// @} 74 | }// namespace glm 75 | 76 | #include "raw_data.inl" 77 | -------------------------------------------------------------------------------- /inc/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_raw_data 28 | /// @file glm/gtx/raw_data.inl 29 | /// @date 2008-11-19 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | -------------------------------------------------------------------------------- /inc/glm/gtx/scalar_relational.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_scalar_relational 28 | /// @file glm/gtx/scalar_relational.hpp 29 | /// @date 2013-02-04 / 2013-02-04 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Extend a position from a source to a position at a defined length. 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 48 | # pragma message("GLM: GLM_GTX_extend extension included") 49 | #endif 50 | 51 | namespace glm 52 | { 53 | /// @addtogroup gtx_scalar_relational 54 | /// @{ 55 | 56 | 57 | 58 | /// @} 59 | }//namespace glm 60 | 61 | #include "scalar_relational.inl" 62 | -------------------------------------------------------------------------------- /inc/glm/gtx/scalar_relational.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_scalar_relational 28 | /// @file glm/gtx/scalar_relational.inl 29 | /// @date 2013-02-04 / 2013-02-04 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | template 36 | GLM_FUNC_QUALIFIER bool lessThan 37 | ( 38 | T const & x, 39 | T const & y 40 | ) 41 | { 42 | return x < y; 43 | } 44 | 45 | template 46 | GLM_FUNC_QUALIFIER bool lessThanEqual 47 | ( 48 | T const & x, 49 | T const & y 50 | ) 51 | { 52 | return x <= y; 53 | } 54 | 55 | template 56 | GLM_FUNC_QUALIFIER bool greaterThan 57 | ( 58 | T const & x, 59 | T const & y 60 | ) 61 | { 62 | return x > y; 63 | } 64 | 65 | template 66 | GLM_FUNC_QUALIFIER bool greaterThanEqual 67 | ( 68 | T const & x, 69 | T const & y 70 | ) 71 | { 72 | return x >= y; 73 | } 74 | 75 | template 76 | GLM_FUNC_QUALIFIER bool equal 77 | ( 78 | T const & x, 79 | T const & y 80 | ) 81 | { 82 | return x == y; 83 | } 84 | 85 | template 86 | GLM_FUNC_QUALIFIER bool notEqual 87 | ( 88 | T const & x, 89 | T const & y 90 | ) 91 | { 92 | return x != y; 93 | } 94 | 95 | GLM_FUNC_QUALIFIER bool any 96 | ( 97 | bool const & x 98 | ) 99 | { 100 | return x; 101 | } 102 | 103 | GLM_FUNC_QUALIFIER bool all 104 | ( 105 | bool const & x 106 | ) 107 | { 108 | return x; 109 | } 110 | 111 | GLM_FUNC_QUALIFIER bool not_ 112 | ( 113 | bool const & x 114 | ) 115 | { 116 | return !x; 117 | } 118 | }//namespace glm 119 | -------------------------------------------------------------------------------- /inc/glm/gtx/spline.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_spline 28 | /// @file glm/gtx/spline.hpp 29 | /// @date 2007-01-25 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// 34 | /// @defgroup gtx_spline GLM_GTX_spline 35 | /// @ingroup gtx 36 | /// 37 | /// @brief Spline functions 38 | /// 39 | /// need to be included to use these functionalities. 40 | /////////////////////////////////////////////////////////////////////////////////// 41 | 42 | #pragma once 43 | 44 | // Dependency: 45 | #include "../glm.hpp" 46 | #include "../gtx/optimum_pow.hpp" 47 | 48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 49 | # pragma message("GLM: GLM_GTX_spline extension included") 50 | #endif 51 | 52 | namespace glm 53 | { 54 | /// @addtogroup gtx_spline 55 | /// @{ 56 | 57 | /// Return a point from a catmull rom curve. 58 | /// @see gtx_spline extension. 59 | template 60 | GLM_FUNC_DECL genType catmullRom( 61 | genType const & v1, 62 | genType const & v2, 63 | genType const & v3, 64 | genType const & v4, 65 | typename genType::value_type const & s); 66 | 67 | /// Return a point from a hermite curve. 68 | /// @see gtx_spline extension. 69 | template 70 | GLM_FUNC_DECL genType hermite( 71 | genType const & v1, 72 | genType const & t1, 73 | genType const & v2, 74 | genType const & t2, 75 | typename genType::value_type const & s); 76 | 77 | /// Return a point from a cubic curve. 78 | /// @see gtx_spline extension. 79 | template 80 | GLM_FUNC_DECL genType cubic( 81 | genType const & v1, 82 | genType const & v2, 83 | genType const & v3, 84 | genType const & v4, 85 | typename genType::value_type const & s); 86 | 87 | /// @} 88 | }//namespace glm 89 | 90 | #include "spline.inl" 91 | -------------------------------------------------------------------------------- /inc/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_std_based_type 28 | /// @file glm/gtx/std_based_type.inl 29 | /// @date 2008-06-08 / 2011-06-07 30 | /// @author Christophe Riccio 31 | /////////////////////////////////////////////////////////////////////////////////// 32 | 33 | namespace glm 34 | { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /inc/glm/gtx/string_cast.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// Restrictions: 16 | /// By making use of the Software for military purposes, you choose to make 17 | /// a Bunny unhappy. 18 | /// 19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | /// THE SOFTWARE. 26 | /// 27 | /// @ref gtx_string_cast 28 | /// @file glm/gtx/string_cast.hpp 29 | /// @date 2008-04-26 / 2014-05-10 30 | /// @author Christophe Riccio 31 | /// 32 | /// @see core (dependence) 33 | /// @see gtc_half_float (dependence) 34 | /// @see gtx_integer (dependence) 35 | /// @see gtx_quaternion (dependence) 36 | /// 37 | /// @defgroup gtx_string_cast GLM_GTX_string_cast 38 | /// @ingroup gtx 39 | /// 40 | /// @brief Setup strings for GLM type values 41 | /// 42 | /// need to be included to use these functionalities. 43 | /// This extension is not supported with CUDA 44 | /////////////////////////////////////////////////////////////////////////////////// 45 | 46 | #pragma once 47 | 48 | // Dependency: 49 | #include "../glm.hpp" 50 | #include "../gtc/type_precision.hpp" 51 | #include "../gtc/quaternion.hpp" 52 | #include "../gtx/dual_quaternion.hpp" 53 | #include 54 | 55 | #if(GLM_COMPILER & GLM_COMPILER_CUDA) 56 | # error "GLM_GTX_string_cast is not supported on CUDA compiler" 57 | #endif 58 | 59 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) 60 | # pragma message("GLM: GLM_GTX_string_cast extension included") 61 | #endif 62 | 63 | namespace glm 64 | { 65 | /// @addtogroup gtx_string_cast 66 | /// @{ 67 | 68 | /// Create a string from a GLM vector or matrix typed variable. 69 | /// @see gtx_string_cast extension. 70 | template