Skip to main content

oriented_against

Function oriented_against 

Source
pub fn oriented_against(n: DVec3, d: DVec3) -> DVec3
Expand description

Flip n so it opposes the incident direction (d · n < 0).

A surface has two sides and a stored normal points at one of them. Whether a ray is arriving from the front or the back is a fact about the ray, not the surface, so the normal is oriented per hit rather than per surface.