Edit

Share via


Intersects function (directxcollision.h)

Test whether a triangle intersects with a ray.

Syntax

bool XM_CALLCONV Intersects(
  FXMVECTOR Origin,
  FXMVECTOR Direction,
  FXMVECTOR V0,
  GXMVECTOR V1,
  HXMVECTOR V2,
  float &   Dist
) noexcept;

Parameters

Origin

The origin of the ray.

Direction

The direction of the ray.

V0

A vector defining the triangle.

V1

A vector defining the triangle.

V2

A vector defining the triangle.

Dist

The distance along the ray where the intersection occurs.

Return value

A boolean value indicating whether the triangle intersects with the ray.

Remarks

Note TriangleTests::Intersects is new for DirectXMath. This functionality is not available in XNAMath 2.x. Similar functionality for XNAMath can be found in the DirectX SDK Collision sample.

Platform Requirements

Microsoft Visual Studio 2010 or Microsoft Visual Studio 2012 with the Windows SDK for Windows 8. Supported for Win32 desktop apps, Windows Store apps, and Windows Phone 8 apps.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Header directxcollision.h

See also

DirectXMath Triangle Test Functions