Important rigid body settings
The various parameters that you can set on the instance shapes in a rigid body simulation control how those shapes behave, and include things like initial speed and direction, spin, friction, and so on. Some of these settings are critical to understand when setting up a simulation, and are described here. All of these settings can be set on the create_rigid_bodies, rigid_body_instance, or set_rigid_properties nodes.
Dynamic, kinematic, and static bodies
The active, dynamic bodies in a simulation are those whose positions are fully controlled and updated by the simulation itself. In addition to these, rigid bodies can be kinematic or static.
Use kinematic bodies for those that are meant to be animated outside of the simulation but still collide with dynamic bodies, such as a hand-animated bowling ball that knocks pins over. The simulation tracks the animation of kinematic bodies and checks for collisions, but does not change their animated motion. To create a kinematic body, connect a mesh to a create_animated_collider node and connect its output to the instances input of simulate_rigid_bodies. Alternatively, you can select the kinematic option on the create_rigid_bodies or set_rigid_properties node — in this case, the active state of the body is ignored.
Use static bodies to save computation for objects like the floor that never move but that other bodies can collide with. To create a static body, connect a mesh to a create_static_collider node and connect its output to the instances input of simulate_rigid_bodies. Another way to make a body static is to set its active_state to Asleep on the create_rigid_bodies or set_rigid_properties node.
Active state
The active state of a rigid body determines whether and how the simulation updates its position during the simulation. Normally, an active body can fall asleep if it does not move beyond a threshold for period of time. The positions of sleeping bodies are not updated to save computation and prevent them from jittering instead of coming fully to rest.
You can control the initial state of bodies in the Dynamic Activation settings of the create_rigid_bodies or set_rigid_properties node:
- Asleep: The body will not move, but other bodies can collide with it.
- WakeOnCollide: The body will not move until another body collides with it.
- SleepWhenInactive: The body will be active until it stops moving.
- Awake: The body will never sleep.
The active state of bodies can be animated.
Collision method and shape
Collision detection is one of the most computationally expensive parts of rigid body simulation. Rigid bodies can have a collision shape that is different from the shape used for rendering, and you can greatly improve the simulation speed by simplifying the shape used for calculating collisions.
The method parameter determines the collision shape:
- BoundingBox is simple and fast, but can result in inaccurate collisions.
- BoundingSphere is also simple, fast, and can result in inaccurate collisions. Depending on the shape of the bodies, it might give better results than BoundingBox.
- ConvexHull gives a more accurate profile of the bodies' shapes, but does not take concavities and holes into account. Use the Collision Properties parameters to control how the collision shape is computed.
- ConvexDecomposition approximates shapes with a set of convex hulls, and is the most accurate but slowest. It may be required to give plausible results for large, irregular bodies with cavities. Use the Collision Properties and Convex Decomposition parameters to control how the collision shape is computed. You can connect your own convex decomposition if you prefer to create one manually.
Be careful not to create collision geometry that overlaps on the first frame. This can produce extreme forces that result in explosive movement.
Name
When creating rigid bodies, you can supply a name that is useful for filtering when creating constraints and applying influences. These names are concatenated with those created by the fracturing compounds.
