forked from K0lb3/UnityPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuaternion.py
More file actions
50 lines (39 loc) · 1.01 KB
/
Quaternion.py
File metadata and controls
50 lines (39 loc) · 1.01 KB
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
43
44
45
46
47
48
49
50
class Quaternion:
X: float
Y: float
Z: float
W: float
def __init__(self, x: float = 0.0, y: float = 0.0, z: float = 0.0, w: float = 0.0):
self._data = [0.0] * 4
self.X = x
self.Y = y
self.Z = z
self.W = w
@property
def X(self) -> float:
return self._data[0]
@X.setter
def X(self, value: float):
self._data[0] = value
@property
def Y(self) -> float:
return self._data[1]
@Y.setter
def Y(self, value: float):
self._data[1] = value
@property
def Z(self) -> float:
return self._data[2]
@Z.setter
def Z(self, value: float):
self._data[2] = value
@property
def W(self) -> float:
return self._data[3]
@W.setter
def W(self, value: float):
self._data[3] = value
def __getitem__(self, value):
return self._data[value]
def __setitem__(self, index, value):
self._data[index] = value