The RotateAround
method allows you to rotate a Transform
around a specified point in space. This is useful for creating orbital motion or rotating an object around a pivot point.
The RotateAround
method allows you to rotate a Transform
around a specified point in space. This is useful for creating orbital motion or rotating an object around a pivot point.
To use the RotateAround
method, you need to provide a reference to a Vector3
representing the center point around which the rotation will occur, and a Rotation
object that defines the rotation to be applied.
The method modifies the Transform
by rotating it around the specified center point using the given rotation.
// Example of using RotateAround Transform myTransform = new Transform(); Vector3 centerPoint = new Vector3(0, 0, 0); Rotation rotation = Rotation.FromAxis(Vector3.Up, 90); // Rotate 90 degrees around the Up axis myTransform.RotateAround(ref centerPoint, ref rotation); // After this call, myTransform will be rotated 90 degrees around the centerPoint.