diff options
author | chai <chaifix@163.com> | 2021-12-01 19:30:25 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-12-01 19:30:25 +0800 |
commit | bcc11176480f403ab294de24d61bab993ce2fdfd (patch) | |
tree | 0863baca5d29dc58b3555cf38bfeecbeecbec624 /Client/Source/Phy2DLite/Settings.h | |
parent | 1308cb4e2db1eb117b53372bc4fe964cf2d96813 (diff) |
*misc
Diffstat (limited to 'Client/Source/Phy2DLite/Settings.h')
-rw-r--r-- | Client/Source/Phy2DLite/Settings.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/Client/Source/Phy2DLite/Settings.h b/Client/Source/Phy2DLite/Settings.h index e50646c..73639ef 100644 --- a/Client/Source/Phy2DLite/Settings.h +++ b/Client/Source/Phy2DLite/Settings.h @@ -11,6 +11,32 @@ #elif NUMBER_ALIAS == NUMBER_FPM
#include "fpm/include/fpm/fixed.hpp"
#include "fpm/include/fpm/math.hpp"
+#endif
+
+namespace Phy2D
+{
+
+#if NUMBER_ALIAS == NUMBER_FLOAT
+
+typedef float number;
+#define NUMBER_MAX (FLT_MAX)
+#define NUMBER_MIN (FLT_MIN)
+#define SQRT(a) (sqrt((a)))
+#define SIN(a) (sin((a)))
+#define COS(a) (cos((a)))
+
+#elif NUMBER_ALIAS == NUMBER_LIBFIX
+
+// 同时一定要开启内联函数扩展,否则执行效率会非常低
+typedef Fix16 number;
+#define NUMBER_MAX (fix16_maximum)
+#define NUMBER_MIN (fix16_minimum)
+#define SQRT(a) ((a).sqrt())
+#define SIN(a) ((a).sin())
+#define COS(a) ((a).cos())
+#define PI (fix16_pi)
+
+#elif NUMBER_ALIAS == NUMBER_FPM
template <typename T> struct Limits {}; @@ -57,32 +83,6 @@ struct Limits<fpm::fixed_8_24> static constexpr fpm::fixed_8_24 max() noexcept { return fpm::fixed_8_24::from_raw_value(2147483647); } }; -#endif
-
-namespace Phy2D
-{
-
-#if NUMBER_ALIAS == NUMBER_FLOAT
-
-typedef float number;
-#define NUMBER_MAX (FLT_MAX)
-#define NUMBER_MIN (FLT_MIN)
-#define SQRT(a) (sqrt((a)))
-#define SIN(a) (sin((a)))
-#define COS(a) (cos((a)))
-
-#elif NUMBER_ALIAS == NUMBER_LIBFIX
-
-// 同时一定要开启内联函数扩展,否则执行效率会非常低
-typedef Fix16 number;
-#define NUMBER_MAX (fix16_maximum)
-#define NUMBER_MIN (fix16_minimum)
-#define SQRT(a) ((a).sqrt())
-#define SIN(a) ((a).sin())
-#define COS(a) ((a).cos())
-
-#elif NUMBER_ALIAS == NUMBER_FPM
-
typedef fpm::fixed_16_16 number;
#define NUMBER_MAX (Limits<number>::max())
#define NUMBER_MIN (Limits<number>::min())
|