Description
The AngularDamping
property of the PhysicsBody
class represents the generic angular damping of the physics body. Angular damping is a measure of how much the physics body will slow down its rotational movement over time due to internal resistance. This property is useful for simulating realistic rotational deceleration in a physics simulation.
Usage
To use the AngularDamping
property, simply get or set its value on an instance of PhysicsBody
. A higher value will result in faster rotational deceleration, while a lower value will allow the body to maintain its angular velocity for a longer period.
Example
// Create a new PhysicsBody instance
PhysicsBody myPhysicsBody = new PhysicsBody();
// Set the angular damping to a specific value
myPhysicsBody.AngularDamping = 0.5f;
// Get the current angular damping value
float currentAngularDamping = myPhysicsBody.AngularDamping;
// Output the current angular damping
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use a logging system or in-game UI to display values
// Log.Info($"Current Angular Damping: {currentAngularDamping}");