XMVectorInsert function (directxmath.h)

Rotates a vector left by a given number of 32-bit components and insert selected elements of that result into another vector.

Syntax

XMVECTOR XM_CALLCONV XMVectorInsert(
  [in] FXMVECTOR VD,
  [in] FXMVECTOR VS,
  [in] uint32_t  VSLeftRotateElements,
  [in] uint32_t  Select0,
  [in] uint32_t  Select1,
  [in] uint32_t  Select2,
  [in] uint32_t  Select3
) noexcept;

Parameters

[in] VD

Vector to insert into.

[in] VS

Vector to rotate left.

[in] VSLeftRotateElements

Number of 32-bit components by which to rotate VS left.

[in] Select0

Either 0 or 1. If one, the x-component of the rotated vector will be inserted into the corresponding component of VD. Otherwise, the x-component of VD is left alone.

[in] Select1

Either 0 or 1. If one, the y-component of the rotated vector will be inserted into the corresponding component of VD. Otherwise, the y-component of VD is left alone.

[in] Select2

Either 0 or 1. If one, the z-component of the rotated vector will be inserted into the corresponding component of VD. Otherwise, the z-component of VD is left alone.

[in] Select3

Either 0 or 1. If one, the w-component of the rotated vector will be inserted into the corresponding component of VD. Otherwise, the w-component of VD is left alone.

Return value

Returns the XMVECTOR that results from the rotation and insertion.

Remarks

For best performance, the result of XMVectorInsert should be assigned back to VD.

For cases with constant uint32_t parameters, it is more efficient to use the template form of XMVectorInsert:


template<uint32_t VSLeftRotateElements, uint32_t Select0, uint32_t Select1, uint32_t Select2, uint32_t Select3>
    XMVECTOR XMVectorInsert(FXMVECTOR VD, FXMVECTOR VS)
   

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

Component-Wise Vector Functions

XMVectorPermute

XMVectorRotateLeft

XMVectorRotateRight

XMVectorShiftLeft