XMVector4RefractV

Refracts an incident 4D vector across a 4D normal vector.

Syntax

XMVECTOR XMVector4RefractV(
         XMVECTOR Incident,
         XMVECTOR Normal,
         XMVECTOR RefractionIndex
)  

Parameters

Incident
Type: XMVECTOR 

4D incident vector to refract.

Normal
Type: XMVECTOR 

4D normal vector to refract the incident vector through.

RefractionIndex
Type: XMVECTOR 

4D vector, all of whose components are equal to the index of refraction.

Return value

Type: XMVECTOR 

Returns the refracted incident vector. If the refraction index and the angle between the incident vector and the normal are such that the result is a total internal reflection, the function will return a vector of the form < 0.0f, 0.0f, 0.0f, 0.0f >.

Remarks

This function is identical to XMVector4Refract except that the RefractionIndex is supplied using a 4D vector instead of a float value.

Requirements

Header: Declared in directxmath.h.