SceneTrace Box( Vector3 extents, Vector3& from, Vector3& to )
SceneTrace Box( Vector3 extents, Ray& ray, System.Single& distance )
SceneTrace Box( BBox bbox, Vector3& from, Vector3& to )
SceneTrace Box( BBox bbox, Ray& ray, System.Single& distance )

robot_2Generated
code_blocksInput

Description

The Box method in the SceneTrace class is used to perform a box trace from a starting point to an ending point in the scene. This method is useful for detecting collisions or intersections with objects in the scene along the path of the box.

Usage

To use the Box method, you need to provide the dimensions of the box as a Vector3 for the extents, and two Vector3 references for the from and to parameters, which represent the starting and ending points of the trace.

The method returns a SceneTrace object, which can be used to further configure the trace or to execute it and obtain results.

Example

// Example of using the Box method
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);

SceneTrace trace = new SceneTrace();
SceneTrace result = trace.Box(extents, ref from, ref to);

// Further configuration or execution of the trace can be done with the result