SRigidbody

Index

Functions Index

Function Name

void AddExplosionForce (float explosionForce, SVector explosionPosition, float explosionRadius, float upwardsModifier)

void AddForce (SVector force)

void AddForceAtPosition (SVector force, SVector position)

void AddRelativeTorque (SVector torque)

void AddTorque (SVector torque)

SVector ClosestPointOnBounds (SVector input)

SVector GetPointVelocity (SVector worldPoint)

SVector GetRelativePointVelocity (SVector point)

void MovePosition (SVector point)

void MoveRotation (SQuaternion rotation)

void Sleep ()

void WakeUp ()

SPhysicsHit[] SweepTestAll (SVector direction, float distance)

Properties Index

Property Name

float AngularDrag get set

SVector AngularVelocity get set

SVector CenterOfMass get set

float Drag get set

bool FreezeRotation get set

bool Kinematic get set

float Mass get set

float MaxAngularVelocity get set

bool UseGravity get set

SVector Velocity get set

bool Sleeping get

float Density set

SVector InertiaTensor get set

SQuaternion InertiaTensorRotation get set

SGameObject GameObject get

Functions

AddExplosionForce

void AddExplosionForce (float explosionForce, SVector explosionPosition, float explosionRadius, float upwardsModifier)

Applies a force to a rigidbody that simulates explosion effects. Other rigidbodies will be affected by the explosion within its radius - the closer they are to the explosionPosition, the stronger the force will be exerted on them.

Parameter
Type
Description

AddForce

void AddForce (SVector force)

Adds a force to the Rigidbody that is continuously exerted on it in the given direction.

Parameter
Type
Description

AddForceAtPosition

void AddForceAtPosition (SVector force, SVector position)

Adds a force to the Rigidbody at a given position (should be within the range of the rigidbody for a realistic result). Thus, both a torque and force are applied to the object.

Parameter
Type
Description

AddRelativeTorque

void AddRelativeTorque (SVector torque)

Adds a torque to the rigidbody relative to the local coordinate system.

Parameter
Type
Description

AddTorque

void AddTorque (SVector torque)

Adds a torque to the rigidbody relative to the global coordinate system.

Parameter
Type
Description

ClosestPointOnBounds

SVector ClosestPointOnBounds (SVector input)

Returns the closest point on the bounding box of the attached colliders.

Parameter
Type
Description

GetPointVelocity

SVector GetPointVelocity (SVector worldPoint)

Function Description

Parameter
Type
Description

GetRelativePointVelocity

SVector GetRelativePointVelocity (SVector point)

Function Description

Parameter
Type
Description

MovePosition

void MovePosition (SVector point)

Moves the rigidbody to position.

Parameter
Type
Description

MoveRotation

void MoveRotation (SQuaternion rotation)

Rotates the rigidbody to rotation.

Parameter
Type
Description

ResetCenterOfMass

void ResetCenterOfMass ()

Reset the center of mass of the rigidbody.

ResetIntertiaTensor

void ResetIntertiaTensor ()

Reset the inertia tensor value and rotation.

Sleep

void Sleep ()

Forces a rigidbody to sleep.

WakeUp

void WakeUp ()

Forces a rigidbody to wake up.

SweepTestAll

SPhysicsHit[] SweepTestAll (SVector direction, float distance)

Like Rigidbody.SweepTest, but returns all hits.

Parameter
Type
Description

Properties

AngularDrag

float AngularDrag get set

The angular drag of the object.

AngularVelocity

SVector AngularVelocity get set

The angular velocity vector of the rigidbody (in radians per second).

CenterOfMass

SVector CenterOfMass get set

The center of mass relative to the local origin.

Drag

float Drag get set

The drag of the object.

FreezeRotation

bool FreezeRotation get set

Controls whether physics will have any impact on the rotation of the object.

Kinematic

bool Kinematic get set

Controls whether physics will have any impact on the object.

Mass

float Mass get set

The mass of the rigidbody.

MaxAngularVelocity

float MaxAngularVelocity get set

The maximum angular velocity of the rigidbody (7 by default). Can be useful to prevent an object from spinning uncontrollably fast.

MaxDepenetrationVelocity

float MaxDepenetrationVelocity get set

The maximum depenetration velocity of the rigidbody (1.00000003318135E+32 by default). Can be useful to make colliding objects bounce away in a smoother fashion.

UseGravity

bool UseGravity get set

Controls whether gravity affects the rigidbody.

Velocity

SVector Velocity get set

The velocity vector of the rigidbody. (in units per second).

WorldCenterOfMass

SVector WorldCenterOfMass get

The center of mass of the rigidbody relative to the global origin (Read Only).

Sleeping

bool Sleeping get

Is the rigidbody sleeping?

Density

float Density set

The density of the object (1 by default). Changing this value will affect the mass of the object (the volume will remain unchanged).

InertiaTensor

SVector InertiaTensor get set

The diagonal inertia tensor of mass relative to the center of mass. It is defined in x,y,z axis. It is calculate by physics automatically,and if you set value to it, it would override the value.

InertiaTensorRotation

SQuaternion InertiaTensorRotation get set

The rotation of the inertia tensor.

GameObject

SGameObject GameObject get

Property Description

Last updated

Was this helpful?