Exemple #1
0
	float raySect(const Vector3d &p,const Vector3d &dir,Vector3d &sect) 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.

	}
Exemple #2
0
	bool Concave(const Vector3d &p,float &distance,Vector3d &n) const
	{
		n.NearestPointInTriangle(p,mP1,mP2,mP3);
		distance = p.Distance(n);
		return true;
	}