BBox Bounds { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Bounds property of the MapInstance class provides the world bounds of the map. This property returns a BBox object, which represents the bounding box of the map in world coordinates. It is useful for determining the spatial limits of the map within the scene.

Usage

To access the Bounds property, you need to have an instance of the MapInstance class. Once you have the instance, you can retrieve the bounds of the map as follows:

Example

// Assuming 'mapInstance' is an instance of MapInstance
BBox mapBounds = mapInstance.Bounds;

// You can now use 'mapBounds' to get information about the map's boundaries
Vector3 min = mapBounds.Mins;
Vector3 max = mapBounds.Maxs;

// Example: Check if a point is within the map bounds
Vector3 point = new Vector3(0, 0, 0);
bool isWithinBounds = mapBounds.Contains(point);