Commit Graph

47 Commits (master)

Author SHA1 Message Date
elsid 08b026e907
Store copies of ref_ptr for btCollisionShape wrappers in Navigator
To keep btCollisionShape lifetime.
3 years ago
elsid d122e184cc
Report navmesh change for not posted tiles
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.
4 years ago
elsid 59f89d22f8
Apply min distance only for not present tiles
To avoid waiting when navmesh update is triggered by transformed object for
already present tiles.
4 years ago
psi29a fd89582e0c Merge branch 'navmesh_wait' into 'master'
Wait until navmesh is generated within given distance around player (#5500)

Closes #5500

See merge request OpenMW/openmw!819
4 years ago
Andrei Kortunov 8d4a374516 Add missing include for std::inserter 4 years ago
elsid f169f8e6f0
Wait until navmesh is generated for interior cells
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.
4 years ago
elsid c4cd3b2c4f
Add pathgrid to navmesh as off mesh connection 5 years ago
Bret Curtis b7f7aabd8b
Merge pull request #2806 from elsid/detournavigator_tests
Add detournavigator test for multiple worker threads
5 years ago
elsid 899a6b5aa3
Workaround for GCC 5 bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61636
5 years ago
elsid bd1ef4dd6d
Add detournavigator test for multiple worker threads 5 years ago
elsid df6e85b619
Use callback to handle changed tiles
Instead of collecting changed tiles into a temporary vector.
5 years ago
elsid 5168f2059f
Compare revisions by equality to support overflow 5 years ago
elsid 7ae7cb181d
Support recast mesh rendering 5 years ago
Andrei Kortunov 14b756a692 Use a generic logging system for RecastNavigation 6 years ago
Bret Curtis 45221418bd
Merge pull request #2260 from elsid/fix_clean_unused_navmeshes
Fix clean unused navmeshes
6 years ago
elsid 4624f31788
Report navigator stats 6 years ago
elsid 8adc83f6e2
Fix clean unused navmeshes
weak_ptr doesn't have constructor for shared_ptr&& type, so ptr wasn't
moved, just copied.
6 years ago
Bret Curtis cb1a5f3679
Merge pull request #2245 from elsid/navigator_refactor
Refactor navigator related code
6 years ago
elsid c05fc9e054
Add missing cleanup 6 years ago
elsid ce9aebcba1
Clear all changed tiles after post 6 years ago
elsid 614d5243c3
Make NavMeshCacheItem consistent
Move all logic related to this type into its methods.
6 years ago
elsid ccc709a316
Store guarded navmesh cache item in shared_ptr
Remove useless SharedGuarded type.
6 years ago
elsid 0479ebf5ae
Remove unused actors and navmeshes on update
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.
6 years ago
elsid f2e47d640d
Add option to limit max number of navmesh tiles 6 years ago
Andrei Kortunov 3032b177a1 Remove redundant includes 6 years ago
Bret Curtis 09262e0336
Merge pull request #2170 from elsid/disable_navigator_option
Add option to disable DetourNavigator component (feature #4833)
6 years ago
elsid da6df818ff
Fix update navmesh
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.
6 years ago
elsid 16675fd254
Return empty path when navmesh is not found for agent 6 years ago
elsid 41319eb2bf
Use new change type for update object
To perform jobs for updated animated objects and doors with lowest
priority.
6 years ago
elsid ed73d130f9
Cache navmesh tiles
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.
6 years ago
elsid 1a27489904
Add special type for object id 6 years ago
elsid ff478aba6d
Use actor half extent for interior cells 6 years ago
elsid 346e9e3141
Add off mesh connections for doors without teleport 6 years ago
elsid c95cea414c
Support water for NavMesh 6 years ago
elsid 72f211ef28
Add enums for area type and flags 6 years ago
elsid fa23b590a4
Add unwalkable areas to NavMesh 6 years ago
elsid c771986c56
Prioritise NavMesh jobs first to remove and last to add
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.
6 years ago
elsid 144e1a063b
Support animated objects 6 years ago
elsid 4aba0fa85f
Limit number of NavMesh tiles to add by distance from player tile 6 years ago
elsid d2fd9abd51
Split RecastMesh into tiles 6 years ago
elsid dbb1d99bff
Add NavMeshItem generation to fix update NavMesh for render 6 years ago
elsid ed3a255f65
Do not use NavMesh to find changed tiles 6 years ago
elsid 70a369f70e
Add command to enable NavMesh render
togglenavmesh or tnm
6 years ago
elsid dd5e6a61a3
Support btCompoundShape for RecastMesh 6 years ago
elsid d1d034a1ec
Update NavMesh one by one tile in order from nearest to player 6 years ago
elsid 430ba9d7a5
Build NavMesh tile data only for changed tiles 6 years ago
elsid fafba8ea0c
Use recastnavigation to find path 6 years ago