-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathphysics.py
More file actions
60 lines (41 loc) · 1.34 KB
/
physics.py
File metadata and controls
60 lines (41 loc) · 1.34 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
51
52
53
54
55
56
57
58
59
60
from enum import IntEnum
from .component import Behaviour, Component
from .object import field
class Collider(Component):
material = field("m_Material")
is_trigger = field("m_IsTrigger", bool)
class BoxCollider(Collider):
center = field("m_Center")
size = field("m_Size")
class SphereCollider(Collider):
center = field("m_Center")
radius = field("m_Radius")
class CapsuleCollider(SphereCollider):
height = field("m_Height")
direction = field("m_Direction")
class MeshCollider(Collider):
convex = field("m_Convex", bool)
cooking_options = field("m_CookingOptions")
skin_width = field("m_SkinWidth")
mesh = field("m_Mesh")
class Collider2D(Behaviour):
is_trigger = field("m_IsTrigger")
material = field("m_Material")
offset = field("m_Offset")
used_by_effector = field("m_UsedByEffector", bool)
class BoxCollider2D(Collider2D):
size = field("m_Size")
class RigidbodySleepMode2D(IntEnum):
NeverSleep = 0
StartAwake = 1
StartAsleep = 2
class Rigidbody2D(Component):
angular_drag = field("m_AngularDrag")
collision_detection = field("m_CollisionDetection")
constraints = field("m_Constraints")
drag = field("m_LinearDrag")
gravity_scale = field("m_GravityScale")
interpolate = field("m_Interpolate")
is_kinematic = field("m_IsKinematic", bool)
mass = field("m_Mass")
sleep_mode = field("m_SleepingMode", RigidbodySleepMode2D)