diff options
author | rtk0c <[email protected]> | 2025-08-16 11:23:49 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2025-08-16 11:23:49 -0700 |
commit | 047f294de1b4d385b811ac9f5afc393d81cc4ae9 (patch) | |
tree | f96100a813a4ffb28dcd074455d3a2f8ee426430 /3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp | |
parent | 488fb8b4b9da7f99a5cc37e39fff9f1cb700f2a8 (diff) |
Copy changes from the no-history fork, generated back in 2023
Original commit message:
> commit f138311d2d2e0cc9ba0496d523bb46f2c1c9fb73
> Author: rtk0c <[email protected]>
> Date: Wed Sep 20 23:58:58 2023 -0700
>
> Copy from the PlasticSCM repo, replace vendored glm wtih conan
In reality, this also introduced a few uncommitted changes in the
original PlasticSCM repo. See the modified and new files in this patch.
Diffstat (limited to '3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp')
-rw-r--r-- | 3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp deleted file mode 100644 index fbcdbef..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include <glm/ext/quaternion_exponential.hpp> -#include <glm/ext/quaternion_float.hpp> -#include <glm/ext/quaternion_float_precision.hpp> -#include <glm/ext/quaternion_double.hpp> -#include <glm/ext/quaternion_double_precision.hpp> -#include <glm/ext/quaternion_relational.hpp> -#include <glm/ext/vector_float3.hpp> -#include <glm/ext/vector_float3_precision.hpp> -#include <glm/ext/vector_double3.hpp> -#include <glm/ext/vector_double3_precision.hpp> -#include <glm/ext/scalar_constants.hpp> - -template <typename quaType, typename vecType> -int test_log() -{ - typedef typename quaType::value_type T; - - T const Epsilon = static_cast<T>(0.001f); - - int Error = 0; - - quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0)); - quaType const P = glm::log(Q); - Error += glm::any(glm::notEqual(Q, P, Epsilon)) ? 0 : 1; - - quaType const R = glm::exp(P); - Error += glm::all(glm::equal(Q, R, Epsilon)) ? 0 : 1; - - return Error; -} - -template <typename quaType, typename vecType> -int test_pow() -{ - typedef typename quaType::value_type T; - - T const Epsilon = static_cast<T>(0.001f); - - int Error = 0; - - quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0)); - - { - T const One = static_cast<T>(1.0f); - quaType const P = glm::pow(Q, One); - Error += glm::all(glm::equal(Q, P, Epsilon)) ? 0 : 1; - } - - { - T const Two = static_cast<T>(2.0f); - quaType const P = glm::pow(Q, Two); - quaType const R = Q * Q; - Error += glm::all(glm::equal(P, R, Epsilon)) ? 0 : 1; - - quaType const U = glm::sqrt(P); - Error += glm::all(glm::equal(Q, U, Epsilon)) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_log<glm::quat, glm::vec3>(); - Error += test_log<glm::lowp_quat, glm::lowp_vec3>(); - Error += test_log<glm::mediump_quat, glm::mediump_vec3>(); - Error += test_log<glm::highp_quat, glm::highp_vec3>(); - - Error += test_log<glm::dquat, glm::dvec3>(); - Error += test_log<glm::lowp_dquat, glm::lowp_dvec3>(); - Error += test_log<glm::mediump_dquat, glm::mediump_dvec3>(); - Error += test_log<glm::highp_dquat, glm::highp_dvec3>(); - - Error += test_pow<glm::quat, glm::vec3>(); - Error += test_pow<glm::lowp_quat, glm::lowp_vec3>(); - Error += test_pow<glm::mediump_quat, glm::mediump_vec3>(); - Error += test_pow<glm::highp_quat, glm::highp_vec3>(); - - Error += test_pow<glm::dquat, glm::dvec3>(); - Error += test_pow<glm::lowp_dquat, glm::lowp_dvec3>(); - Error += test_pow<glm::mediump_dquat, glm::mediump_dvec3>(); - Error += test_pow<glm::highp_dquat, glm::highp_dvec3>(); - - return Error; -} |