Commit Graph

29 Commits (63b8e636f391e80388a7d7a5077c16cf9847fd64)

Author SHA1 Message Date
elsid 9854d42d56
Use ESM::RefId for worldspace type 7 months ago
elsid 180dd7dc64
Log worldspace in RecastContext 2 years ago
elsid 28f7a89530
Reuse dtNavMeshQuery
To avoid redundant allocations.
2 years ago
elsid cf1d8544e3
Check agent bounds on adding agent to navigator
Do not add agent bounds which are not supported by recastnavigation with given
settings and log such events.

To avoid reaching navmesh tile generation to find out it can't be generated for
such agent bounds.
2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
elsid b1fb42a28c
Cleanup detournavigator includes 2 years ago
elsid 1a12c453d6
Support different agent collision shape type for pathfinding
Actors may have different collision shapes. Currently there are axis-aligned
bounding boxes and rotating bounding boxes. With AABB it's required to use
bounding cylinder for navmesh agent to avoid providing paths where actor can't
pass. But for rotating bounding boxes cylinder with diameter equal to the front
face width should be used to not reduce of available paths. For example rats
have rotating bounding box as collision shape because of the difference between
front and side faces width.

* Add agent bounds to navmesh tile db cache key. This is required to distinguish
  tiles for agents with different bounds.
* Increase navmesh version because navmesh tile db cache key and data has changed.
* Move navmesh version to the code to avoid misconfiguration by users.
* Fix all places where wrong half extents were used for pathfinding.
3 years ago
elsid 96eb8d7be9
Write generated navmesh to navmeshdb
Perform all request to db in a single thread to avoid blocking navmesh
generator threads due to slow write operations.

Write to db navmesh for all changes except update as it done for memory cache.

Batch multiple db operations into a single transaction to speed up writing by
not executing fsync after each insert/update query. All reads are performed in
the same transaction so they see uncommited data.
3 years ago
elsid c9b8ba7b46
Read navmesh tile data from database
When tile is not found in memory cache try to find it in the database.
3 years ago
elsid 953a4c5550
Add a binary to generate navmesh from content files
Load content files based on the engine config files. Generate navmesh per cell
for all cells and store into SQLite database.
3 years ago
elsid 01c712d5f1
Split navigator settings into subtypes
Mostly to distinguish settings that affect properties of the generated navmesh.
3 years ago
elsid 86e6d3dac8
Do not cache navmesh when only object transformation is changed
This saves cache capacity when a scene contains objects contantly transforming
by scripts and causing changes in navmesh. The probability to get cache hit for
such states is almost zero because even a constant change in a single float
value may give up to 2^32 different states.
3 years ago
elsid beeb882ea8
Do not use off mesh connections as a part of navmesh cache key
To reduce cache size and make it more flexible.

Adding off mesh connections to the navmesh is the last step of navmesh
generation and it's very fast comparing to other steps (microseconds vs
milliseconds). Having less cache size makes get and set operations almost 2x
times faster that also have an order of microseconds. So in total there is
no performance impact.
4 years ago
jvoisin 28d5e5e8be Remove some superfluous includes in components/detournavigator 4 years ago
elsid 614d5243c3
Make NavMeshCacheItem consistent
Move all logic related to this type into its methods.
6 years ago
elsid ff47df4f2c
Repost navmesh update jobs when failed because of out of memory
DT_OUT_OF_MEMORY error is returned when limit of tiles is reached.
6 years ago
elsid 0c16fef285
Add navmesh update status builder 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 cf4066751c
Add classes to encapsulate value guarded by mutex 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 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 c26773bd29
Log update NavMesh status 6 years ago
elsid dd5f4498f6
Increment NavMesh revision on remove or add tile 6 years ago
elsid ed3a255f65
Do not use NavMesh to find changed tiles 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