XMQuaternionRotationAxis 函式 (directxmath.h)

計算軸的旋轉四元數。

語法

XMVECTOR XM_CALLCONV XMQuaternionRotationAxis(
  [in] FXMVECTOR Axis,
  [in] float     Angle
) noexcept;

參數

[in] Axis

描述旋轉軸的 3D 向量。

[in] Angle

旋轉角度以弧度為單位。 沿著旋轉軸向原點方向看時,角度是順時針方向測量。

傳回值

傳迴旋轉四元數。

備註

DirectXMath 四元數函數使用 XMVECTOR 4 向量來表示四元數,其中 X、Y 和 Z 元件是向量部分,而 W 元件是純量部分。

如果 Axis 是標準化向量,使用 XMQuaternionRotationNormal 會比較快

平臺需求

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

規格需求

需求
目標平台 Windows
標頭 directxmath.h

另請參閱

DirectXMath 連結庫四元數函數