-
Notifications
You must be signed in to change notification settings - Fork 0
Rigidbody Extensions
Clears the momentum of the Rigidbody instance.
// Example of usage
rigidbody.ClearMomentum();Parameters:
-
{Rigidbody} rigidbody: The Rigidbody instance.
Returns:
void
Sets the x position of the Rigidbody instance.
// Example of usage
rigidbody.SetPositionX(2.0f);Sets the y position of the Rigidbody instance.
// Example of usage
rigidbody.SetPositionY(3.0f);Sets the z position of the Rigidbody instance.
// Example of usage
rigidbody.SetPositionZ(4.0f);Parameters:
-
{float} x: The x position. -
{float} y: The y position. -
{float} z: The z position.
Returns:
void
Gets the x position of the Rigidbody instance.
// Example of usage
float xPos = rigidbody.GetPositionX();Gets the y position of the Rigidbody instance.
// Example of usage
float yPos = rigidbody.GetPositionY();Gets the z position of the Rigidbody instance.
// Example of usage
float zPos = rigidbody.GetPositionZ();Parameters:
-
{Rigidbody} rigidbody: The Rigidbody instance.
Returns:
-
{float}: The x, y, or z position.
Gets the x rotation of the Rigidbody instance.
// Example of usage
float xRot = rigidbody.GetRotationX();Gets the y rotation of the Rigidbody instance.
// Example of usage
float yRot = rigidbody.GetRotationY();Gets the z rotation of the Rigidbody instance.
// Example of usage
float zRot = rigidbody.GetRotationZ();Gets the w rotation of the Rigidbody instance.
// Example of usage
float wRot = rigidbody.GetRotationW();Parameters:
-
{Rigidbody} rigidbody: The Rigidbody instance.
Returns:
-
{float}: The x, y, z, or w rotation.
Sets the x rotation of the Rigidbody instance.
// Example of usage
rigidbody.SetRotationX(45.0f);Sets the y rotation of the Rigidbody instance.
// Example of usage
rigidbody.SetRotationY(90.0f);Sets the z rotation of the Rigidbody instance.
// Example of usage
rigidbody.SetRotationZ(180.0f);Sets the w rotation of the Rigidbody instance.
// Example of usage
rigidbody.SetRotationW(1.0f);Parameters:
-
{float} x: The x rotation. -
{float} y: The y rotation. -
{float} z: The z rotation. -
{float} w: The w rotation.
Returns:
void
Sets the x component of the Euler angles of the Rigidbody instance.
// Example of usage
rigidbody.SetEulerAnglesX(45.0f);Sets the y component of the Euler angles of the Rigidbody instance.
// Example of usage
rigidbody.SetEulerAnglesY(90.0f);Sets the z component of the Euler angles of the Rigidbody instance.
// Example of usage
rigidbody.SetEulerAnglesZ(180.0f);Parameters:
-
{float} x: The x component of the Euler angles. -
{float} y: The y component of the Euler angles. -
{float} z: The z component of the Euler angles.
Returns:
void
Gets the x component of the Euler angles of the Rigidbody instance.
// Example of usage
float xEuler = rigidbody.GetEulerAnglesX();Gets the y component of the Euler
angles of the Rigidbody instance.
// Example of usage
float yEuler = rigidbody.GetEulerAnglesY();Gets the z component of the Euler angles of the Rigidbody instance.
// Example of usage
float zEuler = rigidbody.GetEulerAnglesZ();Parameters:
-
{Rigidbody} rigidbody: The Rigidbody instance.
Returns:
-
{float}: The x, y, or z component of the Euler angles.
Sets the x component of the velocity of the Rigidbody instance.
// Example of usage
rigidbody.SetVelocityX(5.0f);Sets the y component of the velocity of the Rigidbody instance.
// Example of usage
rigidbody.SetVelocityY(-2.0f);Sets the z component of the velocity of the Rigidbody instance.
// Example of usage
rigidbody.SetVelocityZ(3.0f);Parameters:
-
{float} x: The x component of the velocity. -
{float} y: The y component of the velocity. -
{float} z: The z component of the velocity.
Returns:
void
Gets the x component of the velocity of the Rigidbody instance.
// Example of usage
float xVel = rigidbody.GetVelocityX();Gets the y component of the velocity of the Rigidbody instance.
// Example of usage
float yVel = rigidbody.GetVelocityY();Gets the z component of the velocity of the Rigidbody instance.
// Example of usage
float zVel = rigidbody.GetVelocityZ();Parameters:
-
{Rigidbody} rigidbody: The Rigidbody instance.
Returns:
-
{float}: The x, y, or z component of the velocity.
Adds to the x component of the velocity of the Rigidbody instance.
// Example of usage
rigidbody.AddVelocityX(2.0f);Adds to the y component of the velocity of the Rigidbody instance.
// Example of usage
rigidbody.AddVelocityY(-1.0f);Adds to the z component of the velocity of the Rigidbody instance.
// Example of usage
rigidbody.AddVelocityZ(0.5f);Parameters:
-
{float} x: The x component to add to the velocity. -
{float} y: The y component to add to the velocity. -
{float} z: The z component to add to the velocity.
Returns:
void
Sets the x component of the angular velocity of the Rigidbody instance.
// Example of usage
rigidbody.SetAngularVelocityX(90.0f);Sets the y component of the angular velocity of the Rigidbody instance.
// Example of usage
rigidbody.SetAngularVelocityY(-45.0f);Sets the z component of the angular velocity of the Rigidbody instance.
// Example of usage
rigidbody.SetAngularVelocityZ(180.0f);Parameters:
-
{float} x: The x component of the angular velocity. -
{float} y: The y component of the angular velocity. -
{float} z: The z component of the angular velocity.
Returns:
void
Gets the x component of the angular velocity of the Rigidbody instance.
// Example of usage
float xAngVel = rigidbody.GetAngularVelocityX();Gets the y component of the angular velocity of the Rigidbody instance.
// Example of usage
float yAngVel = rigidbody.GetAngularVelocityY();Gets the z component of the angular velocity of the Rigidbody instance.
// Example of usage
float zAngVel = rigidbody.GetAngularVelocityZ();Parameters:
-
{Rigidbody} rigidbody: The Rigidbody instance.
Returns:
-
{float}: The x, y, or z component of the angular velocity.
Adds to the x component of the angular velocity of the Rigidbody instance.
// Example of usage
rigidbody.AddAngularVelocityX(20.0f);Adds to the y component of the angular velocity of the Rigidbody instance.
// Example of usage
rigidbody.AddAngularVelocityY(-10.0f);Adds to the z component of the angular velocity of the Rigidbody instance.
// Example of usage
rigidbody.AddAngularVelocityZ(5.0f);Parameters:
-
{float} x: The x component to add to the angular velocity. -
{float} y: The y component to add to the angular velocity. -
{float} z: The z component to add to the angular velocity.