Bagikan melalui


Fungsi XMVectorInBounds (directxmath.h)

Menguji apakah komponen vektor tertentu berada dalam batas yang ditetapkan.

Sintaks

XMVECTOR XM_CALLCONV XMVectorInBounds(
  [in] FXMVECTOR V,
  [in] FXMVECTOR Bounds
) noexcept;

Parameter

[in] V

Vektor untuk diuji.

[in] Bounds

Vektor yang menentukan batas.

Mengembalikan nilai

Mengembalikan vektor yang berisi hasil setiap pengujian komponen.

Keterangan

Pseudocode berikut menunjukkan pengoperasian fungsi:

XMVECTOR Control;

Control.x = (V.x <= Bounds.x && V.x >= -Bounds.x) ? 0xFFFFFFFF : 0;
Control.y = (V.y <= Bounds.y && V.y >= -Bounds.y) ? 0xFFFFFFFF : 0;
Control.z = (V.z <= Bounds.z && V.z >= -Bounds.z) ? 0xFFFFFFFF : 0;
Control.w = (V.w <= Bounds.w && V.w >= -Bounds.w) ? 0xFFFFFFFF : 0;

return Control;

Persyaratan Platform

Microsoft Visual Studio 2010 atau Microsoft Visual Studio 2012 dengan Windows SDK untuk Windows 8. Didukung untuk aplikasi desktop Win32, aplikasi Windows Store, dan aplikasi Windows Phone 8.

Persyaratan

   
Target Platform Windows
Header directxmath.h (termasuk DirectXMath.h)

Lihat juga

Fungsi Vektor Geometris

XMVectorInBoundsR