The Rotate
method of the BBox
struct applies a rotation to the bounding box and returns a new BBox
that represents the rotated bounding box. This method is useful for transforming the bounding box to align with a rotated object in 3D space.
The Rotate
method of the BBox
struct applies a rotation to the bounding box and returns a new BBox
that represents the rotated bounding box. This method is useful for transforming the bounding box to align with a rotated object in 3D space.
To use the Rotate
method, you need to have an instance of BBox
and a Rotation
object that defines the rotation to be applied. The method will return a new BBox
that is the result of applying the rotation.
// Example of using the Rotate method BBox originalBox = new BBox(new Vector3(0, 0, 0), new Vector3(1, 1, 1)); Rotation rotation = Rotation.FromAxis(Vector3.Up, 45); // Rotate 45 degrees around the Y-axis BBox rotatedBox = originalBox.Rotate(ref rotation); // The rotatedBox now represents the bounding box after rotation.