diff options
author | chai <chaifix@163.com> | 2021-11-30 23:50:01 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-30 23:50:01 +0800 |
commit | 84d961f754c905b37420f4d1b3fee8f4e523e58a (patch) | |
tree | aa3669ac285f7186ecd6a26f874da9bba765178b /Client/Source/Phy2DLite/Settings.h | |
parent | 9e0e01b7f4375063f06e494113187d48614628e0 (diff) |
+phy2d lite
Diffstat (limited to 'Client/Source/Phy2DLite/Settings.h')
-rw-r--r-- | Client/Source/Phy2DLite/Settings.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Client/Source/Phy2DLite/Settings.h b/Client/Source/Phy2DLite/Settings.h new file mode 100644 index 0000000..5f7237f --- /dev/null +++ b/Client/Source/Phy2DLite/Settings.h @@ -0,0 +1,27 @@ +#pragma once + +#include "libfixmath/libfixmath/fixmath.h" + +namespace Phy2D +{ + +#define NUMBER_FLOAT false + +#if 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))) +#else +// 同时一定要开启内联函数扩展,否则执行效率会非常低 +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()) +#endif + +}
\ No newline at end of file |