Description
The Capsule
method in the SceneTrace
struct is used to perform a trace operation using a capsule shape. This method is part of the tracing system in the Sandbox game engine, which allows for collision detection and physics interactions within a scene.
Usage
To use the Capsule
method, you need to provide a Capsule
object as a parameter. This object defines the shape and dimensions of the capsule that will 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
GameObject hitObject = result.Entity;
// Do something with the hit object
}