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

Method RemoveTile

Source/Engine/Navigation/NavMeshRuntime.cpp:459–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void NavMeshRuntime::RemoveTile(int32 x, int32 y, int32 layer)
460{
461 ScopeLock lock(Locker);
462 if (!_navMesh)
463 return;
464 PROFILE_CPU_NAMED("NavMeshRuntime.RemoveTile");
465
466 const auto tileRef = _navMesh->getTileRefAt(x, y, layer);
467 if (tileRef == 0)
468 return;
469
470 if (dtStatusFailed(_navMesh->removeTile(tileRef, nullptr, nullptr)))
471 {
472 LOG(Warning, "Failed to remove tile ({1}x{2}, layer {3}) from navmesh {0}", Properties.Name, x, y, layer);
473 }
474
475 for (int32 i = 0; i < _tiles.Count(); i++)
476 {
477 auto& tile = _tiles[i];
478 if (tile.X == x && tile.Y == y && tile.Layer == layer)
479 {
480 _tiles.RemoveAt(i);
481 break;
482 }
483 }
484}
485
486void NavMeshRuntime::RemoveTiles(bool (*prediction)(const NavMeshRuntime* navMesh, const NavMeshTile& tile, void* customData), void* userData)
487{

Callers 1

RemoveTileFunction · 0.80

Calls 5

dtStatusFailedFunction · 0.85
getTileRefAtMethod · 0.80
removeTileMethod · 0.45
CountMethod · 0.45
RemoveAtMethod · 0.45

Tested by

no test coverage detected