LavishNav:lnavpathfinder (Object Type)

From Lavish Software Wiki
Jump to navigation Jump to search

Description

Object Type Vitals
lnavpathfinder
Defined By LavishNav
Inherits none
Reduces To NULL
Variable Object Type
See
Uses Sub-Types no
C/C++ Type LNavPathfinder *

Members

  • string Type: Type of pathfinder (Dijkstra or AStar)
  • float Distance[from region search,to region search]: Distance from one region to another (see the pathfinder types for efficiency notes on distance)
  • ... LastStart: Last from region used
  • ... LastGoal: Last to region used
  • ... NearestConnectedRegion[from region search,to X,to Y,to Z]: Nearest connected region to the given (to) X,Y,Z
  • ... NearestConnectedRegion[from region search,to X,to Y,to Z,lnavpath object]: Nearest connected region to the given (to) X,Y,Z. Additionally appends the given lnavpath object with the shortest path to the returned region.
  • ... NearestConnectedRegion[from region search,to X,to Y,to Z,lnavpath object,maximum cost]: Nearest connected region to the given (to) X,Y,Z, bound by a maximum cost. Additionally appends the given lnavpath object with the shortest path to the returned region.

Methods

  • SelectPath[from region search,to region search,lnavpath object]: Selects a path, if any, from one region to another, appending the given lnavpath object with the result. Note that the first hop of the selected path will be the start region, and there will be no connection
  • SelectPath[from region search,to region search,lnavpath object,maximum cost cost]: Selects a path, if any, from one region to another, bound by a maximum cost, appending the given lnavpath object with the result. Note that the first hop of the selected path will be the start region, and there will be no connection
  • Reset: Resets the current pathfinding data. Note that the pathfinder is automatically reset when necessary, you do not generally need to use this method.

Maximum Cost behavior

Maximum cost ensures that the calculated shortest path to the goal falls within the given maximum travel cost from the origin. In other words, any connection with a total cost heuristic greater than the maximum cost is ignored. For Dijkstra pathfinders, the total cost heuristic means only the distance from the origin. For A* pathfinders, the total cost heuristic means the distance from the origin, plus the distance to the goal -- in LavishNav A*, the distance to the goal is calculated by the length of a line segment from the X,Y,Z in question to the goal X,Y,Z (as opposed to e.g. the Manhattan style of distance to goal heuristic).

Examples

See Also