Description
The LocalBounds
property of a SceneObject
represents the world bounds translated to the local position of the object. It is important to note that this property does not account for any scaling or rotation transformations that may be applied to the object. The bounds are represented as an axis-aligned bounding box (BBox
), which is useful for collision detection, visibility checks, and other spatial queries within the local space of the object.
Usage
Use the LocalBounds
property when you need to determine the spatial extent of a SceneObject
in its local coordinate system. This can be particularly useful for operations that require knowledge of the object's size and position relative to its local origin, such as local collision detection or rendering optimizations.
Example
// Example of accessing the LocalBounds property
SceneObject mySceneObject = new SceneObject();
BBox localBounds = mySceneObject.LocalBounds;
// Use localBounds for spatial queries or other operations
Vector3 min = localBounds.Mins;
Vector3 max = localBounds.Maxs;
// Example: Check if a point is within the local bounds
Vector3 point = new Vector3(1, 1, 1);
bool isWithinBounds = localBounds.Contains(point);