The Rotate
method of the BBox
struct is used to rotate the bounding box by a specified rotation. This method modifies the bounding box to reflect the new orientation after applying the given rotation.
The Rotate
method of the BBox
struct is used to rotate the bounding box by a specified rotation. This method modifies the bounding box to reflect the new orientation after applying the given rotation.
To use the Rotate
method, you need to have an instance of BBox
and a Rotation
object that specifies the desired rotation. The method will return a new BBox
that represents the rotated bounding box.
// Example of using the Rotate method BBox boundingBox = new BBox(new Vector3(0, 0, 0), new Vector3(1, 1, 1)); Rotation rotation = new Rotation(Quaternion.FromAxisAngle(Vector3.Up, 90)); BBox rotatedBox = boundingBox.Rotate(ref rotation); // rotatedBox now represents the bounding box after being rotated by 90 degrees around the Y-axis.