Description
The Capsule
method in the SceneTrace
struct is used to perform a trace operation by casting a capsule shape within the scene. This method is useful for detecting collisions or intersections with other objects in the scene using a capsule as the tracing shape.
Usage
To use the Capsule
method, you need to provide a Capsule
object as a parameter. This object defines the dimensions and position of the capsule to be used in the trace operation. The method returns a SceneTrace
object, which can be further configured or executed to perform the trace.
Example
// Example of using the Capsule method
Capsule capsule = new Capsule(new Vector3(0, 0, 0), new Vector3(0, 0, 10), 1.0f);
SceneTrace trace = new SceneTrace().Capsule(capsule);
SceneTraceResult result = trace.Run();
if (result.Hit)
{
// Handle collision
var hitPosition = result.Position;
// Additional logic
}