Skip to content

Rigidbody

Jirka Dell'Oro-Friedl edited this page Sep 6, 2022 · 9 revisions

ComponentRigidbody

This component adds a physical representation of the node in the physics world. It comes with a large set of parameters.

Type

Three types of bodies are available

STATIC DYNAMIC KINEMATIC
The body is completely immoveable and no forces on it must be calculated. Use this type for objects that don't need to react to collisions or forces like floors and walls etc. Since those bodies don't need to be tested for collision against each other, using them reduces computational load drastically. The body is subject to physical interaction and influenced by collisions and forces. In fact, the body can only be controlled by such, manipulation of its geometrical transformation is completely ignored. The body is controlled by its geometrical transformation and not influenced by the physics world. However, it impacts other dynamic bodys, rendering it a strange chimera of both worlds.

Collider

For ease of calculation, the physic engine uses shapes with simple mathematical definitions instead of complex meshes with a lot of vertices and edges. There is a set of shapes to chose from to define the body, most commonly to approximate the shape of the geometrical object. However, the body may represent a whole branch of geometry with one simple shape in the physics world, if appropriate.

The shapes are CUBE, SPHERE, CAPSULE, CYLINDER, CONE, PYRAMID. The shape CONVEX is supported by OIMO but completely untested in FUDGE at this point of time.

Pivot

The pivot matrix transforms the collider relative to the node, so the shapes may be further adjusted to fit. Beware that the transformation effecting the shape is the resulting transformation up to that node plus the pivot.

Mass

As the most fundamental physical property, the mass determines how the body reacts to forces. Given the same force exerted, a body with a small mass accelerates much faster than one with a large mass.

Restitution

Is the ratio of the final to initial relative speed between two objects after they collide. A restitution of 1 would be a perfectly elastic bounce, whereas 0 would result in all energy being absorbed.

Friction

Determines the friction of the surface of the body and goes into effect, when it slides on another body. The friction values of both surfaces must be considered.

DampTranslation

Defines the energy loss during translation, approximating the resistance of a medium the body is travelling through.

DampRotation

Defines the energy loss during rotation, approximating the resistance of a medium the body is spinning in.

EffectGravity

Defines if and to what extend a body is effected by gravity, which is a constant acceleration towards the negative Y-axis of the world and set to the standard value of Earths gravity of 9.81 m/s². A negative value would make the body fly.

Trigger

If the body is defined as a trigger, it won't react to forces or collisions, but a collision causes a trigger-event to be dispatched to the node. This is an easy way to define areas of various shapes to cause a reaction in the game to happen, when a body enters or leaves it.

Clone this wiki locally