Description
The Capsule
method in the PhysicsTraceBuilder
class is used to define a capsule shape for a physics trace. This method allows you to specify a capsule, which is a 3D shape consisting of a cylinder with hemispherical ends, to be used in the trace operation. This is useful for collision detection and physics simulations where a capsule shape is more appropriate than a simple sphere or box.
Usage
To use the Capsule
method, you need to have an instance of PhysicsTraceBuilder
. You can then call the Capsule
method, passing a Capsule
object as a parameter. This method returns the PhysicsTraceBuilder
instance, allowing for method chaining.
Example
// Example of using the Capsule method in PhysicsTraceBuilder
// Create a new PhysicsTraceBuilder instance
PhysicsTraceBuilder traceBuilder = new PhysicsTraceBuilder();
// Define a capsule with specific dimensions
Capsule myCapsule = new Capsule(new Vector3(0, 0, 0), new Vector3(0, 0, 10), 2);
// Use the Capsule method to set the trace shape
traceBuilder = traceBuilder.Capsule(myCapsule);
// Continue building the trace with other methods
traceBuilder = traceBuilder.IgnoreStatic().HitTriggers();
// Run the trace
PhysicsTraceResult result = traceBuilder.Run();