Interface NodeGenerator
- All Known Implementing Classes:
FlyingNodeGenerator
,GroundNodeGenerator
,PreciseGroundNodeGenerator
,WaterNodeGenerator
public interface NodeGenerator
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canMoveTowards
(@NotNull Block.Getter getter, @NotNull Point start, @NotNull Point end, @NotNull BoundingBox boundingBox) Check if we can move directly from one point to another@NotNull Collection
<? extends PNode> getWalkable
(@NotNull Block.Getter getter, @NotNull Set<PNode> visited, @NotNull PNode current, @NotNull Point goal, @NotNull BoundingBox boundingBox) Gets the walkable nodes.@NotNull OptionalDouble
gravitySnap
(@NotNull Block.Getter getter, double pointX, double pointY, double pointZ, @NotNull BoundingBox boundingBox, double maxFall) Snap point to the groundboolean
default double
Heuristic use for the distance from the node to the targetdefault boolean
pointInvalid
(@NotNull Block.Getter getter, @NotNull Point point, @NotNull BoundingBox boundingBox) Check if the point is invalid
-
Method Details
-
getWalkable
@NotNull @NotNull Collection<? extends PNode> getWalkable(@NotNull Block.Getter getter, @NotNull @NotNull Set<PNode> visited, @NotNull @NotNull PNode current, @NotNull @NotNull Point goal, @NotNull @NotNull BoundingBox boundingBox) Gets the walkable nodes.- Parameters:
getter
- the instancevisited
- the visited nodescurrent
- the current nodegoal
- the goalboundingBox
- the bounding box- Returns:
- the walkable nodes
-
hasGravitySnap
boolean hasGravitySnap()- Returns:
- snap start and end points to the ground
-
gravitySnap
@NotNull @NotNull OptionalDouble gravitySnap(@NotNull Block.Getter getter, double pointX, double pointY, double pointZ, @NotNull @NotNull BoundingBox boundingBox, double maxFall) Snap point to the ground- Parameters:
getter
- the block getterpointX
- the x coordinatepointY
- the y coordinatepointZ
- the z coordinateboundingBox
- the bounding boxmaxFall
- the maximum fall distance- Returns:
- the snapped y coordinate. Empty if the snap point is not found
-
canMoveTowards
default boolean canMoveTowards(@NotNull Block.Getter getter, @NotNull @NotNull Point start, @NotNull @NotNull Point end, @NotNull @NotNull BoundingBox boundingBox) Check if we can move directly from one point to another- Parameters:
getter
-start
-end
-boundingBox
-- Returns:
- true if we can move directly from start to end
-
pointInvalid
default boolean pointInvalid(@NotNull Block.Getter getter, @NotNull @NotNull Point point, @NotNull @NotNull BoundingBox boundingBox) Check if the point is invalid- Parameters:
getter
-point
-boundingBox
-- Returns:
- true if the point is invalid
-
heuristic
Heuristic use for the distance from the node to the target- Parameters:
node
-target
-- Returns:
- the heuristic
-