PhysicsTraceResult RunAgainstCapsule( Capsule& capsule, Transform& transform )

robot_2Generated
code_blocksInput

Description

The RunAgainstCapsule method in the PhysicsTraceBuilder class is used to perform a physics trace against a capsule shape. This method takes a capsule and a transform as parameters and returns a PhysicsTraceResult that contains information about the trace, such as whether it hit any objects and details about the hit.

Usage

To use the RunAgainstCapsule method, you need to have a PhysicsTraceBuilder instance. You can then call this method by passing a reference to a Capsule and a Transform that defines the position and orientation of the capsule in the world.

Ensure that the capsule and transform are properly initialized before calling this method to get accurate trace results.

Example

// Example usage of RunAgainstCapsule
PhysicsTraceBuilder traceBuilder = new PhysicsTraceBuilder();
Capsule capsule = new Capsule();
Transform transform = new Transform();

// Initialize capsule and transform as needed
// ...

PhysicsTraceResult result = traceBuilder.RunAgainstCapsule(ref capsule, ref transform);

if (result.Hit)
{
    // Handle hit
    var hitPosition = result.Position;
    var hitNormal = result.Normal;
    // Additional hit processing
}