src/engine/ePath.cpp File Reference

#include "eGrid.h"
#include "eTess2.h"
#include "ePath.h"
#include "eGameObject.h"
#include "tConsole.h"
#include "eWall.h"
#include "eSensor.h"

Include dependency graph for ePath.cpp:

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< eHalfEdgeopenEdges
static tHeap< eHalfEdgeclosedEdges
static ePathlastPath = NULL


Function Documentation

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

static REAL Distance ( const eHalfEdge a,
const eCoord &  b 
) [static]

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

tHeap<eHalfEdge> closedEdges [static]

Definition at line 38 of file ePath.cpp.

ePath* lastPath = NULL [static]

Definition at line 355 of file ePath.cpp.

tHeap<eHalfEdge> openEdges [static]

Definition at line 37 of file ePath.cpp.


Generated on Sat Mar 15 22:57:36 2008 for Armagetron Advanced by  doxygen 1.5.4