共用方式為


XMVectorGetByIndexPtr 函式 (directxmath.h)

擷取,並擷取指標所參考浮點數的實例,這是 XMVECTOR 資料類型 包含索引所參考浮點數據之四個元件之一的值。

語法

void XM_CALLCONV XMVectorGetByIndexPtr(
  [out] float     *f,
        FXMVECTOR V,
        size_t    i
) noexcept;

參數

[out] f

將接收XMVECTOR 資料類型物件之 i元件值的浮點物件 V 實例指標。

V

包含浮點數據的 XMVECTOR 資料類型

i

要擷取之元件的索引。

傳回值

無。

備註

i的值必須是正數,且小於或等於三個 ( 0 < = i < = 3 ) 。

索引具有下列 與 XMVECTOR 資料類型 向量元件的對應:

索引 元件
0 x
1 y
2 z
3 w
 

平臺需求

Microsoft Visual Studio 2010 或 Microsoft Visual Studio 2012 搭配 Windows SDK for Windows 8。 支援 Win32 傳統型應用程式、Windows 市集應用程式和 Windows Phone 8 個應用程式。

需求

   
目標平台 Windows
標頭 directxmath.h (包含 DirectXMath.h)

另請參閱

DirectXMath 程式庫向量存取子函式

XMVectorGetByIndex

XMVectorSetByIndexPtr