Vector3 Normal

book_4_sparkGenerated
code_blocksInput

Description

The Normal field in 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 usage of PhysicsTraceResult.Normal
PhysicsTraceResult traceResult = PerformPhysicsTrace();

if (traceResult.Hit)
{
    Vector3 hitNormal = traceResult.Normal;
    // Use hitNormal for further calculations, such as reflections or force application
}