Description
The LocalBounds
property of a SceneObject
provides the bounding box of the object in its local space. This means that the bounds are calculated relative to the object's local position, without considering any scaling or rotation transformations that might be applied to the object. This property is useful for understanding the spatial extent of the object in its own coordinate system.
Usage
Use the LocalBounds
property when you need to determine the size and position of a SceneObject
in its local space. This can be particularly useful for collision detection, spatial queries, or when you need to perform operations that depend on the object's local dimensions.
Example
// Assuming 'sceneObject' is an instance of SceneObject
BBox localBounds = sceneObject.LocalBounds;
// You can now use localBounds to perform operations
Vector3 size = localBounds.Size;
Vector3 center = localBounds.Center;
// Example: Check if a point is within the local bounds
Vector3 point = new Vector3(1, 1, 1);
bool isInside = localBounds.Contains(point);