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

public interface NodeGenerator
  • Method Details

    • getWalkable

      Collection<? extends PNode> getWalkable(Block.Getter getter, Set<PNode> visited, PNode current, Point goal, 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

      OptionalDouble gravitySnap(Block.Getter getter, double pointX, double pointY, double pointZ, 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(Block.Getter getter, Point start, Point end, 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(Block.Getter getter, Point point, BoundingBox boundingBox)
      Check if the point is invalid
      Parameters:
      getter -
      point -
      boundingBox -
      Returns:
      true if the point is invalid
    • heuristic

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