Description
The Rotation
property of the PhysicsBody
class represents the rotation of the physics body in world space. This property is used to get or set the orientation of the physics body, which is crucial for determining how the body interacts with other objects in the physics simulation.
Usage
To use the Rotation
property, you can directly access it from an instance of PhysicsBody
. You can both retrieve the current rotation and assign a new rotation to the physics body.
Example
// Example of accessing and modifying the Rotation property
// Assume 'body' is an instance of PhysicsBody
Rotation currentRotation = body.Rotation;
// Set a new rotation
body.Rotation = new Rotation(0, 90, 0); // Rotates the body 90 degrees around the Y-axis