Share via


PrtEngine.ClosestRayIntersects(Vector3,Vector3,IntersectInformation) Method (Microsoft.DirectX.Direct3D)

Uses efficient ray-tracing in precomputed radiance transfer (PRT) simulations to determine whether a ray intersects a mesh. If an intersection is found, the method returns the index of the closest mesh face hit by the ray and the barycentric coordinates of the intersection point.

Definition

Visual Basic Public Function ClosestRayIntersects( _
    ByVal rayPosition As Vector3, _
    ByVal rayDirection As Vector3, _
    ByRef intersection As IntersectInformation _
) As Boolean
C# public bool ClosestRayIntersects(
    Vector3 rayPosition,
    Vector3 rayDirection,
    out IntersectInformation intersection
);
C++ public:
bool ClosestRayIntersects(
    Vector3 rayPosition,
    Vector3 rayDirection,
    [Out] IntersectInformationintersection
);
JScript public function ClosestRayIntersects(
    rayPosition : Vector3,
    rayDirection : Vector3,
    intersection : IntersectInformation
) : boolean;

Parameters

rayPosition Microsoft.DirectX.Vector3
A Vector3 structure that specifies the point where the ray begins.
rayDirection Microsoft.DirectX.Vector3
A Vector3 structure that specifies the direction of the ray.
intersection Microsoft.DirectX.Direct3D.IntersectInformation
An IntersectInformation structure that represents the intersection point and the current mesh face that is first hit by the given ray, based upon stacking all blocker mesh faces in front of the current mesh.

Return Value

System.Boolean
true if the ray intersects the current mesh; false if it does not.

Remarks

Use SetMinMaxIntersection to set minimum and maximum distances of intersection with the ray.

The barycentric coordinate of the third vertex (vertex 2) of the triangle is 1 - ( U + V ).

This method executes slower than ShadowRayIntersects. Use ShadowRayIntersects if the location of the intersection point is not needed.