From 9c4198770d3b3b2ca62626dc18bbef3d7af192f1 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Thu, 4 Aug 2016 03:08:59 +0300 Subject: [PATCH] Add hepter variables and typedefs to the shared basic header. --- source/Base/Shared.hpp | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/source/Base/Shared.hpp b/source/Base/Shared.hpp index 4304d034..dd909957 100644 --- a/source/Base/Shared.hpp +++ b/source/Base/Shared.hpp @@ -7,6 +7,51 @@ // ------------------------------------------------------------------------------------------------ namespace SqMod { +/* ------------------------------------------------------------------------------------------------ + * Constant for PI. +*/ +constexpr Float32 SQMOD_PI = 3.14159265359f; + +/* ------------------------------------------------------------------------------------------------ + * Constant for reciprocal of PI. +*/ +constexpr Float32 SQMOD_RECIPROCAL_PI = (1.0f / SQMOD_PI); + +/* ------------------------------------------------------------------------------------------------ + * Constant for half of PI. +*/ +constexpr Float32 SQMOD_HALF_PI = (SQMOD_PI / 2.0f); + +/* ------------------------------------------------------------------------------------------------ + * Constant for 64 bit PI. +*/ +constexpr Float64 SQMOD_PI64 = 3.1415926535897932384626433832795028841971693993751; + +/* ------------------------------------------------------------------------------------------------ + * Constant for 64 bit reciprocal of PI. +*/ +constexpr Float64 SQMOD_RECIPROCAL_PI64 = 1.0/SQMOD_PI64; + +/* ------------------------------------------------------------------------------------------------ + * 32bit Constant for converting from degrees to radians. +*/ +constexpr Float32 SQMOD_DEGTORAD = SQMOD_PI / 180.0f; + +/* ------------------------------------------------------------------------------------------------ + * 32bit constant for converting from radians to degrees. (formally known as GRAD_PI) +*/ +constexpr Float32 SQMOD_RADTODEG = 180.0f / SQMOD_PI; + +/* ------------------------------------------------------------------------------------------------ + * 64 bit constant for converting from degrees to radians. (formally known as GRAD_PI2) +*/ +constexpr Float64 SQMOD_DEGTORAD64 = SQMOD_PI64 / 180.0; + +/* ------------------------------------------------------------------------------------------------ + * 64 bit constant for converting from radians to degrees. +*/ +constexpr Float64 SQMOD_RADTODEG64 = 180.0 / SQMOD_PI64; + /* ------------------------------------------------------------------------------------------------ * Forward declarations of the logging functions to avoid including the logger everywhere. * Primary logging functions.