ePath Class Reference

#include <ePath.h>

Collaboration diagram for ePath:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ePath ()
 ~ePath ()
bool Valid () const
eCoord & CurrentPosition () const
eCoord & CurrentOffset () const
bool Proceed ()
bool GoBack ()
void Clear ()

Protected Member Functions

void Add (eHalfEdge *edge)
void Add (const eCoord &point)

Protected Attributes

tArray< eCoord > positions
tArray< eCoord > offsets
int current

Friends

class eHalfEdge


Detailed Description

Definition at line 36 of file ePath.h.


Constructor & Destructor Documentation

ePath::ePath (  ) 

Definition at line 415 of file ePath.cpp.

References current.

00415             {
00416     current=-1;
00417 }

ePath::~ePath (  ) 

Definition at line 419 of file ePath.cpp.

References NULL.

00419              {
00420     if ( lastPath == this )
00421         lastPath = NULL;
00422 }


Member Function Documentation

bool ePath::Valid (  )  const [inline]

Definition at line 46 of file ePath.h.

References current, GrowingArrayBase::Len(), and positions.

Referenced by gAIPlayer::ThinkPath().

00046 { return current >= 0 && current < positions.Len(); }

Here is the call graph for this function:

Here is the caller graph for this function:

eCoord& ePath::CurrentPosition (  )  const [inline]

Definition at line 47 of file ePath.h.

References current, and positions.

Referenced by gAIPlayer::ThinkPath().

00047 { return positions(current); }

Here is the caller graph for this function:

eCoord& ePath::CurrentOffset (  )  const [inline]

Definition at line 48 of file ePath.h.

References current, and offsets.

Referenced by gAIPlayer::ThinkPath().

00048 { return offsets(current); }

Here is the caller graph for this function:

bool ePath::Proceed (  ) 

Definition at line 393 of file ePath.cpp.

References current.

Referenced by gAIPlayer::ThinkPath().

00394 {
00395     if (current > 0)
00396     {
00397         current--;
00398         return true;
00399     }
00400     else
00401         return false;
00402 }

Here is the caller graph for this function:

bool ePath::GoBack (  ) 

Definition at line 404 of file ePath.cpp.

References current, GrowingArrayBase::Len(), and positions.

Referenced by gAIPlayer::ThinkPath().

00405 {
00406     if (current < positions.Len()-1)
00407     {
00408         current++;
00409         return true;
00410     }
00411     else
00412         return false;
00413 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ePath::Clear (  ) 

Definition at line 452 of file ePath.cpp.

References current, offsets, positions, and tArray< T, MALLOC >::SetLen().

Referenced by eHalfEdge::FindPath(), and gAIPlayer::NewObject().

00453 {
00454     lastPath = this;
00455 
00456     current=-1;
00457 
00458     offsets.SetLen(0);
00459     positions.SetLen(0);
00460 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ePath::Add ( eHalfEdge edge  )  [protected]

Definition at line 424 of file ePath.cpp.

References current, eCoord, eHalfEdge::Next(), offsets, eHalfEdge::Point(), pos, positions, REAL, sqrt(), and tASSERT.

Referenced by eHalfEdge::FindPath().

00425 {
00426     tASSERT (e->Point() && e->Next() && e->Next()->Point() && e->Next()->Next() && e->Next()->Next()->Point());
00427 
00428     current++;
00429 
00430     eCoord pos    = *e->Point();
00431     //  eCoord dir    = e->Vec();
00432     eCoord offset = ((*e->Next()->Next()->Point() + *e->Next()->Point()) * .5f - pos) * .5f;
00433     //  offset = offset - dir * (eCoord::F(dir, offset) / dir.NormSquared());
00434 
00435     REAL ol = sqrt(offset.NormSquared());
00436     if (ol > 1)
00437         offset = offset * (1/ol);
00438 
00439     positions[current] = pos;
00440     offsets[current]   = offset;
00441 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ePath::Add ( const eCoord &  point  )  [protected]

Definition at line 443 of file ePath.cpp.

References current, eCoord, offsets, and positions.

00444 {
00445     current++;
00446 
00447     positions[current] = point;
00448     offsets[current]   = eCoord(0, 0);
00449 }


Friends And Related Function Documentation

friend class eHalfEdge [friend]

Definition at line 42 of file ePath.h.


Member Data Documentation

tArray<eCoord> ePath::positions [protected]

Definition at line 55 of file ePath.h.

Referenced by Add(), Clear(), CurrentPosition(), GoBack(), and Valid().

tArray<eCoord> ePath::offsets [protected]

Definition at line 56 of file ePath.h.

Referenced by Add(), Clear(), and CurrentOffset().

int ePath::current [protected]

Definition at line 57 of file ePath.h.

Referenced by Add(), Clear(), CurrentOffset(), CurrentPosition(), ePath(), GoBack(), Proceed(), and Valid().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:26:53 2008 for Armagetron Advanced by  doxygen 1.5.4