다음을 통해 공유


Intersects(XMVECTOR, XMVECTOR, XMVECTOR, XMVECTOR, XMVECTOR, float&) method

Test whether a triangle intersects with a ray.

Syntax

bool Intersects(
        XMVECTOR Origin,
        XMVECTOR Direction,
        XMVECTOR V0,
        XMVECTOR V1,
        XMVECTOR V2,
  [ref] float    &Dist
);

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 [ref]
    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

Namespace

DirectX::TriangleTests

Header

DirectXCollision.h

See also

DirectXMath Triangle Test Functions