reckfellENGINE

RigidBody3D

A 3D dynamic body driven by forces and contacts.

On this page
class RigidBody3DReckfellSharpInherits PhysicsBody3D

RigidBody3D receives motion from the physics integrator. Use forces for thrust and impulses for one-off pushes. Repeated Position/Rotation writes in _Process compete with simulation. Request a controlled reset through _IntegrateForces and modify PhysicsDirectBodyState.

BodyEntered requires ContactMonitor and a positive MaxContactsReported. Sleeping, Freeze and shape Disabled differ. CustomIntegrator disables ordinary force integration, not every contact. The example checks falling, impulse, reset and freeze, not every stack/speed/platform.

Guide and example.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

RigidBody3DConstructor
# RigidBody3D
C#
public RigidBody3D();

Properties23

AngularDampProperty
# AngularDamp
C#
public float AngularDamp { get; set; }

Damps the body's rotation. By default, the body will use the ProjectSettings.physics/3d/default_angular_damp project setting or any value override set by an Area3D the body is in. Depending on RigidBody3D.AngularDampMode, you can set RigidBody3D.AngularDamp to be added to or to replace the body's damping value. See ProjectSettings.physics/3d/default_angular_damp for more details about damping.

AngularDampModeProperty
# AngularDampMode
C#
public RigidBody3D.DampMode AngularDampMode { get; set; }

Defines how RigidBody3D.AngularDamp is applied.

AngularVelocityProperty
# AngularVelocity
C#
public Vector3 AngularVelocity { get; set; }

The RigidBody3D's rotational velocity in radians per second.

CanSleepProperty
# CanSleep
C#
public bool CanSleep { get; set; }

If true, the body can enter sleep mode when there is no movement. See RigidBody3D.Sleeping.

CenterOfMassProperty
# CenterOfMass
C#
public Vector3 CenterOfMass { get; set; }

The body's custom center of mass, relative to the body's origin position, when RigidBody3D.CenterOfMassMode is set to RigidBody3D.CenterOfMassModeEnum.Custom. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration. When RigidBody3D.CenterOfMassMode is set to RigidBody3D.CenterOfMassModeEnum.Auto (default value), the center of mass is automatically determined, but this does not update the value of RigidBody3D.CenterOfMass.

CenterOfMassModeProperty
# CenterOfMassMode
C#
public RigidBody3D.CenterOfMassModeEnum CenterOfMassMode { get; set; }

Defines the way the body's center of mass is set.

ConstantForceProperty
# ConstantForce
C#
public Vector3 ConstantForce { get; set; }

The body's total constant positional forces applied during each physics update. See RigidBody3D.AddConstantForce and RigidBody3D.AddConstantCentralForce.

ConstantTorqueProperty
# ConstantTorque
C#
public Vector3 ConstantTorque { get; set; }

The body's total constant rotational forces applied during each physics update. See RigidBody3D.AddConstantTorque.

ContactMonitorProperty
# ContactMonitor
C#
public bool ContactMonitor { get; set; }

Enables body contact monitoring. Signals also need MaxContactsReported > 0 and actual contact between suitable shapes, not arbitrary visual overlap.

ContinuousCdProperty
# ContinuousCd
C#
public bool ContinuousCd { get; set; }

If true, continuous collision detection is used. Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects.

CustomIntegratorProperty
# CustomIntegrator
C#
public bool CustomIntegrator { get; set; }

If true, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the RigidBody3D._IntegrateForces method, if that virtual method is overridden. Setting this property will call the method PhysicsServer3D.BodySetOmitForceIntegration internally.

FreezeProperty
# Freeze
C#
public bool Freeze { get; set; }

If true, the body is frozen. Gravity and forces are not applied anymore. See RigidBody3D.FreezeMode to set the body's behavior when frozen. Note: For a body that is always frozen, use StaticBody3D or AnimatableBody3D instead.

FreezeModeProperty
# FreezeMode
C#
public RigidBody3D.FreezeModeEnum FreezeMode { get; set; }

The body's freeze mode. Determines the body's behavior when RigidBody3D.Freeze is true. Note: For a body that is always frozen, use StaticBody3D or AnimatableBody3D instead.

GravityScaleProperty
# GravityScale
C#
public float GravityScale { get; set; }

This is multiplied by ProjectSettings.physics/3d/default_gravity to produce this body's gravity. For example, a value of 1.0 will apply normal gravity, 2.0 will apply double the gravity, and 0.5 will apply half the gravity to this body.

InertiaProperty
# Inertia
C#
public Vector3 Inertia { get; set; }

The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body on each axis. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value. If set to Vector3.Zero, inertia is automatically computed (default value). Note: This value does not change when inertia is automatically computed. Use PhysicsServer3D to get the computed inertia.

C#
private RigidBody3D _ball;

public override void _Ready()
{
    _ball = GetEntity<RigidBody3D>("Ball");
}

private Vector3 GetBallInertia()
{
    return PhysicsServer3D.BodyGetDirectState(_ball.GetRid()).InverseInertia.Inverse();
}
LinearDampProperty
# LinearDamp
C#
public float LinearDamp { get; set; }

Damps the body's movement. By default, the body will use the ProjectSettings.physics/3d/default_linear_damp project setting or any value override set by an Area3D the body is in. Depending on RigidBody3D.LinearDampMode, you can set RigidBody3D.LinearDamp to be added to or to replace the body's damping value. See ProjectSettings.physics/3d/default_linear_damp for more details about damping.

LinearDampModeProperty
# LinearDampMode
C#
public RigidBody3D.DampMode LinearDampMode { get; set; }

Defines how RigidBody3D.LinearDamp is applied.

LinearVelocityProperty
# LinearVelocity
C#
public Vector3 LinearVelocity { get; set; }

The body's linear velocity in units per second. Can be used sporadically, but don't set this every frame, because physics may run in another thread and runs at a different granularity. Use RigidBody3D._IntegrateForces as your process loop for precise control of the body state.

LockRotationProperty
# LockRotation
C#
public bool LockRotation { get; set; }

If true, the body cannot rotate. Gravity and forces only apply linear movement.

MassProperty
# Mass
C#
public float Mass { get; set; }

The body's mass.

MaxContactsReportedProperty
# MaxContactsReported
C#
public int MaxContactsReported { get; set; }

The maximum number of contacts that will be recorded. Requires a value greater than 0 and RigidBody3D.ContactMonitor to be set to true to start to register contacts. Use RigidBody3D.GetContactCount to retrieve the count or RigidBody3D.GetCollidingBodies to retrieve bodies that have been collided with. Note: The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner).

PhysicsMaterialOverrideProperty
# PhysicsMaterialOverride
C#
public PhysicsMaterial PhysicsMaterialOverride { get; set; }

The physics material override for the body. If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.

SleepingProperty
# Sleeping
C#
public bool Sleeping { get; set; }

If true, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the RigidBody3D.ApplyImpulse or RigidBody3D.ApplyForce methods.

Methods62

AddConstantCentralForcevoid
# AddConstantCentralForce
C#
public void AddConstantCentralForce(Vector3 force);

Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with constant_force = Vector3(0, 0, 0). This is equivalent to using RigidBody3D.AddConstantForce at the body's center of mass.

Parameters
NameTypeDefault
forceVector3—
AddConstantForcevoid
# AddConstantForce
C#
public void AddConstantForce(Vector3 force, Vector3? position = default);

Adds a constant positioned force to the body that keeps being applied over time until cleared with constant_force = Vector3(0, 0, 0). position is the offset from the body origin in global coordinates.

Parameters
NameTypeDefault
forceVector3—
positionVector3?default
position

If the parameter is null, then the default value is new Vector3(0.0f, 0.0f, 0.0f).

AddConstantTorquevoid
# AddConstantTorque
C#
public void AddConstantTorque(Vector3 torque);

Adds a constant rotational force without affecting position that keeps being applied over time until cleared with constant_torque = Vector3(0, 0, 0).

Parameters
NameTypeDefault
torqueVector3—
ApplyCentralForcevoid
# ApplyCentralForce
C#
public void ApplyCentralForce(Vector3 force);

Applies force for the current physics tick. Call on every required _PhysicsProcess for thrust; force is already integrated over time, so multiplying by delta again is incorrect.

Parameters
NameTypeDefault
forceVector3—
ApplyCentralImpulsevoid
# ApplyCentralImpulse
C#
public void ApplyCentralImpulse(Vector3 impulse);

Applies a one-off central impulse. Do not multiply by delta or call each frame for continuous thrust. Without constraints/damping, velocity change depends on impulse / mass.

Parameters
NameTypeDefault
impulseVector3—
ApplyForcevoid
# ApplyForce
C#
public void ApplyForce(Vector3 force, Vector3? position = default);

Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. position is the offset from the body origin in global coordinates.

Parameters
NameTypeDefault
forceVector3—
positionVector3?default
position

If the parameter is null, then the default value is new Vector3(0.0f, 0.0f, 0.0f).

ApplyImpulsevoid
# ApplyImpulse
C#
public void ApplyImpulse(Vector3 impulse, Vector3? position = default);

Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). position is the offset from the body origin in global coordinates.

Parameters
NameTypeDefault
impulseVector3—
positionVector3?default
position

If the parameter is null, then the default value is new Vector3(0.0f, 0.0f, 0.0f).

ApplyTorquevoid
# ApplyTorque
C#
public void ApplyTorque(Vector3 torque);

Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. Note: RigidBody3D.Inertia is required for this to work. To have RigidBody3D.Inertia, an active CollisionShape3D must be a child of the node, or you can manually set RigidBody3D.Inertia.

Parameters
NameTypeDefault
torqueVector3—
ApplyTorqueImpulsevoid
# ApplyTorqueImpulse
C#
public void ApplyTorqueImpulse(Vector3 impulse);

Applies a rotational impulse to the body without affecting the position. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). Note: RigidBody3D.Inertia is required for this to work. To have RigidBody3D.Inertia, an active CollisionShape3D must be a child of the node, or you can manually set RigidBody3D.Inertia.

Parameters
NameTypeDefault
impulseVector3—
GetAngularDampfloat
# GetAngularDamp
C#
public float GetAngularDamp();
Returns float
GetAngularDampModeRigidBody3D.DampMode
# GetAngularDampMode
C#
public RigidBody3D.DampMode GetAngularDampMode();
Returns RigidBody3D.DampMode
GetAngularVelocityVector3
# GetAngularVelocity
C#
public Vector3 GetAngularVelocity();
Returns Vector3
GetCenterOfMassVector3
# GetCenterOfMass
C#
public Vector3 GetCenterOfMass();
Returns Vector3
GetCenterOfMassModeRigidBody3D.CenterOfMassModeEnum
# GetCenterOfMassMode
C#
public RigidBody3D.CenterOfMassModeEnum GetCenterOfMassMode();
Returns RigidBody3D.CenterOfMassModeEnum
GetCollidingBodiesReckfell.Collections.Array<Entity3D>
# GetCollidingBodies
C#
public Reckfell.Collections.Array<Entity3D> GetCollidingBodies();

Returns a list of the bodies colliding with this one. Requires RigidBody3D.ContactMonitor to be set to true and RigidBody3D.MaxContactsReported to be set high enough to detect all the collisions. Note: The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.

Returns Reckfell.Collections.Array<Entity3D>
GetConstantForceVector3
# GetConstantForce
C#
public Vector3 GetConstantForce();
Returns Vector3
GetConstantTorqueVector3
# GetConstantTorque
C#
public Vector3 GetConstantTorque();
Returns Vector3
GetContactCountint
# GetContactCount
C#
public int GetContactCount();

Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see RigidBody3D.ContactMonitor). Note: To retrieve the colliding bodies, use RigidBody3D.GetCollidingBodies.

Returns int
GetFreezeModeRigidBody3D.FreezeModeEnum
# GetFreezeMode
C#
public RigidBody3D.FreezeModeEnum GetFreezeMode();
Returns RigidBody3D.FreezeModeEnum
GetGravityScalefloat
# GetGravityScale
C#
public float GetGravityScale();
Returns float
GetInertiaVector3
# GetInertia
C#
public Vector3 GetInertia();
Returns Vector3
GetInverseInertiaTensorBasis
# GetInverseInertiaTensor
C#
public Basis GetInverseInertiaTensor();

Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the RigidBody3D.

Returns Basis
GetLinearDampfloat
# GetLinearDamp
C#
public float GetLinearDamp();
Returns float
GetLinearDampModeRigidBody3D.DampMode
# GetLinearDampMode
C#
public RigidBody3D.DampMode GetLinearDampMode();
Returns RigidBody3D.DampMode
GetLinearVelocityVector3
# GetLinearVelocity
C#
public Vector3 GetLinearVelocity();
Returns Vector3
GetMassfloat
# GetMass
C#
public float GetMass();
Returns float
GetMaxContactsReportedint
# GetMaxContactsReported
C#
public int GetMaxContactsReported();
Returns int
GetPhysicsMaterialOverridePhysicsMaterial
# GetPhysicsMaterialOverride
C#
public PhysicsMaterial GetPhysicsMaterialOverride();
Returns PhysicsMaterial
GetVelocityAtLocalPositionVector3
# GetVelocityAtLocalPosition
C#
public Vector3 GetVelocityAtLocalPosition(Vector3 localPosition);

Returns the body's velocity at the given relative position. local_position is the offset from the body origin in global coordinates. See also RigidBody3D.GetVelocityAtPosition.

Parameters
NameTypeDefault
localPositionVector3—
Returns Vector3
GetVelocityAtPositionVector3
# GetVelocityAtPosition
C#
public Vector3 GetVelocityAtPosition(Vector3 globalPoint);

Returns the body's velocity at the given global position. This is equivalent to get_velocity_at_local_position(global_point - global_position). See also RigidBody3D.GetVelocityAtLocalPosition.

Parameters
NameTypeDefault
globalPointVector3—
Returns Vector3
IsAbleToSleepbool
# IsAbleToSleep
C#
public bool IsAbleToSleep();
Returns bool
IsContactMonitorEnabledbool
# IsContactMonitorEnabled
C#
public bool IsContactMonitorEnabled();
Returns bool
IsFreezeEnabledbool
# IsFreezeEnabled
C#
public bool IsFreezeEnabled();
Returns bool
IsLockRotationEnabledbool
# IsLockRotationEnabled
C#
public bool IsLockRotationEnabled();
Returns bool
IsSleepingbool
# IsSleeping
C#
public bool IsSleeping();
Returns bool
IsUsingContinuousCollisionDetectionbool
# IsUsingContinuousCollisionDetection
C#
public bool IsUsingContinuousCollisionDetection();
Returns bool
IsUsingCustomIntegratorbool
# IsUsingCustomIntegrator
C#
public bool IsUsingCustomIntegrator();
Returns bool
SetAngularDampvoid
# SetAngularDamp
C#
public void SetAngularDamp(float angularDamp);
Parameters
NameTypeDefault
angularDampfloat—
SetAngularDampModevoid
# SetAngularDampMode
C#
public void SetAngularDampMode(RigidBody3D.DampMode angularDampMode);
Parameters
NameTypeDefault
angularDampModeRigidBody3D.DampMode—
SetAngularVelocityvoid
# SetAngularVelocity
C#
public void SetAngularVelocity(Vector3 angularVelocity);
Parameters
NameTypeDefault
angularVelocityVector3—
SetAxisVelocityvoid
# SetAxisVelocity
C#
public void SetAxisVelocity(Vector3 axisVelocity);

Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.

Parameters
NameTypeDefault
axisVelocityVector3—
SetCanSleepvoid
# SetCanSleep
C#
public void SetCanSleep(bool ableToSleep);
Parameters
NameTypeDefault
ableToSleepbool—
SetCenterOfMassvoid
# SetCenterOfMass
C#
public void SetCenterOfMass(Vector3 centerOfMass);
Parameters
NameTypeDefault
centerOfMassVector3—
SetCenterOfMassModevoid
# SetCenterOfMassMode
C#
public void SetCenterOfMassMode(RigidBody3D.CenterOfMassModeEnum mode);
Parameters
NameTypeDefault
modeRigidBody3D.CenterOfMassModeEnum—
SetConstantForcevoid
# SetConstantForce
C#
public void SetConstantForce(Vector3 force);
Parameters
NameTypeDefault
forceVector3—
SetConstantTorquevoid
# SetConstantTorque
C#
public void SetConstantTorque(Vector3 torque);
Parameters
NameTypeDefault
torqueVector3—
SetContactMonitorvoid
# SetContactMonitor
C#
public void SetContactMonitor(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetFreezeEnabledvoid
# SetFreezeEnabled
C#
public void SetFreezeEnabled(bool freezeMode);
Parameters
NameTypeDefault
freezeModebool—
SetFreezeModevoid
# SetFreezeMode
C#
public void SetFreezeMode(RigidBody3D.FreezeModeEnum freezeMode);
Parameters
NameTypeDefault
freezeModeRigidBody3D.FreezeModeEnum—
SetGravityScalevoid
# SetGravityScale
C#
public void SetGravityScale(float gravityScale);
Parameters
NameTypeDefault
gravityScalefloat—
SetInertiavoid
# SetInertia
C#
public void SetInertia(Vector3 inertia);
Parameters
NameTypeDefault
inertiaVector3—
SetLinearDampvoid
# SetLinearDamp
C#
public void SetLinearDamp(float linearDamp);
Parameters
NameTypeDefault
linearDampfloat—
SetLinearDampModevoid
# SetLinearDampMode
C#
public void SetLinearDampMode(RigidBody3D.DampMode linearDampMode);
Parameters
NameTypeDefault
linearDampModeRigidBody3D.DampMode—
SetLinearVelocityvoid
# SetLinearVelocity
C#
public void SetLinearVelocity(Vector3 linearVelocity);
Parameters
NameTypeDefault
linearVelocityVector3—
SetLockRotationEnabledvoid
# SetLockRotationEnabled
C#
public void SetLockRotationEnabled(bool lockRotation);
Parameters
NameTypeDefault
lockRotationbool—
SetMassvoid
# SetMass
C#
public void SetMass(float mass);
Parameters
NameTypeDefault
massfloat—
SetMaxContactsReportedvoid
# SetMaxContactsReported
C#
public void SetMaxContactsReported(int amount);
Parameters
NameTypeDefault
amountint—
SetPhysicsMaterialOverridevoid
# SetPhysicsMaterialOverride
C#
public void SetPhysicsMaterialOverride(PhysicsMaterial physicsMaterialOverride);
Parameters
NameTypeDefault
physicsMaterialOverridePhysicsMaterial—
SetSleepingvoid
# SetSleeping
C#
public void SetSleeping(bool sleeping);
Parameters
NameTypeDefault
sleepingbool—
SetUseContinuousCollisionDetectionvoid
# SetUseContinuousCollisionDetection
C#
public void SetUseContinuousCollisionDetection(bool enable);
Parameters
NameTypeDefault
enablebool—
SetUseCustomIntegratorvoid
# SetUseCustomIntegrator
C#
public void SetUseCustomIntegrator(bool enable);
Parameters
NameTypeDefault
enablebool—
_IntegrateForcesvoid
# _IntegrateForces
C#
public virtual void _IntegrateForces(PhysicsDirectBodyState3D state);

A physics callback for controlled state modification. For teleporting, set state.Transform and explicitly clear required velocities. Do not substitute repeated Position writes in _Process for the integrator.

Parameters
NameTypeDefault
statePhysicsDirectBodyState3D—

Signals and events5

BodyEnteredEvent
# BodyEntered
C#
public event RigidBody3D.BodyEnteredEventHandler BodyEntered;

Emitted when a collision with another PhysicsBody3D or GridMap occurs. Requires RigidBody3D.ContactMonitor to be set to true and RigidBody3D.MaxContactsReported to be set high enough to detect all the collisions. GridMaps are detected if the MeshLibrary has Collision Shape3Ds. body the Entity, if it exists in the tree, of the other PhysicsBody3D or GridMap.

Handler parameters
NameTypeDefault
bodyEntity—
BodyExitedEvent
# BodyExited
C#
public event RigidBody3D.BodyExitedEventHandler BodyExited;

Emitted when the collision with another PhysicsBody3D or GridMap ends. Requires RigidBody3D.ContactMonitor to be set to true and RigidBody3D.MaxContactsReported to be set high enough to detect all the collisions. GridMaps are detected if the MeshLibrary has Collision Shape3Ds. body the Entity, if it exists in the tree, of the other PhysicsBody3D or GridMap.

Handler parameters
NameTypeDefault
bodyEntity—
BodyShapeEnteredEvent
# BodyShapeEntered
C#
public event RigidBody3D.BodyShapeEnteredEventHandler BodyShapeEntered;

Emitted when one of this RigidBody3D's Shape3Ds collides with another PhysicsBody3D or GridMap's Shape3Ds. Requires RigidBody3D.ContactMonitor to be set to true and RigidBody3D.MaxContactsReported to be set high enough to detect all the collisions. GridMaps are detected if the MeshLibrary has Collision Shape3Ds. body_rid the Rid of the other PhysicsBody3D or MeshLibrary's CollisionObject3D used by the PhysicsServer3D. body the Entity, if it exists in the tree, of the other PhysicsBody3D or GridMap. body_shape_index the index of the Shape3D of the other PhysicsBody3D or GridMap used by the PhysicsServer3D. Get the CollisionShape3D node with body.shape_owner_get_owner(body.shape_find_owner(body_shape_index)). local_shape_index the index of the Shape3D of this RigidBody3D used by the PhysicsServer3D. Get the CollisionShape3D node with self.shape_owner_get_owner(self.shape_find_owner(local_shape_index)).

Handler parameters
NameTypeDefault
bodyRidRid—
bodyEntity—
bodyShapeIndexlong—
localShapeIndexlong—
BodyShapeExitedEvent
# BodyShapeExited
C#
public event RigidBody3D.BodyShapeExitedEventHandler BodyShapeExited;

Emitted when the collision between one of this RigidBody3D's Shape3Ds and another PhysicsBody3D or GridMap's Shape3Ds ends. Requires RigidBody3D.ContactMonitor to be set to true and RigidBody3D.MaxContactsReported to be set high enough to detect all the collisions. GridMaps are detected if the MeshLibrary has Collision Shape3Ds. body_rid the Rid of the other PhysicsBody3D or MeshLibrary's CollisionObject3D used by the PhysicsServer3D. GridMaps are detected if the Meshes have Shape3Ds. body the Entity, if it exists in the tree, of the other PhysicsBody3D or GridMap. body_shape_index the index of the Shape3D of the other PhysicsBody3D or GridMap used by the PhysicsServer3D. Get the CollisionShape3D node with body.shape_owner_get_owner(body.shape_find_owner(body_shape_index)). local_shape_index the index of the Shape3D of this RigidBody3D used by the PhysicsServer3D. Get the CollisionShape3D node with self.shape_owner_get_owner(self.shape_find_owner(local_shape_index)).

Handler parameters
NameTypeDefault
bodyRidRid—
bodyEntity—
bodyShapeIndexlong—
localShapeIndexlong—
SleepingStateChangedEvent
# SleepingStateChanged
C#
public event Action SleepingStateChanged;

Emitted when the physics engine changes the body's sleeping state. Note: Changing the value RigidBody3D.Sleeping will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or emit_signal("sleeping_state_changed") is used.

RigidBody3D.CenterOfMassModeEnum

ValueDescription
Auto = 0

In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass.

Custom = 1

In this mode, the body's center of mass is set through RigidBody3D.CenterOfMass. Defaults to the body's origin position.

RigidBody3D.DampMode

ValueDescription
Combine = 0

In this mode, the body's damping value is added to any value set in areas or the default value.

Replace = 1

In this mode, the body's damping value replaces any value set in areas or the default value.

RigidBody3D.FreezeModeEnum

ValueDescription
Kinematic = 1

Kinematic body freeze mode. Similar to RigidBody3D.FreezeModeEnum.Static, but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated.

Static = 0

Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.