예제 #1
0
        public bool IsIntersect(ref GeoRay3 dist, ref GeoInsectPointArrayInfo insect)
        {
            GeoInsectPointInfo info = new GeoInsectPointInfo();
            bool isInsect           = GeoRayUtils.IsRayInsectTriangle3(dist.mOrigin, dist.mDirection, mP1, mP2, mP3, ref info);

            if (isInsect)
            {
                insect.mHitObject2 = this;
                insect.mHitGlobalPoint.mPointArray.Add(info.mHitGlobalPoint);
                insect.mLength = (info.mHitGlobalPoint - dist.mOrigin).magnitude;
            }
            return(isInsect);
        }
예제 #2
0
 public static bool IsTriangleInsectRay3(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 rayOrigin, Vector3 rayDirection, ref GeoInsectPointInfo insect)
 {
     return(GeoRayUtils.IsRayInsectTriangle3(rayOrigin, rayDirection, p1, p2, p3, ref insect));
 }