65 return (
unsigned int)(node - m_nodes) + 1;
71 return &m_nodes[idx - 1];
77 return &m_nodes[idx - 1];
82 return sizeof(*this) +
83 sizeof(
dtNode)*m_maxNodes +
103 const int m_maxNodes;
104 const int m_hashSize;
120 dtNode* result = m_heap[0];
122 trickleDown(0, m_heap[m_size]);
129 bubbleUp(m_size-1, node);
134 for (
int i = 0; i < m_size; ++i)
136 if (m_heap[i] == node)
144 inline bool empty()
const {
return m_size == 0; }
148 return sizeof(*this) +
149 sizeof(
dtNode*) * (m_capacity + 1);
159 void bubbleUp(
int i,
dtNode* node);
160 void trickleDown(
int i,
dtNode* node);
163 const int m_capacity;
static const int DT_MAX_STATES_PER_NODE
Definition: DetourNode.h:47
dtNodeFlags
Definition: DetourNode.h:25
@ DT_NODE_OPEN
Definition: DetourNode.h:26
@ DT_NODE_CLOSED
Definition: DetourNode.h:27
@ DT_NODE_PARENT_DETACHED
Definition: DetourNode.h:28
static const int DT_NODE_STATE_BITS
Definition: DetourNode.h:35
static const dtNodeIndex DT_NULL_IDX
Definition: DetourNode.h:32
static const int DT_NODE_PARENT_BITS
Definition: DetourNode.h:34
unsigned short dtNodeIndex
Definition: DetourNode.h:31
Definition: DetourNode.h:50
int getMemUsed() const
Definition: DetourNode.h:80
dtNode * findNode(dtPolyRef id, unsigned char state)
Definition: DetourNode.cpp:108
void clear()
Definition: DetourNode.cpp:83
unsigned int getNodeIdx(const dtNode *node) const
Definition: DetourNode.h:62
int getNodeCount() const
Definition: DetourNode.h:93
dtNode * getNodeAtIdx(unsigned int idx)
Definition: DetourNode.h:68
unsigned int findNodes(dtPolyRef id, dtNode **nodes, const int maxNodes)
Definition: DetourNode.cpp:89
dtNodePool(int maxNodes, int hashSize)
Definition: DetourNode.cpp:51
dtNodeIndex getFirst(int bucket) const
Definition: DetourNode.h:91
int getHashSize() const
Definition: DetourNode.h:90
dtNode * getNode(dtPolyRef id, unsigned char state=0)
Definition: DetourNode.cpp:121
~dtNodePool()
Definition: DetourNode.cpp:76
int getMaxNodes() const
Definition: DetourNode.h:88
dtNodeIndex getNext(int i) const
Definition: DetourNode.h:92
const dtNode * getNodeAtIdx(unsigned int idx) const
Definition: DetourNode.h:74
Definition: DetourNode.h:109
int getMemUsed() const
Definition: DetourNode.h:146
bool empty() const
Definition: DetourNode.h:144
int getCapacity() const
Definition: DetourNode.h:152
dtNode * pop()
Definition: DetourNode.h:118
void push(dtNode *node)
Definition: DetourNode.h:126
~dtNodeQueue()
Definition: DetourNode.cpp:167
void modify(dtNode *node)
Definition: DetourNode.h:132
dtNodeQueue(int n)
Definition: DetourNode.cpp:156
void clear()
Definition: DetourNode.h:114
dtNode * top()
Definition: DetourNode.h:116
unsigned int dtPolyRef
A handle to a polygon within a navigation mesh tile.
Definition: DetourNavMesh.h:48
Definition: DetourNode.h:37
dtPolyRef id
Polygon ref the node corresponds to.
Definition: DetourNode.h:44
float cost
Cost from previous node to current node.
Definition: DetourNode.h:39
float pos[3]
Position of the node.
Definition: DetourNode.h:38
unsigned int state
extra state information. A polyRef can have multiple nodes with different extra info....
Definition: DetourNode.h:42
unsigned int flags
Node flags. A combination of dtNodeFlags.
Definition: DetourNode.h:43
float total
Cost up to the node.
Definition: DetourNode.h:40
unsigned int pidx
Index to parent node.
Definition: DetourNode.h:41