public void SetOccupied(CallbackXY p, SimZMinMaxLevel MinMaxZ, float detail) { // detail /= 2f; //float MinX = this.MinX + offset.X; //float MaxX = this.MaxX + offset.X; //float MinY = this.MinY + offset.Y; //float MaxY = this.MaxY + offset.Y; //float MinZ = this.MinZ + offset.Z; //float MaxZ = this.MaxZ + offset.Z; float SimZMinLevel, SimZMaxLevel; // = SimPathStore.StepSize; for (float x = MinX; x <= MaxX; x += detail) { for (float y = MinY; y <= MaxY; y += detail) { MinMaxZ(x, y, out SimZMinLevel, out SimZMaxLevel); if (SimZMinLevel > MaxZ || SimZMaxLevel < MinZ) { // this box is not between the Z levels continue; } p(x, y, MinZ, MaxZ); } } /// the for/next loop probably missed this last point MinMaxZ(MaxX, MaxY, out SimZMinLevel, out SimZMaxLevel); if (SimZMinLevel > MaxZ || SimZMaxLevel < MinZ) { // this box is not between the Z levels return; } p(MaxX, MaxY, MinZ, MaxZ); }
public void SetOccupied(CallbackXY p, SimZMinMaxLevel MinMaxZ, float detail) { if (InnerBoxes.Count == 0) { CollisionPlane.Debug("using outerbox for " + this); OuterBox.SetOccupied(p, MinMaxZ, detail); return; } foreach (CollisionObject box in InnerBoxes) { box.SetOccupied(p, MinMaxZ, detail); } }