Interface NodeGenerator

All Known Implementing Classes:
FlyingNodeGenerator, GroundNodeGenerator, PreciseGroundNodeGenerator, WaterNodeGenerator

public interface NodeGenerator
  • 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 instance
      visited - the visited nodes
      current - the current node
      goal - the goal
      boundingBox - 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 getter
      pointX - the x coordinate
      pointY - the y coordinate
      pointZ - the z coordinate
      boundingBox - the bounding box
      maxFall - 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

      default double heuristic(@NotNull @NotNull Point node, @NotNull @NotNull Point target)
      Heuristic use for the distance from the node to the target
      Parameters:
      node -
      target -
      Returns:
      the heuristic