Description
The RunAll
method of the PhysicsTraceBuilder
class executes the configured physics trace and returns an array of PhysicsTraceResult
objects. Each object in the array represents a hit detected during the trace operation. This method is useful when you need to gather information about all collisions along the trace path, rather than just the first one.
Usage
To use the RunAll
method, first configure a PhysicsTraceBuilder
instance with the desired trace parameters, such as the shape, size, and direction of the trace. Then, call RunAll
to execute the trace and retrieve all collision results.
Example
// Example usage of the RunAll method
PhysicsTraceBuilder traceBuilder = new PhysicsTraceBuilder();
traceBuilder = traceBuilder.Sphere(1.0f, ref startPosition, ref endPosition);
PhysicsTraceResult[] results = traceBuilder.RunAll();
foreach (var result in results)
{
// Process each hit result
var hitEntity = result.Entity;
var hitPosition = result.Position;
// Additional processing...
}