From 85f2e6b998d8c65e8b9fd0274c80832d7c5b6345 Mon Sep 17 00:00:00 2001 From: christophe Date: Thu, 21 Dec 2023 12:05:02 +0100 Subject: [PATCH] Add tau constant ##1153 --- glm/gtc/constants.hpp | 5 +++++ glm/gtc/constants.inl | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/glm/gtc/constants.hpp b/glm/gtc/constants.hpp index 99f21286..5dececb9 100644 --- a/glm/gtc/constants.hpp +++ b/glm/gtc/constants.hpp @@ -39,6 +39,11 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); + /// Return unit-circle circumference, or pi * 2. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType tau() { return glm::two_pi(); } + /// Return square root of pi. /// @see gtc_constants template diff --git a/glm/gtc/constants.inl b/glm/gtc/constants.inl index bb98c6bf..e9d37761 100644 --- a/glm/gtc/constants.inl +++ b/glm/gtc/constants.inl @@ -20,6 +20,12 @@ namespace glm return genType(6.28318530717958647692528676655900576); } + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType tau() + { + return two_pi(); + } + template GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() {