152class PathNode :
public SimpleEntity
158 int virtualNumChildren;
162 class PathNode *Parent;
167 const vec_t *m_PathPos;
177 friend class PathSearch;
178 friend void DrawAllConnections(
void);
181 void ConnectTo(PathNode *node);
182 void SetNodeFlags(
Event *ev);
183 void SetLowWallArc(
Event *ev);
184 void Remove(
Event *ev);
187 CLASS_PROTOTYPE(PathNode);
192 void *
operator new(
size_t size);
193 void operator delete(
void *ptr);
195 void Archive(
Archiver& arc)
override;
199 bool CheckPathTo(PathNode *node);
200 void CheckPathToDefault(PathNode *node,
pathway_t *pathway);
201 qboolean LadderTo(PathNode *node,
pathway_t *pathway);
203 void DrawConnections(
void);
204 void Claim(
Entity *pClaimer);
205 void Relinquish(
void);
206 Entity *GetClaimHolder(
void)
const;
207 bool IsClaimedByOther(
Entity *pPossibleClaimer)
const;
208 void MarkTemporarilyBad(
void);
209 void ConnectChild(
int i);
210 void DisconnectChild(
int i);
211 const_str GetSpecialAttack(
class Actor *pActor);
212 void IsTouching(
Event *ev);
213 qboolean IsTouching(
Entity *e1);
214 void setOriginEvent(
Vector org)
override;
242class PathSearch :
public Listener
244 friend class PathNode;
247 static MapCell PathMap[PATHMAP_GRIDSIZE][PATHMAP_GRIDSIZE];
248 static PathNode *open;
249 static int findFrame;
250 static qboolean m_bNodesloaded;
251 static qboolean m_NodeCheckFailed;
252 static int m_LoadIndex;
255 static PathNode *pathnodes[MAX_PATHNODES];
256 static int nodecount;
257 static float total_dist;
258 static const char *last_error;
261 static void LoadAddToGrid(
int x,
int y);
262 static void LoadAddToGrid2(PathNode *node,
int x,
int y);
263 static void AddToGrid(PathNode *node,
int x,
int y);
264 static bool Connect(PathNode *node,
int x,
int y);
265 static int NodeCoordinate(
float coord);
266 static int GridCoordinate(
float coord);
267 static qboolean ArchiveSaveNodes(
void);
268 static void ArchiveLoadNodes(
void);
269 static void Init(
void);
272 CLASS_PROTOTYPE(PathSearch);
275 virtual ~PathSearch();
277 static void ArchiveStaticLoad(
Archiver& arc);
278 static void ArchiveStaticSave(
Archiver& arc);
279 static bool ArchiveDynamic(
Archiver& arc);
281 static void AddNode(PathNode *node);
282 static void Connect(PathNode *node);
283 static void UpdateNode(PathNode *node);
285 static MapCell *GetNodesInCell(
int x,
int y);
286 static MapCell *GetNodesInCell(
const vec3_t pos);
288 static class PathNode *DebugNearestStartNode(
const vec3_t pos,
Entity *ent = NULL);
289 static class PathNode *NearestStartNode(
const vec3_t pos,
SimpleActor *ent);
290 static class PathNode *NearestEndNode(
const vec3_t pos);
291 static int DebugNearestNodeList(
const vec3_t pos, PathNode **nodelist,
int iMaxNodes);
292 static int DebugNearestNodeList2(
const vec3_t pos, PathNode **nodelist,
int iMaxNodes);
294 static void ShowNodes(
void);
295 static void LoadNodes(
void);
296 static void CreatePaths(
void);
297 static void *AllocPathNode(
void);
298 static void FreePathNode(
void *);
299 static void ResetNodes(
void);
300 static void ClearNodes(
void);
302 static void UpdatePathwaysForBadPlace(
const Vector& origin,
float radius,
int dir,
int team);
307 static class PathNode *GetSpawnNode(
ClassDef *cls);
314 const vec3_t vLeashHome,
315 float fLeashDistSquared,
318 static int FindPathAway(
321 const vec3_t vPreferredDir,
324 const vec3_t vLeashHome,
325 float fLeashDistSquared,
328 static int FindPathNear(
333 float fRadiusSquared,
334 const vec3_t vLeashHome,
335 float fLeashDistSquared,
339 static class PathNode *
340 FindCornerNodeForWall(
const vec3_t start,
const vec3_t end,
Entity *ent,
float maxPath,
const vec4_t plane);
341 static class PathNode *FindCornerNodeForExactPath(
Entity *self,
Sentient *enemy,
float fMaxPath);
342 static int FindPotentialCover(
Entity *pEnt,
Vector& vPos,
Entity *pEnemy, PathNode **ppFoundNodes,
int iMaxFind);
343 static void PlayerCover(
class Player *pPlayer);
345 static class PathNode *FindNearestSniperNode(
Entity *pEnt,
Vector& vPos,
Entity *pEnemy);
348 static int NearestNodeSetup(
const vec3_t pos,
MapCell *cell,
int *nodes, vec3_t *deltas);