示例#1
0
        public static bool IsTriangleInsectSphere(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 center, float r, ref GeoInsectPointArrayInfo insect)
        {
            GeoPlane plane   = GeoPlaneUtils.CreateFromTriangle(p1, p2, p3);
            bool     isInsec = GeoPlaneUtils.IsPlaneInsectSphere(plane, center, r, ref insect);

            if (isInsec)
            {
                Vector3 c1  = insect.mHitGlobalPoint.mPointArray[0];
                float   rad = insect.mHitGlobalPoint.mPointArray[0][0];
                insect.Clear();
                return(IsTriangleInsectPlaneCircle2(p1, p2, p3, c1, rad, plane, ref insect));
            }
            return(false);
        }