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

Method AddTiles

Source/Engine/Navigation/NavMeshRuntime.cpp:386–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386void NavMeshRuntime::AddTiles(NavMesh* navMesh)
387{
388 ASSERT(navMesh);
389 if (navMesh->Data.Tiles.IsEmpty())
390 return;
391 auto& data = navMesh->Data;
392 PROFILE_CPU_NAMED("NavMeshRuntime.AddTiles");
393 PROFILE_MEM(NavigationMesh);
394 ScopeLock lock(Locker);
395
396 // Validate data (must match navmesh) or init navmesh to match the tiles options
397 if (_navMesh)
398 {
399 if (Math::NotNearEqual(data.TileSize, _tileSize))
400 {
401 LOG(Warning, "Cannot add navigation scene tiles to the navmesh {2}. Navmesh tile size: {0}, input tiles size: {1}", _tileSize, data.TileSize, Properties.Name);
402 return;
403 }
404 }
405 else
406 {
407 _tileSize = data.TileSize;
408 }
409
410 // Ensure to have space for new tiles
411 EnsureCapacity(data.Tiles.Count());
412
413 // Add new tiles
414 for (auto& tileData : data.Tiles)
415 {
416 AddTileInternal(navMesh, tileData);
417 }
418}
419
420void NavMeshRuntime::AddTile(NavMesh* navMesh, NavMeshTileData& tileData)
421{

Callers

nothing calls this directly

Calls 4

EnsureCapacityFunction · 0.85
NotNearEqualFunction · 0.50
IsEmptyMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected