float Distance { get; set; }

robot_2Generated
code_blocksInput

Description

The Distance property of the SceneTraceResult struct represents the distance between the start and end positions of a trace operation within a scene. This property is read-only and provides a single-precision floating-point value indicating how far the trace traveled before hitting an object or reaching its endpoint.

Usage

Use the Distance property to determine how far a trace operation has traveled. This can be useful for calculating the length of a trace or for determining if a trace has reached a certain distance threshold.

Example

// Example of using the Distance property
SceneTraceResult traceResult = SceneTraceResult.From(scene, trace);
float traceDistance = traceResult.Distance;

// Check if the trace distance is greater than a certain value
if (traceDistance > 10.0f)
{
    // Perform some action based on the trace distance
    // For example, log the distance or trigger an event
}