|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#include <PathGenerator.h>
Public Member Functions | |
| bool | CalculatePath (float destX, float destY, float destZ, bool forceDest=false) |
| G3D::Vector3 const & | GetActualEndPosition () const |
| G3D::Vector3 const & | GetEndPosition () const |
| Movement::PointsArray const & | GetPath () const |
| PathType | GetPathType () const |
| G3D::Vector3 const & | GetStartPosition () const |
| PathGenerator (Unit const *owner) | |
| void | SetPathLengthLimit (float distance) |
| void | SetUseStraightPath (bool useStraightPath) |
| ~PathGenerator () | |
Private Member Functions | |
| void | BuildPointPath (float const *startPoint, float const *endPoint) |
| void | BuildPolyPath (G3D::Vector3 const &startPos, G3D::Vector3 const &endPos) |
| void | BuildShortcut () |
| void | Clear () |
| void | CreateFilter () |
| void | DensifyGroundPath () |
| float | Dist3DSqr (G3D::Vector3 const &p1, G3D::Vector3 const &p2) const |
| dtStatus | FindSmoothPath (float const *startPos, float const *endPos, dtPolyRef const *polyPath, uint32 polyPathSize, float *smoothPath, int *smoothPathSize, uint32 smoothPathMaxSize) |
| uint32 | FixupCorridor (dtPolyRef *path, uint32 npath, uint32 maxPath, dtPolyRef const *visited, uint32 nvisited) |
| NavTerrain | GetNavTerrain (float x, float y, float z) |
| dtPolyRef | GetPathPolyByPosition (dtPolyRef const *polyPath, uint32 polyPathSize, float const *Point, float *Distance=NULL) const |
| dtPolyRef | GetPolyByLocation (float const *Point, float *Distance) const |
| bool | GetSteerTarget (float const *startPos, float const *endPos, float minTargetDist, dtPolyRef const *path, uint32 pathSize, float *steerPos, unsigned char &steerPosFlag, dtPolyRef &steerPosRef) |
| bool | HaveTile (G3D::Vector3 const &p) const |
| bool | InRange (G3D::Vector3 const &p1, G3D::Vector3 const &p2, float r, float h) const |
| bool | InRangeYZX (float const *v1, float const *v2, float r, float h) const |
| void | NormalizePath () |
| void | SetActualEndPosition (G3D::Vector3 const &point) |
| void | SetEndPosition (G3D::Vector3 const &point) |
| void | SetStartPosition (G3D::Vector3 const &point) |
| void | UpdateFilter () |
Static Private Member Functions | |
| static float | ResolveTerrainZ (Unit const *unit, float x, float y, float z) |
Private Attributes | |
| G3D::Vector3 | _actualEndPosition |
| G3D::Vector3 | _endPosition |
| dtQueryFilter | _filter |
| bool | _forceDestination |
| dtNavMesh const * | _navMesh |
| dtNavMeshQuery const * | _navMeshQuery |
| Movement::PointsArray | _pathPoints |
| dtPolyRef | _pathPolyRefs [MAX_PATH_LENGTH] |
| uint32 | _pointPathLimit |
| uint32 | _polyLength |
| Unit const *const | _sourceUnit |
| G3D::Vector3 | _startPosition |
| PathType | _type |
| bool | _useStraightPath |
Definition at line 39 of file PathGenerator.h.
|
explicit |
Definition at line 17 of file PathGenerator.cpp.
References _endPosition, _forceDestination, _navMesh, _navMeshQuery, _pathPolyRefs, _pointPathLimit, _polyLength, _sourceUnit, _type, _useStraightPath, CreateFilter(), MMAP::MMapFactory::createOrGetMMapManager(), MMAP::MMapManager::GetNavMesh(), MMAP::MMapManager::GetNavMeshQuery(), MMAP::MMapFactory::IsPathfindingEnabled(), MAX_POINT_PATH_LENGTH, PATHFIND_BLANK, and SF_LOG_DEBUG.
| PathGenerator::~PathGenerator | ( | ) |
Definition at line 37 of file PathGenerator.cpp.
References _sourceUnit, and SF_LOG_DEBUG.
|
private |
Definition at line 390 of file PathGenerator.cpp.
References _forceDestination, _navMeshQuery, _pathPoints, _pathPolyRefs, _pointPathLimit, _polyLength, _type, _useStraightPath, BuildShortcut(), Dist3DSqr(), FindSmoothPath(), GetActualEndPosition(), GetEndPosition(), GetStartPosition(), InRange(), MAX_POINT_PATH_LENGTH, NormalizePath(), PATHFIND_NOPATH, PATHFIND_NORMAL, PATHFIND_NOT_USING_PATH, PATHFIND_SHORT, SetActualEndPosition(), SF_LOG_DEBUG, and VERTEX_SIZE.
Referenced by BuildPolyPath().
|
private |
Definition at line 143 of file PathGenerator.cpp.
References _filter, _navMeshQuery, _pathPoints, _pathPolyRefs, _polyLength, _sourceUnit, _type, ASSERT, BuildPointPath(), BuildShortcut(), Creature::CanFly(), Creature::CanSwim(), Clear(), GetPolyByLocation(), INVALID_POLYREF, LIQUID_MAP_NO_WATER, MAP_ALL_LIQUIDS, MAX_PATH_LENGTH, PATHFIND_INCOMPLETE, PATHFIND_NOPATH, PATHFIND_NORMAL, PATHFIND_NOT_USING_PATH, SetActualEndPosition(), SF_LOG_DEBUG, SF_LOG_ERROR, TYPEID_UNIT, and VERTEX_SIZE.
Referenced by CalculatePath().
|
private |
Definition at line 548 of file PathGenerator.cpp.
References _pathPoints, _type, Clear(), GetActualEndPosition(), GetStartPosition(), NormalizePath(), PATHFIND_SHORTCUT, and SF_LOG_DEBUG.
Referenced by BuildPointPath(), BuildPolyPath(), and CalculatePath().
| bool PathGenerator::CalculatePath | ( | float | destX, |
| float | destY, | ||
| float | destZ, | ||
| bool | forceDest = false ) |
Definition at line 42 of file PathGenerator.cpp.
References _forceDestination, _navMesh, _navMeshQuery, _sourceUnit, _type, BuildPolyPath(), BuildShortcut(), HaveTile(), Skyfire::IsValidMapCoord(), PATHFIND_NORMAL, PATHFIND_NOT_USING_PATH, SetEndPosition(), SetStartPosition(), SF_LOG_DEBUG, UNIT_STATE_IGNORE_PATHFINDING, and UpdateFilter().
Referenced by ConfusedMovementGenerator< T >::DoUpdate(), mmaps_commandscript::HandleMmapPathCommand(), mmaps_commandscript::HandleMmapTestArea(), and Movement::MoveSplineInit::MoveTo().
|
inlineprivate |
Definition at line 90 of file PathGenerator.h.
References _pathPoints, and _polyLength.
Referenced by BuildPolyPath(), and BuildShortcut().
|
private |
Definition at line 566 of file PathGenerator.cpp.
References _filter, _sourceUnit, Creature::CanSwim(), Creature::CanWalk(), NAV_GROUND, NAV_MAGMA, NAV_SLIME, NAV_WATER, TYPEID_UNIT, and UpdateFilter().
Referenced by PathGenerator().
|
private |
Definition at line 487 of file PathGenerator.cpp.
References _pathPoints, _sourceUnit, Creature::CanWalk(), Creature::GetCreatureTemplate(), INHABIT_AIR, INHABIT_GROUND, ResolveTerrainZ(), SMOOTH_PATH_STEP_SIZE, and TYPEID_UNIT.
Referenced by NormalizePath().
|
private |
Definition at line 863 of file PathGenerator.cpp.
Referenced by BuildPointPath().
|
private |
Definition at line 727 of file PathGenerator.cpp.
References _filter, _navMesh, _navMeshQuery, FixupCorridor(), GetSteerTarget(), InRangeYZX(), INVALID_POLYREF, MAX_PATH_LENGTH, MAX_POINT_PATH_LENGTH, SMOOTH_PATH_SLOP, SMOOTH_PATH_STEP_SIZE, and VERTEX_SIZE.
Referenced by BuildPointPath().
|
private |
Definition at line 645 of file PathGenerator.cpp.
Referenced by FindSmoothPath().
|
inline |
Definition at line 56 of file PathGenerator.h.
References _actualEndPosition.
Referenced by BuildPointPath(), BuildShortcut(), mmaps_commandscript::HandleMmapPathCommand(), and MotionMaster::MoveCharge().
|
inline |
Definition at line 55 of file PathGenerator.h.
References _endPosition.
Referenced by BuildPointPath(), and mmaps_commandscript::HandleMmapPathCommand().
|
private |
Definition at line 608 of file PathGenerator.cpp.
References _sourceUnit, LIQUID_MAP_NO_WATER, MAP_ALL_LIQUIDS, MAP_LIQUID_TYPE_MAGMA, MAP_LIQUID_TYPE_OCEAN, MAP_LIQUID_TYPE_SLIME, MAP_LIQUID_TYPE_WATER, NAV_GROUND, NAV_MAGMA, NAV_SLIME, NAV_WATER, and LiquidData::type_flags.
Referenced by UpdateFilter().
|
inline |
Definition at line 58 of file PathGenerator.h.
References _pathPoints.
Referenced by ConfusedMovementGenerator< T >::DoUpdate(), mmaps_commandscript::HandleMmapPathCommand(), MotionMaster::MoveCharge(), and Movement::MoveSplineInit::MoveTo().
|
private |
Definition at line 76 of file PathGenerator.cpp.
References _navMeshQuery, INVALID_POLYREF, and VERTEX_SIZE.
Referenced by GetPolyByLocation().
|
inline |
Definition at line 60 of file PathGenerator.h.
References _type.
Referenced by ConfusedMovementGenerator< T >::DoUpdate(), mmaps_commandscript::HandleMmapPathCommand(), and Movement::MoveSplineInit::MoveTo().
|
private |
Definition at line 109 of file PathGenerator.cpp.
References _filter, _navMeshQuery, _pathPolyRefs, _polyLength, GetPathPolyByPosition(), INVALID_POLYREF, and VERTEX_SIZE.
Referenced by BuildPolyPath().
|
inline |
Definition at line 54 of file PathGenerator.h.
References _startPosition.
Referenced by BuildPointPath(), BuildShortcut(), and mmaps_commandscript::HandleMmapPathCommand().
|
private |
Definition at line 690 of file PathGenerator.cpp.
References _navMeshQuery, InRangeYZX(), and VERTEX_SIZE.
Referenced by FindSmoothPath().
|
private |
Workaround For some reason, often the tx and ty variables wont get a valid value Use this check to prevent getting negative tile coords and crashing on getTileAt
Definition at line 629 of file PathGenerator.cpp.
References _navMesh, and VERTEX_SIZE.
Referenced by CalculatePath().
|
private |
Definition at line 857 of file PathGenerator.cpp.
Referenced by BuildPointPath().
|
private |
Definition at line 849 of file PathGenerator.cpp.
Referenced by FindSmoothPath(), and GetSteerTarget().
|
private |
Definition at line 540 of file PathGenerator.cpp.
References _pathPoints, _sourceUnit, and DensifyGroundPath().
Referenced by BuildPointPath(), and BuildShortcut().
|
staticprivate |
Definition at line 469 of file PathGenerator.cpp.
References WorldObject::GetBaseMap(), Map::GetHeight(), WorldObject::GetPhaseMask(), INVALID_HEIGHT, and WorldObject::UpdateAllowedPositionZ().
Referenced by DensifyGroundPath().
|
inlineprivate |
Definition at line 85 of file PathGenerator.h.
References _actualEndPosition.
Referenced by BuildPointPath(), and BuildPolyPath().
|
inlineprivate |
Definition at line 84 of file PathGenerator.h.
References _actualEndPosition, and _endPosition.
Referenced by CalculatePath().
|
inline |
Definition at line 51 of file PathGenerator.h.
References _pointPathLimit, MAX_POINT_PATH_LENGTH, and SMOOTH_PATH_STEP_SIZE.
Referenced by ConfusedMovementGenerator< T >::DoUpdate().
|
inlineprivate |
Definition at line 83 of file PathGenerator.h.
References _startPosition.
Referenced by CalculatePath().
|
inline |
Definition at line 50 of file PathGenerator.h.
References _useStraightPath.
Referenced by mmaps_commandscript::HandleMmapPathCommand().
|
private |
Definition at line 593 of file PathGenerator.cpp.
References _filter, _sourceUnit, and GetNavTerrain().
Referenced by CalculatePath(), and CreateFilter().
|
private |
Definition at line 75 of file PathGenerator.h.
Referenced by GetActualEndPosition(), SetActualEndPosition(), and SetEndPosition().
|
private |
Definition at line 74 of file PathGenerator.h.
Referenced by GetEndPosition(), PathGenerator(), and SetEndPosition().
|
private |
Definition at line 81 of file PathGenerator.h.
Referenced by BuildPolyPath(), CreateFilter(), FindSmoothPath(), GetPolyByLocation(), and UpdateFilter().
|
private |
Definition at line 70 of file PathGenerator.h.
Referenced by BuildPointPath(), CalculatePath(), and PathGenerator().
|
private |
Definition at line 78 of file PathGenerator.h.
Referenced by CalculatePath(), FindSmoothPath(), HaveTile(), and PathGenerator().
|
private |
Definition at line 79 of file PathGenerator.h.
Referenced by BuildPointPath(), BuildPolyPath(), CalculatePath(), FindSmoothPath(), GetPathPolyByPosition(), GetPolyByLocation(), GetSteerTarget(), and PathGenerator().
|
private |
Definition at line 66 of file PathGenerator.h.
Referenced by BuildPointPath(), BuildPolyPath(), BuildShortcut(), Clear(), DensifyGroundPath(), GetPath(), and NormalizePath().
|
private |
Definition at line 63 of file PathGenerator.h.
Referenced by BuildPointPath(), BuildPolyPath(), GetPolyByLocation(), and PathGenerator().
|
private |
Definition at line 71 of file PathGenerator.h.
Referenced by BuildPointPath(), PathGenerator(), and SetPathLengthLimit().
|
private |
Definition at line 64 of file PathGenerator.h.
Referenced by BuildPointPath(), BuildPolyPath(), Clear(), GetPolyByLocation(), and PathGenerator().
|
private |
Definition at line 77 of file PathGenerator.h.
Referenced by BuildPolyPath(), CalculatePath(), CreateFilter(), DensifyGroundPath(), GetNavTerrain(), NormalizePath(), PathGenerator(), UpdateFilter(), and ~PathGenerator().
|
private |
Definition at line 73 of file PathGenerator.h.
Referenced by GetStartPosition(), and SetStartPosition().
|
private |
Definition at line 67 of file PathGenerator.h.
Referenced by BuildPointPath(), BuildPolyPath(), BuildShortcut(), CalculatePath(), GetPathType(), and PathGenerator().
|
private |
Definition at line 69 of file PathGenerator.h.
Referenced by BuildPointPath(), PathGenerator(), and SetUseStraightPath().