From 27b005e9f54e5cea4cb7e50752bd64f425e0f48b Mon Sep 17 00:00:00 2001 From: Zuzu-Typ Date: Fri, 11 Oct 2024 11:57:17 +0200 Subject: [PATCH] Revert "Implementing fcompMin / fcompMax, closes g-truc/glm#1215" This reverts commit dd99bd0e53b6c6a85dbb752c2a9c97953f3ffdcb. --- glm/gtx/component_wise.hpp | 10 ------ glm/gtx/component_wise.inl | 19 ----------- test/gtx/gtx_component_wise.cpp | 59 --------------------------------- 3 files changed, 88 deletions(-) diff --git a/glm/gtx/component_wise.hpp b/glm/gtx/component_wise.hpp index b1caaa274..57925cd00 100644 --- a/glm/gtx/component_wise.hpp +++ b/glm/gtx/component_wise.hpp @@ -61,16 +61,6 @@ namespace glm template GLM_FUNC_DECL typename genType::value_type compMax(genType const& v); - /// Find the minimum float between single vector components. - /// @see gtx_component_wise - template - GLM_FUNC_DECL typename genType::value_type fcompMin(genType const& v); - - /// Find the maximum float between single vector components. - /// @see gtx_component_wise - template - GLM_FUNC_DECL typename genType::value_type fcompMax(genType const& v); - /// @} }//namespace glm diff --git a/glm/gtx/component_wise.inl b/glm/gtx/component_wise.inl index 3a993dbce..cbbc7d41e 100644 --- a/glm/gtx/component_wise.inl +++ b/glm/gtx/component_wise.inl @@ -1,7 +1,6 @@ /// @ref gtx_component_wise #include -#include namespace glm{ namespace detail @@ -125,22 +124,4 @@ namespace detail Result = max(Result, v[i]); return Result; } - - template::value, T>::type> - GLM_FUNC_QUALIFIER T fcompMin(vec const& v) - { - T Result(v[0]); - for(length_t i = 1, n = v.length(); i < n; ++i) - Result = std::fmin(Result, v[i]); - return Result; - } - - template::value, T>::type> - GLM_FUNC_QUALIFIER T fcompMax(vec const& v) - { - T Result(v[0]); - for(length_t i = 1, n = v.length(); i < n; ++i) - Result = std::fmax(Result, v[i]); - return Result; - } }//namespace glm diff --git a/test/gtx/gtx_component_wise.cpp b/test/gtx/gtx_component_wise.cpp index f8d8c7819..9fab86f8f 100644 --- a/test/gtx/gtx_component_wise.cpp +++ b/test/gtx/gtx_component_wise.cpp @@ -105,71 +105,12 @@ namespace compScale } }// compScale -namespace fcompMax -{ - static int run() - { - int Error(0); - - { - float const A = glm::fcompMax(glm::vec4(NAN, 0.2f, 0.5f, 1.0f)); - - Error += A == 1.0f ? 0 : 1; - } - - { - float const A = glm::fcompMax(glm::vec4(2.0f, NAN, 0.3f, 0.7f)); - - Error += A == 2.0f ? 0 : 1; - } - - { - float const A = glm::fcompMax(glm::vec4(NAN, NAN, NAN, NAN)); - - Error += std::isnan(A) ? 0 : 1; - } - - return Error; - } -}// fcompMax - -namespace fcompMin -{ - static int run() - { - int Error(0); - - { - float const A = glm::fcompMin(glm::vec4(NAN, 0.2f, 0.5f, 1.0f)); - - Error += A == 0.2f ? 0 : 1; - } - - { - float const A = glm::fcompMin(glm::vec4(2.0f, NAN, 0.3f, 0.7f)); - - Error += A == 0.3f ? 0 : 1; - } - - { - float const A = glm::fcompMin(glm::vec4(NAN, NAN, NAN, NAN)); - - Error += std::isnan(A) ? 0 : 1; - } - - - return Error; - } -}// fcompMin - int main() { int Error(0); Error += compNormalize::run(); Error += compScale::run(); - Error += fcompMax::run(); - Error += fcompMin::run(); return Error; }