Exemplo n.º 1
0
 public IEnumerable <BlockPosSide> LineIntersection(IsBlockEmpty isEmpty, GetBlockHeight getBlockHeight, Line3D line)
 {
     currentLine = line;
     currentHit  = new Vector3();
     foreach (var node in Search(BoxHit))
     {
         Vector3 hit = currentHit;
         int     x   = (int)node.MinEdge.X;
         int     y   = (int)node.MinEdge.Z;
         int     z   = (int)node.MinEdge.Y;
         if (!isEmpty(x, y, z))
         {
             var node2 = node;
             node2.MaxEdge.Y = node2.MinEdge.Y + getBlockHeight(x, y, z);
             var hit2 = Intersection.CheckLineBoxExact(line, node2);
             if (hit2 != null)
             {
                 yield return(hit2.Value);
             }
         }
     }
 }
Exemplo n.º 2
0
 public IEnumerable<BlockPosSide> LineIntersection(IsBlockEmpty isEmpty, GetBlockHeight getBlockHeight, Line3D line)
 {
     currentLine = line;
     currentHit = new Vector3();
     foreach (var node in Search(BoxHit))
     {
         Vector3 hit = currentHit;
         int x = (int)node.MinEdge.X;
         int y = (int)node.MinEdge.Z;
         int z = (int)node.MinEdge.Y;
         if (!isEmpty(x, y, z))
         {
             var node2 = node;
             node2.MaxEdge.Y = node2.MinEdge.Y + getBlockHeight(x, y, z);
             var hit2 = Intersection.CheckLineBoxExact(line, node2);
             if (hit2 != null)
             {
                 yield return hit2.Value;
             }
         }
     }
 }