Description
The GetBounds
method of the PhysicsBody
class returns the Axis-Aligned Bounding Box (AABB) of the physics body. This bounding box is a rectangular box that completely contains the physics body, aligned with the coordinate axes. It is useful for quickly determining the spatial extent of the body in the world space.
Usage
To use the GetBounds
method, simply call it on an instance of PhysicsBody
. This method does not require any parameters and returns a BBox
object representing the bounding box of the physics body.
Example
// Example of using GetBounds method
PhysicsBody myPhysicsBody = new PhysicsBody();
BBox boundingBox = myPhysicsBody.GetBounds();
// Now you can use boundingBox to get the extents of the physics body
Vector3 min = boundingBox.Mins;
Vector3 max = boundingBox.Max;
// Output the bounding box dimensions
// Note: Replace with appropriate logging or handling in your application
// Console.WriteLine($"Bounding Box Min: {min}, Max: {max}");