ASR::Level::LevelNode Class Reference

#include <Level.h>

Collaboration diagram for ASR::Level::LevelNode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LevelNode (Vector3 worldPos, float traversalCost=1.0f)
void setTraversalCost (float cost)
int getNumNeighbours () const
LevelNodegetNeighbour (int index) const
float getTraversalCost () const
float getEstimatedCostToState (const LevelNode &state) const
Vector3 getWorldPosition ()
bool operator== (const LevelNode &rhs) const
bool isNode (const LevelNode &rhs) const

Private Attributes

Vector3 mWorldPos
float mTraversalCost
unsigned int mId
bool mChecked
int mNumNeighbours
LevelNodemNeighbours [8]

Friends

class Level

Detailed Description

Definition at line 62 of file Level.h.


Constructor & Destructor Documentation

ASR::Level::LevelNode::LevelNode ( Vector3  worldPos,
float  traversalCost = 1.0f 
) [inline]

Definition at line 85 of file Level.h.

References mNeighbours.

00086                                 : mWorldPos ( worldPos ), mTraversalCost ( traversalCost ),
00087                                   mNumNeighbours ( 0 )
00088                         {
00089                                 for ( int i = 0; i < 8; i++ )
00090                                 {
00091                                         mNeighbours[i] = NULL;
00092                                 }
00093                         }


Member Function Documentation

float ASR::Level::LevelNode::getEstimatedCostToState ( const LevelNode state  )  const [inline]

Definition at line 123 of file Level.h.

References mWorldPos.

00124                         {
00125                                 Vector3 distance;
00126                                 distance = state.mWorldPos - mWorldPos;
00127                                 return distance.length ();
00128                         }

LevelNode* ASR::Level::LevelNode::getNeighbour ( int  index  )  const [inline]

Definition at line 110 of file Level.h.

References mNeighbours, and mNumNeighbours.

Referenced by ASR::Level::getClosestNode().

00111                         {
00112                                 assert ( index < mNumNeighbours );
00113                                 return mNeighbours[index];
00114                         }

int ASR::Level::LevelNode::getNumNeighbours (  )  const [inline]

Definition at line 104 of file Level.h.

References mNumNeighbours.

Referenced by ASR::Level::getClosestNode().

00105                         {
00106                                 return mNumNeighbours;
00107                         }

float ASR::Level::LevelNode::getTraversalCost (  )  const [inline]

Definition at line 117 of file Level.h.

References mTraversalCost.

Referenced by ASR::Level::getClosestNode().

00118                         {
00119                                 return mTraversalCost;
00120                         }

Vector3 ASR::Level::LevelNode::getWorldPosition (  )  [inline]

Definition at line 132 of file Level.h.

References mWorldPos.

00133                         {
00134                                 return mWorldPos;
00135                         }

bool ASR::Level::LevelNode::isNode ( const LevelNode rhs  )  const [inline]

Definition at line 148 of file Level.h.

References operator==().

00149                         {
00150                                 return operator== ( rhs );
00151                         }

bool ASR::Level::LevelNode::operator== ( const LevelNode rhs  )  const [inline]

Definition at line 138 of file Level.h.

References mId, and mWorldPos.

Referenced by isNode().

00139                         {
00140                                 return mId == rhs.mId;
00141 
00142                                 Vector3 distance = mWorldPos - rhs.mWorldPos;
00143                                 return distance.isZeroLength ();
00144                         }

void ASR::Level::LevelNode::setTraversalCost ( float  cost  )  [inline]

Definition at line 95 of file Level.h.

References mTraversalCost.

00096                         {
00097                                 mTraversalCost = cost;
00098                         }


Friends And Related Function Documentation

friend class Level [friend]

Definition at line 64 of file Level.h.


Member Data Documentation

bool ASR::Level::LevelNode::mChecked [private]

Definition at line 77 of file Level.h.

Referenced by ASR::Level::getClosestNode().

unsigned int ASR::Level::LevelNode::mId [private]

Definition at line 71 of file Level.h.

Referenced by operator==().

LevelNode* ASR::Level::LevelNode::mNeighbours[8] [private]

Definition at line 80 of file Level.h.

Referenced by getNeighbour(), and LevelNode().

int ASR::Level::LevelNode::mNumNeighbours [private]

Definition at line 79 of file Level.h.

Referenced by getNeighbour(), and getNumNeighbours().

float ASR::Level::LevelNode::mTraversalCost [private]

Definition at line 70 of file Level.h.

Referenced by getTraversalCost(), and setTraversalCost().

Vector3 ASR::Level::LevelNode::mWorldPos [private]

Definition at line 69 of file Level.h.

Referenced by getEstimatedCostToState(), getWorldPosition(), and operator==().


The documentation for this class was generated from the following file:
Generated on Sun Jun 25 19:23:44 2006 for Valors End by  doxygen 1.4.7