SceneTrace Sphere( float radius, Vector3& from, Vector3& to )
SceneTrace Sphere( float radius, Ray& ray, System.Single& distance )

robot_2Generated
code_blocksInput

Description

The Sphere method in the SceneTrace struct is used to perform a sphere trace from a starting point to an ending point in the scene. This method is useful for detecting collisions or intersections along a path defined by a sphere moving from one point to another.

Usage

To use the Sphere method, you need to provide the radius of the sphere and the starting and ending points of the trace. The method will return a SceneTrace object that can be further configured or executed to perform the trace.

Example

// Example of using the Sphere method
Vector3 startPoint = new Vector3(0, 0, 0);
Vector3 endPoint = new Vector3(10, 0, 0);
float sphereRadius = 1.0f;

SceneTrace trace = new SceneTrace();
SceneTrace result = trace.Sphere(sphereRadius, ref startPoint, ref endPoint);

// Further configuration or execution of the trace can be done here
SceneTraceResult traceResult = result.Run();

if (traceResult.Hit)
{
    // Handle the hit result
    Vector3 hitPosition = traceResult.Position;
    // Additional logic here
}