Component
Physics
(NOTE) RigidBody defines the inertia (mass, velocity, etc...) of a rigid object. Any PhysicsEffects attached to a RigidBody without a region will be applied to the center of mass of this body.
Properties
ActiveBody : rigidbody
read-only
If this is a static body then the active body (the one force/velocity should be applied to or calculated from) is the nearest parent body up the hierarchy that is not static. If one isn't found then this returns the current rigid body (this).
var ActiveBody : RigidBody
AllowSleep : boolean
Sleeping happens when an object has not "moved" (small enough linear + angular velocity) for long enough. If this happens then the physics engine stops updating this object (integration, collision detection, etc...) until an awake object hits it. Sleeping is purely an optimization. Sometimes it is not desirable for a body to ever fall asleep (such as a player).
var AllowSleep : Boolean
AngularVelocity : real3
The angular velocity (radians per second) of this body in world space. Objects will rotate about this axis using the right-hand rule. Max bounds are around 1e+10, after this the angular velocity will be capped. Setting this will wake up the body if it's asleep.
var AngularVelocity : Real3
Asleep : boolean
Whether or not this object is currently asleep. Setting this to true will force the object asleep even if this causes invalid behavior (objects floating).
var Asleep : Boolean
DynamicState : RigidBodyDynamicState
How this rigid body handles dynamics. Is it a regular rigid body (dynamic)? Does it not move (static)? Does the user want to manually move it and have objects properly collide with it (kinematic)? Note: Static vs. static does not check for collision.
var DynamicState : RigidBodyDynamicState
Force : real3
The total accumulated force (in world space) that is being applied to the center of mass of this rigid body this frame. Setting this will wake up the body if it's asleep.
var Force : Real3
LocalInverseInertiaTensor : real3x3
read-only
The inverse inertia tensor in local space of this body. The local space inertia tensor doesn't change when the object rotates but is not typically useful for any calculations other than computing the world-space inverse inertia tensor.
var LocalInverseInertiaTensor : Real3x3
Mass : real
read-only
The current mass of the rigid body. This includes all child colliders belonging to this body.
var Mass : Real
Mode2D : Mode2DStates
Used to make an object act as if it were 2D. This is done by locking it to the current z-plane and only allowing rotation about the world's z-axis. Objects can be set to always be 2D or 3D, or this can be deferred to the PhysicsSpace's Mode2D.
var Mode2D : Mode2DStates
RotationLocked : boolean
Makes physics unable to rotate this object. Manual rotations can still be applied.
var RotationLocked : Boolean
Torque : real3
The total accumulated torque (in world space) that is being applied to the center of mass of this rigid body this frame. Setting this will wake up the body if it's asleep.
var Torque : Real3
Velocity : real3
The velocity (units per second) of this body in world space. Max bounds are around 1e+10, after this the velocity will be capped. Setting this will wake up the body if it's asleep.
var Velocity : Real3
WorldCenterOfMass : real3
read-only
The position of the center of mass in world space.
var WorldCenterOfMass : Real3
WorldInverseInertiaTensor : real3x3
read-only
The inverse inertia tensor in world space of this body. Describes how hard it is to rotate an object about the world-space axes. Useful to convert any torque into an angular velocity.
var WorldInverseInertiaTensor : Real3x3
Methods
ApplyAngularImpulse : Void
Applies an angular impulse through the center of mass (world space). Only results in a change of angular velocity. Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |angular|real3| |
function ApplyAngularImpulse(angular : Real3)
ApplyAngularVelocity : Void
Adds to the current angular velocity (world space). Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |angular|real3| |
function ApplyAngularVelocity(angular : Real3)
ApplyForce : Void
Applies a force through the center of mass of the body (world space). Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |force|real3| |
function ApplyForce(force : Real3)
ApplyForceAtOffsetVector : Void
Applies a force at an offset from the center of mass (world space). Results in a force and torque to the center of mass. Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |force|real3| | |worldOffset|real3| |
function ApplyForceAtOffsetVector(force : Real3, worldOffset : Real3)
ApplyForceAtOffsetVectorNoWakeUp : Void
Applies a force at an offset from the center of mass (world space). Results in a force and torque to the center of mass. Will not wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |force|real3| | |worldOffset|real3| |
function ApplyForceAtOffsetVectorNoWakeUp(force : Real3, worldOffset : Real3)
ApplyForceAtPoint : Void
Applies a force at a world point (world space). Results in a force and torque to the center of mass. Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |force|real3| | |worldPoint|real3| |
function ApplyForceAtPoint(force : Real3, worldPoint : Real3)
ApplyForceAtPointNoWakeUp : Void
Applies a force at a world point (world space). Results in a force and torque to the center of mass. Will not wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |force|real3| | |worldPoint|real3| |
function ApplyForceAtPointNoWakeUp(force : Real3, worldPoint : Real3)
ApplyForceNoWakeUp : Void
Applies a force through the center of mass of the body (world space). Will not wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |force|real3| |
function ApplyForceNoWakeUp(force : Real3)
ApplyImpulseAtOffsetVector : Void
Applies an impulse at on offset from the center of mass (world space). Results in a change in linear and angular velocity. Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |impulse|real3| | |worldOffset|real3| |
function ApplyImpulseAtOffsetVector(impulse : Real3, worldOffset : Real3)
ApplyImpulseAtPoint : Void
Applies an impulse at a world point (world space). Results in a change to linear and angular velocity. Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |impulse|real3| | |worldPoint|real3| |
function ApplyImpulseAtPoint(impulse : Real3, worldPoint : Real3)
ApplyLinearImpulse : Void
Applies a linear impulse through the center of mass (world space). Only results in a change of linear velocity. Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |linear|real3| |
function ApplyLinearImpulse(linear : Real3)
ApplyLinearVelocity : Void
Adds to the current linear velocity (world space). Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |linear|real3| |
function ApplyLinearVelocity(linear : Real3)
ApplyTorque : Void
Applies a torque through the center of mass of the body (world space). Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |torque|real3| |
function ApplyTorque(torque : Real3)
ApplyTorqueNoWakeUp : Void
Applies a torque through the center of mass of the body (world space). Will not wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |torque|real3| |
function ApplyTorqueNoWakeUp(torque : Real3)
ApplyVelocityAtPoint : Void
Applies a velocity at a world space point on the object. Results in a change to linear and angular velocity. Will wake up the body if it's asleep. |Name|Type|Description| |---|---|---| |velocity|real3| | |worldPoint|real3| |
function ApplyVelocityAtPoint(velocity : Real3, worldPoint : Real3)
ForceAsleep : Void
Forces the object asleep. Warning: calling this function could create gameplay flaws if used incorrectly, use at your own risk (and sparingly). |Name|Type|Description| |---|---|---|
function ForceAsleep()
ForceAwake : Void
Forces the object awake. Will reset the sleep timer. |Name|Type|Description| |---|---|---|
function ForceAwake()
GetPointVelocity : real3
Computes the linear point velocity of world-space point. |Name|Type|Description| |---|---|---| |worldPoint|real3| |
function GetPointVelocity(worldPoint : Real3) : Real3
RigidBody : Void
constructor
Name Type Description function RigidBody()