Description
The Normal
field of the SceneTraceResult
struct represents the normal vector of the surface that was hit during a trace operation. This vector is a unit vector that is perpendicular to the surface at the point of impact, indicating the direction in which the surface is facing.
Usage
Use the Normal
field to determine the orientation of the surface that was hit. This can be useful for calculating reflections, determining the angle of impact, or applying physics responses based on the surface orientation.
Example
// Example of using the Normal field in a trace operation
SceneTraceResult traceResult = Scene.Trace(...);
if (traceResult.Hit)
{
Vector3 hitNormal = traceResult.Normal;
// Use hitNormal for further calculations, such as reflections or physics responses
}