BBox Rotate( Rotation& rotation )

book_4_sparkGenerated
code_blocksInput

Description

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.

Usage

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

// 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.