-
Notifications
You must be signed in to change notification settings - Fork 4
/
engine.pyi
215 lines (156 loc) · 4.85 KB
/
engine.pyi
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
from typing import List
def getEvents() -> Events: ...
def getMousePosition() -> Vector2: ...
def setMousePosition(int x, int y) -> None: ...
def getWindowSize() -> cave.Vector2: ...
def quitGame() -> None: ...
def getCurrentScene() -> Scene: ...
def setScene(sceneName : str) -> None: ...
def restartCurrentScene() -> None: ...
class Events:
def pressed(self, event : str) -> bool: ...
def active(self, event : str) -> bool: ...
def released(self, event : str) -> bool: ...
class Entity:
name : str
def kill(): ...
def hasTag(tag : str) -> bool: ...
def add(component : Component) -> None: ...
def get(component : str) -> Component: ...
def getAll(component : str) -> list(Component): ...
def getScene() -> Scene: ...
def getParent() -> Entity: ...
def getChildren() -> list(Entity): ...
def getTransform() -> TransformComponent: ...
def getID() -> int: ...
class RayCastOut:
hit : bool
position : Vector3
normal : Vector3
entity : Entity
class Scene:
def newEntity() -> Entity: ...
def add(entity : Entity) -> Entity: ...
def addFromTemplate(templateName : str, overrideTransform=True) -> Entity: ...
def remove(entity : Entity) -> None: ...
def rayCast(origin : Vector3, target : Vector3) -> RayCastOut: ...
def getSun() -> Sun: ...
class Sun:
hour : float # 0.0 to 24.0
angle : float #0.0 to 360.0
color : Vector3
intensity : float
class Timer:
def get() -> float: ...
def set(value : float) -> None: ...
def reset() -> None: ...
###############################################################################
class Component:
entity : Entity
def start(scene : Scene)-> None:
"""Override thid Method and it will be called by the entity when added to the scene."""
pass
def update()-> None:
"""Override thid Method and it will be called every frame."""
pass
def end(scene : Scene)-> None:
"""Override thid Method and it will be called by the entity when removed from the scene."""
pass
class TransformComponent(Component):
position : Vector3
scale : Vector3
def getEuler() -> Vector3: ...
def setEuler(euler : Vector3): ...
def setEuler(x : float, y : float, z : float): ...
def getQuaternion() -> Quaternion: ...
def setQuaternion(quaternion : Quaternion): ...
def setQuaternion(x : float, y : float, z : float, w: float): ...
def getMatrix() -> Matrix4: ...
def setMatrix(mat : Matrix4): ...
def rotateVector(vec : Vector3) -> Vector3: ...
def transformVector(vec : Vector3) -> Vector3: ...
def rotate(x : float, y : float, z : float) -> None: ...
def move(x : float, y : float, z : float, local = True): ...
def rotateOnAxis(angle : float, axis : Vector3) -> None: ...
def rotateOnPitch(angle : float) -> None: ...
def rotateOnYaw(angle : float) -> None: ...
def rotateOnRoll(angle : float) -> None: ...
def applyLocalMovement(x : float, y : float, z : float) -> None: ...
def getPitch() -> float: ...
def getYaw() -> float: ...
def getRoll() -> float: ...
def getForwardVector() -> Vector3: ...
def getRightVector() -> Vector3: ...
def getUpVector() -> Vector3: ...
def lookAt(direction : Vector3, up = Vector3(0, 1, 0)) -> None: ...
class MeshComponent(Component):
def setAnimation(animation : string) -> None: ...
class LightComponent(Component):
color : Vector3
radius : float
intensity : float
class UIElementComponent(Component):
text : str
position : UIVector
scale : UIVector
text : str
def isHovered() -> bool: ...
class RigidBodyComponent(Component):
alwaysActive : bool
linearVelocity : cave.Vector3
angularVelocity : cave.Vector3
angularFactor : cave.Vector3
def getCollisions() -> list(Entity): ...
def collidedWith(tag : string) -> bool: ...
def applyTorque(x : float, y : float, z : float) -> None: ...
def applyForce(x : float, y : float, z : float, location : Vector3) -> None: ...
def isDynamic() -> bool: ...
def setMass(value : float) -> None: ...
###############################################################################
# Math
def normalized(vec : Vector3) -> Vector3: ...
def length(vec : Vector3) -> float: ...
class Vector2:
x : float
y : float
# Equivalents:
s : float
t : float
x : float
y : float
class Vector3:
x : float
y : float
z : float
# Equivalents:
r : float
g : float
b : float
class Vector4:
x : float
y : float
z : float
w : float
# Equivalents:
r : float
g : float
b : float
a : float
class Quaternion:
x : float
y : float
z : float
w : float
class UIVector:
anchoringX : int # -1, 0, 1
anchoringY : int # -1, 0, 1
def isRelativeX() -> bool: ...
def isRelativeY() -> bool: ...
def getX(parentScale = 1.0) -> float: ...
def getY(parentScale = 1.0) -> float: ...
def setPixelX(value : int) -> None: ...
def setPixelY(value : int) -> None: ...
def setPixel(x : int, y : int) -> None: ...
def setRelativeX(value : float) -> None: ...
def setRelativeY(value : float) -> None: ...
def setRelative(x : float, y : float) -> None: ...