Ejemplo n.º 1
0
        private static bool IsCollidingWith(MyVoxelBase voxel, BoundingBoxD box, MatrixD orientation)
        {
            if (voxel.RootVoxel != null)
            {
                voxel = voxel.RootVoxel;
            }

            if (voxel.IsAnyAabbCornerInside(ref orientation, box))
            {
                return(true);
            }

            Vector3D extents = box.HalfExtents;
            double   min     = Math.Min(extents.X, Math.Min(extents.Y, extents.Z));

            return(voxel.DoOverlapSphereTest((float)min, orientation.Translation));
        }