XMVectorCatmullRom function

Performs a Catmull-Rom interpolation, using the specified position vectors.

Syntax

XMVECTOR XM_CALLCONV XMVectorCatmullRom(
  FXMVECTOR Position0,
  FXMVECTOR Position1,
  FXMVECTOR Position2,
  GXMVECTOR Position3,
  float     t
);

Parameters

Position0

First position.

Position1

Second position.

Position2

Third position.

Position3

Fourth position.

t

Interpolating control factor.

Return Value

Returns the results of the Catmull-Rom interpolation.

Remarks

The following pseudocode demonstrates the operation of the function:

XMVECTOR Result;

float t2 = t * t; float t3 = t2* t;

float P0 = -t3 + 2.0f * t2 - t; float P1 = 3.0f * t3 - 5.0f * t2 + 2.0f; float P2 = -3.0f * t3 + 4.0f * t2 + t; float P3 = t3 - t2;

Result.x = (P0 * Position0.x + P1 * Position1.x + P2 * Position2.x + P3 * Position3.x) * 0.5f; Result.y = (P0 * Position0.y + P1 * Position1.y + P2 * Position2.y + P3 * Position3.y) * 0.5f; Result.z = (P0 * Position0.z + P1 * Position1.z + P2 * Position2.z + P3 * Position3.z) * 0.5f; Result.w = (P0 * Position0.w + P1 * Position1.w + P2 * Position2.w + P3 * Position3.w) * 0.5f;

return Result;

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

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

See Also

Geometric Vector Functions

XMVectorCatmullRomV