robot_2Generated
code_blocksInput

Description

The Body method in the PhysicsTraceBuilder class is used to set up a physics trace that involves a specific physics body. This method allows you to specify a physics body and a target position to trace towards. It is part of the fluent interface of the PhysicsTraceBuilder, enabling you to chain multiple trace configuration methods together.

Usage

To use the Body method, you need to have an instance of PhysicsTraceBuilder. You can then call the Body method on this instance, passing in a PhysicsBody and a target Vector3 position. This method returns the same PhysicsTraceBuilder instance, allowing for method chaining.

Example

// Example of using the Body method in a physics trace
PhysicsBody myBody = GetPhysicsBody(); // Assume this retrieves a valid PhysicsBody
Vector3 targetPosition = new Vector3(10, 0, 0);

PhysicsTraceBuilder traceBuilder = new PhysicsTraceBuilder();
traceBuilder.Body(myBody, ref targetPosition)
            .Run(); // Executes the trace and returns the result