Vector3 Normal

robot_2Generated
code_blocksInput

Description

The Normal field of the PhysicsTraceResult struct represents the surface normal at the point of impact during a physics trace. This is a direction vector that is perpendicular to the surface that was hit, providing information about the orientation of the surface at the hit location.

Usage

Use the Normal field to determine the orientation of the surface that was hit by a physics trace. This can be useful for calculating reflections, determining the angle of impact, or applying forces in the direction opposite to the surface normal.

Example

// Example of using the Normal field in a physics trace
PhysicsTraceResult traceResult = PerformPhysicsTrace();

if (traceResult.Hit)
{
    Vector3 hitNormal = traceResult.Normal;
    // Use hitNormal to calculate reflection or other physics-based logic
    Vector3 reflectionDirection = Vector3.Reflect(traceResult.Direction, hitNormal);
    // Apply reflectionDirection or use it for further calculations
}