| 261 | } |
| 262 | |
| 263 | void duDebugDrawNavMeshNodes(struct duDebugDraw* dd, const dtNavMeshQuery& query) |
| 264 | { |
| 265 | if (!dd) return; |
| 266 | |
| 267 | const dtNodePool* pool = query.getNodePool(); |
| 268 | if (pool) |
| 269 | { |
| 270 | const float off = 0.5f; |
| 271 | dd->begin(DU_DRAW_POINTS, 4.0f); |
| 272 | for (int i = 0; i < pool->getHashSize(); ++i) |
| 273 | { |
| 274 | for (dtNodeIndex j = pool->getFirst(i); j != DT_NULL_IDX; j = pool->getNext(j)) |
| 275 | { |
| 276 | const dtNode* node = pool->getNodeAtIdx(j+1); |
| 277 | if (!node) continue; |
| 278 | dd->vertex(node->pos[0],node->pos[1]+off,node->pos[2], duRGBA(255,192,0,255)); |
| 279 | } |
| 280 | } |
| 281 | dd->end(); |
| 282 | |
| 283 | dd->begin(DU_DRAW_LINES, 2.0f); |
| 284 | for (int i = 0; i < pool->getHashSize(); ++i) |
| 285 | { |
| 286 | for (dtNodeIndex j = pool->getFirst(i); j != DT_NULL_IDX; j = pool->getNext(j)) |
| 287 | { |
| 288 | const dtNode* node = pool->getNodeAtIdx(j+1); |
| 289 | if (!node) continue; |
| 290 | if (!node->pidx) continue; |
| 291 | const dtNode* parent = pool->getNodeAtIdx(node->pidx); |
| 292 | if (!parent) continue; |
| 293 | dd->vertex(node->pos[0],node->pos[1]+off,node->pos[2], duRGBA(255,192,0,128)); |
| 294 | dd->vertex(parent->pos[0],parent->pos[1]+off,parent->pos[2], duRGBA(255,192,0,128)); |
| 295 | } |
| 296 | } |
| 297 | dd->end(); |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | |
| 302 | static void drawMeshTileBVTree(duDebugDraw* dd, const dtMeshTile* tile) |
nothing calls this directly
no test coverage detected