Description
The Box
method in the PhysicsTraceBuilder
class is used to define a box-shaped trace for physics calculations. This method allows you to specify the extents of the box and the start and end points of the trace. It returns a PhysicsTraceBuilder
object, enabling method chaining for further configuration of the trace.
Usage
To use the Box
method, you need to provide the dimensions of the box as a Vector3
for the extents
parameter, and the start and end points of the trace as Vector3
references for the from
and to
parameters. This method is typically used in a chain of method calls to configure and execute a physics trace.
Example
// Example of using the Box method in a physics trace
Vector3 extents = new Vector3(1.0f, 1.0f, 1.0f);
Vector3 from = new Vector3(0.0f, 0.0f, 0.0f);
Vector3 to = new Vector3(10.0f, 0.0f, 0.0f);
PhysicsTraceBuilder traceBuilder = new PhysicsTraceBuilder();
traceBuilder.Box(extents, ref from, ref to)
.Run();