BBox Bounds { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Bounds property of a SceneObject represents the axis-aligned bounding box (AABB) for the object. This bounding box is used to define the spatial limits of the object in the scene, which can be useful for collision detection, visibility determination, and other spatial queries.

Usage

You can use the Bounds property to retrieve or set the bounding box of a SceneObject. This property is particularly useful when you need to perform operations that depend on the spatial dimensions of the object, such as checking for intersections with other objects or determining if the object is within a certain area.

Example

// Example of setting the Bounds property
SceneObject myObject = new SceneObject();
BBox newBounds = new BBox(new Vector3(-1, -1, -1), new Vector3(1, 1, 1));
myObject.Bounds = newBounds;

// Example of getting the Bounds property
BBox currentBounds = myObject.Bounds;
Vector3 min = currentBounds.Mins;
Vector3 max = currentBounds.Maxs;

// Use the bounds for collision detection or other spatial operations
bool isWithinBounds = currentBounds.Contains(new Vector3(0, 0, 0));