Enum Class Pathfinder.PathfindSnapMode

java.lang.Object
java.lang.Enum<Pathfinder.PathfindSnapMode>
me.nabdev.pathfinding.Pathfinder.PathfindSnapMode
All Implemented Interfaces:
Serializable, Comparable<Pathfinder.PathfindSnapMode>, Constable
Enclosing class:
Pathfinder

public static enum Pathfinder.PathfindSnapMode extends Enum<Pathfinder.PathfindSnapMode>
Determines how vertices will be snapped to the nearest obstacle edge if they are inside of an obstacle. Snapping is useful in case the robot center is inside of the inflated obstacle vertices.
  • Enum Constant Details

    • NONE

      public static final Pathfinder.PathfindSnapMode NONE
      No snapping. If a the start or target is inside of an obstacle, an ImpossiblePathException will be thrown.
    • SNAP_ALL

      public static final Pathfinder.PathfindSnapMode SNAP_ALL
      Snap start and target vertices
    • SNAP_ALL_THEN_LINE

      @Deprecated public static final Pathfinder.PathfindSnapMode SNAP_ALL_THEN_LINE
      Deprecated.
      Can create very sharp corners as it just draws a straight line, not recommended. Instead, use Path.getUnsnappedTarget() and handle moving there yourself after you follow the path if you need to. This may be replaced with a better solution in the future.
      Snap start and target vertices. If the target is inside an obstacle, draw a straight line from the snapped target to the original target to drive there anyways
    • SNAP_START

      public static final Pathfinder.PathfindSnapMode SNAP_START
      Snap start vertex
    • SNAP_TARGET

      public static final Pathfinder.PathfindSnapMode SNAP_TARGET
      Snap target vertex
    • SNAP_TARGET_THEN_LINE

      @Deprecated public static final Pathfinder.PathfindSnapMode SNAP_TARGET_THEN_LINE
      Deprecated.
      Can create very sharp corners as it just draws a straight line, not recommended. Instead, use Path.getUnsnappedTarget() and handle moving there yourself after you follow the path if you need to. This may be replaced with a better solution in the future.
      If the target is inside an obstacle, snap it and draw a straight line from the snapped target to the original target to drive there anyways.
  • Method Details

    • values

      public static Pathfinder.PathfindSnapMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Pathfinder.PathfindSnapMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null