次の方法で共有


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)
   

プラットフォームの要件

Windows 8 用 Windows SDK を使用した Microsoft Visual Studio 2010 または Microsoft Visual Studio 2012。 Win32 デスクトップ アプリ、Windows ストア アプリ、Windows Phone 8 アプリでサポートされます。

要件

   
対象プラットフォーム Windows
ヘッダー directxmath.h (DirectXMath.h を含む)

関連項目

コンポーネントごとのベクトル関数

XMVectorPermute

XMVectorRotateLeft

XMVectorShiftLeft