@Article{kerbl3Dgaussians,
9 | author = {Kerbl, Bernhard and Kopanas, Georgios and Leimk{\"u}hler, Thomas and Drettakis, George},
10 | title = {3D Gaussian Splatting for Real-Time Radiance Field Rendering},
11 | journal = {ACM Transactions on Graphics},
12 | number = {4},
13 | volume = {42},
14 | month = {July},
15 | year = {2023},
16 | url = {https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/}
17 | }
18 | ::value>::call(x, y); 8 | } 9 | 10 | template11 | GLM_FUNC_QUALIFIER T length(qua const& q) 12 | { 13 | return glm::sqrt(dot(q, q)); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER qua normalize(qua const& q) 18 | { 19 | T len = length(q); 20 | if(len <= static_cast (0)) // Problem 21 | return qua (static_cast (1), static_cast (0), static_cast (0), static_cast (0)); 22 | T oneOverLen = static_cast (1) / len; 23 | return qua (q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); 24 | } 25 | 26 | template 27 | GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2) 28 | { 29 | return qua ( 30 | q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, 31 | q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, 32 | q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, 33 | q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); 34 | } 35 | }//namespace glm 36 | 37 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/quaternion_relational.inl: -------------------------------------------------------------------------------- 1 | namespace glm 2 | { 3 | template 4 | GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y) 5 | { 6 | vec<4, bool, Q> Result; 7 | for(length_t i = 0; i < x.length(); ++i) 8 | Result[i] = x[i] == y[i]; 9 | return Result; 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon) 14 | { 15 | vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); 16 | return lessThan(abs(v), vec<4, T, Q>(epsilon)); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y) 21 | { 22 | vec<4, bool, Q> Result; 23 | for(length_t i = 0; i < x.length(); ++i) 24 | Result[i] = x[i] != y[i]; 25 | return Result; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon) 30 | { 31 | vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); 32 | return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); 33 | } 34 | }//namespace glm 35 | 36 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/quaternion_transform.inl: -------------------------------------------------------------------------------- 1 | namespace glm 2 | { 3 | template 4 | GLM_FUNC_QUALIFIER qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& v) 5 | { 6 | vec<3, T, Q> Tmp = v; 7 | 8 | // Axis of rotation must be normalised 9 | T len = glm::length(Tmp); 10 | if(abs(len - static_cast (1)) > static_cast (0.001)) 11 | { 12 | T oneOverLen = static_cast (1) / len; 13 | Tmp.x *= oneOverLen; 14 | Tmp.y *= oneOverLen; 15 | Tmp.z *= oneOverLen; 16 | } 17 | 18 | T const AngleRad(angle); 19 | T const Sin = sin(AngleRad * static_cast (0.5)); 20 | 21 | return q * qua (cos(AngleRad * static_cast (0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); 22 | } 23 | }//namespace glm 24 | 25 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/quaternion_trigonometric.inl: -------------------------------------------------------------------------------- 1 | #include "scalar_constants.hpp" 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T angle(qua const& x) 7 | { 8 | if (abs(x.w) > cos_one_over_two ()) 9 | { 10 | T const a = asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast (2); 11 | if(x.w < static_cast (0)) 12 | return pi () * static_cast (2) - a; 13 | return a; 14 | } 15 | 16 | return acos(x.w) * static_cast (2); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER vec<3, T, Q> axis(qua const& x) 21 | { 22 | T const tmp1 = static_cast (1) - x.w * x.w; 23 | if(tmp1 <= static_cast (0)) 24 | return vec<3, T, Q>(0, 0, 1); 25 | T const tmp2 = static_cast (1) / sqrt(tmp1); 26 | return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); 27 | } 28 | 29 | template 30 | GLM_FUNC_QUALIFIER qua angleAxis(T const& angle, vec<3, T, Q> const& v) 31 | { 32 | T const a(angle); 33 | T const s = glm::sin(a * static_cast (0.5)); 34 | 35 | return qua (glm::cos(a * static_cast (0.5)), v * s); 36 | } 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/scalar_constants.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_scalar_constants 2 | /// @file glm/ext/scalar_constants.hpp 3 | /// 4 | /// @defgroup ext_scalar_constants GLM_EXT_scalar_constants 5 | /// @ingroup ext 6 | /// 7 | /// Provides a list of constants and precomputed useful values. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | // Dependencies 14 | #include "../detail/setup.hpp" 15 | 16 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 17 | # pragma message("GLM: GLM_EXT_scalar_constants extension included") 18 | #endif 19 | 20 | namespace glm 21 | { 22 | /// @addtogroup ext_scalar_constants 23 | /// @{ 24 | 25 | /// Return the epsilon constant for floating point types. 26 | template 27 | GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); 28 | 29 | /// Return the pi constant for floating point types. 30 | template 31 | GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); 32 | 33 | /// Return the value of cos(1 / 2) for floating point types. 34 | template 35 | GLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two(); 36 | 37 | /// @} 38 | } //namespace glm 39 | 40 | #include "scalar_constants.inl" 41 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/scalar_constants.inl: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() 7 | { 8 | GLM_STATIC_ASSERT(std::numeric_limits ::is_iec559, "'epsilon' only accepts floating-point inputs"); 9 | return std::numeric_limits ::epsilon(); 10 | } 11 | 12 | template 13 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() 14 | { 15 | GLM_STATIC_ASSERT(std::numeric_limits ::is_iec559, "'pi' only accepts floating-point inputs"); 16 | return static_cast (3.14159265358979323846264338327950288); 17 | } 18 | 19 | template 20 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two() 21 | { 22 | return genType(0.877582561890372716130286068203503191); 23 | } 24 | } //namespace glm 25 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/scalar_packing.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_scalar_packing 2 | /// @file glm/ext/scalar_packing.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup ext_scalar_packing GLM_EXT_scalar_packing 7 | /// @ingroup ext 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// This extension provides a set of function to convert scalar values to packed 12 | /// formats. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../detail/qualifier.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_EXT_scalar_packing extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup ext_scalar_packing 26 | /// @{ 27 | 28 | 29 | /// @} 30 | }// namespace glm 31 | 32 | #include "scalar_packing.inl" 33 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/scalar_packing.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fudan-zvg/4d-gaussian-splatting/3fe460f1f2342526bccf6c01b63da125faf0fa94/diff-gaussian-rasterization/third_party/glm/glm/ext/scalar_packing.inl -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/scalar_relational.inl: -------------------------------------------------------------------------------- 1 | #include "../common.hpp" 2 | #include "../ext/scalar_int_sized.hpp" 3 | #include "../ext/scalar_uint_sized.hpp" 4 | #include "../detail/type_float.hpp" 5 | 6 | namespace glm 7 | { 8 | template 9 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon) 10 | { 11 | return abs(x - y) <= epsilon; 12 | } 13 | 14 | template 15 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon) 16 | { 17 | return abs(x - y) > epsilon; 18 | } 19 | 20 | template 21 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int MaxULPs) 22 | { 23 | detail::float_t const a(x); 24 | detail::float_t const b(y); 25 | 26 | // Different signs means they do not match. 27 | if(a.negative() != b.negative()) 28 | return false; 29 | 30 | // Find the difference in ULPs. 31 | typename detail::float_t ::int_type const DiffULPs = abs(a.i - b.i); 32 | return DiffULPs <= MaxULPs; 33 | } 34 | 35 | template 36 | GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs) 37 | { 38 | return !equal(x, y, ULPs); 39 | } 40 | }//namespace glm 41 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_bool1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_bool1 2 | /// @file glm/ext/vector_bool1.hpp 3 | /// 4 | /// @defgroup ext_vector_bool1 GLM_EXT_vector_bool1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes bvec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_bool1_precision extension. 12 | 13 | #pragma once 14 | 15 | #include "../detail/type_vec1.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_vector_bool1 extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup ext_vector_bool1 24 | /// @{ 25 | 26 | /// 1 components vector of boolean. 27 | typedef vec<1, bool, defaultp> bvec1; 28 | 29 | /// @} 30 | }//namespace glm 31 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_bool1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_bool1_precision 2 | /// @file glm/ext/vector_bool1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_bool1_precision GLM_EXT_vector_bool1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | 11 | #pragma once 12 | 13 | #include "../detail/type_vec1.hpp" 14 | 15 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 16 | # pragma message("GLM: GLM_EXT_vector_bool1_precision extension included") 17 | #endif 18 | 19 | namespace glm 20 | { 21 | /// @addtogroup ext_vector_bool1_precision 22 | /// @{ 23 | 24 | /// 1 component vector of bool values. 25 | typedef vec<1, bool, highp> highp_bvec1; 26 | 27 | /// 1 component vector of bool values. 28 | typedef vec<1, bool, mediump> mediump_bvec1; 29 | 30 | /// 1 component vector of bool values. 31 | typedef vec<1, bool, lowp> lowp_bvec1; 32 | 33 | /// @} 34 | }//namespace glm 35 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_bool2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, bool, defaultp> bvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_bool3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, bool, defaultp> bvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_bool4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_bool4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of boolean. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, bool, defaultp> bvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_double1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_double1 2 | /// @file glm/ext/vector_double1.hpp 3 | /// 4 | /// @defgroup ext_vector_double1 GLM_EXT_vector_double1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes double-precision floating point vector type with one component. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_double1_precision extension. 12 | /// @see ext_vector_float1 extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_double1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_double1 25 | /// @{ 26 | 27 | /// 1 components vector of double-precision floating-point numbers. 28 | typedef vec<1, double, defaultp> dvec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_double1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_double1_precision 2 | /// @file glm/ext/vector_double1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_double1_precision GLM_EXT_vector_double1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_dvec1, mediump_dvec1 and lowp_dvec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_double1 12 | 13 | #pragma once 14 | 15 | #include "../detail/type_vec1.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_vector_double1_precision extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup ext_vector_double1_precision 24 | /// @{ 25 | 26 | /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. 27 | typedef vec<1, double, highp> highp_dvec1; 28 | 29 | /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. 30 | typedef vec<1, double, mediump> mediump_dvec1; 31 | 32 | /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. 33 | typedef vec<1, double, lowp> lowp_dvec1; 34 | 35 | /// @} 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_double2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, double, defaultp> dvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_double3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, double, defaultp> dvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_double4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_double4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of double-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, double, defaultp> dvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_float1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_float1 2 | /// @file glm/ext/vector_float1.hpp 3 | /// 4 | /// @defgroup ext_vector_float1 GLM_EXT_vector_float1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes single-precision floating point vector type with one component. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_float1_precision extension. 12 | /// @see ext_vector_double1 extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_float1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_float1 25 | /// @{ 26 | 27 | /// 1 components vector of single-precision floating-point numbers. 28 | typedef vec<1, float, defaultp> vec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_float1_precision.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_float1_precision 2 | /// @file glm/ext/vector_float1_precision.hpp 3 | /// 4 | /// @defgroup ext_vector_float1_precision GLM_EXT_vector_float1_precision 5 | /// @ingroup ext 6 | /// 7 | /// Exposes highp_vec1, mediump_vec1 and lowp_vec1 types. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_float1 extension. 12 | 13 | #pragma once 14 | 15 | #include "../detail/type_vec1.hpp" 16 | 17 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 18 | # pragma message("GLM: GLM_EXT_vector_float1_precision extension included") 19 | #endif 20 | 21 | namespace glm 22 | { 23 | /// @addtogroup ext_vector_float1_precision 24 | /// @{ 25 | 26 | /// 1 component vector of single-precision floating-point numbers using high precision arithmetic in term of ULPs. 27 | typedef vec<1, float, highp> highp_vec1; 28 | 29 | /// 1 component vector of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. 30 | typedef vec<1, float, mediump> mediump_vec1; 31 | 32 | /// 1 component vector of single-precision floating-point numbers using low precision arithmetic in term of ULPs. 33 | typedef vec<1, float, lowp> lowp_vec1; 34 | 35 | /// @} 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_float2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, float, defaultp> vec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_float3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, float, defaultp> vec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_float4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_float4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of single-precision floating-point numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, float, defaultp> vec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_int1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_int1 2 | /// @file glm/ext/vector_int1.hpp 3 | /// 4 | /// @defgroup ext_vector_int1 GLM_EXT_vector_int1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes ivec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_uint1 extension. 12 | /// @see ext_vector_int1_precision extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_int1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_int1 25 | /// @{ 26 | 27 | /// 1 component vector of signed integer numbers. 28 | typedef vec<1, int, defaultp> ivec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | 33 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_int2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, int, defaultp> ivec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_int3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, int, defaultp> ivec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_int4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_int4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of signed integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, int, defaultp> ivec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_packing.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_packing 2 | /// @file glm/ext/vector_packing.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup ext_vector_packing GLM_EXT_vector_packing 7 | /// @ingroup ext 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// This extension provides a set of function to convert vectors to packed 12 | /// formats. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../detail/qualifier.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # pragma message("GLM: GLM_EXT_vector_packing extension included") 21 | #endif 22 | 23 | namespace glm 24 | { 25 | /// @addtogroup ext_vector_packing 26 | /// @{ 27 | 28 | 29 | /// @} 30 | }// namespace glm 31 | 32 | #include "vector_packing.inl" 33 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_packing.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fudan-zvg/4d-gaussian-splatting/3fe460f1f2342526bccf6c01b63da125faf0fa94/diff-gaussian-rasterization/third_party/glm/glm/ext/vector_packing.inl -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_uint1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref ext_vector_uint1 2 | /// @file glm/ext/vector_uint1.hpp 3 | /// 4 | /// @defgroup ext_vector_uint1 GLM_EXT_vector_uint1 5 | /// @ingroup ext 6 | /// 7 | /// Exposes uvec1 vector type. 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// @see ext_vector_int1 extension. 12 | /// @see ext_vector_uint1_precision extension. 13 | 14 | #pragma once 15 | 16 | #include "../detail/type_vec1.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_EXT_vector_uint1 extension included") 20 | #endif 21 | 22 | namespace glm 23 | { 24 | /// @addtogroup ext_vector_uint1 25 | /// @{ 26 | 27 | /// 1 component vector of unsigned integer numbers. 28 | typedef vec<1, unsigned int, defaultp> uvec1; 29 | 30 | /// @} 31 | }//namespace glm 32 | 33 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_uint2.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint2.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec2.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 2 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<2, unsigned int, defaultp> uvec2; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_uint3.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint3.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec3.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 3 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<3, unsigned int, defaultp> uvec3; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/ext/vector_uint4.hpp: -------------------------------------------------------------------------------- 1 | /// @ref core 2 | /// @file glm/ext/vector_uint4.hpp 3 | 4 | #pragma once 5 | #include "../detail/type_vec4.hpp" 6 | 7 | namespace glm 8 | { 9 | /// @addtogroup core_vector 10 | /// @{ 11 | 12 | /// 4 components vector of unsigned integer numbers. 13 | /// 14 | /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors 15 | typedef vec<4, unsigned int, defaultp> uvec4; 16 | 17 | /// @} 18 | }//namespace glm 19 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/integer.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_integer 2 | /// @file glm/gtc/integer.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtc_integer (dependence) 6 | /// 7 | /// @defgroup gtc_integer GLM_GTC_integer 8 | /// @ingroup gtc 9 | /// 10 | /// Include to use the features of this extension. 11 | /// 12 | /// @brief Allow to perform bit operations on integer values 13 | 14 | #pragma once 15 | 16 | // Dependencies 17 | #include "../detail/setup.hpp" 18 | #include "../detail/qualifier.hpp" 19 | #include "../common.hpp" 20 | #include "../integer.hpp" 21 | #include "../exponential.hpp" 22 | #include "../ext/scalar_common.hpp" 23 | #include "../ext/vector_common.hpp" 24 | #include 25 | 26 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 27 | # pragma message("GLM: GLM_GTC_integer extension included") 28 | #endif 29 | 30 | namespace glm 31 | { 32 | /// @addtogroup gtc_integer 33 | /// @{ 34 | 35 | /// Returns the log2 of x for integer values. Useful to compute mipmap count from the texture size. 36 | /// @see gtc_integer 37 | template 38 | GLM_FUNC_DECL genIUType log2(genIUType x); 39 | 40 | /// @} 41 | } //namespace glm 42 | 43 | #include "integer.inl" 44 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/integer.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_integer 2 | 3 | namespace glm{ 4 | namespace detail 5 | { 6 | template 7 | struct compute_log2 8 | { 9 | GLM_FUNC_QUALIFIER static vec call(vec const& v) 10 | { 11 | //Equivalent to return findMSB(vec); but save one function call in ASM with VC 12 | //return findMSB(vec); 13 | return vec (detail::compute_findMSB_vec ::call(v)); 14 | } 15 | }; 16 | 17 | # if GLM_HAS_BITSCAN_WINDOWS 18 | template 19 | struct compute_log2<4, int, Q, false, Aligned> 20 | { 21 | GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) 22 | { 23 | vec<4, int, Q> Result; 24 | _BitScanReverse(reinterpret_cast (&Result.x), v.x); 25 | _BitScanReverse(reinterpret_cast (&Result.y), v.y); 26 | _BitScanReverse(reinterpret_cast (&Result.z), v.z); 27 | _BitScanReverse(reinterpret_cast (&Result.w), v.w); 28 | return Result; 29 | } 30 | }; 31 | # endif//GLM_HAS_BITSCAN_WINDOWS 32 | }//namespace detail 33 | }//namespace glm 34 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/matrix_transform.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_matrix_transform 2 | /// @file glm/gtc/matrix_transform.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// @see gtx_transform 6 | /// @see gtx_transform2 7 | /// 8 | /// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform 9 | /// @ingroup gtc 10 | /// 11 | /// Include to use the features of this extension. 12 | /// 13 | /// Defines functions that generate common transformation matrices. 14 | /// 15 | /// The matrices generated by this extension use standard OpenGL fixed-function 16 | /// conventions. For example, the lookAt function generates a transform from world 17 | /// space into the specific eye space that the projective matrix functions 18 | /// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility 19 | /// specifications defines the particular layout of this eye space. 20 | 21 | #pragma once 22 | 23 | // Dependencies 24 | #include "../mat4x4.hpp" 25 | #include "../vec2.hpp" 26 | #include "../vec3.hpp" 27 | #include "../vec4.hpp" 28 | #include "../ext/matrix_projection.hpp" 29 | #include "../ext/matrix_clip_space.hpp" 30 | #include "../ext/matrix_transform.hpp" 31 | 32 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 33 | # pragma message("GLM: GLM_GTC_matrix_transform extension included") 34 | #endif 35 | 36 | #include "matrix_transform.inl" 37 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/matrix_transform.inl: -------------------------------------------------------------------------------- 1 | #include "../geometric.hpp" 2 | #include "../trigonometric.hpp" 3 | #include "../matrix.hpp" 4 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/quaternion_simd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fudan-zvg/4d-gaussian-splatting/3fe460f1f2342526bccf6c01b63da125faf0fa94/diff-gaussian-rasterization/third_party/glm/glm/gtc/quaternion_simd.inl -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/reciprocal.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_reciprocal 2 | /// @file glm/gtc/reciprocal.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_reciprocal GLM_GTC_reciprocal 7 | /// @ingroup gtc 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Define secant, cosecant and cotangent functions. 12 | 13 | #pragma once 14 | 15 | // Dependencies 16 | #include "../detail/setup.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # pragma message("GLM: GLM_GTC_reciprocal extension included") 20 | #endif 21 | 22 | #include "../ext/scalar_reciprocal.hpp" 23 | #include "../ext/vector_reciprocal.hpp" 24 | 25 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtc_precision 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtc/vec1.hpp: -------------------------------------------------------------------------------- 1 | /// @ref gtc_vec1 2 | /// @file glm/gtc/vec1.hpp 3 | /// 4 | /// @see core (dependence) 5 | /// 6 | /// @defgroup gtc_vec1 GLM_GTC_vec1 7 | /// @ingroup gtc 8 | /// 9 | /// Include to use the features of this extension. 10 | /// 11 | /// Add vec1, ivec1, uvec1 and bvec1 types. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../ext/vector_bool1.hpp" 17 | #include "../ext/vector_bool1_precision.hpp" 18 | #include "../ext/vector_float1.hpp" 19 | #include "../ext/vector_float1_precision.hpp" 20 | #include "../ext/vector_double1.hpp" 21 | #include "../ext/vector_double1_precision.hpp" 22 | #include "../ext/vector_int1.hpp" 23 | #include "../ext/vector_int1_sized.hpp" 24 | #include "../ext/vector_uint1.hpp" 25 | #include "../ext/vector_uint1_sized.hpp" 26 | 27 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 28 | # pragma message("GLM: GLM_GTC_vec1 extension included") 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_closest_point 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine 7 | ( 8 | vec<3, T, Q> const& point, 9 | vec<3, T, Q> const& a, 10 | vec<3, T, Q> const& b 11 | ) 12 | { 13 | T LineLength = distance(a, b); 14 | vec<3, T, Q> Vector = point - a; 15 | vec<3, T, Q> LineDirection = (b - a) / LineLength; 16 | 17 | // Project Vector to LineDirection to get the distance of point from a 18 | T Distance = dot(Vector, LineDirection); 19 | 20 | if(Distance <= T(0)) return a; 21 | if(Distance >= LineLength) return b; 22 | return a + LineDirection * Distance; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine 27 | ( 28 | vec<2, T, Q> const& point, 29 | vec<2, T, Q> const& a, 30 | vec<2, T, Q> const& b 31 | ) 32 | { 33 | T LineLength = distance(a, b); 34 | vec<2, T, Q> Vector = point - a; 35 | vec<2, T, Q> LineDirection = (b - a) / LineLength; 36 | 37 | // Project Vector to LineDirection to get the distance of point from a 38 | T Distance = dot(Vector, LineDirection); 39 | 40 | if(Distance <= T(0)) return a; 41 | if(Distance >= LineLength) return b; 42 | return a + LineDirection * Distance; 43 | } 44 | 45 | }//namespace glm 46 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/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 | /// Include to use the features of this extension. 10 | /// 11 | /// Extend a position from a source to a position at a defined length. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_extend extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_extend 29 | /// @{ 30 | 31 | /// Extends of Length the Origin position using the (Source - Origin) direction. 32 | /// @see gtx_extend 33 | template 34 | GLM_FUNC_DECL genType extend( 35 | genType const& Origin, 36 | genType const& Source, 37 | typename genType::value_type const Length); 38 | 39 | /// @} 40 | }//namespace glm 41 | 42 | #include "extend.inl" 43 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_extend 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType extend 7 | ( 8 | genType const& Origin, 9 | genType const& Source, 10 | genType const& Distance 11 | ) 12 | { 13 | return Origin + (Source - Origin) * Distance; 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER vec<2, T, Q> extend 18 | ( 19 | vec<2, T, Q> const& Origin, 20 | vec<2, T, Q> const& Source, 21 | T const& Distance 22 | ) 23 | { 24 | return Origin + (Source - Origin) * Distance; 25 | } 26 | 27 | template 28 | GLM_FUNC_QUALIFIER vec<3, T, Q> extend 29 | ( 30 | vec<3, T, Q> const& Origin, 31 | vec<3, T, Q> const& Source, 32 | T const& Distance 33 | ) 34 | { 35 | return Origin + (Source - Origin) * Distance; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER vec<4, T, Q> extend 40 | ( 41 | vec<4, T, Q> const& Origin, 42 | vec<4, T, Q> const& Source, 43 | T const& Distance 44 | ) 45 | { 46 | return Origin + (Source - Origin) * Distance; 47 | } 48 | }//namespace glm 49 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/exterior_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_exterior_product 2 | 3 | #include 4 | 5 | namespace glm { 6 | namespace detail 7 | { 8 | template 9 | struct compute_cross_vec2 10 | { 11 | GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) 12 | { 13 | GLM_STATIC_ASSERT(std::numeric_limits ::is_iec559, "'cross' accepts only floating-point inputs"); 14 | 15 | return v.x * u.y - u.x * v.y; 16 | } 17 | }; 18 | }//namespace detail 19 | 20 | template 21 | GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) 22 | { 23 | return detail::compute_cross_vec2 ::value>::call(x, y); 24 | } 25 | }//namespace glm 26 | 27 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/float_notmalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_float_normalize 2 | 3 | #include 4 | 5 | namespace glm 6 | { 7 | template 8 | GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) 9 | { 10 | return vec (v) / static_cast (std::numeric_limits ::max()); 11 | } 12 | 13 | }//namespace glm 14 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/functions.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_functions 2 | 3 | #include "../exponential.hpp" 4 | 5 | namespace glm 6 | { 7 | template 8 | GLM_FUNC_QUALIFIER T gauss 9 | ( 10 | T x, 11 | T ExpectedValue, 12 | T StandardDeviation 13 | ) 14 | { 15 | return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast (2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast (6.28318530717958647692528676655900576))); 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER T gauss 20 | ( 21 | vec<2, T, Q> const& Coord, 22 | vec<2, T, Q> const& ExpectedValue, 23 | vec<2, T, Q> const& StandardDeviation 24 | ) 25 | { 26 | vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast (2) * StandardDeviation * StandardDeviation); 27 | return exp(-(Squared.x + Squared.y)); 28 | } 29 | }//namespace glm 30 | 31 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_gradient_paint 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T radialGradient 7 | ( 8 | vec<2, T, Q> const& Center, 9 | T const& Radius, 10 | vec<2, T, Q> const& Focal, 11 | vec<2, T, Q> const& Position 12 | ) 13 | { 14 | vec<2, T, Q> F = Focal - Center; 15 | vec<2, T, Q> D = Position - Focal; 16 | T Radius2 = pow2(Radius); 17 | T Fx2 = pow2(F.x); 18 | T Fy2 = pow2(F.y); 19 | 20 | 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)); 21 | T Denominator = Radius2 - (Fx2 + Fy2); 22 | return Numerator / Denominator; 23 | } 24 | 25 | template 26 | GLM_FUNC_QUALIFIER T linearGradient 27 | ( 28 | vec<2, T, Q> const& Point0, 29 | vec<2, T, Q> const& Point1, 30 | vec<2, T, Q> const& Position 31 | ) 32 | { 33 | vec<2, T, Q> Dist = Point1 - Point0; 34 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 35 | } 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_handed_coordinate_space 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER bool rightHanded 7 | ( 8 | vec<3, T, Q> const& tangent, 9 | vec<3, T, Q> const& binormal, 10 | vec<3, T, Q> const& normal 11 | ) 12 | { 13 | return dot(cross(normal, tangent), binormal) > T(0); 14 | } 15 | 16 | template 17 | GLM_FUNC_QUALIFIER bool leftHanded 18 | ( 19 | vec<3, T, Q> const& tangent, 20 | vec<3, T, Q> const& binormal, 21 | vec<3, T, Q> const& normal 22 | ) 23 | { 24 | return dot(cross(normal, tangent), binormal) < T(0); 25 | } 26 | }//namespace glm 27 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/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 | /// Include to use the features of this extension. 10 | /// 11 | /// Logarithm for any base. base can be a vector or a scalar. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_log_base is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_log_base extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_log_base 29 | /// @{ 30 | 31 | /// Logarithm for any base. 32 | /// From GLM_GTX_log_base. 33 | template 34 | GLM_FUNC_DECL genType log( 35 | genType const& x, 36 | genType const& base); 37 | 38 | /// Logarithm for any base. 39 | /// From GLM_GTX_log_base. 40 | template 41 | GLM_FUNC_DECL vec sign( 42 | vec const& x, 43 | vec const& base); 44 | 45 | /// @} 46 | }//namespace glm 47 | 48 | #include "log_base.inl" 49 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_log_base 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) 7 | { 8 | return glm::log(x) / glm::log(base); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) 13 | { 14 | return glm::log(x) / glm::log(base); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_matrix_cross_product 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3 7 | ( 8 | vec<3, T, Q> const& x 9 | ) 10 | { 11 | mat<3, 3, T, Q> Result(T(0)); 12 | Result[0][1] = x.z; 13 | Result[1][0] = -x.z; 14 | Result[0][2] = -x.y; 15 | Result[2][0] = x.y; 16 | Result[1][2] = x.x; 17 | Result[2][1] = -x.x; 18 | return Result; 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4 23 | ( 24 | vec<3, T, Q> const& x 25 | ) 26 | { 27 | mat<4, 4, T, Q> Result(T(0)); 28 | Result[0][1] = x.z; 29 | Result[1][0] = -x.z; 30 | Result[0][2] = -x.y; 31 | Result[2][0] = x.y; 32 | Result[1][2] = x.x; 33 | Result[2][1] = -x.x; 34 | return Result; 35 | } 36 | 37 | }//namespace glm 38 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/matrix_factorisation.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fudan-zvg/4d-gaussian-splatting/3fe460f1f2342526bccf6c01b63da125faf0fa94/diff-gaussian-rasterization/third_party/glm/glm/gtx/matrix_factorisation.inl -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/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 | /// Include to use the features of this extension. 10 | /// 11 | /// Mixed product of 3 vectors. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_mixed_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_mixed_product extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_mixed_product 29 | /// @{ 30 | 31 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) 32 | template 33 | GLM_FUNC_DECL T mixedProduct( 34 | vec<3, T, Q> const& v1, 35 | vec<3, T, Q> const& v2, 36 | vec<3, T, Q> const& v3); 37 | 38 | /// @} 39 | }// namespace glm 40 | 41 | #include "mixed_product.inl" 42 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_mixed_product 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T mixedProduct 7 | ( 8 | vec<3, T, Q> const& v1, 9 | vec<3, T, Q> const& v2, 10 | vec<3, T, Q> const& v3 11 | ) 12 | { 13 | return dot(cross(v1, v2), v3); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/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 | /// Include to use the features of this extension. 11 | /// 12 | /// Compute the normal of a triangle. 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | 19 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 20 | # ifndef GLM_ENABLE_EXPERIMENTAL 21 | # pragma message("GLM: GLM_GTX_normal is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 22 | # else 23 | # pragma message("GLM: GLM_GTX_normal extension included") 24 | # endif 25 | #endif 26 | 27 | namespace glm 28 | { 29 | /// @addtogroup gtx_normal 30 | /// @{ 31 | 32 | /// Computes triangle normal from triangle points. 33 | /// 34 | /// @see gtx_normal 35 | template 36 | GLM_FUNC_DECL vec<3, T, Q> triangleNormal(vec<3, T, Q> const& p1, vec<3, T, Q> const& p2, vec<3, T, Q> const& p3); 37 | 38 | /// @} 39 | }//namespace glm 40 | 41 | #include "normal.inl" 42 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normal 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal 7 | ( 8 | vec<3, T, Q> const& p1, 9 | vec<3, T, Q> const& p2, 10 | vec<3, T, Q> const& p3 11 | ) 12 | { 13 | return normalize(cross(p1 - p2, p1 - p3)); 14 | } 15 | }//namespace glm 16 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/normalize_dot.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_normalize_dot 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) 7 | { 8 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) 13 | { 14 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); 15 | } 16 | }//namespace glm 17 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_number_precision 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_optimum_pow 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType pow2(genType const& x) 7 | { 8 | return x * x; 9 | } 10 | 11 | template 12 | GLM_FUNC_QUALIFIER genType pow3(genType const& x) 13 | { 14 | return x * x * x; 15 | } 16 | 17 | template 18 | GLM_FUNC_QUALIFIER genType pow4(genType const& x) 19 | { 20 | return (x * x) * (x * x); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_orthonormalize 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m) 7 | { 8 | mat<3, 3, T, Q> r = m; 9 | 10 | r[0] = normalize(r[0]); 11 | 12 | T d0 = dot(r[0], r[1]); 13 | r[1] -= r[0] * d0; 14 | r[1] = normalize(r[1]); 15 | 16 | T d1 = dot(r[1], r[2]); 17 | d0 = dot(r[0], r[2]); 18 | r[2] -= r[0] * d0 + r[1] * d1; 19 | r[2] = normalize(r[2]); 20 | 21 | return r; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y) 26 | { 27 | return normalize(x - y * dot(y, x)); 28 | } 29 | }//namespace glm 30 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/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 | /// Include to use the features of this extension. 11 | /// 12 | /// Perpendicular of a vector from other one 13 | 14 | #pragma once 15 | 16 | // Dependency: 17 | #include "../glm.hpp" 18 | #include "../gtx/projection.hpp" 19 | 20 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 21 | # ifndef GLM_ENABLE_EXPERIMENTAL 22 | # pragma message("GLM: GLM_GTX_perpendicular is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 23 | # else 24 | # pragma message("GLM: GLM_GTX_perpendicular extension included") 25 | # endif 26 | #endif 27 | 28 | namespace glm 29 | { 30 | /// @addtogroup gtx_perpendicular 31 | /// @{ 32 | 33 | //! Projects x a perpendicular axis of Normal. 34 | //! From GLM_GTX_perpendicular extension. 35 | template 36 | GLM_FUNC_DECL genType perp(genType const& x, genType const& Normal); 37 | 38 | /// @} 39 | }//namespace glm 40 | 41 | #include "perpendicular.inl" 42 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_perpendicular 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType perp(genType const& x, genType const& Normal) 7 | { 8 | return x - proj(x, Normal); 9 | } 10 | }//namespace glm 11 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_polar_coordinates 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER vec<3, T, Q> polar 7 | ( 8 | vec<3, T, Q> const& euclidean 9 | ) 10 | { 11 | T const Length(length(euclidean)); 12 | vec<3, T, Q> const tmp(euclidean / Length); 13 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); 14 | 15 | return vec<3, T, Q>( 16 | asin(tmp.y), // latitude 17 | atan(tmp.x, tmp.z), // longitude 18 | xz_dist); // xz distance 19 | } 20 | 21 | template 22 | GLM_FUNC_QUALIFIER vec<3, T, Q> euclidean 23 | ( 24 | vec<2, T, Q> const& polar 25 | ) 26 | { 27 | T const latitude(polar.x); 28 | T const longitude(polar.y); 29 | 30 | return vec<3, T, Q>( 31 | cos(latitude) * sin(longitude), 32 | sin(latitude), 33 | cos(latitude) * cos(longitude)); 34 | } 35 | 36 | }//namespace glm 37 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/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 | /// Include to use the features of this extension. 10 | /// 11 | /// Projection of a vector to other one 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../geometric.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_projection is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_projection extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_projection 29 | /// @{ 30 | 31 | /// Projects x on Normal. 32 | /// 33 | /// @param[in] x A vector to project 34 | /// @param[in] Normal A normal that doesn't need to be of unit length. 35 | /// 36 | /// @see gtx_projection 37 | template 38 | GLM_FUNC_DECL genType proj(genType const& x, genType const& Normal); 39 | 40 | /// @} 41 | }//namespace glm 42 | 43 | #include "projection.inl" 44 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_projection 2 | 3 | namespace glm 4 | { 5 | template 6 | GLM_FUNC_QUALIFIER genType proj(genType const& x, genType const& Normal) 7 | { 8 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 9 | } 10 | }//namespace glm 11 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_raw_data 2 | 3 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/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 | /// Include to use the features of this extension. 10 | /// 11 | /// Extend a position from a source to a position at a defined length. 12 | 13 | #pragma once 14 | 15 | // Dependency: 16 | #include "../glm.hpp" 17 | 18 | #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) 19 | # ifndef GLM_ENABLE_EXPERIMENTAL 20 | # pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") 21 | # else 22 | # pragma message("GLM: GLM_GTX_extend extension included") 23 | # endif 24 | #endif 25 | 26 | namespace glm 27 | { 28 | /// @addtogroup gtx_scalar_relational 29 | /// @{ 30 | 31 | 32 | 33 | /// @} 34 | }//namespace glm 35 | 36 | #include "scalar_relational.inl" 37 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_std_based_type 2 | 3 | namespace glm 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /diff-gaussian-rasterization/third_party/glm/glm/gtx/texture.inl: -------------------------------------------------------------------------------- 1 | /// @ref gtx_texture 2 | 3 | namespace glm 4 | { 5 | template 6 | inline T levels(vec const& Extent) 7 | { 8 | return glm::log2(compMax(Extent)) + static_cast