doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions | Variables
AI_pathing.cpp File Reference
#include "../../idlib/precompiled.h"
#include "../Game_local.h"

Go to the source code of this file.

Classes

struct  obstacle_s
 
struct  pathNode_s
 
struct  pathTrace_s
 
struct  ballistics_s
 

Typedefs

typedef struct obstacle_s obstacle_t
 
typedef struct pathNode_s pathNode_t
 
typedef struct pathTrace_s pathTrace_t
 
typedef struct ballistics_s ballistics_t
 

Functions

bool LineIntersectsPath (const idVec2 &start, const idVec2 &end, const pathNode_t *node)
 
int PointInsideObstacle (const obstacle_t *obstacles, const int numObstacles, const idVec2 &point)
 
void GetPointOutsideObstacles (const obstacle_t *obstacles, const int numObstacles, idVec2 &point, int *obstacle, int *edgeNum)
 
bool GetFirstBlockingObstacle (const obstacle_t *obstacles, int numObstacles, int skipObstacle, const idVec2 &startPos, const idVec2 &delta, float &blockingScale, int &blockingObstacle, int &blockingEdgeNum)
 
int GetObstacles (const idPhysics *physics, const idAAS *aas, const idEntity *ignore, int areaNum, const idVec3 &startPos, const idVec3 &seekPos, obstacle_t *obstacles, int maxObstacles, idBounds &clipBounds)
 
void FreePathTree_r (pathNode_t *node)
 
void DrawPathTree (const pathNode_t *root, const float height)
 
bool GetPathNodeDelta (pathNode_t *node, const obstacle_t *obstacles, const idVec2 &seekPos, bool blocked)
 
pathNode_tBuildPathTree (const obstacle_t *obstacles, int numObstacles, const idBounds &clipBounds, const idVec2 &startPos, const idVec2 &seekPos, obstaclePath_t &path)
 
void PrunePathTree (pathNode_t *root, const idVec2 &seekPos)
 
int OptimizePath (const pathNode_t *root, const pathNode_t *leafNode, const obstacle_t *obstacles, int numObstacles, idVec2 optimizedPath[MAX_OBSTACLE_PATH])
 
float PathLength (idVec2 optimizedPath[MAX_OBSTACLE_PATH], int numPathPoints, const idVec2 &curDir)
 
bool FindOptimalPath (const pathNode_t *root, const obstacle_t *obstacles, int numObstacles, const float height, const idVec3 &curDir, idVec3 &seekPos)
 
bool PathTrace (const idEntity *ent, const idAAS *aas, const idVec3 &start, const idVec3 &end, int stopEvent, struct pathTrace_s &trace, predictedPath_t &path)
 

Variables

const float MAX_OBSTACLE_RADIUS = 256.0f
 
const float PUSH_OUTSIDE_OBSTACLES = 0.5f
 
const float CLIP_BOUNDS_EPSILON = 10.0f
 
const int MAX_AAS_WALL_EDGES = 256
 
const int MAX_OBSTACLES = 256
 
const int MAX_PATH_NODES = 256
 
const int MAX_OBSTACLE_PATH = 64
 
idBlockAlloc< pathNode_t, 128 > pathNodeAllocator
 
const float OVERCLIP = 1.001f
 
const int MAX_FRAME_SLIDE = 5
 

Typedef Documentation

typedef struct ballistics_s ballistics_t
typedef struct obstacle_s obstacle_t
typedef struct pathNode_s pathNode_t
typedef struct pathTrace_s pathTrace_t

Function Documentation

pathNode_t* BuildPathTree ( const obstacle_t obstacles,
int  numObstacles,
const idBounds clipBounds,
const idVec2 startPos,
const idVec2 seekPos,
obstaclePath_t path 
)

Definition at line 592 of file AI_pathing.cpp.

void DrawPathTree ( const pathNode_t root,
const float  height 
)

Definition at line 504 of file AI_pathing.cpp.

bool FindOptimalPath ( const pathNode_t root,
const obstacle_t obstacles,
int  numObstacles,
const float  height,
const idVec3 curDir,
idVec3 seekPos 
)

Definition at line 833 of file AI_pathing.cpp.

void FreePathTree_r ( pathNode_t node)

Definition at line 489 of file AI_pathing.cpp.

bool GetFirstBlockingObstacle ( const obstacle_t obstacles,
int  numObstacles,
int  skipObstacle,
const idVec2 startPos,
const idVec2 delta,
float blockingScale,
int blockingObstacle,
int blockingEdgeNum 
)

Definition at line 271 of file AI_pathing.cpp.

int GetObstacles ( const idPhysics physics,
const idAAS aas,
const idEntity ignore,
int  areaNum,
const idVec3 startPos,
const idVec3 seekPos,
obstacle_t obstacles,
int  maxObstacles,
idBounds clipBounds 
)

Definition at line 309 of file AI_pathing.cpp.

bool GetPathNodeDelta ( pathNode_t node,
const obstacle_t obstacles,
const idVec2 seekPos,
bool  blocked 
)

Definition at line 528 of file AI_pathing.cpp.

void GetPointOutsideObstacles ( const obstacle_t obstacles,
const int  numObstacles,
idVec2 point,
int obstacle,
int edgeNum 
)

Definition at line 150 of file AI_pathing.cpp.

bool LineIntersectsPath ( const idVec2 start,
const idVec2 end,
const pathNode_t node 
)

Definition at line 98 of file AI_pathing.cpp.

int OptimizePath ( const pathNode_t root,
const pathNode_t leafNode,
const obstacle_t obstacles,
int  numObstacles,
idVec2  optimizedPath[MAX_OBSTACLE_PATH] 
)

Definition at line 749 of file AI_pathing.cpp.

float PathLength ( idVec2  optimizedPath[MAX_OBSTACLE_PATH],
int  numPathPoints,
const idVec2 curDir 
)

Definition at line 809 of file AI_pathing.cpp.

bool PathTrace ( const idEntity ent,
const idAAS aas,
const idVec3 start,
const idVec3 end,
int  stopEvent,
struct pathTrace_s trace,
predictedPath_t path 
)

Definition at line 1032 of file AI_pathing.cpp.

int PointInsideObstacle ( const obstacle_t obstacles,
const int  numObstacles,
const idVec2 point 
)

Definition at line 125 of file AI_pathing.cpp.

void PrunePathTree ( pathNode_t root,
const idVec2 seekPos 
)

Definition at line 697 of file AI_pathing.cpp.

Variable Documentation

const float CLIP_BOUNDS_EPSILON = 10.0f

Definition at line 54 of file AI_pathing.cpp.

const int MAX_AAS_WALL_EDGES = 256

Definition at line 55 of file AI_pathing.cpp.

const int MAX_FRAME_SLIDE = 5

Definition at line 1016 of file AI_pathing.cpp.

const int MAX_OBSTACLE_PATH = 64

Definition at line 58 of file AI_pathing.cpp.

const float MAX_OBSTACLE_RADIUS = 256.0f

Definition at line 52 of file AI_pathing.cpp.

const int MAX_OBSTACLES = 256

Definition at line 56 of file AI_pathing.cpp.

const int MAX_PATH_NODES = 256

Definition at line 57 of file AI_pathing.cpp.

const float OVERCLIP = 1.001f

Definition at line 1015 of file AI_pathing.cpp.

idBlockAlloc<pathNode_t, 128> pathNodeAllocator

Definition at line 90 of file AI_pathing.cpp.

const float PUSH_OUTSIDE_OBSTACLES = 0.5f

Definition at line 53 of file AI_pathing.cpp.