共用方式為


XMVector4InBounds 函式 (directxmath.h)

測試 4D 向量的元件是否在設定範圍內。

語法

bool XM_CALLCONV XMVector4InBounds(
  [in] FXMVECTOR V,
  [in] FXMVECTOR Bounds
) noexcept;

參數

[in] V

要測試的 4D 向量。

[in] Bounds

決定界限的 4D 向量。

傳回值

如果 V 的所有元件都在設定範圍內,則傳回 true,否則傳回 false。

備註

下列虛擬程式代碼示範函式的作業:

return (V.x <= Bounds.x && V.x >= -Bounds.x) &&
       (V.y <= Bounds.y && V.y >= -Bounds.y) &&
       (V.z <= Bounds.z && V.z >= -Bounds.z) &&
       (V.w <= Bounds.w && V.w >= -Bounds.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 連結庫 4D 向量幾何函數