float raySect(const Vector3d &p,const Vector3d &dir,Vector3d §) const { float plane[4]; plane[0] = mNormal.x; plane[1] = mNormal.y; plane[2] = mNormal.z; plane[3] = mPlaneD; Vector3d dest = p+dir*100000; intersect( p.Ptr(), dest.Ptr(), sect.Ptr(), plane ); return sect.Distance(p); // return the intersection distance. }
bool Concave(const Vector3d &p,float &distance,Vector3d &n) const { n.NearestPointInTriangle(p,mP1,mP2,mP3); distance = p.Distance(n); return true; }