XMVectorInsert (XMVECTOR, XMVECTOR, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)

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

Syntax

XMVECTOR XMVectorInsert(
         XMVECTOR VD,
         XMVECTOR VS,
         uint32_t VSLeftRotateElements,
         uint32_t Select0,
         uint32_t Select1,
         uint32_t Select2,
         uint32_t Select3
)  

Parameters

VD
Type: XMVECTOR 

Vector to insert into.

VS
Type: XMVECTOR 

Vector to rotate left.

VSLeftRotateElements
Type: uint32_t 

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

Select0
Type: uint32_t 

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.

Select1
Type: uint32_t 

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.

Select2
Type: uint32_t 

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.

Select3
Type: uint32_t 

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

Type: XMVECTOR 

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)  

Requirements

Header: Declared in directxmath.h.