Class SimpleSpaceAStarRouteFinder
java.lang.Object
cn.nukkit.entity.ai.route.finder.SimpleRouteFinder
cn.nukkit.entity.ai.route.finder.impl.SimpleFlatAStarRouteFinder
cn.nukkit.entity.ai.route.finder.impl.SimpleSpaceAStarRouteFinder
- All Implemented Interfaces:
IRouteFinder
@PowerNukkitXOnly
@Since("1.6.0.0-PNX")
public class SimpleSpaceAStarRouteFinder
extends SimpleFlatAStarRouteFinder
务必注意,三维标准A*寻路的代价十分高昂(比原版的洪水填充低得多),切忌将最大寻路深度设置得太大!
TODO: 用BA*、JPS或者势能场寻路代替
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
protected static final int
protected static final int
Fields inherited from class cn.nukkit.entity.ai.route.finder.impl.SimpleFlatAStarRouteFinder
closeHashSet, closeList, currentSearchDepth, enableFloydSmooth, entity, finished, interrupt, level, maxSearchDepth, OBLIQUE_MOVE_COST, openList, reachable, reachableTarget, searching, start, target
Fields inherited from class cn.nukkit.entity.ai.route.finder.SimpleRouteFinder
currentIndex, evalPos, nodes
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSpaceAStarRouteFinder
(IPosEvaluator blockEvaluator, EntityIntelligent entity) -
Method Summary
Modifier and TypeMethodDescriptionprotected int
getBlockMoveCostAt
(Level level, Vector3 pos) 获取指定位置的方块的移动Costprotected void
putNeighborNodeIntoOpen
(Node node) 将一个节点周围的有效节点放入OpenList中Methods inherited from class cn.nukkit.entity.ai.route.finder.impl.SimpleFlatAStarRouteFinder
calH, evalPos, evalStandingBlock, existInCloseList, existInOpenList, floydSmooth, getAvailableHorizontalOffset, getCloseHashSet, getCloseList, getCloseNode, getCurrentSearchDepth, getEntity, getHighestUnder, getLevel, getMaxSearchDepth, getNearestNodeFromCloseList, getOpenList, getOpenNode, getPathRoute, getReachableTarget, getStart, getTarget, hasBarrier, hasBarrier, isEnableFloydSmooth, isFinished, isInterrupt, isPositionOverlap, isReachable, isSearching, search, sendParticle, setCurrentSearchDepth, setEnableFloydSmooth, setEntity, setFinished, setInterrupt, setLevel, setMaxSearchDepth, setReachable, setReachableTarget, setSearching, setStart, setTarget
Methods inherited from class cn.nukkit.entity.ai.route.finder.SimpleRouteFinder
addNode, addNode, getCurrentIndex, getCurrentNode, getEvalPos, getNode, getNodeIndex, getNodes, getRoute, hasCurrentNode, hasNext, next, resetNodes, setNodeIndex
-
Field Details
-
DIRECT_MOVE_COST
protected static final int DIRECT_MOVE_COST- See Also:
-
OBLIQUE_2D_MOVE_COST
protected static final int OBLIQUE_2D_MOVE_COST- See Also:
-
OBLIQUE_3D_MOVE_COST
protected static final int OBLIQUE_3D_MOVE_COST- See Also:
-
-
Constructor Details
-
SimpleSpaceAStarRouteFinder
-
-
Method Details
-
getBlockMoveCostAt
Description copied from class:SimpleFlatAStarRouteFinder
获取指定位置的方块的移动Cost- Overrides:
getBlockMoveCostAt
in classSimpleFlatAStarRouteFinder
- Returns:
- cost
-
putNeighborNodeIntoOpen
Description copied from class:SimpleFlatAStarRouteFinder
将一个节点周围的有效节点放入OpenList中- Overrides:
putNeighborNodeIntoOpen
in classSimpleFlatAStarRouteFinder
- Parameters:
node
- 节点
-