aboutsummaryrefslogtreecommitdiff
path: root/Client/Source/Phy2DLite/Constants.h
blob: 59a8c09706e1643d27f10fe09fbc35ce70caa305 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once

#include "Settings.h"

namespace Phy2D
{
#if NUMBER_ALIAS == NUMBER_FPM
#define CONSTANT(name, value) static constexpr fixed name = fixed::from_raw_value(value)

    CONSTANT(_1,    65536);
    CONSTANT(_n1, -65536);
    CONSTANT(_0,    0);
    CONSTANT(_0_01, 655);
    CONSTANT(_0_2, 13107);
    CONSTANT(_0_5, 32768);
    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
}