@@ -11,6 +11,70 @@ class Vector4D : public Object {
11
11
static void _bind_methods ();
12
12
13
13
public:
14
+ // These are a superset of the directions found in Godot's Vector3 type.
15
+ // These align with the G4MF specification: https://github.com/godot-dimensions/g4mf/blob/main/specification/parts/coordinate_system.md
16
+ #if USE_CONST_NOT_CONSTEXPR_FOR_VECTORS
17
+ static const Vector4 ZERO;
18
+ static const Vector4 ONE;
19
+
20
+ static const Vector4 DIR_RIGHT;
21
+ static const Vector4 DIR_LEFT;
22
+ static const Vector4 DIR_UP;
23
+ static const Vector4 DIR_DOWN;
24
+ static const Vector4 DIR_BACK;
25
+ static const Vector4 DIR_FORWARD;
26
+ static const Vector4 DIR_ANA;
27
+ static const Vector4 DIR_KATA;
28
+
29
+ static const Vector4 MODEL_LEFT_SIDE;
30
+ static const Vector4 MODEL_RIGHT_SIDE;
31
+ static const Vector4 MODEL_TOP_SIDE;
32
+ static const Vector4 MODEL_BOTTOM_SIDE;
33
+ static const Vector4 MODEL_FRONT_SIDE;
34
+ static const Vector4 MODEL_REAR_SIDE;
35
+ static const Vector4 MODEL_ANA_SIDE;
36
+ static const Vector4 MODEL_KATA_SIDE;
37
+
38
+ static const Vector4 CARDINAL_EAST;
39
+ static const Vector4 CARDINAL_WEST;
40
+ static const Vector4 CARDINAL_ZENITH;
41
+ static const Vector4 CARDINAL_NADIR;
42
+ static const Vector4 CARDINAL_SOUTH;
43
+ static const Vector4 CARDINAL_NORTH;
44
+ static const Vector4 CARDINAL_ANTH;
45
+ static const Vector4 CARDINAL_KENTH;
46
+ #else
47
+ static constexpr Vector4 ZERO = Vector4(0 , 0 , 0 , 0 );
48
+ static constexpr Vector4 ONE = Vector4(1 , 1 , 1 , 1 );
49
+
50
+ static constexpr Vector4 DIR_RIGHT = Vector4(1 , 0 , 0 , 0 );
51
+ static constexpr Vector4 DIR_LEFT = Vector4(-1 , 0 , 0 , 0 );
52
+ static constexpr Vector4 DIR_UP = Vector4(0 , 1 , 0 , 0 );
53
+ static constexpr Vector4 DIR_DOWN = Vector4(0 , -1 , 0 , 0 );
54
+ static constexpr Vector4 DIR_BACK = Vector4(0 , 0 , 1 , 0 );
55
+ static constexpr Vector4 DIR_FORWARD = Vector4(0 , 0 , -1 , 0 );
56
+ static constexpr Vector4 DIR_ANA = Vector4(0 , 0 , 0 , 1 );
57
+ static constexpr Vector4 DIR_KATA = Vector4(0 , 0 , 0 , -1 );
58
+
59
+ static constexpr Vector4 MODEL_LEFT_SIDE = Vector4(1 , 0 , 0 , 0 );
60
+ static constexpr Vector4 MODEL_RIGHT_SIDE = Vector4(-1 , 0 , 0 , 0 );
61
+ static constexpr Vector4 MODEL_TOP_SIDE = Vector4(0 , 1 , 0 , 0 );
62
+ static constexpr Vector4 MODEL_BOTTOM_SIDE = Vector4(0 , -1 , 0 , 0 );
63
+ static constexpr Vector4 MODEL_FRONT_SIDE = Vector4(0 , 0 , 1 , 0 );
64
+ static constexpr Vector4 MODEL_REAR_SIDE = Vector4(0 , 0 , -1 , 0 );
65
+ static constexpr Vector4 MODEL_ANA_SIDE = Vector4(0 , 0 , 0 , 1 );
66
+ static constexpr Vector4 MODEL_KATA_SIDE = Vector4(0 , 0 , 0 , -1 );
67
+
68
+ static constexpr Vector4 CARDINAL_EAST = Vector4(1 , 0 , 0 , 0 );
69
+ static constexpr Vector4 CARDINAL_WEST = Vector4(-1 , 0 , 0 , 0 );
70
+ static constexpr Vector4 CARDINAL_ZENITH = Vector4(0 , 1 , 0 , 0 );
71
+ static constexpr Vector4 CARDINAL_NADIR = Vector4(0 , -1 , 0 , 0 );
72
+ static constexpr Vector4 CARDINAL_SOUTH = Vector4(0 , 0 , 1 , 0 );
73
+ static constexpr Vector4 CARDINAL_NORTH = Vector4(0 , 0 , -1 , 0 );
74
+ static constexpr Vector4 CARDINAL_ANTH = Vector4(0 , 0 , 0 , 1 );
75
+ static constexpr Vector4 CARDINAL_KENTH = Vector4(0 , 0 , 0 , -1 );
76
+ #endif
77
+
14
78
// Cosmetic functions.
15
79
static Color axis_color (int64_t p_axis);
16
80
static String axis_letter (int64_t p_axis);
0 commit comments