public class RegionBoundingBox extends AStarMapBase<AStarRegionNode>
objectPool
Constructor and Description |
---|
RegionBoundingBox(AStarMapBase<AStarRegionNode> regionGrid,
int startX,
int startY,
int startZ,
int goalX,
int goalY,
int goalZ)
Creates a new bounding box around the given pair of coordinates.
|
Modifier and Type | Method and Description |
---|---|
void |
clearMapKeepBlocks() |
AStarMapBase<AStarRegionNode> |
clone() |
void |
enlarge()
Increases the size of the bounding box by one in all directions.
|
int |
getMaxXNodes()
Returns the horizontal size of the map.
|
int |
getMaxYNodes()
Returns the vertical size of the map.
|
int |
getMaxZNodes()
Returns the number of layers of the map.
|
boolean |
isBoundingBoxFree()
Returns if all regions are currently not occupied by another search.
|
boolean |
isTileBlocked(int x,
int y,
int z)
Returns if the specified position is blocked.
|
AStarRegionNode |
nodeAt(int x,
int y,
int z)
Returns the node at the given coordinates.
|
void |
occupyBoundingBox()
Marks all AStarRegionNodes inside this bounding box as occupied.
|
void |
releaseBoundingBox()
Marks all AStarRegionNodes inside this bounding box as not occupied.
|
void |
setBounds(int westernBound,
int easternBound,
int northernBound,
int southernBound,
int upperBound,
int lowerBound)
Deprecated.
The bounds are currently calculated internally.
|
void |
setTileBlocked(int x,
int y,
int z,
boolean blockedStatus)
Marks the specified position as blocked, which means that there is no valid
movement from any adjacent tile to this one.
|
void |
visitNeighboursOf(AStarRegionNode origin,
AStarMapVisitorBase<AStarRegionNode> visitor)
Lets the visitor visit the neighbours of
origin in six
directions, that is four in the same layer and its neighbours above and
below. |
setObjectPool, tryInsertPath, visitIfNotBlocked, visitNeighboursOf4, visitNeighboursOf8
public RegionBoundingBox(AStarMapBase<AStarRegionNode> regionGrid, int startX, int startY, int startZ, int goalX, int goalY, int goalZ)
enlarge
regionGrid
- The region grid this bounding box is located in.startX
- X position of the start point.startY
- Y position of the start point.startZ
- Z position of the start point.goalX
- X position of the goal point.goalY
- Y position of the goal point.goalZ
- Z position of the goal point.@Deprecated public void setBounds(int westernBound, int easternBound, int northernBound, int southernBound, int upperBound, int lowerBound)
westernBound
- easternBound
- northernBound
- southernBound
- upperBound
- lowerBound
- public void enlarge()
public boolean isBoundingBoxFree()
public void occupyBoundingBox()
public void releaseBoundingBox()
public void clearMapKeepBlocks()
clearMapKeepBlocks
in class AStarMapBase<AStarRegionNode>
public AStarMapBase<AStarRegionNode> clone()
clone
in class AStarMapBase<AStarRegionNode>
public int getMaxXNodes()
AStarMapBase
0
.getMaxXNodes
in class AStarMapBase<AStarRegionNode>
public int getMaxYNodes()
AStarMapBase
0
.getMaxYNodes
in class AStarMapBase<AStarRegionNode>
public int getMaxZNodes()
AStarMapBase
0
.getMaxZNodes
in class AStarMapBase<AStarRegionNode>
public boolean isTileBlocked(int x, int y, int z)
AStarMapBase
isTileBlocked
in class AStarMapBase<AStarRegionNode>
x
- Horizontal positiony
- Vertical positionz
- Layertrue
if this position is blocked, false
otherwise.public AStarRegionNode nodeAt(int x, int y, int z)
AStarMapBase
null
in these cases.nodeAt
in class AStarMapBase<AStarRegionNode>
x
- Horizontal positiony
- Vertical positionnull
if none exists
there.public void setTileBlocked(int x, int y, int z, boolean blockedStatus)
AStarMapBase
setTileBlocked
in class AStarMapBase<AStarRegionNode>
x
- Horizontal positiony
- Vertical positionblockedStatus
- true
if this position should be blocked,
false
otherwise.public void visitNeighboursOf(AStarRegionNode origin, AStarMapVisitorBase<AStarRegionNode> visitor)
origin
in six
directions, that is four in the same layer and its neighbours above and
below.visitNeighboursOf
in class AStarMapBase<AStarRegionNode>
origin
- visitor
-