#include "eGrid.h"
#include "eTess2.h"
#include "ePath.h"
#include "eGameObject.h"
#include "tConsole.h"
#include "eWall.h"
#include "eSensor.h"
Go to the source code of this file.
Functions | |
static REAL | Distance (const eHalfEdge *a, const eCoord &b) |
static REAL | Modifier (const eGameObject *gameObject, const eHalfEdge *edge) |
static bool | CanPass (const eGameObject *gameObject, const eHalfEdge *edge) |
REAL | EdgePenalty (const eHalfEdge *e, const eGameObject *g) |
Variables | |
static tHeap< eHalfEdge > | openEdges |
static tHeap< eHalfEdge > | closedEdges |
static ePath * | lastPath = NULL |
static bool CanPass | ( | const eGameObject * | gameObject, | |
const eHalfEdge * | edge | |||
) | [static] |
Definition at line 65 of file ePath.cpp.
References eGameObject::EdgeIsDangerous(), eWallHolder::GetWall(), eGameObject::LastTime(), eHalfEdge::Other(), and tASSERT.
Referenced by eHalfEdge::FindPath().
00067 { 00068 tASSERT(edge); 00069 tASSERT(gameObject); 00070 00071 eWall* w = edge->GetWall(); 00072 if (!w && edge->Other()) 00073 w = edge->Other()->GetWall(); 00074 00075 return !gameObject->EdgeIsDangerous(w, gameObject->LastTime(), 0.5f); 00076 }
Definition at line 42 of file ePath.cpp.
References eHalfEdge::Point(), sqrt(), and tASSERT.
Referenced by gCycleChatBot::Activate(), gCycleChatBot::Distance(), and eHalfEdge::FindPath().
00043 { 00044 tASSERT( a ); 00045 tASSERT( a->Point() ); 00046 00047 return sqrt(((*a->Point()) - b).NormSquared()); 00048 }
REAL EdgePenalty | ( | const eHalfEdge * | e, | |
const eGameObject * | g | |||
) |
Definition at line 126 of file ePath.cpp.
References eCoord, eHalfEdge::Face(), eHalfEdge::Point(), sqrt(), and eHalfEdge::Vec().
Referenced by eHalfEdge::FindPath().
00127 { 00128 eCoord probePre = e->Vec().Turn(0, 1); 00129 eCoord probe = probePre * (1/sqrt(probePre.NormSquared())); 00130 00131 eSensor s (const_cast<eGameObject * >( g ), *e->Point() + e->Vec() * .5f + probePre * .0001f, probe); 00132 s.SetCurrentFace(e->Face()); 00133 s.detect(1); 00134 if (s.hit > 1) 00135 s.hit = 1; 00136 00137 return 100 * (1/(s.hit + .1) - (1/1.1)); 00138 }
static REAL Modifier | ( | const eGameObject * | gameObject, | |
const eHalfEdge * | edge | |||
) | [static] |
Definition at line 52 of file ePath.cpp.
References eWallHolder::GetWall(), eHalfEdge::Other(), eGameObject::PathfindingModifier(), and tASSERT.
Referenced by eHalfEdge::FindPath().
00054 { 00055 tASSERT(edge); 00056 tASSERT(gameObject); 00057 00058 eWall* w = edge->GetWall(); 00059 if (!w && edge->Other()) 00060 w = edge->Other()->GetWall(); 00061 00062 return gameObject->PathfindingModifier(w); 00063 }
tHeap<eHalfEdge> closedEdges [static] |