Corresponding recast mesh tiles can be updated but navmesh tiles may never
appear for them. Report back zero navmesh version to allow oscillating recast
objects detection to work. This version is always less than any generated
navmesh tile version so any report for generated navmesh will override it.
If zero navmesh version is reported after recast mesh tile got report about
generated navmesh tile it is a no-op since generated version is always greater
than zero.
Add special loading progress bar.
It should be fast enough to not keep loading screen for noticably long but
will provide better pathfinding for actors inside interior cells.
When there is only one actor (player) on a scene and it moving to other
cell first it will be removed from navigator then added. Remove cause
navmesh removing for its half extents. After it is added navmesh for
same half extents is created and added. While this all happens there are
still jobs for old navmesh are processing. Old navmesh still exists
because it is stored by shared pointer. So jobs take tiles from cache
and place them into old navmesh. After that other jobs take same tiles
from cache (half extents and coordinates are equal) and place them into
other navmesh. dtNavMesh changes tile data on add and remove. Adding tile
to two dtNavMesh corrupts tile in both nameshes.
Every updated object should produce a set of changed tiles where it is
placed. Before this change only current object tiles were updated. If
object was moved to another set of tiles then navmesh were not changed
in new tiles.
TileCachedRecastMeshManager::updateObject should add all new tiles if object
was moved and remove all no more used tiles. Both new and old tiles should be
marked as changed.
Also add tests to show desired result for add, update, remove.
Use LRU modification to hold currently used items. Use RecastMesh binary
data for item key.
Store original pointer of btCollisionShape in user pointer to make available
it as an identifier within all duplicates. Use pointer to heights data array
for btHeightfieldTerrainShape.
When player move fast enough, tiles update for specific area square
couldn't catch player move. Tiles to be removed are left in the queue
with lower priority then tiles to be added which are nearest to player.
This can lead to overflow for amount of tiles. So we try to do remove
first. But we detect change type approximately using mixed change type,
because even if we do it precise, change type could change while job
is in queue.