Example #1
0
 private int BuildArray(Node node, int offset)
 {
     var nd = node;
     while (nd != null)
     {
         var firstOffset = offset;
         var p = new LNode()
         {
             Bounds = nd.Bound,
             PrimitiveIndex = nd.Primitives != null ? (uint) nd.PrimitiveIndexStart : NoHit,
         };
         offset = BuildArray(nd.Left, offset + 1);
         p.SetSkipIndex((uint) offset);
         nodes[firstOffset] = p;
         nd = nd.Right;
     }
     return offset;
 }