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.
BOOL ClosestRayIntersects( CONST D3DXVECTOR3 * pRayPos, CONST D3DXVECTOR3 * pRayDir, DWORD * pFaceIndex, FLOAT * pU, FLOAT * pV, FLOAT * pDist );
Returns TRUE if the ray intersects the current mesh; otherwise, returns FALSE.
Use ID3DXPRTEngine::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 ID3DXPRTEngine::ShadowRayIntersects. Use ID3DXPRTEngine::ShadowRayIntersects if the location of the intersection point is not needed.
Barycentric coordinates define a point inside a triangle in terms of the triangle's vertices. For a more in-depth description of barycentric coordinates, see Mathworld's Barycentric Coordinates Description.
Header: Declared in D3dx9mesh.h.
ID3DXPRTEngine::ShadowRayIntersects, ID3DXPRTEngine::SetMinMaxIntersection