Description
The Extents
property of the BBox
structure represents half the size of the bounding box along each axis. It is a Vector3
value that provides a convenient way to understand the dimensions of the bounding box relative to its center. This property is particularly useful when you need to perform calculations or transformations that involve the size of the bounding box.
Usage
Use the Extents
property when you need to determine the half-size of the bounding box. This can be useful for collision detection, rendering, or any spatial calculations where the size of the bounding box is a factor.
Note that this property is marked with the JsonIgnore
attribute, meaning it will not be serialized when using JSON serialization.
Example
// Example of accessing the Extents property
BBox bbox = new BBox(new Vector3(0, 0, 0), new Vector3(10, 10, 10));
Vector3 extents = bbox.Extents;
// extents will be (5, 5, 5) since it is half the size of the BBox