├── .gitignore ├── LICENSE.txt ├── README.md ├── depends ├── include │ ├── KHR │ │ └── khrplatform.h │ ├── glad │ │ └── glad.h │ ├── glfw │ │ ├── glfw3.h │ │ ├── glfw3native.h │ │ └── linmath.h │ └── glm │ │ ├── CMakeLists.txt │ │ ├── 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_common_simd.inl │ │ ├── func_exponential.hpp │ │ ├── func_exponential.inl │ │ ├── func_exponential_simd.inl │ │ ├── func_geometric.hpp │ │ ├── func_geometric.inl │ │ ├── func_geometric_simd.inl │ │ ├── func_integer.hpp │ │ ├── func_integer.inl │ │ ├── func_integer_simd.inl │ │ ├── func_matrix.hpp │ │ ├── func_matrix.inl │ │ ├── func_matrix_simd.inl │ │ ├── func_packing.hpp │ │ ├── func_packing.inl │ │ ├── func_packing_simd.inl │ │ ├── func_trigonometric.hpp │ │ ├── func_trigonometric.inl │ │ ├── func_trigonometric_simd.inl │ │ ├── func_vector_relational.hpp │ │ ├── func_vector_relational.inl │ │ ├── func_vector_relational_simd.inl │ │ ├── glm.cpp │ │ ├── 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_mat4x4_simd.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_simd.inl │ │ ├── exponential.hpp │ │ ├── ext.hpp │ │ ├── fwd.hpp │ │ ├── geometric.hpp │ │ ├── glm.hpp │ │ ├── gtc │ │ ├── bitfield.hpp │ │ ├── bitfield.inl │ │ ├── color_encoding.inl │ │ ├── color_space.hpp │ │ ├── color_space.inl │ │ ├── constants.hpp │ │ ├── constants.inl │ │ ├── epsilon.hpp │ │ ├── epsilon.inl │ │ ├── functions.hpp │ │ ├── functions.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 │ │ ├── quaternion_simd.inl │ │ ├── random.hpp │ │ ├── random.inl │ │ ├── reciprocal.hpp │ │ ├── reciprocal.inl │ │ ├── round.hpp │ │ ├── round.inl │ │ ├── type_aligned.hpp │ │ ├── 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 │ │ ├── extended_min_max.hpp │ │ ├── extended_min_max.inl │ │ ├── fast_exponential.hpp │ │ ├── fast_exponential.inl │ │ ├── fast_square_root.hpp │ │ ├── fast_square_root.inl │ │ ├── fast_trigonometry.hpp │ │ ├── fast_trigonometry.inl │ │ ├── float_notmalize.inl │ │ ├── gradient_paint.hpp │ │ ├── gradient_paint.inl │ │ ├── handed_coordinate_space.hpp │ │ ├── handed_coordinate_space.inl │ │ ├── hash.hpp │ │ ├── hash.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 │ │ ├── type_trait.hpp │ │ ├── type_trait.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 │ │ ├── simd │ │ ├── common.h │ │ ├── exponential.h │ │ ├── geometric.h │ │ ├── integer.h │ │ ├── matrix.h │ │ ├── packing.h │ │ ├── platform.h │ │ ├── trigonometric.h │ │ └── vector_relational.h │ │ ├── trigonometric.hpp │ │ ├── vec2.hpp │ │ ├── vec3.hpp │ │ ├── vec4.hpp │ │ └── vector_relational.hpp ├── lib │ └── glfw │ │ ├── glfw3.dll │ │ ├── glfw3.lib │ │ └── glfw3dll.lib └── src │ └── glad │ └── glad.c ├── examples ├── bwImageHeightMap │ ├── CImg.h │ ├── GreyScaleVoxel.h │ ├── ImageSourceChunkFactory.cpp │ ├── ImageSourceChunkFactory.h │ ├── ReadMe.txt │ ├── bwImageHeightMap.cpp │ ├── bwImageHeightMap.vcxproj │ ├── bwImageHeightMap.vcxproj.filters │ ├── bwImageHeightMap.vcxproj.user │ ├── smallColour.bmp │ ├── smallColourBusSeats.bmp │ ├── sourceImageSmall.bmp │ ├── sourceImageSmaller.bmp │ ├── sourceImageVerySmall.bmp │ ├── stdafx.cpp │ ├── stdafx.h │ ├── targetver.h │ └── vatican.bmp ├── perlinLandscape │ ├── PerlinNoise.cpp │ ├── PerlinNoise.h │ ├── PerlinNoiseChunkFactory.cpp │ ├── PerlinNoiseChunkFactory.h │ ├── ReadMe.txt │ ├── Voxels.h │ ├── perlinLandscape.cpp │ ├── perlinLandscape.vcxproj │ ├── perlinLandscape.vcxproj.filters │ ├── perlinLandscape.vcxproj.user │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h ├── sprites │ ├── TerrainChunkFactory.cpp │ ├── TerrainChunkFactory.h │ ├── TerrainVoxel.h │ ├── Voxels.h │ ├── fourHouses.vox │ ├── highTowerBlock.vox │ ├── sprites.cpp │ ├── sprites.vcxproj │ ├── sprites.vcxproj.filters │ ├── sprites.vcxproj.user │ ├── stdafx.cpp │ ├── stdafx.h │ ├── supermarket.vox │ ├── targetver.h │ └── towerBlock.vox └── voxelInvaders │ ├── BulletMovementSpriteBehaviour.cpp │ ├── BulletMovementSpriteBehaviour.h │ ├── InvaderMovementSpriteBehaviour.cpp │ ├── InvaderMovementSpriteBehaviour.h │ ├── PlayerMovementBehaviour.cpp │ ├── PlayerMovementBehaviour.h │ ├── TerrainChunkFactory.cpp │ ├── TerrainChunkFactory.h │ ├── TerrainVoxel.h │ ├── Voxels.h │ ├── invader2_f0.vox │ ├── invader2_f1.vox │ ├── invaderBullet.vox │ ├── invader_f0.vox │ ├── invader_f1.vox │ ├── player.vox │ ├── playerBullet.vox │ ├── shield.vox │ ├── stdafx.cpp │ ├── stdafx.h │ ├── targetver.h │ ├── voxelInvaders.cpp │ ├── voxelInvaders.vcxproj │ ├── voxelInvaders.vcxproj.filters │ └── voxelInvaders.vcxproj.user ├── screenshots ├── cityConstruction.png ├── invaders.png ├── perlinNoiseLandscape.png ├── photoHeightMap.png └── photoHeightMapVideo.png ├── voxelEngine.sln └── voxelEngine ├── include ├── AABB.h ├── BehaviourFactory.h ├── Chunk.h ├── GeometryUpdateRequest.h ├── IAABB.h ├── ICamera.h ├── ICameraControllerInput.h ├── IChunk.h ├── IChunkFactory.h ├── IChunkManager.h ├── ILightSource.h ├── ISprite.h ├── ISpriteBehaviour.h ├── ISpriteCollisionSet.h ├── ISpriteManager.h ├── ISpriteVoxel.h ├── IVoxel.h ├── IVoxelContainer.h ├── MouseAndKeyboardCameraControllerInput.h ├── SimpleLight.h ├── SpriteCollision.h ├── UniformChunk.h ├── VoxelEngine.h ├── VoxelEngineException.h ├── color.h └── worldSize.h ├── src ├── AABBTree.cpp ├── AABBTree.h ├── BehaviourFactory.cpp ├── Camera.cpp ├── Camera.h ├── Chunk.cpp ├── ChunkManager.cpp ├── ChunkManager.h ├── Controls.cpp ├── Controls.hpp ├── FrameCounter.h ├── ISprite.cpp ├── IVoxel.cpp ├── MouseAndKeyboardCameraControllerInput.cpp ├── NotImplementedException.h ├── NullCameraController.h ├── ShaderManager.cpp ├── ShaderManager.h ├── SpriteCollisionSet.h ├── SpriteManager.cpp ├── SpriteManager.h ├── SpriteVoxel.h ├── UniformChunk.cpp ├── VoxelContainerGeometry.cpp ├── VoxelContainerGeometry.h ├── VoxelEngine.cpp ├── VoxelGeometry.cpp ├── VoxelGeometry.h ├── VoxelRenderer.cpp ├── VoxelRenderer.h ├── VoxelSprite.cpp ├── VoxelSprite.h ├── behaviours │ ├── VoxelatedConstructionSpriteBehaviour.cpp │ └── VoxelatedConstructionSpriteBehaviour.h ├── shaders │ ├── grass.fragmentshader │ ├── simple.vertexshader │ ├── simpleLightColor.fragmentshader │ ├── simpleLightTransform.vertexshader │ └── simpleTransform.vertexshader └── targetver.h ├── voxelEngine.vcxproj ├── voxelEngine.vcxproj.filters └── voxelEngine.vcxproj.user /.gitignore: -------------------------------------------------------------------------------- 1 | x64 2 | Debug 3 | Release 4 | .vs 5 | .DS_Store 6 | voxelEngine.VC.db 7 | *.VC.opendb 8 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 James Randall 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /depends/include/glm/common.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/common.hpp 3 | 4 | #pragma once 5 | 6 | #include "detail/func_common.hpp" 7 | -------------------------------------------------------------------------------- /depends/include/glm/detail/_fixes.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/_fixes.hpp 3 | 4 | #include 5 | 6 | //! Workaround for compatibility with other libraries 7 | #ifdef max 8 | #undef max 9 | #endif 10 | 11 | //! Workaround for compatibility with other libraries 12 | #ifdef min 13 | #undef min 14 | #endif 15 | 16 | //! Workaround for Android 17 | #ifdef isnan 18 | #undef isnan 19 | #endif 20 | 21 | //! Workaround for Android 22 | #ifdef isinf 23 | #undef isinf 24 | #endif 25 | 26 | //! Workaround for Chrone Native Client 27 | #ifdef log2 28 | #undef log2 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /depends/include/glm/detail/func_exponential_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_exponential_simd.inl 3 | 4 | #include "../simd/exponential.h" 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | namespace glm{ 9 | namespace detail 10 | { 11 | template 12 | struct compute_sqrt 13 | { 14 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v) 15 | { 16 | tvec4 result(uninitialize); 17 | result.data = _mm_sqrt_ps(v.data); 18 | return result; 19 | } 20 | }; 21 | 22 | template <> 23 | struct compute_sqrt 24 | { 25 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v) 26 | { 27 | tvec4 result(uninitialize); 28 | result.data = glm_vec4_sqrt_lowp(v.data); 29 | return result; 30 | } 31 | }; 32 | }//namespace detail 33 | }//namespace glm 34 | 35 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 36 | -------------------------------------------------------------------------------- /depends/include/glm/detail/func_integer_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_integer_simd.inl 3 | 4 | #include "../simd/integer.h" 5 | 6 | #if GLM_ARCH & GLM_ARCH_SSE2_BIT 7 | 8 | namespace glm{ 9 | namespace detail 10 | { 11 | template 12 | struct compute_bitfieldReverseStep 13 | { 14 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v, uint32 Mask, uint32 Shift) 15 | { 16 | __m128i const set0 = v.data; 17 | 18 | __m128i const set1 = _mm_set1_epi32(Mask); 19 | __m128i const and1 = _mm_and_si128(set0, set1); 20 | __m128i const sft1 = _mm_slli_epi32(and1, Shift); 21 | 22 | __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); 23 | __m128i const and2 = _mm_and_si128(set0, set2); 24 | __m128i const sft2 = _mm_srai_epi32(and2, Shift); 25 | 26 | __m128i const or0 = _mm_or_si128(sft1, sft2); 27 | 28 | return or0; 29 | } 30 | }; 31 | 32 | template 33 | struct compute_bitfieldBitCountStep 34 | { 35 | GLM_FUNC_QUALIFIER static tvec4 call(tvec4 const & v, uint32 Mask, uint32 Shift) 36 | { 37 | __m128i const set0 = v.data; 38 | 39 | __m128i const set1 = _mm_set1_epi32(Mask); 40 | __m128i const and0 = _mm_and_si128(set0, set1); 41 | __m128i const sft0 = _mm_slli_epi32(set0, Shift); 42 | __m128i const and1 = _mm_and_si128(sft0, set1); 43 | __m128i const add0 = _mm_add_epi32(and0, and1); 44 | 45 | return add0; 46 | } 47 | }; 48 | }//namespace detail 49 | 50 | # if GLM_ARCH & GLM_ARCH_AVX_BIT 51 | template <> 52 | GLM_FUNC_QUALIFIER int bitCount(uint32 x) 53 | { 54 | return _mm_popcnt_u32(x); 55 | } 56 | 57 | # if(GLM_MODEL == GLM_MODEL_64) 58 | template <> 59 | GLM_FUNC_QUALIFIER int bitCount(uint64 x) 60 | { 61 | return static_cast(_mm_popcnt_u64(x)); 62 | } 63 | # endif//GLM_MODEL 64 | # endif//GLM_ARCH 65 | 66 | }//namespace glm 67 | 68 | #endif//GLM_ARCH & GLM_ARCH_SSE2_BIT 69 | -------------------------------------------------------------------------------- /depends/include/glm/detail/func_packing_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_packing_simd.inl 3 | 4 | namespace glm{ 5 | namespace detail 6 | { 7 | 8 | }//namespace detail 9 | }//namespace glm 10 | -------------------------------------------------------------------------------- /depends/include/glm/detail/func_trigonometric_simd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamesRandall/SimpleVoxelEngine/7dcabb818ff11c4aea20a6ff0c605602d6cc2526/depends/include/glm/detail/func_trigonometric_simd.inl -------------------------------------------------------------------------------- /depends/include/glm/detail/func_vector_relational_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/func_vector_relational_simd.inl 3 | 4 | namespace glm{ 5 | namespace detail 6 | { 7 | 8 | }//namespace detail 9 | }//namespace glm 10 | -------------------------------------------------------------------------------- /depends/include/glm/detail/precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/precision.hpp 3 | 4 | #pragma once 5 | 6 | #include "setup.hpp" 7 | 8 | namespace glm 9 | { 10 | enum precision 11 | { 12 | packed_highp, 13 | packed_mediump, 14 | packed_lowp, 15 | 16 | # if GLM_HAS_ALIGNED_TYPE 17 | aligned_highp, 18 | aligned_mediump, 19 | aligned_lowp, 20 | aligned = aligned_highp, 21 | # endif 22 | 23 | highp = packed_highp, 24 | mediump = packed_mediump, 25 | lowp = packed_lowp, 26 | packed = packed_highp, 27 | 28 | # if GLM_HAS_ALIGNED_TYPE && defined(GLM_FORCE_ALIGNED) 29 | defaultp = aligned_highp 30 | # else 31 | defaultp = highp 32 | # endif 33 | }; 34 | 35 | namespace detail 36 | { 37 | template 38 | struct is_aligned 39 | { 40 | static const bool value = false; 41 | }; 42 | 43 | # if GLM_HAS_ALIGNED_TYPE 44 | template<> 45 | struct is_aligned 46 | { 47 | static const bool value = true; 48 | }; 49 | 50 | template<> 51 | struct is_aligned 52 | { 53 | static const bool value = true; 54 | }; 55 | 56 | template<> 57 | struct is_aligned 58 | { 59 | static const bool value = true; 60 | }; 61 | # endif 62 | }//namespace detail 63 | }//namespace glm 64 | -------------------------------------------------------------------------------- /depends/include/glm/detail/type_half.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_half.hpp 3 | 4 | #pragma once 5 | 6 | #include "setup.hpp" 7 | 8 | namespace glm{ 9 | namespace detail 10 | { 11 | typedef short hdata; 12 | 13 | GLM_FUNC_DECL float toFloat32(hdata value); 14 | GLM_FUNC_DECL hdata toFloat16(float const & value); 15 | 16 | }//namespace detail 17 | }//namespace glm 18 | 19 | #include "type_half.inl" 20 | -------------------------------------------------------------------------------- /depends/include/glm/detail/type_mat.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_mat.inl 3 | 4 | -------------------------------------------------------------------------------- /depends/include/glm/detail/type_mat4x4_simd.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_mat4x4_sse2.inl 3 | 4 | namespace glm 5 | { 6 | 7 | }//namespace glm 8 | -------------------------------------------------------------------------------- /depends/include/glm/detail/type_vec.inl: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/detail/type_vec.inl 3 | -------------------------------------------------------------------------------- /depends/include/glm/exponential.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/exponential.hpp 3 | 4 | #pragma once 5 | 6 | #include "detail/func_exponential.hpp" 7 | -------------------------------------------------------------------------------- /depends/include/glm/geometric.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/geometric.hpp 3 | 4 | #pragma once 5 | 6 | #include "detail/func_geometric.hpp" 7 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/color_space.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_color_space 2 | /// @file glm/gtc/color_space.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_color_space (dependence) 6 | /// 7 | /// @defgroup gtc_color_space GLM_GTC_color_space 8 | /// @ingroup gtc 9 | /// 10 | /// @brief Allow to perform bit operations on integer values 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependencies 17 | #include "../detail/setup.hpp" 18 | #include "../detail/precision.hpp" 19 | #include "../exponential.hpp" 20 | #include "../vec3.hpp" 21 | #include "../vec4.hpp" 22 | #include 23 | 24 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 25 | # pragma message("GLM: GLM_GTC_color_space extension included") 26 | #endif 27 | 28 | namespace glm 29 | { 30 | /// @addtogroup gtc_color_space 31 | /// @{ 32 | 33 | /// Convert a linear color to sRGB color using a standard gamma correction. 34 | /// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 35 | template class vecType> 36 | GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear); 37 | 38 | /// Convert a linear color to sRGB color using a custom gamma correction. 39 | /// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 40 | template class vecType> 41 | GLM_FUNC_DECL vecType convertLinearToSRGB(vecType const & ColorLinear, T Gamma); 42 | 43 | /// Convert a sRGB color to linear color using a standard gamma correction. 44 | /// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 45 | template class vecType> 46 | GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB); 47 | 48 | /// Convert a sRGB color to linear color using a custom gamma correction. 49 | // IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb 50 | template class vecType> 51 | GLM_FUNC_DECL vecType convertSRGBToLinear(vecType const & ColorSRGB, T Gamma); 52 | 53 | /// @} 54 | } //namespace glm 55 | 56 | #include "color_space.inl" 57 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/epsilon.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_epsilon 2 | /// @file glm/gtc/epsilon.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// @see gtc_quaternion (dependence) 7 | /// 8 | /// @defgroup gtc_epsilon GLM_GTC_epsilon 9 | /// @ingroup gtc 10 | /// 11 | /// @brief Comparison functions for a user defined epsilon values. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependencies 18 | #include "../detail/setup.hpp" 19 | #include "../detail/precision.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTC_epsilon extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtc_epsilon 28 | /// @{ 29 | 30 | /// Returns the component-wise comparison of |x - y| < epsilon. 31 | /// True if this expression is satisfied. 32 | /// 33 | /// @see gtc_epsilon 34 | template class vecType> 35 | GLM_FUNC_DECL vecType epsilonEqual( 36 | vecType const & x, 37 | vecType const & y, 38 | T const & epsilon); 39 | 40 | /// Returns the component-wise comparison of |x - y| < epsilon. 41 | /// True if this expression is satisfied. 42 | /// 43 | /// @see gtc_epsilon 44 | template 45 | GLM_FUNC_DECL bool epsilonEqual( 46 | genType const & x, 47 | genType const & y, 48 | genType const & epsilon); 49 | 50 | /// Returns the component-wise comparison of |x - y| < epsilon. 51 | /// True if this expression is not satisfied. 52 | /// 53 | /// @see gtc_epsilon 54 | template 55 | GLM_FUNC_DECL typename genType::boolType epsilonNotEqual( 56 | genType const & x, 57 | genType const & y, 58 | typename genType::value_type const & epsilon); 59 | 60 | /// Returns the component-wise comparison of |x - y| >= epsilon. 61 | /// True if this expression is not satisfied. 62 | /// 63 | /// @see gtc_epsilon 64 | template 65 | GLM_FUNC_DECL bool epsilonNotEqual( 66 | genType const & x, 67 | genType const & y, 68 | genType const & epsilon); 69 | 70 | /// @} 71 | }//namespace glm 72 | 73 | #include "epsilon.inl" 74 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/functions.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_functions 2 | /// @file glm/gtc/functions.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// @see gtc_quaternion (dependence) 7 | /// 8 | /// @defgroup gtc_functions GLM_GTC_functions 9 | /// @ingroup gtc 10 | /// 11 | /// @brief List of useful common functions. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependencies 18 | #include "../detail/setup.hpp" 19 | #include "../detail/precision.hpp" 20 | #include "../detail/type_vec2.hpp" 21 | 22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 | # pragma message("GLM: GLM_GTC_functions extension included") 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtc_functions 29 | /// @{ 30 | 31 | /// 1D gauss function 32 | /// 33 | /// @see gtc_epsilon 34 | template 35 | GLM_FUNC_DECL T gauss( 36 | T x, 37 | T ExpectedValue, 38 | T StandardDeviation); 39 | 40 | /// 2D gauss function 41 | /// 42 | /// @see gtc_epsilon 43 | template 44 | GLM_FUNC_DECL T gauss( 45 | tvec2 const& Coord, 46 | tvec2 const& ExpectedValue, 47 | tvec2 const& StandardDeviation); 48 | 49 | /// @} 50 | }//namespace glm 51 | 52 | #include "functions.inl" 53 | 54 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/functions.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_functions 2 | /// @file glm/gtc/functions.inl 3 | 4 | #include "../detail/func_exponential.hpp" 5 | 6 | namespace glm 7 | { 8 | template 9 | GLM_FUNC_QUALIFIER T gauss 10 | ( 11 | T x, 12 | T ExpectedValue, 13 | T StandardDeviation 14 | ) 15 | { 16 | return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER T gauss 21 | ( 22 | tvec2 const& Coord, 23 | tvec2 const& ExpectedValue, 24 | tvec2 const& StandardDeviation 25 | ) 26 | { 27 | tvec2 const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); 28 | return exp(-(Squared.x + Squared.y)); 29 | } 30 | }//namespace glm 31 | 32 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/matrix_access.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_access 2 | /// @file glm/gtc/matrix_access.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_matrix_access GLM_GTC_matrix_access 7 | /// @ingroup gtc 8 | /// 9 | /// Defines functions to access rows or columns of a matrix easily. 10 | /// need to be included to use these functionalities. 11 | 12 | #pragma once 13 | 14 | // Dependency: 15 | #include "../detail/setup.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_GTC_matrix_access extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup gtc_matrix_access 24 | /// @{ 25 | 26 | /// Get a specific row of a matrix. 27 | /// @see gtc_matrix_access 28 | template 29 | GLM_FUNC_DECL typename genType::row_type row( 30 | genType const & m, 31 | length_t index); 32 | 33 | /// Set a specific row to a matrix. 34 | /// @see gtc_matrix_access 35 | template 36 | GLM_FUNC_DECL genType row( 37 | genType const & m, 38 | length_t index, 39 | typename genType::row_type const & x); 40 | 41 | /// Get a specific column of a matrix. 42 | /// @see gtc_matrix_access 43 | template 44 | GLM_FUNC_DECL typename genType::col_type column( 45 | genType const & m, 46 | length_t index); 47 | 48 | /// Set a specific column to a matrix. 49 | /// @see gtc_matrix_access 50 | template 51 | GLM_FUNC_DECL genType column( 52 | genType const & m, 53 | length_t index, 54 | typename genType::col_type const & x); 55 | 56 | /// @} 57 | }//namespace glm 58 | 59 | #include "matrix_access.inl" 60 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/matrix_access.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_access 2 | /// @file glm/gtc/matrix_access.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType row 8 | ( 9 | genType const & m, 10 | length_t index, 11 | typename genType::row_type const & x 12 | ) 13 | { 14 | assert(index >= 0 && index < m[0].length()); 15 | 16 | genType Result = m; 17 | for(length_t i = 0; i < m.length(); ++i) 18 | Result[i][index] = x[i]; 19 | return Result; 20 | } 21 | 22 | template 23 | GLM_FUNC_QUALIFIER typename genType::row_type row 24 | ( 25 | genType const & m, 26 | length_t index 27 | ) 28 | { 29 | assert(index >= 0 && index < m[0].length()); 30 | 31 | typename genType::row_type Result; 32 | for(length_t i = 0; i < m.length(); ++i) 33 | Result[i] = m[i][index]; 34 | return Result; 35 | } 36 | 37 | template 38 | GLM_FUNC_QUALIFIER genType column 39 | ( 40 | genType const & m, 41 | length_t index, 42 | typename genType::col_type const & x 43 | ) 44 | { 45 | assert(index >= 0 && index < m.length()); 46 | 47 | genType Result = m; 48 | Result[index] = x; 49 | return Result; 50 | } 51 | 52 | template 53 | GLM_FUNC_QUALIFIER typename genType::col_type column 54 | ( 55 | genType const & m, 56 | length_t index 57 | ) 58 | { 59 | assert(index >= 0 && index < m.length()); 60 | 61 | return m[index]; 62 | } 63 | }//namespace glm 64 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/matrix_inverse.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_inverse 2 | /// @file glm/gtc/matrix_inverse.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse 7 | /// @ingroup gtc 8 | /// 9 | /// Defines additional matrix inverting functions. 10 | /// need to be included to use these functionalities. 11 | 12 | #pragma once 13 | 14 | // Dependencies 15 | #include "../detail/setup.hpp" 16 | #include "../matrix.hpp" 17 | #include "../mat2x2.hpp" 18 | #include "../mat3x3.hpp" 19 | #include "../mat4x4.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTC_matrix_inverse extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtc_matrix_inverse 28 | /// @{ 29 | 30 | /// Fast matrix inverse for affine matrix. 31 | /// 32 | /// @param m Input matrix to invert. 33 | /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. 34 | /// @see gtc_matrix_inverse 35 | template 36 | GLM_FUNC_DECL genType affineInverse(genType const & m); 37 | 38 | /// Compute the inverse transpose of a matrix. 39 | /// 40 | /// @param m Input matrix to invert transpose. 41 | /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. 42 | /// @see gtc_matrix_inverse 43 | template 44 | GLM_FUNC_DECL genType inverseTranspose(genType const & m); 45 | 46 | /// @} 47 | }//namespace glm 48 | 49 | #include "matrix_inverse.inl" 50 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/noise.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_noise 2 | /// @file glm/gtc/noise.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_noise GLM_GTC_noise 7 | /// @ingroup gtc 8 | /// 9 | /// Defines 2D, 3D and 4D procedural noise functions 10 | /// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": 11 | /// https://github.com/ashima/webgl-noise 12 | /// Following Stefan Gustavson's paper "Simplex noise demystified": 13 | /// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf 14 | /// need to be included to use these functionalities. 15 | 16 | #pragma once 17 | 18 | // Dependencies 19 | #include "../detail/setup.hpp" 20 | #include "../detail/precision.hpp" 21 | #include "../detail/_noise.hpp" 22 | #include "../geometric.hpp" 23 | #include "../common.hpp" 24 | #include "../vector_relational.hpp" 25 | #include "../vec2.hpp" 26 | #include "../vec3.hpp" 27 | #include "../vec4.hpp" 28 | 29 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 30 | # pragma message("GLM: GLM_GTC_noise extension included") 31 | #endif 32 | 33 | namespace glm 34 | { 35 | /// @addtogroup gtc_noise 36 | /// @{ 37 | 38 | /// Classic perlin noise. 39 | /// @see gtc_noise 40 | template class vecType> 41 | GLM_FUNC_DECL T perlin( 42 | vecType const & p); 43 | 44 | /// Periodic perlin noise. 45 | /// @see gtc_noise 46 | template class vecType> 47 | GLM_FUNC_DECL T perlin( 48 | vecType const & p, 49 | vecType const & rep); 50 | 51 | /// Simplex noise. 52 | /// @see gtc_noise 53 | template class vecType> 54 | GLM_FUNC_DECL T simplex( 55 | vecType const & p); 56 | 57 | /// @} 58 | }//namespace glm 59 | 60 | #include "noise.inl" 61 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_swizzle 2 | /// @file glm/gtc/swizzle.inl 3 | 4 | namespace glm 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/ulp.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_ulp 2 | /// @file glm/gtc/ulp.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_ulp GLM_GTC_ulp 7 | /// @ingroup gtc 8 | /// 9 | /// @brief Allow the measurement of the accuracy of a function against a reference 10 | /// implementation. This extension works on floating-point data and provide results 11 | /// in ULP. 12 | /// need to be included to use these features. 13 | 14 | #pragma once 15 | 16 | // Dependencies 17 | #include "../detail/setup.hpp" 18 | #include "../detail/precision.hpp" 19 | #include "../detail/type_int.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTC_ulp extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtc_ulp 28 | /// @{ 29 | 30 | /// Return the next ULP value(s) after the input value(s). 31 | /// @see gtc_ulp 32 | template 33 | GLM_FUNC_DECL genType next_float(genType const & x); 34 | 35 | /// Return the previous ULP value(s) before the input value(s). 36 | /// @see gtc_ulp 37 | template 38 | GLM_FUNC_DECL genType prev_float(genType const & x); 39 | 40 | /// Return the value(s) ULP distance after the input value(s). 41 | /// @see gtc_ulp 42 | template 43 | GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance); 44 | 45 | /// Return the value(s) ULP distance before the input value(s). 46 | /// @see gtc_ulp 47 | template 48 | GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance); 49 | 50 | /// Return the distance in the number of ULP between 2 scalars. 51 | /// @see gtc_ulp 52 | template 53 | GLM_FUNC_DECL uint float_distance(T const & x, T const & y); 54 | 55 | /// Return the distance in the number of ULP between 2 vectors. 56 | /// @see gtc_ulp 57 | template class vecType> 58 | GLM_FUNC_DECL vecType float_distance(vecType const & x, vecType const & y); 59 | 60 | /// @} 61 | }// namespace glm 62 | 63 | #include "ulp.inl" 64 | -------------------------------------------------------------------------------- /depends/include/glm/gtc/vec1.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_vec1 2 | /// @file glm/gtc/vec1.inl 3 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/closest_point.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_closest_point 2 | /// @file glm/gtx/closest_point.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_closest_point GLM_GTX_closest_point 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Find the point on a straight line which is the closet of a point. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_closest_point extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_closest_point 25 | /// @{ 26 | 27 | /// Find the point on a straight line which is the closet of a point. 28 | /// @see gtx_closest_point 29 | template 30 | GLM_FUNC_DECL tvec3 closestPointOnLine( 31 | tvec3 const & point, 32 | tvec3 const & a, 33 | tvec3 const & b); 34 | 35 | /// 2d lines work as well 36 | template 37 | GLM_FUNC_DECL tvec2 closestPointOnLine( 38 | tvec2 const & point, 39 | tvec2 const & a, 40 | tvec2 const & b); 41 | 42 | /// @} 43 | }// namespace glm 44 | 45 | #include "closest_point.inl" 46 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_closest_point 2 | /// @file glm/gtx/closest_point.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tvec3 closestPointOnLine 8 | ( 9 | tvec3 const & point, 10 | tvec3 const & a, 11 | tvec3 const & b 12 | ) 13 | { 14 | T LineLength = distance(a, b); 15 | tvec3 Vector = point - a; 16 | tvec3 LineDirection = (b - a) / LineLength; 17 | 18 | // Project Vector to LineDirection to get the distance of point from a 19 | T Distance = dot(Vector, LineDirection); 20 | 21 | if(Distance <= T(0)) return a; 22 | if(Distance >= LineLength) return b; 23 | return a + LineDirection * Distance; 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER tvec2 closestPointOnLine 28 | ( 29 | tvec2 const & point, 30 | tvec2 const & a, 31 | tvec2 const & b 32 | ) 33 | { 34 | T LineLength = distance(a, b); 35 | tvec2 Vector = point - a; 36 | tvec2 LineDirection = (b - a) / LineLength; 37 | 38 | // Project Vector to LineDirection to get the distance of point from a 39 | T Distance = dot(Vector, LineDirection); 40 | 41 | if(Distance <= T(0)) return a; 42 | if(Distance >= LineLength) return b; 43 | return a + LineDirection * Distance; 44 | } 45 | 46 | }//namespace glm 47 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/color_space.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_color_space 2 | /// @file glm/gtx/color_space.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_color_space GLM_GTX_color_space 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Related to RGB to HSV conversions and operations. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_color_space extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_color_space 25 | /// @{ 26 | 27 | /// Converts a color from HSV color space to its color in RGB color space. 28 | /// @see gtx_color_space 29 | template 30 | GLM_FUNC_DECL tvec3 rgbColor( 31 | tvec3 const & hsvValue); 32 | 33 | /// Converts a color from RGB color space to its color in HSV color space. 34 | /// @see gtx_color_space 35 | template 36 | GLM_FUNC_DECL tvec3 hsvColor( 37 | tvec3 const & rgbValue); 38 | 39 | /// Build a saturation matrix. 40 | /// @see gtx_color_space 41 | template 42 | GLM_FUNC_DECL tmat4x4 saturation( 43 | T const s); 44 | 45 | /// Modify the saturation of a color. 46 | /// @see gtx_color_space 47 | template 48 | GLM_FUNC_DECL tvec3 saturation( 49 | T const s, 50 | tvec3 const & color); 51 | 52 | /// Modify the saturation of a color. 53 | /// @see gtx_color_space 54 | template 55 | GLM_FUNC_DECL tvec4 saturation( 56 | T const s, 57 | tvec4 const & color); 58 | 59 | /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. 60 | /// @see gtx_color_space 61 | template 62 | GLM_FUNC_DECL T luminosity( 63 | tvec3 const & color); 64 | 65 | /// @} 66 | }//namespace glm 67 | 68 | #include "color_space.inl" 69 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/color_space_YCoCg.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_color_space_YCoCg 2 | /// @file glm/gtx/color_space_YCoCg.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg 7 | /// @ingroup gtx 8 | /// 9 | /// @brief RGB to YCoCg conversions and operations 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_color_space_YCoCg 25 | /// @{ 26 | 27 | /// Convert a color from RGB color space to YCoCg color space. 28 | /// @see gtx_color_space_YCoCg 29 | template 30 | GLM_FUNC_DECL tvec3 rgb2YCoCg( 31 | tvec3 const & rgbColor); 32 | 33 | /// Convert a color from YCoCg color space to RGB color space. 34 | /// @see gtx_color_space_YCoCg 35 | template 36 | GLM_FUNC_DECL tvec3 YCoCg2rgb( 37 | tvec3 const & YCoCgColor); 38 | 39 | /// Convert a color from RGB color space to YCoCgR color space. 40 | /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" 41 | /// @see gtx_color_space_YCoCg 42 | template 43 | GLM_FUNC_DECL tvec3 rgb2YCoCgR( 44 | tvec3 const & rgbColor); 45 | 46 | /// Convert a color from YCoCgR color space to RGB color space. 47 | /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" 48 | /// @see gtx_color_space_YCoCg 49 | template 50 | GLM_FUNC_DECL tvec3 YCoCgR2rgb( 51 | tvec3 const & YCoCgColor); 52 | 53 | /// @} 54 | }//namespace glm 55 | 56 | #include "color_space_YCoCg.inl" 57 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/common.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_common 2 | /// @file glm/gtx/common.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// 7 | /// @defgroup gtx_common GLM_GTX_common 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Provide functions to increase the compatibility with Cg and HLSL languages 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependencies: 17 | #include "../vec2.hpp" 18 | #include "../vec3.hpp" 19 | #include "../vec4.hpp" 20 | #include "../gtc/vec1.hpp" 21 | 22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 | # pragma message("GLM: GLM_GTX_common extension included") 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_common 29 | /// @{ 30 | 31 | /// Returns true if x is a denormalized number 32 | /// Numbers whose absolute value is too small to be represented in the normal format are represented in an alternate, denormalized format. 33 | /// This format is less precise but can represent values closer to zero. 34 | /// 35 | /// @tparam genType Floating-point scalar or vector types. 36 | /// 37 | /// @see GLSL isnan man page 38 | /// @see GLSL 4.20.8 specification, section 8.3 Common Functions 39 | template 40 | GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x); 41 | 42 | /// Similar to 'mod' but with a different rounding and integer support. 43 | /// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)' 44 | /// 45 | /// @see GLSL mod vs HLSL fmod 46 | /// @see GLSL mod man page 47 | template class vecType> 48 | GLM_FUNC_DECL vecType fmod(vecType const & v); 49 | 50 | /// @} 51 | }//namespace glm 52 | 53 | #include "common.inl" 54 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/compatibility.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_compatibility 2 | /// @file glm/gtx/compatibility.inl 3 | 4 | #include 5 | 6 | namespace glm 7 | { 8 | // isfinite 9 | template 10 | GLM_FUNC_QUALIFIER bool isfinite( 11 | genType const & x) 12 | { 13 | # if GLM_HAS_CXX11_STL 14 | return std::isfinite(x) != 0; 15 | # elif GLM_COMPILER & GLM_COMPILER_VC 16 | return _finite(x); 17 | # elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID 18 | return _isfinite(x) != 0; 19 | # else 20 | if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm) 21 | return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x; 22 | else 23 | return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x; 24 | # endif 25 | } 26 | 27 | template 28 | GLM_FUNC_QUALIFIER tvec1 isfinite( 29 | tvec1 const & x) 30 | { 31 | return tvec1( 32 | isfinite(x.x)); 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER tvec2 isfinite( 37 | tvec2 const & x) 38 | { 39 | return tvec2( 40 | isfinite(x.x), 41 | isfinite(x.y)); 42 | } 43 | 44 | template 45 | GLM_FUNC_QUALIFIER tvec3 isfinite( 46 | tvec3 const & x) 47 | { 48 | return tvec3( 49 | isfinite(x.x), 50 | isfinite(x.y), 51 | isfinite(x.z)); 52 | } 53 | 54 | template 55 | GLM_FUNC_QUALIFIER tvec4 isfinite( 56 | tvec4 const & x) 57 | { 58 | return tvec4( 59 | isfinite(x.x), 60 | isfinite(x.y), 61 | isfinite(x.z), 62 | isfinite(x.w)); 63 | } 64 | 65 | }//namespace glm 66 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/component_wise.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_component_wise 2 | /// @file glm/gtx/component_wise.hpp 3 | /// @date 2007-05-21 / 2011-06-07 4 | /// @author Christophe Riccio 5 | /// 6 | /// @see core (dependence) 7 | /// 8 | /// @defgroup gtx_component_wise GLM_GTX_component_wise 9 | /// @ingroup gtx 10 | /// 11 | /// @brief Operations between components of a type 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependencies 18 | #include "../detail/setup.hpp" 19 | #include "../detail/precision.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTX_component_wise extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtx_component_wise 28 | /// @{ 29 | 30 | /// Convert an integer vector to a normalized float vector. 31 | /// If the parameter value type is already a floating precision type, the value is passed through. 32 | /// @see gtx_component_wise 33 | template class vecType> 34 | GLM_FUNC_DECL vecType compNormalize(vecType const & v); 35 | 36 | /// Convert a normalized float vector to an integer vector. 37 | /// If the parameter value type is already a floating precision type, the value is passed through. 38 | /// @see gtx_component_wise 39 | template class vecType> 40 | GLM_FUNC_DECL vecType compScale(vecType const & v); 41 | 42 | /// Add all vector components together. 43 | /// @see gtx_component_wise 44 | template 45 | GLM_FUNC_DECL typename genType::value_type compAdd(genType const & v); 46 | 47 | /// Multiply all vector components together. 48 | /// @see gtx_component_wise 49 | template 50 | GLM_FUNC_DECL typename genType::value_type compMul(genType const & v); 51 | 52 | /// Find the minimum value between single vector components. 53 | /// @see gtx_component_wise 54 | template 55 | GLM_FUNC_DECL typename genType::value_type compMin(genType const & v); 56 | 57 | /// Find the maximum value between single vector components. 58 | /// @see gtx_component_wise 59 | template 60 | GLM_FUNC_DECL typename genType::value_type compMax(genType const & v); 61 | 62 | /// @} 63 | }//namespace glm 64 | 65 | #include "component_wise.inl" 66 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/extend.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | /// @file glm/gtx/extend.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_extend GLM_GTX_extend 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Extend a position from a source to a position at a defined length. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_extend extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_extend 25 | /// @{ 26 | 27 | /// Extends of Length the Origin position using the (Source - Origin) direction. 28 | /// @see gtx_extend 29 | template 30 | GLM_FUNC_DECL genType extend( 31 | genType const & Origin, 32 | genType const & Source, 33 | typename genType::value_type const Length); 34 | 35 | /// @} 36 | }//namespace glm 37 | 38 | #include "extend.inl" 39 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | /// @file glm/gtx/extend.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType extend 8 | ( 9 | genType const & Origin, 10 | genType const & Source, 11 | genType const & Distance 12 | ) 13 | { 14 | return Origin + (Source - Origin) * Distance; 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER tvec2 extend 19 | ( 20 | tvec2 const & Origin, 21 | tvec2 const & Source, 22 | T const & Distance 23 | ) 24 | { 25 | return Origin + (Source - Origin) * Distance; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER tvec3 extend 30 | ( 31 | tvec3 const & Origin, 32 | tvec3 const & Source, 33 | T const & Distance 34 | ) 35 | { 36 | return Origin + (Source - Origin) * Distance; 37 | } 38 | 39 | template 40 | GLM_FUNC_QUALIFIER tvec4 extend 41 | ( 42 | tvec4 const & Origin, 43 | tvec4 const & Source, 44 | T const & Distance 45 | ) 46 | { 47 | return Origin + (Source - Origin) * Distance; 48 | } 49 | }//namespace glm 50 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/fast_trigonometry.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_fast_trigonometry 2 | /// @file glm/gtx/fast_trigonometry.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Fast but less accurate implementations of trigonometric functions. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../gtc/constants.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_fast_trigonometry extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_fast_trigonometry 25 | /// @{ 26 | 27 | /// Wrap an angle to [0 2pi[ 28 | /// From GLM_GTX_fast_trigonometry extension. 29 | template 30 | GLM_FUNC_DECL T wrapAngle(T angle); 31 | 32 | /// Faster than the common sin function but less accurate. 33 | /// From GLM_GTX_fast_trigonometry extension. 34 | template 35 | GLM_FUNC_DECL T fastSin(T angle); 36 | 37 | /// Faster than the common cos function but less accurate. 38 | /// From GLM_GTX_fast_trigonometry extension. 39 | template 40 | GLM_FUNC_DECL T fastCos(T angle); 41 | 42 | /// Faster than the common tan function but less accurate. 43 | /// Defined between -2pi and 2pi. 44 | /// From GLM_GTX_fast_trigonometry extension. 45 | template 46 | GLM_FUNC_DECL T fastTan(T angle); 47 | 48 | /// Faster than the common asin function but less accurate. 49 | /// Defined between -2pi and 2pi. 50 | /// From GLM_GTX_fast_trigonometry extension. 51 | template 52 | GLM_FUNC_DECL T fastAsin(T angle); 53 | 54 | /// Faster than the common acos function but less accurate. 55 | /// Defined between -2pi and 2pi. 56 | /// From GLM_GTX_fast_trigonometry extension. 57 | template 58 | GLM_FUNC_DECL T fastAcos(T angle); 59 | 60 | /// Faster than the common atan function but less accurate. 61 | /// Defined between -2pi and 2pi. 62 | /// From GLM_GTX_fast_trigonometry extension. 63 | template 64 | GLM_FUNC_DECL T fastAtan(T y, T x); 65 | 66 | /// Faster than the common atan function but less accurate. 67 | /// Defined between -2pi and 2pi. 68 | /// From GLM_GTX_fast_trigonometry extension. 69 | template 70 | GLM_FUNC_DECL T fastAtan(T angle); 71 | 72 | /// @} 73 | }//namespace glm 74 | 75 | #include "fast_trigonometry.inl" 76 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/float_notmalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_float_normalize 2 | /// @file glm/gtx/float_normalize.inl 3 | 4 | #include 5 | 6 | namespace glm 7 | { 8 | template class vecType> 9 | GLM_FUNC_QUALIFIER vecType floatNormalize(vecType const & v) 10 | { 11 | return vecType(v) / static_cast(std::numeric_limits::max()); 12 | } 13 | 14 | }//namespace glm 15 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/gradient_paint.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_gradient_paint 2 | /// @file glm/gtx/gradient_paint.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_optimum_pow (dependence) 6 | /// 7 | /// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Functions that return the color of procedural gradient for specific coordinates. 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtx/optimum_pow.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_gradient_paint extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_gradient_paint 26 | /// @{ 27 | 28 | /// Return a color from a radial gradient. 29 | /// @see - gtx_gradient_paint 30 | template 31 | GLM_FUNC_DECL T radialGradient( 32 | tvec2 const & Center, 33 | T const & Radius, 34 | tvec2 const & Focal, 35 | tvec2 const & Position); 36 | 37 | /// Return a color from a linear gradient. 38 | /// @see - gtx_gradient_paint 39 | template 40 | GLM_FUNC_DECL T linearGradient( 41 | tvec2 const & Point0, 42 | tvec2 const & Point1, 43 | tvec2 const & Position); 44 | 45 | /// @} 46 | }// namespace glm 47 | 48 | #include "gradient_paint.inl" 49 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_gradient_paint 2 | /// @file glm/gtx/gradient_paint.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER T radialGradient 8 | ( 9 | tvec2 const & Center, 10 | T const & Radius, 11 | tvec2 const & Focal, 12 | tvec2 const & Position 13 | ) 14 | { 15 | tvec2 F = Focal - Center; 16 | tvec2 D = Position - Focal; 17 | T Radius2 = pow2(Radius); 18 | T Fx2 = pow2(F.x); 19 | T Fy2 = pow2(F.y); 20 | 21 | 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)); 22 | T Denominator = Radius2 - (Fx2 + Fy2); 23 | return Numerator / Denominator; 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER T linearGradient 28 | ( 29 | tvec2 const & Point0, 30 | tvec2 const & Point1, 31 | tvec2 const & Position 32 | ) 33 | { 34 | tvec2 Dist = Point1 - Point0; 35 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 36 | } 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/handed_coordinate_space.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_handed_coordinate_space 2 | /// @file glm/gtx/handed_coordinate_space.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space 7 | /// @ingroup gtx 8 | /// 9 | /// @brief To know if a set of three basis vectors defines a right or left-handed coordinate system. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_handed_coordinate_space 25 | /// @{ 26 | 27 | //! Return if a trihedron right handed or not. 28 | //! From GLM_GTX_handed_coordinate_space extension. 29 | template 30 | GLM_FUNC_DECL bool rightHanded( 31 | tvec3 const & tangent, 32 | tvec3 const & binormal, 33 | tvec3 const & normal); 34 | 35 | //! Return if a trihedron left handed or not. 36 | //! From GLM_GTX_handed_coordinate_space extension. 37 | template 38 | GLM_FUNC_DECL bool leftHanded( 39 | tvec3 const & tangent, 40 | tvec3 const & binormal, 41 | tvec3 const & normal); 42 | 43 | /// @} 44 | }// namespace glm 45 | 46 | #include "handed_coordinate_space.inl" 47 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_handed_coordinate_space 2 | /// @file glm/gtx/handed_coordinate_space.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER bool rightHanded 8 | ( 9 | tvec3 const & tangent, 10 | tvec3 const & binormal, 11 | tvec3 const & normal 12 | ) 13 | { 14 | return dot(cross(normal, tangent), binormal) > T(0); 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER bool leftHanded 19 | ( 20 | tvec3 const & tangent, 21 | tvec3 const & binormal, 22 | tvec3 const & normal 23 | ) 24 | { 25 | return dot(cross(normal, tangent), binormal) < T(0); 26 | } 27 | }//namespace glm 28 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/integer.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_integer 2 | /// @file glm/gtx/integer.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_integer GLM_GTX_integer 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Add support for integer for core functions 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtc/integer.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_integer extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_integer 26 | /// @{ 27 | 28 | //! Returns x raised to the y power. 29 | //! From GLM_GTX_integer extension. 30 | GLM_FUNC_DECL int pow(int x, int y); 31 | 32 | //! Returns the positive square root of x. 33 | //! From GLM_GTX_integer extension. 34 | GLM_FUNC_DECL int sqrt(int x); 35 | 36 | //! Returns the floor log2 of x. 37 | //! From GLM_GTX_integer extension. 38 | GLM_FUNC_DECL unsigned int floor_log2(unsigned int x); 39 | 40 | //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. 41 | //! From GLM_GTX_integer extension. 42 | GLM_FUNC_DECL int mod(int x, int y); 43 | 44 | //! Return the factorial value of a number (!12 max, integer only) 45 | //! From GLM_GTX_integer extension. 46 | template 47 | GLM_FUNC_DECL genType factorial(genType const & x); 48 | 49 | //! 32bit signed integer. 50 | //! From GLM_GTX_integer extension. 51 | typedef signed int sint; 52 | 53 | //! Returns x raised to the y power. 54 | //! From GLM_GTX_integer extension. 55 | GLM_FUNC_DECL uint pow(uint x, uint y); 56 | 57 | //! Returns the positive square root of x. 58 | //! From GLM_GTX_integer extension. 59 | GLM_FUNC_DECL uint sqrt(uint x); 60 | 61 | //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. 62 | //! From GLM_GTX_integer extension. 63 | GLM_FUNC_DECL uint mod(uint x, uint y); 64 | 65 | //! Returns the number of leading zeros. 66 | //! From GLM_GTX_integer extension. 67 | GLM_FUNC_DECL uint nlz(uint x); 68 | 69 | /// @} 70 | }//namespace glm 71 | 72 | #include "integer.inl" 73 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/log_base.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_log_base 2 | /// @file glm/gtx/log_base.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_log_base GLM_GTX_log_base 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Logarithm for any base. base can be a vector or a scalar. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_log_base extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_log_base 25 | /// @{ 26 | 27 | /// Logarithm for any base. 28 | /// From GLM_GTX_log_base. 29 | template 30 | GLM_FUNC_DECL genType log( 31 | genType const & x, 32 | genType const & base); 33 | 34 | /// Logarithm for any base. 35 | /// From GLM_GTX_log_base. 36 | template class vecType> 37 | GLM_FUNC_DECL vecType sign( 38 | vecType const & x, 39 | vecType const & base); 40 | 41 | /// @} 42 | }//namespace glm 43 | 44 | #include "log_base.inl" 45 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_log_base 2 | /// @file glm/gtx/log_base.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType log(genType const & x, genType const & base) 8 | { 9 | assert(x != genType(0)); 10 | return glm::log(x) / glm::log(base); 11 | } 12 | 13 | template class vecType> 14 | GLM_FUNC_QUALIFIER vecType log(vecType const & x, vecType const & base) 15 | { 16 | return glm::log(x) / glm::log(base); 17 | } 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/matrix_cross_product.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_cross_product 2 | /// @file glm/gtx/matrix_cross_product.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Build cross product matrices 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_matrix_cross_product extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_matrix_cross_product 26 | /// @{ 27 | 28 | //! Build a cross product matrix. 29 | //! From GLM_GTX_matrix_cross_product extension. 30 | template 31 | GLM_FUNC_DECL tmat3x3 matrixCross3( 32 | tvec3 const & x); 33 | 34 | //! Build a cross product matrix. 35 | //! From GLM_GTX_matrix_cross_product extension. 36 | template 37 | GLM_FUNC_DECL tmat4x4 matrixCross4( 38 | tvec3 const & x); 39 | 40 | /// @} 41 | }//namespace glm 42 | 43 | #include "matrix_cross_product.inl" 44 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_cross_product 2 | /// @file glm/gtx/matrix_cross_product.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tmat3x3 matrixCross3 8 | ( 9 | tvec3 const & x 10 | ) 11 | { 12 | tmat3x3 Result(T(0)); 13 | Result[0][1] = x.z; 14 | Result[1][0] = -x.z; 15 | Result[0][2] = -x.y; 16 | Result[2][0] = x.y; 17 | Result[1][2] = x.x; 18 | Result[2][1] = -x.x; 19 | return Result; 20 | } 21 | 22 | template 23 | GLM_FUNC_QUALIFIER tmat4x4 matrixCross4 24 | ( 25 | tvec3 const & x 26 | ) 27 | { 28 | tmat4x4 Result(T(0)); 29 | Result[0][1] = x.z; 30 | Result[1][0] = -x.z; 31 | Result[0][2] = -x.y; 32 | Result[2][0] = x.y; 33 | Result[1][2] = x.x; 34 | Result[2][1] = -x.x; 35 | return Result; 36 | } 37 | 38 | }//namespace glm 39 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/matrix_decompose.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_decompose 2 | /// @file glm/gtx/matrix_decompose.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Decomposes a model matrix to translations, rotation and scale components 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../mat4x4.hpp" 17 | #include "../vec3.hpp" 18 | #include "../vec4.hpp" 19 | #include "../geometric.hpp" 20 | #include "../gtc/quaternion.hpp" 21 | #include "../gtc/matrix_transform.hpp" 22 | 23 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 24 | # pragma message("GLM: GLM_GTX_matrix_decompose extension included") 25 | #endif 26 | 27 | namespace glm 28 | { 29 | /// @addtogroup gtx_matrix_decompose 30 | /// @{ 31 | 32 | /// Decomposes a model matrix to translations, rotation and scale components 33 | /// @see gtx_matrix_decompose 34 | template 35 | GLM_FUNC_DECL bool decompose( 36 | tmat4x4 const & modelMatrix, 37 | tvec3 & scale, tquat & orientation, tvec3 & translation, tvec3 & skew, tvec4 & perspective); 38 | 39 | /// @} 40 | }//namespace glm 41 | 42 | #include "matrix_decompose.inl" 43 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/matrix_interpolation.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_interpolation 2 | /// @file glm/gtx/matrix_interpolation.hpp 3 | /// @author Ghenadii Ursachi (the.asteroth@gmail.com) 4 | /// 5 | /// @see core (dependence) 6 | /// 7 | /// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Allows to directly interpolate two exiciting matrices. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_matrix_interpolation extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_matrix_interpolation 26 | /// @{ 27 | 28 | /// Get the axis and angle of the rotation from a matrix. 29 | /// From GLM_GTX_matrix_interpolation extension. 30 | template 31 | GLM_FUNC_DECL void axisAngle( 32 | tmat4x4 const & mat, 33 | tvec3 & axis, 34 | T & angle); 35 | 36 | /// Build a matrix from axis and angle. 37 | /// From GLM_GTX_matrix_interpolation extension. 38 | template 39 | GLM_FUNC_DECL tmat4x4 axisAngleMatrix( 40 | tvec3 const & axis, 41 | T const angle); 42 | 43 | /// Extracts the rotation part of a matrix. 44 | /// From GLM_GTX_matrix_interpolation extension. 45 | template 46 | GLM_FUNC_DECL tmat4x4 extractMatrixRotation( 47 | tmat4x4 const & mat); 48 | 49 | /// Build a interpolation of 4 * 4 matrixes. 50 | /// From GLM_GTX_matrix_interpolation extension. 51 | /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. 52 | template 53 | GLM_FUNC_DECL tmat4x4 interpolate( 54 | tmat4x4 const & m1, 55 | tmat4x4 const & m2, 56 | T const delta); 57 | 58 | /// @} 59 | }//namespace glm 60 | 61 | #include "matrix_interpolation.inl" 62 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/matrix_transform_2d.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_transform_2d 2 | /// @file glm/gtc/matrix_transform_2d.inl 3 | /// @author Miguel Ángel Pérez Martínez 4 | 5 | #include "../trigonometric.hpp" 6 | 7 | namespace glm 8 | { 9 | 10 | template 11 | GLM_FUNC_QUALIFIER tmat3x3 translate( 12 | tmat3x3 const & m, 13 | tvec2 const & v) 14 | { 15 | tmat3x3 Result(m); 16 | Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; 17 | return Result; 18 | } 19 | 20 | 21 | template 22 | GLM_FUNC_QUALIFIER tmat3x3 rotate( 23 | tmat3x3 const & m, 24 | T angle) 25 | { 26 | T const a = angle; 27 | T const c = cos(a); 28 | T const s = sin(a); 29 | 30 | tmat3x3 Result(uninitialize); 31 | Result[0] = m[0] * c + m[1] * s; 32 | Result[1] = m[0] * -s + m[1] * c; 33 | Result[2] = m[2]; 34 | return Result; 35 | } 36 | 37 | template 38 | GLM_FUNC_QUALIFIER tmat3x3 scale( 39 | tmat3x3 const & m, 40 | tvec2 const & v) 41 | { 42 | tmat3x3 Result(uninitialize); 43 | Result[0] = m[0] * v[0]; 44 | Result[1] = m[1] * v[1]; 45 | Result[2] = m[2]; 46 | return Result; 47 | } 48 | 49 | template 50 | GLM_FUNC_QUALIFIER tmat3x3 shearX( 51 | tmat3x3 const & m, 52 | T y) 53 | { 54 | tmat3x3 Result(1); 55 | Result[0][1] = y; 56 | return m * Result; 57 | } 58 | 59 | template 60 | GLM_FUNC_QUALIFIER tmat3x3 shearY( 61 | tmat3x3 const & m, 62 | T x) 63 | { 64 | tmat3x3 Result(1); 65 | Result[1][0] = x; 66 | return m * Result; 67 | } 68 | 69 | }//namespace glm 70 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/mixed_product.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | /// @file glm/gtx/mixed_product.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Mixed product of 3 vectors. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_mixed_product 25 | /// @{ 26 | 27 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 28 | template 29 | GLM_FUNC_DECL T mixedProduct( 30 | tvec3 const & v1, 31 | tvec3 const & v2, 32 | tvec3 const & v3); 33 | 34 | /// @} 35 | }// namespace glm 36 | 37 | #include "mixed_product.inl" 38 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | /// @file glm/gtx/mixed_product.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER T mixedProduct 8 | ( 9 | tvec3 const & v1, 10 | tvec3 const & v2, 11 | tvec3 const & v3 12 | ) 13 | { 14 | return dot(cross(v1, v2), v3); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/normal.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | /// @file glm/gtx/normal.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_normal GLM_GTX_normal 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Compute the normal of a triangle. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_normal extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_normal 26 | /// @{ 27 | 28 | //! Computes triangle normal from triangle points. 29 | //! From GLM_GTX_normal extension. 30 | template 31 | GLM_FUNC_DECL tvec3 triangleNormal( 32 | tvec3 const & p1, 33 | tvec3 const & p2, 34 | tvec3 const & p3); 35 | 36 | /// @} 37 | }//namespace glm 38 | 39 | #include "normal.inl" 40 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | /// @file glm/gtx/normal.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tvec3 triangleNormal 8 | ( 9 | tvec3 const & p1, 10 | tvec3 const & p2, 11 | tvec3 const & p3 12 | ) 13 | { 14 | return normalize(cross(p1 - p2, p1 - p3)); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/normalize_dot.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normalize_dot 2 | /// @file glm/gtx/normalize_dot.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_fast_square_root (dependence) 6 | /// 7 | /// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Dot product of vectors that need to be normalize with a single square root. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../gtx/fast_square_root.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_normalize_dot extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_normalize_dot 26 | /// @{ 27 | 28 | /// Normalize parameters and returns the dot product of x and y. 29 | /// It's faster that dot(normalize(x), normalize(y)). 30 | /// 31 | /// @see gtx_normalize_dot extension. 32 | template class vecType> 33 | GLM_FUNC_DECL T normalizeDot(vecType const & x, vecType const & y); 34 | 35 | /// Normalize parameters and returns the dot product of x and y. 36 | /// Faster that dot(fastNormalize(x), fastNormalize(y)). 37 | /// 38 | /// @see gtx_normalize_dot extension. 39 | template class vecType> 40 | GLM_FUNC_DECL T fastNormalizeDot(vecType const & x, vecType const & y); 41 | 42 | /// @} 43 | }//namespace glm 44 | 45 | #include "normalize_dot.inl" 46 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normalize_dot 2 | /// @file glm/gtx/normalize_dot.inl 3 | 4 | namespace glm 5 | { 6 | template class vecType> 7 | GLM_FUNC_QUALIFIER T normalizeDot(vecType const & x, vecType const & y) 8 | { 9 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 10 | } 11 | 12 | template class vecType> 13 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType const & x, vecType const & y) 14 | { 15 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 16 | } 17 | }//namespace glm 18 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/number_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_number_precision 2 | /// @file glm/gtx/number_precision.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_type_precision (dependence) 6 | /// @see gtc_quaternion (dependence) 7 | /// 8 | /// @defgroup gtx_number_precision GLM_GTX_number_precision 9 | /// @ingroup gtx 10 | /// 11 | /// @brief Defined size types. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependency: 18 | #include "../glm.hpp" 19 | #include "../gtc/type_precision.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTX_number_precision extension included") 23 | #endif 24 | 25 | namespace glm{ 26 | namespace gtx 27 | { 28 | ///////////////////////////// 29 | // Unsigned int vector types 30 | 31 | /// @addtogroup gtx_number_precision 32 | /// @{ 33 | 34 | typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 35 | typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 36 | typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 37 | typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) 38 | 39 | ////////////////////// 40 | // Float vector types 41 | 42 | typedef f32 f32vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 43 | typedef f64 f64vec1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 44 | 45 | ////////////////////// 46 | // Float matrix types 47 | 48 | typedef f32 f32mat1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 49 | typedef f32 f32mat1x1; //!< \brief Single-precision floating-point scalar. (from GLM_GTX_number_precision extension) 50 | typedef f64 f64mat1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) 51 | typedef f64 f64mat1x1; //!< \brief Double-precision floating-point scalar. (from GLM_GTX_number_precision extension) 52 | 53 | /// @} 54 | }//namespace gtx 55 | }//namespace glm 56 | 57 | #include "number_precision.inl" 58 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_number_precision 2 | /// @file glm/gtx/number_precision.inl 3 | 4 | namespace glm 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/optimum_pow.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | /// @file glm/gtx/optimum_pow.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Integer exponentiation of power functions. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_optimum_pow extension included") 20 | #endif 21 | 22 | namespace glm{ 23 | namespace gtx 24 | { 25 | /// @addtogroup gtx_optimum_pow 26 | /// @{ 27 | 28 | /// Returns x raised to the power of 2. 29 | /// 30 | /// @see gtx_optimum_pow 31 | template 32 | GLM_FUNC_DECL genType pow2(genType const & x); 33 | 34 | /// Returns x raised to the power of 3. 35 | /// 36 | /// @see gtx_optimum_pow 37 | template 38 | GLM_FUNC_DECL genType pow3(genType const & x); 39 | 40 | /// Returns x raised to the power of 4. 41 | /// 42 | /// @see gtx_optimum_pow 43 | template 44 | GLM_FUNC_DECL genType pow4(genType const & x); 45 | 46 | /// @} 47 | }//namespace gtx 48 | }//namespace glm 49 | 50 | #include "optimum_pow.inl" 51 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | /// @file glm/gtx/optimum_pow.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType pow2(genType const & x) 8 | { 9 | return x * x; 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER genType pow3(genType const & x) 14 | { 15 | return x * x * x; 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER genType pow4(genType const & x) 20 | { 21 | return (x * x) * (x * x); 22 | } 23 | }//namespace glm 24 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/orthonormalize.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | /// @file glm/gtx/orthonormalize.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Orthonormalize matrices. 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../vec3.hpp" 18 | #include "../mat3x3.hpp" 19 | #include "../geometric.hpp" 20 | 21 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 | # pragma message("GLM: GLM_GTX_orthonormalize extension included") 23 | #endif 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtx_orthonormalize 28 | /// @{ 29 | 30 | /// Returns the orthonormalized matrix of m. 31 | /// 32 | /// @see gtx_orthonormalize 33 | template 34 | GLM_FUNC_DECL tmat3x3 orthonormalize(tmat3x3 const & m); 35 | 36 | /// Orthonormalizes x according y. 37 | /// 38 | /// @see gtx_orthonormalize 39 | template 40 | GLM_FUNC_DECL tvec3 orthonormalize(tvec3 const & x, tvec3 const & y); 41 | 42 | /// @} 43 | }//namespace glm 44 | 45 | #include "orthonormalize.inl" 46 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | /// @file glm/gtx/orthonormalize.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tmat3x3 orthonormalize(tmat3x3 const & m) 8 | { 9 | tmat3x3 r = m; 10 | 11 | r[0] = normalize(r[0]); 12 | 13 | T d0 = dot(r[0], r[1]); 14 | r[1] -= r[0] * d0; 15 | r[1] = normalize(r[1]); 16 | 17 | T d1 = dot(r[1], r[2]); 18 | d0 = dot(r[0], r[2]); 19 | r[2] -= r[0] * d0 + r[1] * d1; 20 | r[2] = normalize(r[2]); 21 | 22 | return r; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER tvec3 orthonormalize(tvec3 const & x, tvec3 const & y) 27 | { 28 | return normalize(x - y * dot(y, x)); 29 | } 30 | }//namespace glm 31 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/perpendicular.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | /// @file glm/gtx/perpendicular.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_projection (dependence) 6 | /// 7 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Perpendicular of a vector from other one 11 | /// 12 | /// need to be included to use these functionalities. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | #include "../gtx/projection.hpp" 19 | 20 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 21 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 22 | #endif 23 | 24 | namespace glm 25 | { 26 | /// @addtogroup gtx_perpendicular 27 | /// @{ 28 | 29 | //! Projects x a perpendicular axis of Normal. 30 | //! From GLM_GTX_perpendicular extension. 31 | template 32 | GLM_FUNC_DECL vecType perp( 33 | vecType const & x, 34 | vecType const & Normal); 35 | 36 | /// @} 37 | }//namespace glm 38 | 39 | #include "perpendicular.inl" 40 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | /// @file glm/gtx/perpendicular.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER vecType perp 8 | ( 9 | vecType const & x, 10 | vecType const & Normal 11 | ) 12 | { 13 | return x - proj(x, Normal); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/polar_coordinates.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | /// @file glm/gtx/polar_coordinates.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Conversion from Euclidean space to polar space and revert. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_polar_coordinates extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_polar_coordinates 25 | /// @{ 26 | 27 | /// Convert Euclidean to Polar coordinates, x is the xz distance, y, the latitude and z the longitude. 28 | /// 29 | /// @see gtx_polar_coordinates 30 | template 31 | GLM_FUNC_DECL tvec3 polar( 32 | tvec3 const & euclidean); 33 | 34 | /// Convert Polar to Euclidean coordinates. 35 | /// 36 | /// @see gtx_polar_coordinates 37 | template 38 | GLM_FUNC_DECL tvec3 euclidean( 39 | tvec2 const & polar); 40 | 41 | /// @} 42 | }//namespace glm 43 | 44 | #include "polar_coordinates.inl" 45 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | /// @file glm/gtx/polar_coordinates.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tvec3 polar 8 | ( 9 | tvec3 const & euclidean 10 | ) 11 | { 12 | T const Length(length(euclidean)); 13 | tvec3 const tmp(euclidean / Length); 14 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 15 | 16 | return tvec3( 17 | asin(tmp.y), // latitude 18 | atan(tmp.x, tmp.z), // longitude 19 | xz_dist); // xz distance 20 | } 21 | 22 | template 23 | GLM_FUNC_QUALIFIER tvec3 euclidean 24 | ( 25 | tvec2 const & polar 26 | ) 27 | { 28 | T const latitude(polar.x); 29 | T const longitude(polar.y); 30 | 31 | return tvec3( 32 | cos(latitude) * sin(longitude), 33 | sin(latitude), 34 | cos(latitude) * cos(longitude)); 35 | } 36 | 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/projection.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | /// @file glm/gtx/projection.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_projection GLM_GTX_projection 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Projection of a vector to other one 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../geometric.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_projection extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_projection 25 | /// @{ 26 | 27 | /// Projects x on Normal. 28 | /// 29 | /// @see gtx_projection 30 | template 31 | GLM_FUNC_DECL vecType proj(vecType const & x, vecType const & Normal); 32 | 33 | /// @} 34 | }//namespace glm 35 | 36 | #include "projection.inl" 37 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | /// @file glm/gtx/projection.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER vecType proj(vecType const & x, vecType const & Normal) 8 | { 9 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 10 | } 11 | }//namespace glm 12 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/range.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_range 2 | /// @file glm/gtx/range.hpp 3 | /// @author Joshua Moerman 4 | /// 5 | /// @defgroup gtx_range GLM_GTX_range 6 | /// @ingroup gtx 7 | /// 8 | /// @brief Defines begin and end for vectors and matrices. Useful for range-based for loop. 9 | /// The range is defined over the elements, not over columns or rows (e.g. mat4 has 16 elements). 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../detail/setup.hpp" 17 | 18 | #if !GLM_HAS_RANGE_FOR 19 | # error "GLM_GTX_range requires C++11 suppport or 'range for'" 20 | #endif 21 | 22 | #include "../gtc/type_ptr.hpp" 23 | #include "../gtc/vec1.hpp" 24 | 25 | namespace glm 26 | { 27 | /// @addtogroup gtx_range 28 | /// @{ 29 | 30 | template 31 | inline length_t components(tvec1 const & v) 32 | { 33 | return v.length(); 34 | } 35 | 36 | template 37 | inline length_t components(tvec2 const & v) 38 | { 39 | return v.length(); 40 | } 41 | 42 | template 43 | inline length_t components(tvec3 const & v) 44 | { 45 | return v.length(); 46 | } 47 | 48 | template 49 | inline length_t components(tvec4 const & v) 50 | { 51 | return v.length(); 52 | } 53 | 54 | template 55 | inline length_t components(genType const & m) 56 | { 57 | return m.length() * m[0].length(); 58 | } 59 | 60 | template 61 | inline typename genType::value_type const * begin(genType const & v) 62 | { 63 | return value_ptr(v); 64 | } 65 | 66 | template 67 | inline typename genType::value_type const * end(genType const & v) 68 | { 69 | return begin(v) + components(v); 70 | } 71 | 72 | template 73 | inline typename genType::value_type * begin(genType& v) 74 | { 75 | return value_ptr(v); 76 | } 77 | 78 | template 79 | inline typename genType::value_type * end(genType& v) 80 | { 81 | return begin(v) + components(v); 82 | } 83 | 84 | /// @} 85 | }//namespace glm 86 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/raw_data.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | /// @file glm/gtx/raw_data.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_raw_data GLM_GTX_raw_data 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Projection of a vector to other one 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../detail/setup.hpp" 17 | #include "../detail/type_int.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_raw_data extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_raw_data 26 | /// @{ 27 | 28 | //! Type for byte numbers. 29 | //! From GLM_GTX_raw_data extension. 30 | typedef detail::uint8 byte; 31 | 32 | //! Type for word numbers. 33 | //! From GLM_GTX_raw_data extension. 34 | typedef detail::uint16 word; 35 | 36 | //! Type for dword numbers. 37 | //! From GLM_GTX_raw_data extension. 38 | typedef detail::uint32 dword; 39 | 40 | //! Type for qword numbers. 41 | //! From GLM_GTX_raw_data extension. 42 | typedef detail::uint64 qword; 43 | 44 | /// @} 45 | }// namespace glm 46 | 47 | #include "raw_data.inl" 48 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | /// @file glm/gtx/raw_data.inl 3 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/rotate_normalized_axis.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_rotate_normalized_axis 2 | /// @file glm/gtx/rotate_normalized_axis.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_matrix_transform 6 | /// @see gtc_quaternion 7 | /// 8 | /// @defgroup gtx_rotate_normalized_axis GLM_GTX_rotate_normalized_axis 9 | /// @ingroup gtx 10 | /// 11 | /// @brief Quaternions and matrices rotations around normalized axis. 12 | /// 13 | /// need to be included to use these functionalities. 14 | 15 | #pragma once 16 | 17 | // Dependency: 18 | #include "../glm.hpp" 19 | #include "../gtc/epsilon.hpp" 20 | #include "../gtc/quaternion.hpp" 21 | 22 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 23 | # pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_rotate_normalized_axis 29 | /// @{ 30 | 31 | /// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle. 32 | /// 33 | /// @param m Input matrix multiplied by this rotation matrix. 34 | /// @param angle Rotation angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 35 | /// @param axis Rotation axis, must be normalized. 36 | /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. 37 | /// 38 | /// @see gtx_rotate_normalized_axis 39 | /// @see - rotate(T angle, T x, T y, T z) 40 | /// @see - rotate(tmat4x4 const & m, T angle, T x, T y, T z) 41 | /// @see - rotate(T angle, tvec3 const & v) 42 | template 43 | GLM_FUNC_DECL tmat4x4 rotateNormalizedAxis( 44 | tmat4x4 const & m, 45 | T const & angle, 46 | tvec3 const & axis); 47 | 48 | /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. 49 | /// 50 | /// @param q Source orientation 51 | /// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise. 52 | /// @param axis Normalized axis of the rotation, must be normalized. 53 | /// 54 | /// @see gtx_rotate_normalized_axis 55 | template 56 | GLM_FUNC_DECL tquat rotateNormalizedAxis( 57 | tquat const & q, 58 | T const & angle, 59 | tvec3 const & axis); 60 | 61 | /// @} 62 | }//namespace glm 63 | 64 | #include "rotate_normalized_axis.inl" 65 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/rotate_normalized_axis.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_rotate_normalized_axis 2 | /// @file glm/gtx/rotate_normalized_axis.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER tmat4x4 rotateNormalizedAxis 8 | ( 9 | tmat4x4 const & m, 10 | T const & angle, 11 | tvec3 const & v 12 | ) 13 | { 14 | T const a = angle; 15 | T const c = cos(a); 16 | T const s = sin(a); 17 | 18 | tvec3 const axis(v); 19 | 20 | tvec3 const temp((static_cast(1) - c) * axis); 21 | 22 | tmat4x4 Rotate(uninitialize); 23 | Rotate[0][0] = c + temp[0] * axis[0]; 24 | Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; 25 | Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; 26 | 27 | Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; 28 | Rotate[1][1] = c + temp[1] * axis[1]; 29 | Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; 30 | 31 | Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; 32 | Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; 33 | Rotate[2][2] = c + temp[2] * axis[2]; 34 | 35 | tmat4x4 Result(uninitialize); 36 | Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; 37 | Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; 38 | Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; 39 | Result[3] = m[3]; 40 | return Result; 41 | } 42 | 43 | template 44 | GLM_FUNC_QUALIFIER tquat rotateNormalizedAxis 45 | ( 46 | tquat const & q, 47 | T const & angle, 48 | tvec3 const & v 49 | ) 50 | { 51 | tvec3 const Tmp(v); 52 | 53 | T const AngleRad(angle); 54 | T const Sin = sin(AngleRad * T(0.5)); 55 | 56 | return q * tquat(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); 57 | //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); 58 | } 59 | }//namespace glm 60 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/scalar_multiplication.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx 2 | /// @file glm/gtx/scalar_multiplication.hpp 3 | /// @author Joshua Moerman 4 | /// 5 | /// @brief Enables scalar multiplication for all types 6 | /// 7 | /// Since GLSL is very strict about types, the following (often used) combinations do not work: 8 | /// double * vec4 9 | /// int * vec4 10 | /// vec4 / int 11 | /// So we'll fix that! Of course "float * vec4" should remain the same (hence the enable_if magic) 12 | 13 | #pragma once 14 | 15 | #include "../detail/setup.hpp" 16 | 17 | #if !GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) 18 | # error "GLM_GTX_scalar_multiplication requires C++11 support or alias templates and if not support for GCC" 19 | #endif 20 | 21 | #include "../vec2.hpp" 22 | #include "../vec3.hpp" 23 | #include "../vec4.hpp" 24 | #include "../mat2x2.hpp" 25 | #include 26 | 27 | namespace glm 28 | { 29 | template 30 | using return_type_scalar_multiplication = typename std::enable_if< 31 | !std::is_same::value // T may not be a float 32 | && std::is_arithmetic::value, Vec // But it may be an int or double (no vec3 or mat3, ...) 33 | >::type; 34 | 35 | #define GLM_IMPLEMENT_SCAL_MULT(Vec) \ 36 | template \ 37 | return_type_scalar_multiplication \ 38 | operator*(T const & s, Vec rh){ \ 39 | return rh *= static_cast(s); \ 40 | } \ 41 | \ 42 | template \ 43 | return_type_scalar_multiplication \ 44 | operator*(Vec lh, T const & s){ \ 45 | return lh *= static_cast(s); \ 46 | } \ 47 | \ 48 | template \ 49 | return_type_scalar_multiplication \ 50 | operator/(Vec lh, T const & s){ \ 51 | return lh *= 1.0f / s; \ 52 | } 53 | 54 | GLM_IMPLEMENT_SCAL_MULT(vec2) 55 | GLM_IMPLEMENT_SCAL_MULT(vec3) 56 | GLM_IMPLEMENT_SCAL_MULT(vec4) 57 | 58 | GLM_IMPLEMENT_SCAL_MULT(mat2) 59 | GLM_IMPLEMENT_SCAL_MULT(mat2x3) 60 | GLM_IMPLEMENT_SCAL_MULT(mat2x4) 61 | GLM_IMPLEMENT_SCAL_MULT(mat3x2) 62 | GLM_IMPLEMENT_SCAL_MULT(mat3) 63 | GLM_IMPLEMENT_SCAL_MULT(mat3x4) 64 | GLM_IMPLEMENT_SCAL_MULT(mat4x2) 65 | GLM_IMPLEMENT_SCAL_MULT(mat4x3) 66 | GLM_IMPLEMENT_SCAL_MULT(mat4) 67 | 68 | #undef GLM_IMPLEMENT_SCAL_MULT 69 | } // namespace glm 70 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/scalar_relational.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_scalar_relational 2 | /// @file glm/gtx/scalar_relational.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Extend a position from a source to a position at a defined length. 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTX_extend extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup gtx_scalar_relational 25 | /// @{ 26 | 27 | 28 | 29 | /// @} 30 | }//namespace glm 31 | 32 | #include "scalar_relational.inl" 33 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/scalar_relational.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_scalar_relational 2 | /// @file glm/gtx/scalar_relational.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER bool lessThan 8 | ( 9 | T const & x, 10 | T const & y 11 | ) 12 | { 13 | return x < y; 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER bool lessThanEqual 18 | ( 19 | T const & x, 20 | T const & y 21 | ) 22 | { 23 | return x <= y; 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER bool greaterThan 28 | ( 29 | T const & x, 30 | T const & y 31 | ) 32 | { 33 | return x > y; 34 | } 35 | 36 | template 37 | GLM_FUNC_QUALIFIER bool greaterThanEqual 38 | ( 39 | T const & x, 40 | T const & y 41 | ) 42 | { 43 | return x >= y; 44 | } 45 | 46 | template 47 | GLM_FUNC_QUALIFIER bool equal 48 | ( 49 | T const & x, 50 | T const & y 51 | ) 52 | { 53 | return x == y; 54 | } 55 | 56 | template 57 | GLM_FUNC_QUALIFIER bool notEqual 58 | ( 59 | T const & x, 60 | T const & y 61 | ) 62 | { 63 | return x != y; 64 | } 65 | 66 | GLM_FUNC_QUALIFIER bool any 67 | ( 68 | bool const & x 69 | ) 70 | { 71 | return x; 72 | } 73 | 74 | GLM_FUNC_QUALIFIER bool all 75 | ( 76 | bool const & x 77 | ) 78 | { 79 | return x; 80 | } 81 | 82 | GLM_FUNC_QUALIFIER bool not_ 83 | ( 84 | bool const & x 85 | ) 86 | { 87 | return !x; 88 | } 89 | }//namespace glm 90 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/spline.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_spline 2 | /// @file glm/gtx/spline.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtx_spline GLM_GTX_spline 7 | /// @ingroup gtx 8 | /// 9 | /// @brief Spline functions 10 | /// 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include "../gtx/optimum_pow.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_spline extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_spline 26 | /// @{ 27 | 28 | /// Return a point from a catmull rom curve. 29 | /// @see gtx_spline extension. 30 | template 31 | GLM_FUNC_DECL genType catmullRom( 32 | genType const & v1, 33 | genType const & v2, 34 | genType const & v3, 35 | genType const & v4, 36 | typename genType::value_type const & s); 37 | 38 | /// Return a point from a hermite curve. 39 | /// @see gtx_spline extension. 40 | template 41 | GLM_FUNC_DECL genType hermite( 42 | genType const & v1, 43 | genType const & t1, 44 | genType const & v2, 45 | genType const & t2, 46 | typename genType::value_type const & s); 47 | 48 | /// Return a point from a cubic curve. 49 | /// @see gtx_spline extension. 50 | template 51 | GLM_FUNC_DECL genType cubic( 52 | genType const & v1, 53 | genType const & v2, 54 | genType const & v3, 55 | genType const & v4, 56 | typename genType::value_type const & s); 57 | 58 | /// @} 59 | }//namespace glm 60 | 61 | #include "spline.inl" 62 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/spline.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_spline 2 | /// @file glm/gtx/spline.inl 3 | 4 | namespace glm 5 | { 6 | template 7 | GLM_FUNC_QUALIFIER genType catmullRom 8 | ( 9 | genType const & v1, 10 | genType const & v2, 11 | genType const & v3, 12 | genType const & v4, 13 | typename genType::value_type const & s 14 | ) 15 | { 16 | typename genType::value_type s1 = s; 17 | typename genType::value_type s2 = pow2(s); 18 | typename genType::value_type s3 = pow3(s); 19 | 20 | typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s; 21 | typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2); 22 | typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s; 23 | typename genType::value_type f4 = s3 - s2; 24 | 25 | return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2); 26 | 27 | } 28 | 29 | template 30 | GLM_FUNC_QUALIFIER genType hermite 31 | ( 32 | genType const & v1, 33 | genType const & t1, 34 | genType const & v2, 35 | genType const & t2, 36 | typename genType::value_type const & s 37 | ) 38 | { 39 | typename genType::value_type s1 = s; 40 | typename genType::value_type s2 = pow2(s); 41 | typename genType::value_type s3 = pow3(s); 42 | 43 | typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1); 44 | typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2; 45 | typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s; 46 | typename genType::value_type f4 = s3 - s2; 47 | 48 | return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; 49 | } 50 | 51 | template 52 | GLM_FUNC_QUALIFIER genType cubic 53 | ( 54 | genType const & v1, 55 | genType const & v2, 56 | genType const & v3, 57 | genType const & v4, 58 | typename genType::value_type const & s 59 | ) 60 | { 61 | return ((v1 * s + v2) * s + v3) * s + v4; 62 | } 63 | }//namespace glm 64 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/std_based_type.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_std_based_type 2 | /// @file glm/gtx/std_based_type.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_extented_min_max (dependence) 6 | /// 7 | /// @defgroup gtx_std_based_type GLM_GTX_std_based_type 8 | /// @ingroup gtx 9 | /// 10 | /// @brief Adds vector types based on STL value types. 11 | /// need to be included to use these functionalities. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | #include 18 | 19 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_GTX_std_based_type extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup gtx_std_based_type 26 | /// @{ 27 | 28 | /// Vector type based of one std::size_t component. 29 | /// @see GLM_GTX_std_based_type 30 | typedef tvec1 size1; 31 | 32 | /// Vector type based of two std::size_t components. 33 | /// @see GLM_GTX_std_based_type 34 | typedef tvec2 size2; 35 | 36 | /// Vector type based of three std::size_t components. 37 | /// @see GLM_GTX_std_based_type 38 | typedef tvec3 size3; 39 | 40 | /// Vector type based of four std::size_t components. 41 | /// @see GLM_GTX_std_based_type 42 | typedef tvec4 size4; 43 | 44 | /// Vector type based of one std::size_t component. 45 | /// @see GLM_GTX_std_based_type 46 | typedef tvec1 size1_t; 47 | 48 | /// Vector type based of two std::size_t components. 49 | /// @see GLM_GTX_std_based_type 50 | typedef tvec2 size2_t; 51 | 52 | /// Vector type based of three std::size_t components. 53 | /// @see GLM_GTX_std_based_type 54 | typedef tvec3 size3_t; 55 | 56 | /// Vector type based of four std::size_t components. 57 | /// @see GLM_GTX_std_based_type 58 | typedef tvec4 size4_t; 59 | 60 | /// @} 61 | }//namespace glm 62 | 63 | #include "std_based_type.inl" 64 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_std_based_type 2 | /// @file glm/gtx/std_based_type.inl 3 | 4 | namespace glm 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /depends/include/glm/gtx/string_cast.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtx_string_cast 2 | /// @file glm/gtx/string_cast.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_half_float (dependence) 6 | /// @see gtx_integer (dependence) 7 | /// @see gtx_quaternion (dependence) 8 | /// 9 | /// @defgroup gtx_string_cast GLM_GTX_string_cast 10 | /// @ingroup gtx 11 | /// 12 | /// @brief Setup strings for GLM type values 13 | /// 14 | /// need to be included to use these functionalities. 15 | /// This extension is not supported with CUDA 16 | 17 | #pragma once 18 | 19 | // Dependency: 20 | #include "../glm.hpp" 21 | #include "../gtc/type_precision.hpp" 22 | #include "../gtc/quaternion.hpp" 23 | #include "../gtx/dual_quaternion.hpp" 24 | #include 25 | 26 | #if(GLM_COMPILER & GLM_COMPILER_CUDA) 27 | # error "GLM_GTX_string_cast is not supported on CUDA compiler" 28 | #endif 29 | 30 | #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 31 | # pragma message("GLM: GLM_GTX_string_cast extension included") 32 | #endif 33 | 34 | namespace glm 35 | { 36 | /// @addtogroup gtx_string_cast 37 | /// @{ 38 | 39 | /// Create a string from a GLM vector or matrix typed variable. 40 | /// @see gtx_string_cast extension. 41 | template