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

Method AddTile

Source/Engine/Navigation/NavMeshRuntime.cpp:420–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420void NavMeshRuntime::AddTile(NavMesh* navMesh, NavMeshTileData& tileData)
421{
422 ASSERT(navMesh);
423 auto& data = navMesh->Data;
424 PROFILE_CPU_NAMED("NavMeshRuntime.AddTile");
425 PROFILE_MEM(NavigationMesh);
426 ScopeLock lock(Locker);
427
428 // Validate data (must match navmesh) or init navmesh to match the tiles options
429 if (_navMesh)
430 {
431 if (Math::NotNearEqual(data.TileSize, _tileSize))
432 {
433 LOG(Warning, "Cannot add navigation scene tile to the navmesh {2}. Navmesh tile size: {0}, input tile size: {1}", _tileSize, data.TileSize, Properties.Name);
434 return;
435 }
436 }
437 else
438 {
439 _tileSize = data.TileSize;
440 }
441
442 // Ensure to have space for new tile
443 EnsureCapacity(1);
444
445 // Add new tile
446 AddTileInternal(navMesh, tileData);
447}
448
449bool IsTileFromScene(const NavMeshRuntime* navMesh, const NavMeshTile& tile, void* customData)
450{

Callers 1

GenerateTileFunction · 0.80

Calls 2

EnsureCapacityFunction · 0.85
NotNearEqualFunction · 0.50

Tested by

no test coverage detected