blob: 5c24b57686fe78edd9ba849f695b988b8a61e9dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
}
|