|
Iuvo Unity 0.5.1
This is library containing a variety of helper classes and extension methods for the Unity gane engine. GitHub | Iuvo Unity Updates | Creator |
Extension methods for Unity's Rigidbody component, providing utility methods for velocity, forces, rotation, and movement control. More...
Static Public Member Functions | |
| static void | SetVelocityX (this Rigidbody rb, float velocity) |
| Sets the X component of the Rigidbody's velocity. | |
| static void | SetVelocityY (this Rigidbody rb, float velocity) |
| Sets the Y component of the Rigidbody's velocity. | |
| static void | SetVelocityZ (this Rigidbody rb, float velocity) |
| Sets the Z component of the Rigidbody's velocity. | |
| static void | SetVelocityTo (this Rigidbody rb, Vector3 targetVelocity) |
| Sets the Rigidbody's velocity to a target vector. | |
| static void | SetRandomVelocity (this Rigidbody rb, float minSpeed, float maxSpeed) |
| Sets a random velocity with speed between the specified minimum and maximum. | |
| static void | ResetVelocity (this Rigidbody rb) |
| Resets the Rigidbody's linear velocity to zero. | |
| static void | ResetAngularVelocity (this Rigidbody rb) |
| Resets the Rigidbody's angular velocity to zero. | |
| static void | AddDampedForce (this Rigidbody rb, Vector3 force, float damping) |
| Applies a damped force to the Rigidbody. | |
| static void | ApplyImpulseAtPoint (this Rigidbody rb, Vector3 impulse, Vector3 point) |
| Applies an impulse force at a specific point. | |
| static void | ApplyForceByMass (this Rigidbody rb, Vector3 force) |
| Applies a force scaled by the Rigidbody's mass. | |
| static void | ApplyJumpForce (this Rigidbody rb, float jumpForce) |
| Applies an upward impulse to simulate a jump. | |
| static void | ApplyForceInDirectionOfVelocity (this Rigidbody rb, float forceAmount) |
| Applies force in the direction of current velocity. | |
| static void | ApplyKnockbackForce (this Rigidbody rb, Vector3 impactPoint, float knockbackStrength) |
| Applies a knockback impulse away from a given impact point. | |
| static void | ApplyRandomTorque (this Rigidbody rb, float torqueAmount) |
| Applies random rotational torque to the Rigidbody. | |
| static void | RotateToAngle (this Rigidbody rb, Vector3 targetDirection, float speed) |
| Rotates the Rigidbody to face a target direction over time. | |
| static void | RotateToAlignWithTarget (this Rigidbody rb, Vector3 targetPosition, float torqueAmount) |
| Rotates the Rigidbody using torque to align with a target position. | |
| static void | ApplySpin (this Rigidbody rb, float torqueAmount) |
| Applies continuous torque around the Y-axis. | |
| static void | SetPositionDirectly (this Rigidbody rb, Vector3 position) |
| Directly sets the Rigidbody's position. | |
| static bool | IsMoving (this Rigidbody rb) |
| Checks whether the Rigidbody is currently moving. | |
| static bool | IsMovingDown (this Rigidbody rb) |
| Checks whether the Rigidbody is currently moving downwards. | |
| static float | GetSpeedInForwardDirection (this Rigidbody rb) |
| Gets the speed in the forward direction of the Rigidbody. | |
| static void | FreezeMovementInDirection (this Rigidbody rb, Vector3 direction) |
| Restricts Rigidbody movement to a single direction. | |
| static void | StopAtPosition (this Rigidbody rb, Vector3 position) |
| Stops the Rigidbody when it reaches a specified position. | |
| static void | ApplyStopImpulse (this Rigidbody rb) |
| Applies an impulse opposite to current velocity to bring Rigidbody to a stop. | |
| static void | ResetAll (this Rigidbody rb) |
| Resets the Rigidbody's position, velocity, and angular velocity. | |
| static void | IgnoreGravityForTime (this Rigidbody rb, float time, MonoBehaviour context) |
| Temporarily disables gravity on a Rigidbody for a set duration. | |
Static Private Member Functions | |
| static IEnumerator | RestoreGravityAfterTime (Rigidbody rb, float time) |
Extension methods for Unity's Rigidbody component, providing utility methods for velocity, forces, rotation, and movement control.
|
static |
Applies a damped force to the Rigidbody.
| rb | The Rigidbody to apply force to. |
| force | The base force vector. |
| damping | The damping factor to reduce the force. |
|
static |
Applies a force scaled by the Rigidbody's mass.
| rb | The Rigidbody to apply force to. |
| force | The base force vector. |
|
static |
Applies force in the direction of current velocity.
| rb | The Rigidbody to modify. |
| forceAmount | The magnitude of the force to apply. |
|
static |
Applies an impulse force at a specific point.
| rb | The Rigidbody to apply the impulse to. |
| impulse | The impulse vector. |
| point | The world position where the impulse is applied. |
|
static |
Applies an upward impulse to simulate a jump.
| rb | The Rigidbody to apply the force to. |
| jumpForce | The magnitude of the jump force. |
|
static |
Applies a knockback impulse away from a given impact point.
| rb | The Rigidbody to knock back. |
| impactPoint | The point of impact. |
| knockbackStrength | The strength of the knockback. |
|
static |
Applies random rotational torque to the Rigidbody.
| rb | The Rigidbody to apply torque to. |
| torqueAmount | The amount of torque to apply. |
|
static |
Applies continuous torque around the Y-axis.
| rb | The Rigidbody to spin. |
| torqueAmount | The amount of Y-axis torque to apply. |
|
static |
Applies an impulse opposite to current velocity to bring Rigidbody to a stop.
| rb | The Rigidbody to stop. |
|
static |
Restricts Rigidbody movement to a single direction.
| rb | The Rigidbody to modify. |
| direction | The direction to allow movement in. |
|
static |
Gets the speed in the forward direction of the Rigidbody.
| rb | The Rigidbody to evaluate. |
|
static |
Temporarily disables gravity on a Rigidbody for a set duration.
| rb | The Rigidbody to modify. |
| time | Duration in seconds before restoring gravity. |
| context | A MonoBehaviour context to start the coroutine. |
This method requires a MonoBehaviour to start the coroutine.
References RestoreGravityAfterTime().
|
static |
Checks whether the Rigidbody is currently moving.
| rb | The Rigidbody to check. |
|
static |
Checks whether the Rigidbody is currently moving downwards.
| rb | The Rigidbody to check. |
|
static |
Resets the Rigidbody's position, velocity, and angular velocity.
| rb | The Rigidbody to reset. |
|
static |
Resets the Rigidbody's angular velocity to zero.
| rb | The Rigidbody to modify. |
|
static |
Resets the Rigidbody's linear velocity to zero.
| rb | The Rigidbody to modify. |
|
staticprivate |
Referenced by IgnoreGravityForTime().
|
static |
Rotates the Rigidbody using torque to align with a target position.
| rb | The Rigidbody to rotate. |
| targetPosition | The world position to look at. |
| torqueAmount | The torque strength to apply. |
|
static |
Rotates the Rigidbody to face a target direction over time.
| rb | The Rigidbody to rotate. |
| targetDirection | The world direction to face. |
| speed | Rotation speed in radians per second. |
|
static |
Directly sets the Rigidbody's position.
| rb | The Rigidbody to move. |
| position | The new world position. |
|
static |
Sets a random velocity with speed between the specified minimum and maximum.
| rb | The Rigidbody to modify. |
| minSpeed | Minimum speed. |
| maxSpeed | Maximum speed. |
|
static |
Sets the Rigidbody's velocity to a target vector.
| rb | The Rigidbody to modify. |
| targetVelocity | The new velocity vector. |
|
static |
Sets the X component of the Rigidbody's velocity.
| rb | The Rigidbody to modify. |
| velocity | The X velocity to set. |
|
static |
Sets the Y component of the Rigidbody's velocity.
| rb | The Rigidbody to modify. |
| velocity | The Y velocity to set. |
|
static |
Sets the Z component of the Rigidbody's velocity.
| rb | The Rigidbody to modify. |
| velocity | The Z velocity to set. |
|
static |
Stops the Rigidbody when it reaches a specified position.
| rb | The Rigidbody to stop. |
| position | The target position. |