MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / getNode

Method getNode

Source/ThirdParty/recastnavigation/DetourNode.cpp:121–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121dtNode* dtNodePool::getNode(dtPolyRef id, unsigned char state)
122{
123 unsigned int bucket = dtHashRef(id) & (m_hashSize-1);
124 dtNodeIndex i = m_first[bucket];
125 dtNode* node = 0;
126 while (i != DT_NULL_IDX)
127 {
128 if (m_nodes[i].id == id && m_nodes[i].state == state)
129 return &m_nodes[i];
130 i = m_next[i];
131 }
132
133 if (m_nodeCount >= m_maxNodes)
134 return 0;
135
136 i = (dtNodeIndex)m_nodeCount;
137 m_nodeCount++;
138
139 // Init node
140 node = &m_nodes[i];
141 node->pidx = 0;
142 node->cost = 0;
143 node->total = 0;
144 node->id = id;
145 node->state = state;
146 node->flags = 0;
147
148 m_next[i] = m_first[bucket];
149 m_first[bucket] = i;
150
151 return node;
152}
153
154
155//////////////////////////////////////////////////////////////////////////////////////////

Callers 9

findPathMethod · 0.45
initSlicedFindPathMethod · 0.45
updateSlicedFindPathMethod · 0.45
moveAlongSurfaceMethod · 0.45
findPolysAroundCircleMethod · 0.45
findPolysAroundShapeMethod · 0.45
findDistanceToWallMethod · 0.45

Calls 1

dtHashRefFunction · 0.85

Tested by

no test coverage detected