Vector3 RandomPointInside { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The RandomPointInside property of the BBox struct returns a random point within the Axis-Aligned Bounding Box (AABB). This property is useful for generating random positions within a defined 3D space, which can be particularly helpful in scenarios such as spawning objects or particles within a bounded area.

Usage

To use the RandomPointInside property, you need to have an instance of the BBox struct. Once you have the instance, you can access this property to get a random Vector3 point inside the bounding box.

Example

// Example of using RandomPointInside property
BBox boundingBox = new BBox(new Vector3(0, 0, 0), new Vector3(10, 10, 10));
Vector3 randomPoint = boundingBox.RandomPointInside;

// randomPoint now contains a random position within the bounding box defined by the mins and maxs.