public AABCGridSetAABCIterator(AABCGrid grid)
     : base(grid)
 {
     position = new AABCPosition(0, 0, 0);
     if (grid.IsAABCSet(position))
     {
         nextPosition = position;
     }
     nextFound = true;
 }
 private bool FindNext()
 {
     nextPosition = new AABCPosition(position);
     nextPosition.z++;
     for (; nextPosition.x < grid.width; nextPosition.x++)
     {
         for (; nextPosition.y < grid.height; nextPosition.y++)
         {
             for (; nextPosition.z < grid.depth; nextPosition.z++)
             {
                 if (grid.IsAABCSet(nextPosition.x, nextPosition.y, nextPosition.z))
                 {
                     nextFound = true;
                     return(true);
                 }
             }
             nextPosition.z = 0;
         }
         nextPosition.y = 0;
     }
     nextFound = false;
     return(false);
 }
 public AABC(AABCPosition position, AABCGrid grid)
     : base(position)
 {
     this.grid = grid;
 }
 public AABCPosition(AABCPosition aABCPosition)
 {
     this.x = aABCPosition.x;
     this.y = aABCPosition.y;
     this.z = aABCPosition.z;
 }
 protected bool IsAABCSet(AABCPosition pos)
 {
     CheckBounds(pos.x, pos.y, pos.z);
     return(IsAABCSetUnchecked(pos.x, pos.y, pos.z));
 }
 protected Vector3 GetAABCCenterFromGridCenter(AABCPosition pos)
 {
     CheckBounds(pos.x, pos.y, pos.z);
     return(GetAABCCenterFromGridCenterUnchecked(pos.x, pos.y, pos.z));
 }
 protected Vector3[] GetAABCCorners(AABCPosition pos)
 {
     CheckBounds(pos.x, pos.y, pos.z);
     return(GetAABCCornersUnchecked(pos.x, pos.y, pos.z));
 }
Exemple #8
0
 public bool TriangleIntersectAABC(Vector3[] triangle, AABCPosition pos)
 {
     this.CheckBounds(pos.x, pos.y, pos.z);
     return(this.TriangleIntersectAABCUnchecked(triangle, pos.x, pos.y, pos.z));
 }
Exemple #9
0
 public bool IsAABCSet(AABCPosition pos)
 {
     this.CheckBounds(pos.x, pos.y, pos.z);
     return(this.IsAABCSetUnchecked(pos.x, pos.y, pos.z));
 }
Exemple #10
0
 public Vector3[] GetAABCCorners(AABCPosition pos)
 {
     this.CheckBounds(pos.x, pos.y, pos.z);
     return(this.GetAABCCornersUnchecked(pos.x, pos.y, pos.z));
 }
Exemple #11
0
 public Vector3 GetAABCCenterFromGridOrigin(AABCPosition pos)
 {
     this.CheckBounds(pos.x, pos.y, pos.z);
     return(this.GetAABCCenterFromGridOriginUnchecked(pos.x, pos.y, pos.z));
 }