RigidBodyComponent

@MainThread
class RigidBodyComponent : Component

A Component responsible for defining the properties of the rigid body, including its RigidBodyMode, MassProperties, CollisionDetectionMode, linear and angular damping, gravity influence, and constraints on translation or rotation in specific directions.

Constructors

Link copied to clipboard
constructor()

The default constructor.

constructor(massProperties: MassProperties, rigidBodyMode: RigidBodyMode)

Constructs a RigidBodyComponent with the specified MassProperties and RigidBodyMode.

Properties

Link copied to clipboard
var angularDamping: Float

Controls how fast a dynamic rigid body’s rotational motion approaches the zero rest state. Default value is 0.05.

Link copied to clipboard

Controls the collision detection mode used in physics simulation. Default value is CollisionDetectionMode.DISCRETE.

Link copied to clipboard
var isAffectedByGravity: Boolean

Determines whether the simulated object should be affected by gravitational forces.

Link copied to clipboard

A tuple of boolean values that indicates whether the rotation of the rigid body is locked around each of the three axes.

Link copied to clipboard

A tuple of boolean values representing whether the rigid body's translation is locked along each of the three axes. The default value is Bool3(false, false, false), meaning that translation is not locked along any axis.

Link copied to clipboard
var linearDamping: Float

Controls how fast a dynamic rigid body’s translational motion approaches the zero rest state. Default value is 0.02.

Link copied to clipboard

The rigid body’s MassProperties, including mass, center of mass, inertia, and orientation of inertia.

Link copied to clipboard

Defines what will influence the motion of the object.

Functions

Link copied to clipboard
open override fun clone(): Component

Creates and returns a copy of this Component instance.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String