BBox Bounds { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Bounds property of the Mesh class is used to set the Axis-Aligned Bounding Box (AABB) for the mesh. This bounding box defines the spatial limits of the mesh in 3D space, which is crucial for various operations such as collision detection, rendering optimizations, and spatial queries.

Usage

To set the bounds of a mesh, assign a BBox object to the Bounds property. The BBox should encapsulate the entire mesh to ensure accurate spatial representation.

Example

// Example of setting the bounds for a mesh
Mesh myMesh = new Mesh();
BBox boundingBox = new BBox(new Vector3(-1, -1, -1), new Vector3(1, 1, 1));
myMesh.Bounds = boundingBox;