Exemple #1
0
        public float raySect(float3 p, float3 dir, ref float3 sect)
        {
            float4 plane = new float4();

            plane.x = mNormal.x;
            plane.y = mNormal.y;
            plane.z = mNormal.z;
            plane.w = mPlaneD;

            float3 dest = p + dir * 100000f;

            intersect(p, dest, ref sect, plane);

            return(sect.Distance(p)); // return the intersection distance
        }
Exemple #2
0
 public bool Concave(float3 p, ref float distance, ref float3 n)
 {
     n.NearestPointInTriangle(p, mP1, mP2, mP3);
     distance = p.Distance(n);
     return(true);
 }