You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/documentation/about-physics-engine.md
+55-14
Original file line number
Diff line number
Diff line change
@@ -10,30 +10,71 @@ The Physics Engine is a system that offers **Spaces**, **Areas**, **Static Bodie
10
10
11
11
The hierarchy of these objects looks like this:
12
12
13
-
-**Space**: contains
14
-
-**Rigidbodies**: can contain
15
-
-**Shapes**
13
+
-**Space**: can contain
14
+
-**RigidBodies**: can contain
15
+
-**ShapeInstances**
16
16
-**Areas**: can contain
17
-
-**Shapes**
18
-
-**Joints**
17
+
-**ShapeInstances**
19
18
-**Character Controllers**: can contain
20
-
-**Shapes**
19
+
-**ShapeInstances**
20
+
-**Joints**
21
21
-**Fluid**: new concept added by this plugin
22
+
-**Shapes**
23
+
24
+
:::note
25
+
26
+
**RigidBodies/Areas/Character Controllers** can be outside of any space (during initialization time).
27
+
28
+
**Joints** can also be outside of any space (empty joints).
29
+
30
+
**Shapes** are always outside of spaces, but shape instances (or colliders) are bound to bodies. (because shapes can be shared between bodies)
31
+
32
+
Objects without space are a temporary thing and usually done only during initialization.
33
+
34
+
:::
35
+
36
+
All these objects have some internal **state**, and they then also have a **handle** for a Rapier Object.
37
+
38
+
## Rapier
39
+
40
+
Rapier is a physics system that has some concepts that can be mapped to the Physics Engine:
41
+
42
+
-**World**: contains
43
+
-**RigidBodies**: contain
44
+
-**Colliders**
45
+
-**ImpulseJoints**
46
+
-**MultiBodyJoints**
47
+
-**FluidWorld**: contains
48
+
-**Fluids**
49
+
-**Shapes**
22
50
23
51
## Space
24
52
25
-
The space holds stateless data about the godot space, **stateful data** and a **handle** for the **rapier space**. The stateless data can be changed through Godot API.
53
+
The space holds data about:
54
+
-**stateless data** about the godot space.
55
+
-**stateful data** about statistics, scheduled update lists and removed colliders. The scheduled lists contain things such as gravity updates for rigid bodies or callback updates or area monitor updates. The removed colliders use RID internally, and that one cannot be serialized.
56
+
- handle that points to a **inner rapier space**. This is the internal data used by Rapier to simulate the space.
57
+
58
+
## RigidBody / Area / CharacterController
26
59
27
-
### Space State
60
+
The bodies hold data about:
61
+
-**stateless data** about the godot bodies.
62
+
-**stateful data** about detected bodies, computed mass, etc.
63
+
- handle that points to a **inner rapier rigid body**. This is the internal data used by Rapier to simulate the body.
28
64
29
-
Holds state that related to statistics, scheduled update lists and removed colliders. The scheduled lists contain things such as gravity updates for rigidbodies or callback updates or area monitor updates. The removed colliders use RID internally, and that one cannot be serialized.
65
+
## Joint
30
66
31
-
### Space Handle
67
+
The joints hold data about:
68
+
-**stateless data** about the godot joints.
69
+
- handle that points to a **inner rapier joint**. This is the internal data used by Rapier to simulate the joint. This can be either a **impulse joint** or a **multi body joint**.
32
70
33
-
A handle that points to the internal Rapier Space. The handle is created once the space is created and doesn't change after. The handle points to the rapier space.
71
+
## Shape
34
72
35
-
### Rapier Space
73
+
The shapes hold data about:
74
+
-**stateless data** about the godot shapes.
75
+
-**stateful data** about owners, aabb, etc.
76
+
- handle that points to a **inner rapier shape**. This is the internal data used by Rapier to create colliders.
36
77
37
-
This is the internal data used by Rapier to simulate the space. This contains everything else simulated, from shapes to rigidbodies and joints.
78
+
## Colliders
38
79
39
-
WIP
80
+
The colliders are shapes created on bodies. Bodies and shapes hold the handle that points to a **inner rapier collider**.
0 commit comments