BBox LocalBounds { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The LocalBounds property of the ModelRenderer class provides the local bounding box of the model being rendered. This bounding box is defined in the local space of the model, meaning it does not take into account any transformations such as translation, rotation, or scaling that may be applied to the model in the world space.

Usage

Use the LocalBounds property to retrieve the local bounding box of a model. This can be useful for collision detection, visibility checks, or any other operations that require knowledge of the model's dimensions in its own coordinate space.

Example

// Assuming 'modelRenderer' is an instance of ModelRenderer
BBox localBounds = modelRenderer.LocalBounds;

// Use the local bounds for some operation
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);