Description
The RandomPointOnEdge
property of the Capsule
struct provides a way to obtain a random point located on the edge of the capsule. This property is useful for scenarios where you need to sample points along the boundary of a capsule, such as in physics simulations or graphical effects.
Usage
To use the RandomPointOnEdge
property, you first need to have an instance of a Capsule
. You can create a Capsule
using the FromHeightAndRadius
method or by directly setting its fields. Once you have a Capsule
instance, you can access the RandomPointOnEdge
property to get a random point on its edge.
Example
// Create a capsule with a specific height and radius
Capsule capsule = Capsule.FromHeightAndRadius(10.0f, 2.0f);
// Get a random point on the edge of the capsule
Vector3 randomEdgePoint = capsule.RandomPointOnEdge;
// Use the random point for further processing, e.g., placing an object
// object.Position = randomEdgePoint;