#include <AIPathfind.h>
Inherits PathfindServicesInterface, and Snapshot.
Public Member Functions | |
| Pathfinder (void) | |
| ~Pathfinder () | |
| void | reset (void) |
| Reset system in preparation for new map. | |
| void | crc (Xfer *xfer) |
| run the "light" crc check on this data structure | |
| void | xfer (Xfer *xfer) |
| void | loadPostProcess (void) |
| Bool | clientSafeQuickDoesPathExist (const LocomotorSet &locomotorSet, const Coord3D *from, const Coord3D *to) |
| Can we build any path at all between the locations (terrain & buildings check - fast) | |
| Bool | clientSafeQuickDoesPathExistForUI (const LocomotorSet &locomotorSet, const Coord3D *from, const Coord3D *to) |
| Can we build any path at all between the locations (terrain onlyk - fast) | |
| Bool | slowDoesPathExist (Object *obj, const Coord3D *from, const Coord3D *to, ObjectID ignoreObject=INVALID_ID) |
| Can we build any path at all between the locations (terrain, buildings & units check - slower) | |
| Bool | queueForPath (ObjectID id) |
| The object wants to request a pathfind, so put it on the list to process. | |
| void | processPathfindQueue (void) |
| Process some or all of the queued pathfinds. | |
| void | forceMapRecalculation () |
| Force pathfind map recomputation. If region is given, only that area is recomputed. | |
| Path * | getAircraftPath (const Object *obj, const Coord3D *to) |
| Path * | findGroundPath (const Coord3D *from, const Coord3D *to, Int pathRadius, Bool crusher) |
| Find a short, valid path of the desired width on the ground. | |
| void | addObjectToPathfindMap (class Object *obj) |
| Classify the given object's cells in the map. | |
| void | removeObjectFromPathfindMap (class Object *obj) |
| De-classify the given object's cells in the map. | |
| void | removeUnitFromPathfindMap (Object *obj) |
| De-classify the given mobile unit's cells in the map. | |
| void | updateGoal (Object *obj, const Coord3D *newGoalPos, PathfindLayerEnum layer) |
| Update the given mobile unit's cells in the map. | |
| void | updateAircraftGoal (Object *obj, const Coord3D *newGoalPos) |
| Update the given aircraft unit's cells in the map. | |
| void | removeGoal (Object *obj) |
| Removes the given mobile unit's goal cells in the map. | |
| void | updatePos (Object *obj, const Coord3D *newPos) |
| Update the given mobile unit's cells in the map. | |
| void | removePos (Object *obj) |
| Removes the unit's position cells from the map. | |
| Bool | moveAllies (Object *obj, Path *path) |
| void | createAWallFromMyFootprint (Object *obj) |
| void | removeWallFromMyFootprint (Object *obj) |
| Path * | getMoveAwayFromPath (Object *obj, Object *otherObj, Path *pathToAvoid, Object *otherObj2, Path *pathToAvoid2) |
| void | changeBridgeState (PathfindLayerEnum layer, Bool repaired) |
| Bool | findBrokenBridge (const LocomotorSet &locomotorSet, const Coord3D *from, const Coord3D *to, ObjectID *bridgeID) |
| void | newMap (void) |
| PathfindCell * | getCell (PathfindLayerEnum layer, Int x, Int y) |
| Return the cell at grid coords (x,y) | |
| PathfindCell * | getCell (PathfindLayerEnum layer, const Coord3D *pos) |
| Given a position, return associated grid cell. | |
| PathfindCell * | getClippedCell (PathfindLayerEnum layer, const Coord3D *pos) |
| Given a position, return associated grid cell. | |
| void | clip (Coord3D *from, Coord3D *to) |
| Bool | worldToCell (const Coord3D *pos, ICoord2D *cell) |
| Given a world position, return grid cell coordinate. | |
| const ICoord2D * | getExtent (void) const |
| void | setIgnoreObstacleID (ObjectID objID) |
| if non-zero, the pathfinder will ignore the given obstacle | |
| Bool | validMovementPosition (Bool isCrusher, LocomotorSurfaceTypeMask acceptableSurfaces, PathfindCell *toCell, PathfindCell *fromCell=NULL) |
| Return true if given position is a valid movement location. | |
| Bool | validMovementPosition (Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet &locomotorSet, Int x, Int y) |
| Return true if given position is a valid movement location. | |
| Bool | validMovementPosition (Bool isCrusher, PathfindLayerEnum layer, const LocomotorSet &locomotorSet, const Coord3D *pos) |
| Return true if given position is a valid movement location. | |
| Bool | validMovementTerrain (PathfindLayerEnum layer, const Locomotor *locomotor, const Coord3D *pos) |
| Return true if given position is a valid movement location. | |
| Locomotor * | chooseBestLocomotorForPosition (PathfindLayerEnum layer, LocomotorSet *locomotorSet, const Coord3D *pos) |
| Bool | isViewBlockedByObstacle (const Object *obj, const Object *objOther) |
| Return true if the straight line between the given points contains any obstacle, and thus blocks vision. | |
| Bool | isAttackViewBlockedByObstacle (const Object *obj, const Coord3D &attackerPos, const Object *victim, const Coord3D &victimPos) |
| Return true if the straight line between the given points contains any obstacle, and thus blocks vision. | |
| Bool | isLinePassable (const Object *obj, LocomotorSurfaceTypeMask acceptableSurfaces, PathfindLayerEnum layer, const Coord3D &startWorld, const Coord3D &endWorld, Bool blocked, Bool allowPinched) |
| Return true if the straight line between the given points is passable. | |
| void | moveAlliesAwayFromDestination (Object *obj, const Coord3D &destination) |
| Bool | isGroundPathPassable (Bool isCrusher, const Coord3D &startWorld, PathfindLayerEnum startLayer, const Coord3D &endWorld, Int pathDiameter) |
| Return true if the straight line between the given points is passable. | |
| const Coord3D * | getDebugPathPosition (void) |
| void | setDebugPathPosition (const Coord3D *pos) |
| Path * | getDebugPath (void) |
| void | setDebugPath (Path *debugpath) |
| void | cleanOpenAndClosedLists (void) |
| Bool | adjustDestination (Object *obj, const LocomotorSet &locomotorSet, Coord3D *dest, const Coord3D *groupDest=NULL) |
| Bool | adjustToLandingDestination (Object *obj, Coord3D *dest) |
| Bool | adjustTargetDestination (const Object *obj, const Object *target, const Coord3D *targetPos, const Weapon *weapon, Coord3D *dest) |
| Bool | adjustToPossibleDestination (Object *obj, const LocomotorSet &locomotorSet, Coord3D *dest) |
| void | snapPosition (Object *obj, Coord3D *pos) |
| void | snapClosestGoalPosition (Object *obj, Coord3D *pos) |
| Bool | goalPosition (Object *obj, Coord3D *pos) |
| PathfindLayerEnum | addBridge (Bridge *theBridge) |
| void | addWallPiece (Object *wallPiece) |
| void | removeWallPiece (Object *wallPiece) |
| Real | getWallHeight (void) |
| Bool | isPointOnWall (const Coord3D *pos) |
| void | updateLayer (Object *obj, PathfindLayerEnum layer) |
| Updates object's layer. | |
| Int | clearCellForDiameter (Bool crusher, Int cellX, Int cellY, PathfindLayerEnum layer, Int pathDiameter) |
| Return true if given position is a valid movement location. | |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
Static Public Member Functions | |
| static void | classifyMapCell (Int x, Int y, PathfindCell *cell) |
| Classify the given map cell. | |
Protected Types | |
| enum | { NO_ATTACK =0 } |
| typedef Int(* | CellAlongLineProc) (Pathfinder *pathfinder, PathfindCell *from, PathfindCell *to, Int to_x, Int to_y, void *userData) |
Protected Member Functions | |
| virtual Path * | internalFindPath (Object *obj, const LocomotorSet &locomotorSet, const Coord3D *from, const Coord3D *to) |
| Find a short, valid path between given locations. | |
| Path * | findHierarchicalPath (Bool isHuman, const LocomotorSet &locomotorSet, const Coord3D *from, const Coord3D *to, Bool crusher) |
| Path * | findClosestHierarchicalPath (Bool isHuman, const LocomotorSet &locomotorSet, const Coord3D *from, const Coord3D *to, Bool crusher) |
| Path * | internal_findHierarchicalPath (Bool isHuman, const LocomotorSurfaceTypeMask locomotorSurface, const Coord3D *from, const Coord3D *to, Bool crusher, Bool closestOK) |
| void | processHierarchicalCell (const ICoord2D &scanCell, const ICoord2D &deltaPathfindCell, PathfindCell *parentCell, PathfindCell *goalCell, zoneStorageType parentZone, zoneStorageType *examinedZones, Int &numExZones, Bool crusher, Int &cellCount) |
| Bool | checkForAdjust (Object *, const LocomotorSet &locomotorSet, Bool isHuman, Int cellX, Int cellY, PathfindLayerEnum layer, Int iRadius, Bool center, Coord3D *dest, const Coord3D *groupDest) |
| Bool | checkForLanding (Int cellX, Int cellY, PathfindLayerEnum layer, Int iRadius, Bool center, Coord3D *dest) |
| Bool | checkForTarget (const Object *obj, Int cellX, Int cellY, const Weapon *weapon, const Object *victim, const Coord3D *victimPos, Int iRadius, Bool center, Coord3D *dest) |
| Bool | checkForPossible (Bool isCrusher, Int fromZone, Bool center, const LocomotorSet &locomotorSet, Int cellX, Int cellY, PathfindLayerEnum layer, Coord3D *dest, Bool startingInObstacle) |
| void | getRadiusAndCenter (const Object *obj, Int &iRadius, Bool ¢er) |
| void | adjustCoordToCell (Int cellX, Int cellY, Bool centerInCell, Coord3D &pos, PathfindLayerEnum layer) |
| Bool | checkDestination (const Object *obj, Int cellX, Int cellY, PathfindLayerEnum layer, Int iRadius, Bool centerInCell) |
| Bool | checkForMovement (const Object *obj, TCheckMovementInfo &info) |
| Bool | segmentIntersectsTallBuilding (const PathNode *curNode, PathNode *nextNode, ObjectID ignoreBuilding, Coord3D *insertPos1, Coord3D *insertPos2, Coord3D *insertPos3) |
| Return true if the straight line between the given points intersects a tall building. | |
| Bool | circleClipsTallBuilding (const Coord3D *from, const Coord3D *to, Real radius, ObjectID ignoreBuilding, Coord3D *adjustTo) |
| Return true if the circle at the end of the line between the given points intersects a tall building. | |
| Int | examineNeighboringCells (PathfindCell *parentCell, PathfindCell *goalCell, const LocomotorSet &locomotorSet, Bool isHumanPlayer, Bool centerInCell, Int radius, const ICoord2D &startCellNdx, const Object *obj, Int attackDistance) |
| Bool | pathDestination (Object *obj, const LocomotorSet &locomotorSet, Coord3D *dest, PathfindLayerEnum layer, const Coord3D *groupDest) |
| Checks cost between given locations. | |
| Int | checkPathCost (Object *obj, const LocomotorSet &locomotorSet, const Coord3D *from, const Coord3D *to) |
| void | tightenPath (Object *obj, const LocomotorSet &locomotorSet, Coord3D *from, const Coord3D *to) |
| Int | iterateCellsAlongLine (const Coord3D &startWorld, const Coord3D &endWorld, PathfindLayerEnum layer, CellAlongLineProc proc, void *userData) |
| Int | iterateCellsAlongLine (const ICoord2D &start, const ICoord2D &end, PathfindLayerEnum layer, CellAlongLineProc proc, void *userData) |
| void | classifyMap (void) |
| Classify all cells in grid as obstacles, etc. | |
| void | classifyObjectFootprint (Object *obj, Bool insert) |
| void | internal_classifyObjectFootprint (Object *obj, Bool insert) |
| void | classifyFence (Object *obj, Bool insert) |
| void | classifyUnitFootprint (Object *obj, Bool insert, Bool remove, Bool update) |
| void | worldToGrid (const Coord3D *pos, ICoord2D *cellIndex) |
| Convert world coordinate to array index. | |
| Bool | evaluateCell (PathfindCell *newCell, PathfindCell *parentCell, const LocomotorSet &locomotorSet, Bool centerInCell, Int radius, const Object *obj, Int attackDistance) |
| Path * | buildActualPath (const Object *obj, LocomotorSurfaceTypeMask acceptableSurfaces, const Coord3D *fromPos, PathfindCell *goalCell, Bool center, Bool blocked) |
| Work backwards from goal cell to construct final path. | |
| Path * | buildGroundPath (Bool isCrusher, const Coord3D *fromPos, PathfindCell *goalCell, Bool center, Int pathDiameter) |
| Work backwards from goal cell to construct final path. | |
| Path * | buildHierachicalPath (const Coord3D *fromPos, PathfindCell *goalCell) |
| Work backwards from goal cell to construct final path. | |
| void | prependCells (Path *path, const Coord3D *fromPos, PathfindCell *goalCell, Bool center) |
| Add pathfind cells to a path. | |
| void | debugShowSearch (Bool pathFound) |
| Show all cells touched in the last search. | |
| void | checkChangeLayers (PathfindCell *parentCell) |
The Pathfinding engine itself.
Definition at line 592 of file AIPathfind.h.
|
protected |
return 0 to continue iterating the line, nonzero to terminate the iteration. the nonzero result will be returned as the result of iterateCellsAlongLine(). iterateCellsAlongLine will return zero if it completes.
Definition at line 781 of file AIPathfind.h.
|
protected |
| Enumerator | |
|---|---|
| NO_ATTACK | |
Definition at line 761 of file AIPathfind.h.
| Pathfinder::Pathfinder | ( | void | ) |
Definition at line 3828 of file AIPathfind.cpp.
| Pathfinder::~Pathfinder | ( | void | ) |
Definition at line 3835 of file AIPathfind.cpp.
| PathfindLayerEnum Pathfinder::addBridge | ( | Bridge * | theBridge | ) |
Adds a bridge & returns the layer.
Definition at line 3971 of file AIPathfind.cpp.
|
inline |
Classify the given object's cells in the map.
Definition at line 913 of file AIPathfind.h.
| void Pathfinder::addWallPiece | ( | Object * | wallPiece | ) |
Adds a piece of a wall.
Definition at line 3909 of file AIPathfind.cpp.
|
protected |
Definition at line 8960 of file AIPathfind.cpp.
| Bool Pathfinder::adjustDestination | ( | Object * | obj, |
| const LocomotorSet & | locomotorSet, | ||
| Coord3D * | dest, | ||
| const Coord3D * | groupDest = NULL ) |
Find an unoccupied spot for a unit to move to. Returns false if there are no spots available within a reasonable radius.
Definition at line 5355 of file AIPathfind.cpp.
| Bool Pathfinder::adjustTargetDestination | ( | const Object * | obj, |
| const Object * | target, | ||
| const Coord3D * | targetPos, | ||
| const Weapon * | weapon, | ||
| Coord3D * | dest ) |
Find an unoccupied spot for a unit to move to that can fire at victim. Returns false if there are no spots available within a reasonable radius.
Definition at line 5452 of file AIPathfind.cpp.
Find an unoccupied spot for a unit to land at. Returns false if there are no spots available within a reasonable radius.
Definition at line 5277 of file AIPathfind.cpp.
| Bool Pathfinder::adjustToPossibleDestination | ( | Object * | obj, |
| const LocomotorSet & | locomotorSet, | ||
| Coord3D * | dest ) |
Find a pathable spot near the destination. Returns false if there are no spots available within a reasonable radius.
Definition at line 5534 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 9310 of file AIPathfind.cpp.
|
protected |
Work backwards from goal cell to construct final path.
Work backwards from goal cell to construct final path.
Definition at line 8978 of file AIPathfind.cpp.
|
protected |
Work backwards from goal cell to construct final path.
Work backwards from goal cell to construct final path.
Definition at line 6789 of file AIPathfind.cpp.
|
protected |
Work backwards from goal cell to construct final path.
Work backwards from goal cell to construct final path.
Definition at line 6837 of file AIPathfind.cpp.
| void Pathfinder::changeBridgeState | ( | PathfindLayerEnum | layer, |
| Bool | repaired ) |
Classify the cells under the bridge If 'repaired' is true, bridge is repaired If 'repaired' is false, bridge has been damaged to be impassable
Definition at line 9686 of file AIPathfind.cpp.
|
protected |
Definition at line 5966 of file AIPathfind.cpp.
|
protected |
Checks to see if obj can occupy the pathfind cell at x,y. Returns false if there is another unit's goal already there. Assumes your locomotor already said you can go there.
Definition at line 4924 of file AIPathfind.cpp.
|
protected |
Definition at line 5201 of file AIPathfind.cpp.
|
protected |
Definition at line 5252 of file AIPathfind.cpp.
|
protected |
Checks to see if obj can move through the pathfind cell at x,y. Returns false if there are other units already there. Assumes your locomotor already said you can go there.
Definition at line 4995 of file AIPathfind.cpp.
|
protected |
Definition at line 5513 of file AIPathfind.cpp.
|
protected |
Definition at line 5433 of file AIPathfind.cpp.
|
protected |
Definition at line 8456 of file AIPathfind.cpp.
| Locomotor * Pathfinder::chooseBestLocomotorForPosition | ( | PathfindLayerEnum | layer, |
| LocomotorSet * | locomotorSet, | ||
| const Coord3D * | pos ) |
Definition at line 4746 of file AIPathfind.cpp.
|
protected |
Return true if the circle at the end of the line between the given points intersects a tall building.
Definition at line 9546 of file AIPathfind.cpp.
Classify the cells under the given object If 'insert' is true, object is being added If 'insert' is false, object is being removed
Definition at line 4007 of file AIPathfind.cpp.
|
protected |
Classify all cells in grid as obstacles, etc.
Classify all cells in grid as obstacles, etc.
Definition at line 4603 of file AIPathfind.cpp.
|
static |
Classify the given map cell.
Classify the given map cell as WATER, CLIFF, etc. Note that this does NOT classify cells as OBSTACLES. OBSTACLE cells are classified only via objects.
Definition at line 4509 of file AIPathfind.cpp.
Classify the cells under the given object If 'insert' is true, object is being added If 'insert' is false, object is being removed
For now, all small objects will not be obstacles
Definition at line 4117 of file AIPathfind.cpp.
|
protected |
Classify the cells under the given fence object.
| void Pathfinder::cleanOpenAndClosedLists | ( | void | ) |
Definition at line 4812 of file AIPathfind.cpp.
| Int Pathfinder::clearCellForDiameter | ( | Bool | crusher, |
| Int | cellX, | ||
| Int | cellY, | ||
| PathfindLayerEnum | layer, | ||
| Int | pathDiameter ) |
Return true if given position is a valid movement location.
Checks to see if there is enough path width at this cell for ground movement. Returns the width available.
Definition at line 6724 of file AIPathfind.cpp.
| Bool Pathfinder::clientSafeQuickDoesPathExist | ( | const LocomotorSet & | locomotorSet, |
| const Coord3D * | from, | ||
| const Coord3D * | to ) |
Can we build any path at all between the locations (terrain & buildings check - fast)
Does any path exist from 'from' to 'to' given the locomotor set This is the quick check, only looks at whether the terrain is possible or impossible to path over. Doesn't take other units into account. False means it is impossible to path. True means it is possible given the terrain, but there may be units in the way.
Definition at line 8021 of file AIPathfind.cpp.
| Bool Pathfinder::clientSafeQuickDoesPathExistForUI | ( | const LocomotorSet & | locomotorSet, |
| const Coord3D * | from, | ||
| const Coord3D * | to ) |
Can we build any path at all between the locations (terrain onlyk - fast)
Does any path exist from 'from' to 'to' given the locomotor set This is the quick check, only looks at whether the terrain is possible or impossible to path over. Doesn't take other units into account. False means it is impossible to path. True means it is possible given the terrain, but there may be units in the way.
Definition at line 8079 of file AIPathfind.cpp.
Definition at line 8157 of file AIPathfind.cpp.
|
virtual |
run the "light" crc check on this data structure
Implements Snapshot.
Definition at line 11067 of file AIPathfind.cpp.
|
inline |
Definition at line 655 of file AIPathfind.h.
|
protected |
Show all cells touched in the last search.
Show all cells touched in the last search
Definition at line 4692 of file AIPathfind.cpp.
|
protected |
|
staticprotected |
Definition at line 6020 of file AIPathfind.cpp.
|
protected |
Definition at line 6121 of file AIPathfind.cpp.
| Bool Pathfinder::findBrokenBridge | ( | const LocomotorSet & | locoSet, |
| const Coord3D * | from, | ||
| const Coord3D * | to, | ||
| ObjectID * | bridgeID ) |
Does any broken bridge join from and to?
True means that if bridge BridgeID is repaired, there is a land path from to to..
Definition at line 7976 of file AIPathfind.cpp.
|
protected |
Find a short, valid path between given locations. Uses A* algorithm.
Definition at line 7446 of file AIPathfind.cpp.
| Path * Pathfinder::findGroundPath | ( | const Coord3D * | from, |
| const Coord3D * | rawTo, | ||
| Int | pathDiameter, | ||
| Bool | crusher ) |
Find a short, valid path of the desired width on the ground.
Find a short, valid path between given locations. Uses A* algorithm.
Definition at line 7004 of file AIPathfind.cpp.
|
protected |
Find a short, valid path between given locations. Uses A* algorithm.
Definition at line 7435 of file AIPathfind.cpp.
| void Pathfinder::forceMapRecalculation | ( | void | ) |
Force pathfind map recomputation. If region is given, only that area is recomputed.
Force pathfind map recomputation.
Definition at line 4684 of file AIPathfind.cpp.
Returns an aircraft path to the goal.
Create an aircraft path. Just jogs around tall buildings marked with KINDOF_AIRCRAFT_PATH_AROUND.
Definition at line 5805 of file AIPathfind.cpp.
|
inline |
Given a position, return associated grid cell.
Definition at line 943 of file AIPathfind.h.
|
inline |
Return the cell at grid coords (x,y)
Definition at line 923 of file AIPathfind.h.
|
inline |
Given a position, return associated grid cell.
Definition at line 951 of file AIPathfind.h.
|
inline |
Definition at line 908 of file AIPathfind.h.
|
inline |
Definition at line 898 of file AIPathfind.h.
|
inline |
Definition at line 672 of file AIPathfind.h.
| Path * Pathfinder::getMoveAwayFromPath | ( | Object * | obj, |
| Object * | otherObj, | ||
| Path * | pathToAvoid, | ||
| Object * | otherObj2, | ||
| Path * | pathToAvoid2 ) |
Moves an allied unit out of the path of another unit. Uses A* algorithm.
Definition at line 10195 of file AIPathfind.cpp.
Definition at line 9694 of file AIPathfind.cpp.
|
inline |
Definition at line 726 of file AIPathfind.h.
Returns coordinates of goal.
Definition at line 5186 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 6959 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 9626 of file AIPathfind.cpp.
Classify the cells under the given object If 'insert' is true, object is being added If 'insert' is false, object is being removed
Definition at line 4199 of file AIPathfind.cpp.
|
protected |
Find a short, valid path between given locations. Uses A* algorithm.
Definition at line 7458 of file AIPathfind.cpp.
|
protectedvirtual |
Find a short, valid path between given locations.
Find a short, valid path between given locations. Uses A* algorithm.
Definition at line 6462 of file AIPathfind.cpp.
| Bool Pathfinder::isAttackViewBlockedByObstacle | ( | const Object * | obj, |
| const Coord3D & | attackerPos, | ||
| const Object * | victim, | ||
| const Coord3D & | victimPos ) |
Return true if the straight line between the given points contains any obstacle, and thus blocks vision.
srj – someone wanna tell me what this magic number means?
jba - Yes, it means that if someone is on a bridge, or rooftop, they can see 3 pathfind cells out of whatever they are standing on.
srj – awesome! thank you very much :-)
Definition at line 9384 of file AIPathfind.cpp.
| Bool Pathfinder::isGroundPathPassable | ( | Bool | isCrusher, |
| const Coord3D & | startWorld, | ||
| PathfindLayerEnum | startLayer, | ||
| const Coord3D & | endWorld, | ||
| Int | pathDiameter ) |
Return true if the straight line between the given points is passable.
Given two world-space points, check the line of sight between them for any impassible cells. Uses Bresenham line algorithm from www.gamedev.net.
Definition at line 9669 of file AIPathfind.cpp.
| Bool Pathfinder::isLinePassable | ( | const Object * | obj, |
| LocomotorSurfaceTypeMask | acceptableSurfaces, | ||
| PathfindLayerEnum | layer, | ||
| const Coord3D & | startWorld, | ||
| const Coord3D & | endWorld, | ||
| Bool | blocked, | ||
| Bool | allowPinched ) |
Return true if the straight line between the given points is passable.
Given two world-space points, check the line of sight between them for any impassible cells. Uses Bresenham line algorithm from www.gamedev.net.
Definition at line 9645 of file AIPathfind.cpp.
Checks if a point is on the wall.
Definition at line 3953 of file AIPathfind.cpp.
Return true if the straight line between the given points contains any obstacle, and thus blocks vision.
Definition at line 9361 of file AIPathfind.cpp.
|
protected |
Given two world-space points, call callback for each cell. Uses Bresenham line algorithm from www.gamedev.net.
Definition at line 9109 of file AIPathfind.cpp.
|
protected |
Given two world-space points, call callback for each cell. Uses Bresenham line algorithm from www.gamedev.net.
Definition at line 9121 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 9263 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 9577 of file AIPathfind.cpp.
|
virtual |
post process phase for loading save games. All save systems have their xfer run using XferLoad mode, and then all systems each have their post process run
Implements Snapshot.
Definition at line 11120 of file AIPathfind.cpp.
Definition at line 10112 of file AIPathfind.cpp.
Definition at line 6935 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 6901 of file AIPathfind.cpp.
| void Pathfinder::newMap | ( | void | ) |
Set up for a new map.
Definition at line 4548 of file AIPathfind.cpp.
|
protected |
Checks cost between given locations.
Definition at line 8178 of file AIPathfind.cpp.
|
protected |
Add pathfind cells to a path.
Work backwards from goal cell to construct final path.
Definition at line 9030 of file AIPathfind.cpp.
|
protected |
Find a short, valid path between given locations. Uses A* algorithm.
Definition at line 7346 of file AIPathfind.cpp.
| void Pathfinder::processPathfindQueue | ( | void | ) |
Process some or all of the queued pathfinds.
Process some path requests in the pathfind queue.
Definition at line 5881 of file AIPathfind.cpp.
The object wants to request a pathfind, so put it on the list to process.
Queues an object to do a pathfind. It will call the object's ai update->doPathfind() during processPathfindQueue().
Definition at line 5648 of file AIPathfind.cpp.
| void Pathfinder::removeGoal | ( | Object * | obj | ) |
Removes the given mobile unit's goal cells in the map.
Removes the goal cell for an ai unit. Used for a unit that is going to be moving several times, like following a waypoint path, or intentionally collides with other units (like a car bomb). jba
Definition at line 9885 of file AIPathfind.cpp.
|
inline |
De-classify the given object's cells in the map.
Definition at line 918 of file AIPathfind.h.
| void Pathfinder::removePos | ( | Object * | obj | ) |
Removes the unit's position cells from the map.
Removes the position cell flags for an ai unit.
Definition at line 10054 of file AIPathfind.cpp.
| void Pathfinder::removeUnitFromPathfindMap | ( | Object * | obj | ) |
De-classify the given mobile unit's cells in the map.
Removes a mobile unit from the pathfind grid.
Definition at line 10106 of file AIPathfind.cpp.
|
inline |
Definition at line 656 of file AIPathfind.h.
| void Pathfinder::removeWallPiece | ( | Object * | wallPiece | ) |
Removes a piece of a wall
Definition at line 3920 of file AIPathfind.cpp.
| void Pathfinder::reset | ( | void | ) |
Reset system in preparation for new map.
Definition at line 3840 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 9235 of file AIPathfind.cpp.
|
protected |
Return true if the straight line between the given points intersects a tall building.
Definition at line 9488 of file AIPathfind.cpp.
| void Pathfinder::setDebugPath | ( | Path * | debugpath | ) |
Definition at line 9089 of file AIPathfind.cpp.
|
inline |
Definition at line 903 of file AIPathfind.h.
|
inline |
if non-zero, the pathfinder will ignore the given obstacle
Definition at line 873 of file AIPathfind.h.
| Bool Pathfinder::slowDoesPathExist | ( | Object * | obj, |
| const Coord3D * | from, | ||
| const Coord3D * | to, | ||
| ObjectID | ignoreObject = INVALID_ID ) |
Can we build any path at all between the locations (terrain, buildings & units check - slower)
Does any path exist from 'from' to 'to' given the locomotor set This is the careful check, looks at whether the terrain, buindings and units are possible or impossible to path over. Takes other units into account. False means it is impossible to path. True means it is possible to path.
Definition at line 8136 of file AIPathfind.cpp.
Adjusts a goal position to the center of it's cell.
Definition at line 5125 of file AIPathfind.cpp.
Adjusts a coordinate to the center of it's cell.
Definition at line 5106 of file AIPathfind.cpp.
|
protected |
Definition at line 8438 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 8419 of file AIPathfind.cpp.
Update the given aircraft unit's cells in the map.
Updates the goal cell for an ai unit.
Definition at line 9827 of file AIPathfind.cpp.
| void Pathfinder::updateGoal | ( | Object * | obj, |
| const Coord3D * | newGoalPos, | ||
| PathfindLayerEnum | layer ) |
Update the given mobile unit's cells in the map.
Updates the goal cell for an ai unit.
Definition at line 9725 of file AIPathfind.cpp.
| void Pathfinder::updateLayer | ( | Object * | obj, |
| PathfindLayerEnum | layer ) |
Updates object's layer.
Updates an object's layer, making sure the object is actually on the bridge first.
Definition at line 3991 of file AIPathfind.cpp.
Update the given mobile unit's cells in the map.
Updates the position cell for an ai unit.
Definition at line 9945 of file AIPathfind.cpp.
|
staticprotected |
Definition at line 4758 of file AIPathfind.cpp.
| Bool Pathfinder::validMovementPosition | ( | Bool | isCrusher, |
| LocomotorSurfaceTypeMask | acceptableSurfaces, | ||
| PathfindCell * | toCell, | ||
| PathfindCell * | fromCell = NULL ) |
Return true if given position is a valid movement location.
Definition at line 4853 of file AIPathfind.cpp.
|
inline |
Return true if given position is a valid movement location.
Definition at line 889 of file AIPathfind.h.
|
inline |
Return true if given position is a valid movement location.
Definition at line 884 of file AIPathfind.h.
| Bool Pathfinder::validMovementTerrain | ( | PathfindLayerEnum | layer, |
| const Locomotor * | locomotor, | ||
| const Coord3D * | pos ) |
Return true if given position is a valid movement location.
Definition at line 4787 of file AIPathfind.cpp.
Given a world position, return grid cell coordinate.
Definition at line 958 of file AIPathfind.h.
Convert world coordinate to array index.
Classify the cells under the given object If 'insert' is true, object is being added
Definition at line 878 of file AIPathfind.h.
|
virtual |
run save, load, or deep CRC check on this data structure, the type depends on the setup of the Xfer pointer
Implements Snapshot.
Definition at line 11109 of file AIPathfind.cpp.