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 )

book_4_sparkGenerated
code_blocksInput

Description

The Box method in the SceneTrace struct 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, respectively.

Example

// Example usage of 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);

// Process the result to check for collisions or intersections