From fdd228071a3112aeebda20766c7df3b20b8651aa Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 2 Dec 2021 14:44:36 +0800 Subject: +Fix32 --- Client/Source/Phy2DLite/Constants.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Client/Source/Phy2DLite/Constants.h') diff --git a/Client/Source/Phy2DLite/Constants.h b/Client/Source/Phy2DLite/Constants.h index f116ca8..59a8c09 100644 --- a/Client/Source/Phy2DLite/Constants.h +++ b/Client/Source/Phy2DLite/Constants.h @@ -5,7 +5,7 @@ namespace Phy2D { #if NUMBER_ALIAS == NUMBER_FPM -#define CONSTANT(name, value) static fixed name = fixed::from_raw_value(value) +#define CONSTANT(name, value) static constexpr fixed name = fixed::from_raw_value(value) CONSTANT(_1, 65536); CONSTANT(_n1, -65536); @@ -16,5 +16,27 @@ namespace Phy2D CONSTANT(_0_95, 62259); CONSTANT(_12, 786432); +#elif NUMBER_ALIAS == NUMBER_FLOAT + + static const float _1 = 1; + static const float _n1 = -1; + static const float _0 = 0; + static const float _0_01 = 0.01; + static const float _0_2 = 0.2; + static const float _0_5 = 0.5; + static const float _0_95 = 0.95; + static const float _12 = 12; + +#elif NUMBER_ALIAS == NUMBER_FIX32 + + static const float _1 = 1; + static const float _n1 = -1; + static const float _0 = 0; + static const float _0_01 = 0.01; + static const float _0_2 = 0.2; + static const float _0_5 = 0.5; + static const float _0_95 = 0.95; + static const float _12 = 12; + #endif } \ No newline at end of file -- cgit v1.1-26-g67d0