Commit Graph

214 Commits (9e168fd9ccc4912893ea886dd6e39d4db393c364)

Author SHA1 Message Date
elsid 09f9075842
Use RecastMeshBuilder once to create RecastMesh
This allows to move all data out of the object instead of copying.
4 years ago
elsid 0193c95b26
Shrink to fit recast mesh data 4 years ago
elsid 94e460ba1e
Use proper check for distance
To avoid invalid results for r < 1.
4 years ago
elsid a54c4bc2e9
Check dtNavMeshQuery::findStraightPath status 4 years ago
elsid 793c30ab8d
Check dtNavMeshQuery::getPolyHeight status
Otherwise when it fails a node with zero height will be added to a path.
4 years ago
elsid 7e1630a7ad
Remove redundant getPolyHeight wrapper 4 years ago
elsid cc08a45c31
Move include where it is needed 4 years ago
elsid a3942a1e0a
Remove redundant check for y coordinate in inRange function 4 years ago
Petr Mikheev 4b98d460da Merge branch 'const_moar' into 'master'
Sprinkle some const ref

See merge request OpenMW/openmw!963
4 years ago
psi29a 67f32263b2 Merge branch 'fix_malexa_escape' into 'master'
Inscribe physical bounding box into navmesh agent cylinder (#6114)

Closes #6114

See merge request OpenMW/openmw!967
4 years ago
elsid 1552e7e3e3
Add pathgrid edges as one direction off mesh connection 4 years ago
elsid ff1af5e8ec
Use only off mesh connections starting or ending in a given tile 4 years ago
elsid a8ba9a0e2a
Cleanup unused tile positions from OffMeshConnectionsManager 4 years ago
elsid 81e569c3d9
Move OffMeshConnectionsManager implementation into cpp 4 years ago
elsid 7f65a2c4c2
Remove unused code 4 years ago
elsid 3e98db8d60
Fix styleguide 4 years ago
elsid 84d6dea277
Inscribe physical bounding box into navmesh agent cylinder
To disallow too narrow navmesh for a bounding box.
4 years ago
jvoisin 9db7d0278a Sprinkle some const ref 4 years ago
jvoisin 1123dc46ee Add a ton of const refs 4 years ago
elsid 4a6961b365
Trigger navmesh update on moved player only when player tile has been changed 4 years ago
elsid ed91cf9397
Replace unordered_map by map for storing objects
For small amount of items it gives better performance for find by key
for update.
4 years ago
elsid 22c2f106b7
Store object tiles position as sorted vector instead of set 4 years ago
elsid f4f9fa4701
Limit oscillating recast mesh object AABB by tile bounds
AABB change outside recast mesh tile should not affect navmesh for this tile.
4 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 a73ffc25c3
Add missing synchronization for present tiles modification
insert/erase can be done from multiple threads simultaneously. mMutex is
already used to synchronize reads so use it for writes too.
4 years ago
psi29a f1f1703441 Merge branch 'fix_navmesh_wait' into 'master'
Fix redundant waiting until navmesh is generated

See merge request OpenMW/openmw!861
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
elsid d0ea9c482a
Reorder async navmesh updater jobs when player tile changes
When player tile changes distance to player that is part of jobs priority is
invalidated. So jobs are no longer in the right order. This can lead to
processing of farests tiles first.

Sort queue each time player tile is changed.
4 years ago
jvoisin 28d5e5e8be Remove some superfluous includes in components/detournavigator 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 7a51d0db18
Wait until navmesh is generated within given distance around player
Add a setting to change this distance.

To prevent situations when there is not enough navmesh generated and actors
can't find path correctly.
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 865ef56a09
Replace include by RecastMesh forward declaration
To reduce dependency between navigator interface and implementation.
4 years ago
elsid ec87b3f8f7
Remove redundant ChunkyTriMesh
This AABB tree required when need to filter out input mesh that has not
influence navmesh tile output. This filtering is already done before. Each
recast mesh corresponds to a single navmesh tile and has appropriate bounds.
4 years ago
elsid bce06df254
Add missing array header 4 years ago
elsid 22aebcea74
Remove useless rcMarkWalkableTriangles call
It fills areas.data with walkable triangles but right after it's overwritten
and rcClearUnwalkableTriangles is called instead that fills areas.data with
unwalkable triangles.
4 years ago
jvoisin d4d111a709 Don't use std::move on const 4 years ago
Roman Siromakha 68ddde84fe
Merge pull request #3074 from akortunov/warnfix
Declare separate constructors with const reference and rvalue arguments for OscillatingRecastMeshObject
4 years ago
psi29a 16bb3919d1 Merge branch 'navmesh_cache_simplification' into 'master'
Simplify navmesh cache

See merge request OpenMW/openmw!691
4 years ago
Andrei Kortunov 0bc0cfce5f Declare separate constructors with const reference and rvalue arguments for OscillatingRecastMeshObject 4 years ago
elsid 3e67f5ffa5
Detect and ignore updates for oscillating objects
To avoid triggering NavMesh update when RecastMesh change should not change
NavMesh.

Based on the following assumption:
Given a set of transformations and a bounding shape for all these
tranformations, a new object transformation that does not change this
bounding shape also should not change navmesh if for all of this object
transformations resulting navmesh tiles are equivalent

The idea is to report back to RecastMeshManager all changes of NavMesh if there
are any assiciated with RecastMesh version. So we know the last time when
RecastMesh change resulted into the NavMesh change. When later report shows
that there was no NavMesh change for a new RecastMesh version we can assume
that any object transformation within the same bounding box should not change
NavMesh.
4 years ago
elsid 64fb700ae9
Remove unnecessary relation between updateCompoundObject and RecastMeshObject 4 years ago
elsid 629cedb6d0
Do not track last build revision in RecastMeshManger
mLastBuildRevision == mRevision with current use cases does not happen. But
even if this will happen when another use case will be added it does not save
much computation. The most expensive operation is not adding objects to the
MeshBuilder but to optimize resulting navmesh that will happen anyway in
MeshBuilder::create call.
4 years ago
elsid 62f32f4543
Do not replace equivalent navmesh tiles 4 years ago
elsid ab8d1c02d4
Set idle priority for navmesh generation thread
Support Linux, Windows, FreeBSD.
4 years ago
elsid 0c6d72b2d1
Consider first set element as first acquired 4 years ago
elsid f2ebad5115
Return cached element when set existing 4 years ago
elsid 05d6f6ac25
Use single map for navmesh cache 4 years ago
elsid b9a40bc5fc
Add NavMeshTilesCache benchmarks 4 years ago