XMVector2RefractV function (directxmath.h)

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

Syntax

XMVECTOR XM_CALLCONV XMVector2RefractV(
  [in] FXMVECTOR Incident,
  [in] FXMVECTOR Normal,
  [in] FXMVECTOR RefractionIndex
) noexcept;

Parameters

[in] Incident

2D incident vector to refract.

[in] Normal

2D normal vector to refract the incident vector through.

[in] RefractionIndex

2D vector whose x and y-components are both equal to the index of refraction.

Return value

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, undefined, undefined >.

Remarks

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

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

Requirement Value
Target Platform Windows
Header directxmath.h (include DirectXMath.h)

See also

DirectXMath Library 2D Vector Geometric Functions

XMVector2Refract