Reflects an incident 2D vector across a 2D normal vector.
XMVECTOR XMVector2Reflect(
XMVECTOR Incident,
XMVECTOR Normal
)
Incident
Type: XMVECTOR
2D incident vector to reflect.
Normal
Type: XMVECTOR
2D normal vector to reflect the incident vector across.
Type: XMVECTOR
Returns the reflected incident angle.
The following pseudocode demonstrates the operation of the function:
XMVECTOR Result;
float s = 2.0f * (Incident.x * Normal.x + Incident.y * Normal.y); // 2.0 * dot(Incident, Normal);
Result.x = Incident.x - s * Normal.x;
Result.y = Incident.y - s * Normal.y;
Result.z = undefined;
Result.w = undefined;
return Result;
Header: Declared in directxmath.h.