[Closed] MeshProjIntersect in SDK?
Is there an implementation of the MXS MeshProjIntersect function in the SDK? I can’t find anything other than the intersectRay methods, which are too slow for what I need.
I dont know how to code in SDK , but I think it is a Math thing , some suggestion , wish can help u :
-
it is a ray , and we can make a matrix coordinated system with the ray , as i know , in max script , a command : matrixFromNormal . let the ray as the Z axis . in C++ , maybe it is not hard to make a same coord system in C++ .
-
get the faces of the mesh , filter faces with (dot face_normal ray_Z_axis ) < 0 . that will remove the reversed faces .
-
get face verts , 3 verts of a mash tri face. convert them into Ray coord system .
-
if all 3 verts Z in new coord system < 0 . filter them .
-
if the ray hit the mesh face , ( we only consider in XY axis , it is a plane 4 quardrants .) the 3 verts must be distribute in 3 different quadrants .
you could check out the IProjection… interfaces in the SDK, may be something there you can use.