共用方式為


XMVectorRotateRight 函式 (directxmath.h)

將向量向右旋轉 32 位元素的指定數目。

語法

XMVECTOR XM_CALLCONV XMVectorRotateRight(
  [in] FXMVECTOR V,
  [in] uint32_t  Elements
) noexcept;

參數

[in] V

向量向量以向右旋轉。

[in] Elements

要向右旋轉 V 的 32 位元素數目。 此參數必須是 0、1、2 或 3。

傳回值

傳迴旋轉 的 XMVECTOR

備註

下列程式碼示範如何使用此函式。

XMVECTOR v = XMVectorSet( 10.0f, 20.0f, 30.0f, 40.0f );
XMVECTOR result = XMVectorRotateRight( v, 1 );

旋轉向量 (結果) 為 < 40.0f、10.0f、20.0f、30.0f > 。

在常數旋轉值的情況下,使用 XMVectorRotateRight的範本形式會更有效率:


template<uint32_t Elements>
    XMVECTOR XMVectorRotateRight(FXMVECTOR V)
   

平臺需求

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

需求

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

另請參閱

元件向量函式

XMVectorPermute

XMVectorRotateLeft

XMVectorShiftLeft