コード例 #1
0
        public bool ObjectIntersectsBox(int objectIndex, Box3d box)
        {
            int[] fia = FirstIndexArray, via = VertexIndexArray;
            int   fvi = fia[objectIndex], fve = fia[objectIndex + 1];
            var   pa = PositionArray;
            V3d   p0 = pa[via[fvi++]], p1 = pa[via[fvi++]];

            while (fvi < fve)
            {
                var p2 = pa[via[fvi++]];
                if (box.IntersectsTriangle(p0, p1, p2))
                {
                    return(true);
                }
                p1 = p2;
            }
            return(false);
        }
コード例 #2
0
        public bool ObjectIntersectsBox(int objectIndex, Box3d box)
        {
            GetTriangle(objectIndex, out V3d p0, out V3d p1, out V3d p2);

            return(box.IntersectsTriangle(p0, p1, p2));
        }