68 return (
unsigned int)(node - m_nodes)+1;
74 return &m_nodes[idx-1];
80 return &m_nodes[idx-1];
85 return sizeof(*this) +
86 sizeof(
dtNode)*m_maxNodes +
103 const int m_maxNodes;
104 const int m_hashSize;
127 dtNode* result = m_heap[0];
129 trickleDown(0, m_heap[m_size]);
136 bubbleUp(m_size-1, node);
141 for (
int i = 0; i < m_size; ++i)
143 if (m_heap[i] == node)
151 inline bool empty()
const {
return m_size == 0; }
155 return sizeof(*this) +
156 sizeof(
dtNode*)*(m_capacity+1);
162 void bubbleUp(
int i,
dtNode* node);
163 void trickleDown(
int i,
dtNode* node);
166 const int m_capacity;
171 #endif // DETOURNODE_H
bool empty() const
Definition: DetourNode.h:151
unsigned int dtPolyRef
A handle to a polygon within a navigation mesh tile.
Definition: DetourNavMesh.h:44
void clear()
Definition: DetourNode.h:115
Definition: DetourNode.h:35
~dtNodeQueue()
Definition: DetourNode.cpp:165
float pos[3]
Position of the node.
Definition: DetourNode.h:37
Definition: DetourNode.h:26
int getMemUsed() const
Definition: DetourNode.h:153
unsigned int getNodeIdx(const dtNode *node) const
Definition: DetourNode.h:65
Definition: DetourNode.h:108
dtNodeQueue(int n)
Definition: DetourNode.cpp:154
dtNode * pop()
Definition: DetourNode.h:125
int getCapacity() const
Definition: DetourNode.h:159
unsigned int findNodes(dtPolyRef id, dtNode **nodes, const int maxNodes)
Definition: DetourNode.cpp:87
const dtNode * getNodeAtIdx(unsigned int idx) const
Definition: DetourNode.h:77
unsigned int flags
Node flags. A combination of dtNodeFlags.
Definition: DetourNode.h:42
dtNode * findNode(dtPolyRef id, unsigned char state)
Definition: DetourNode.cpp:106
void operator=(dtNodeQueue &)
Definition: DetourNode.h:113
dtPolyRef id
Polygon ref the node corresponds to.
Definition: DetourNode.h:43
int getHashSize() const
Definition: DetourNode.h:93
dtNodeFlags
Definition: DetourNode.h:24
dtNodePool(int maxNodes, int hashSize)
Definition: DetourNode.cpp:51
Definition: DetourNode.h:28
void operator=(const dtNodePool &)
Definition: DetourNode.h:56
~dtNodePool()
Definition: DetourNode.cpp:74
unsigned int pidx
Index to parent node.
Definition: DetourNode.h:40
int getMaxNodes() const
Definition: DetourNode.h:91
int getNodeCount() const
Definition: DetourNode.h:96
dtNodeIndex getNext(int i) const
Definition: DetourNode.h:95
dtNode * getNodeAtIdx(unsigned int idx)
Definition: DetourNode.h:71
static const dtNodeIndex DT_NULL_IDX
Definition: DetourNode.h:33
Definition: DetourNode.h:27
Definition: DetourNode.h:51
dtNode * getNode(dtPolyRef id, unsigned char state=0)
Definition: DetourNode.cpp:119
dtNodeIndex getFirst(int bucket) const
Definition: DetourNode.h:94
dtNode * top()
Definition: DetourNode.h:120
static const int DT_MAX_STATES_PER_NODE
Definition: DetourNode.h:47
float cost
Cost from previous node to current node.
Definition: DetourNode.h:38
void modify(dtNode *node)
Definition: DetourNode.h:139
float total
Cost up to the node.
Definition: DetourNode.h:39
void clear()
Definition: DetourNode.cpp:81
unsigned short dtNodeIndex
Definition: DetourNode.h:32
Definition: DetourNode.h:29
int getMemUsed() const
Definition: DetourNode.h:83
unsigned int state
extra state information. A polyRef can have multiple nodes with different extra info. see DT_MAX_STATES_PER_NODE
Definition: DetourNode.h:41
void push(dtNode *node)
Definition: DetourNode.h:133