D3DX8.Intersect
Determines if a ray intersects with a mesh.
object.Intersect( _
MeshIn As D3DXMesh, _
RayPos As D3DVECTOR, _
RayDir As D3DVECTOR, _
retHit As Long, _
retFaceIndex As Long, _
retU As Single, _
retV As Single, _
retDist As Single)
Parts
- object
- Object expression that resolves to a D3DX8 object.
- MeshIn
- D3DXMesh object, representing the mesh to be tested.
- RayPos
- D3DVECTOR type, specifying the origin coordinate of the ray.
- RayDir
- D3DVECTOR type, specifying the direction of the ray.
- retHit
- If the ray intersects a triangular face on the mesh, this value is set to 1. Otherwise, this value is set to 0.
- retFaceIndex
- Index value of the face closest to the ray origin, if retHit is 1.
- retU
- Barycentric hit coordinate.
- retV
- Barycentric hit coordinate.
- retDist
- Ray intersection parameter distance.
Error Codes
If the method fails, an error is raised and Err.Number can be set to E_OUTOFMEMORY.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.