Skip to content

reflect

reflect(v, normal): Vec2

Defined in: src/modules/collision/narrowphase.ts:254

Reflect a velocity vector off a surface normal using the standard formula v' = v - 2(v·n)n. The caller must supply a unit-length normal; axis-aligned normals like {1,0} or {0,-1} are zero-cost.

Vec2

Vec2

Vec2