[][src]Function directx_math::XMVectorSelectControl

pub fn XMVectorSelectControl(
    VectorIndex0: u32,
    VectorIndex1: u32,
    VectorIndex2: u32,
    VectorIndex3: u32
) -> XMVECTOR

Defines a control vector for use in XMVectorSelect.

Parameters

VectorIndex0 Index that determines which vector in XMVectorSelect will be selected. If zero, the first vector's first component will be selected. Otherwise, the second vector's component will be selected.

VectorIndex1 Index that determines which vector in XMVectorSelect will be selected. If zero, the first vector's second component will be selected. Otherwise, the second vector's component will be selected.

VectorIndex2 Index that determines which vector in XMVectorSelect will be selected. If zero, the first vector's third component will be selected. Otherwise, the second vector's component will be selected.

VectorIndex3 Index that determines which vector in XMVectorSelect will be selected. If zero, the first vector's fourth component will be selected. Otherwise, the second vector's component will be selected.

Return value

Returns the control vector.

Remarks

The following pseudocode demonstrates the operation of the function:

XMVECTOR    ControlVector;
const uint32_t  ControlElement[] =
            {
                XM_SELECT_0,
                XM_SELECT_1
            };

assert(VectorIndex0 < 2);
assert(VectorIndex1 < 2);
assert(VectorIndex2 < 2);
assert(VectorIndex3 < 2);

ControlVector.u[0] = ControlElement[VectorIndex0];
ControlVector.u[1] = ControlElement[VectorIndex1];
ControlVector.u[2] = ControlElement[VectorIndex2];
ControlVector.u[3] = ControlElement[VectorIndex3];

return ControlVector;

Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxmath/nf-directxmath-XMVectorSelectControl