Share via


XMVectorGetByIndexPtr

Retrieve, into an instance of a floating-point referenced by pointer, the value of one of the four components of an XMVECTOR Data Type containing floating-point data, referenced by index.

Syntax

VOID XMVectorGetByIndexPtr(
         FLOAT *f,
         XMVECTOR V,
         UINT i
)

Parameters

  • f
    [out] Pointer to an instance of an floating-point object that will receive the value of the i component of the XMVECTOR Data Type object V.
  • V
    A XMVECTOR Data Type containing floating-point data.
  • i
    The index of the component to be retrieved.

Return Value

None.

Remarks

The value of i must be positive and less than or equal to three ( 0i3 ). If not an XMASSERT will be triggered.

The indexes have the following correspondence with XMVECTOR Data Type vector components:

Index Component

0

x

1

y

2

z

3

w

Note

XMVectorGetByIndexPtr is preferred when targeting the Xbox 360 for storing arbitrary vector elements to memory, since XMVectorGetByIndex may force a Load/Hit/Store event in this situation which degrades performance.

Requirements

Header: Declared in xnamath.h.

See Also

XMVectorGetByIndex
XMVectorSetByIndexPtr