Commit Graph

68 Commits (63b8e636f391e80388a7d7a5077c16cf9847fd64)

Author SHA1 Message Date
elsid 45d62ee59f
Limit RecastMeshManager range by active cell grid 7 months ago
elsid 49db37ee29
Merge setWorldspace and updateBounds 7 months ago
elsid 9854d42d56
Use ESM::RefId for worldspace type 7 months ago
elsid ee2cc8aeb7
Fix build with MSVC 19.38
components\detournavigator\navigator.hpp(44): error C3861: 'assert': identifier not found
10 months ago
elsid 7a7c20d49e
Define single UpdateGuard type in a separate file 2 years ago
elsid 996153f78d
Convert RefId to class 2 years ago
florent.teppe 63e44eddc9 Navigator doesn't use RefId anymore 2 years ago
florent.teppe 150e2ba885 Revert "Use ESM::RefId for worldspace in detournavigator"
This reverts commit b4ab153418.

# Conflicts:
#	apps/navmeshtool/worldspacedata.cpp
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
elsid b4ab153418
Use ESM::RefId for worldspace in detournavigator 2 years ago
florent.teppe 2c30575b3b CellName is now a RefId, makes more sense that way. 2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
elsid 22ee592dd3
Lock TileCachedRecastMeshManager once per changing a cell
To save time on locking mutex and prevent AsyncNavMeshUpdater to use RecastMesh
for a tile in the middle of objects loading.
2 years ago
elsid c15848932b
Separate reading navigator stats and reporting 2 years ago
elsid e1bed86d7e
Do single navigator update per frame
Primarily for crossing cell border case. Each Navigator::update call has a cost.
Doing it multiple times per frame increased frame duration on cell loading.

Call Navigator::wait only when cell has changed but do not use
Scene::hasCellChanged because it doesn't always indicates it.
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 05b54cbfb8
Cull navmesh objects by scene bounds
If object is too big iteration over all tiles covering it can take too much
time. Limit bounds to a square around a player position to cover only tiles
that will be present in navmesh based on max tiles number option.

Each object is associated with a set of tiles its present in. Culling can
reduce this set but it has to be update when bounds change position. Do this
in TileCachedRecastMeshManager::setBounds updating the set and adding/removing
objects to the corresponding CachedRecastMeshManagers.
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 5a6b39f8e0
Store mesh source data in recast mesh 3 years ago
elsid 7dcb219ecf
Add raw heightfield data to navigator 3 years ago
elsid 8571c317d8
Add raw water data to navigator 3 years ago
elsid 9f808fbe3a
Move findPath-like navigator functions into a separate header 3 years ago
elsid 5e99454cc4
Add factory functions to create navigator implementations 3 years ago
elsid 0c8a811ad5
Render only cached recast mesh
To avoid waiting while recast mesh is generating.

Remove redundant continue.
3 years ago
elsid fea4fb6e69
Make AiPursue path destination to be as close as possible to target
Even when target is not reachable actor will try to run there either because
target navmesh polygon is selected within extended area or because partial path
is built to the closest possible polygon.
3 years ago
elsid c8987bda2f
Store reference to BulletShapeInstance for btCollisionShape
To keep btCollisionShape lifetime.
3 years ago
elsid 4574e5f565
Remove redundant Navigator API functions 3 years ago
elsid 9a5ec5fd03
Store heightfields as array of heights instead of triangles
To reduce size of RecastMesh and therefore cache size.
3 years ago
elsid 753767d6d9
Store only water shift
Rotation is not used.
3 years ago
elsid 4a6961b365
Trigger navmesh update on moved player only when player tile has been changed 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 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 39c0ce9ddf
Build limited path for far destinations
When distance between start and end point is greater than max radius of area
possibly covered by navmesh there is no way to find path via navmesh. Also if
distance is greater than cell size navmesh might not exists withing mentioned
area because cell is not loaded therefore navmesh is not generated. So minumum
of these values is used to limit max path distance. Assuming that path
actually exists it's possible to build path to the edge of a circle. When
actor reaches initial edge path is built further. However it will not be
optimal.
4 years ago
elsid 8dba61f7ae
Use navmesh raycast to find reachable position around target 4 years ago
Bret Curtis 62b0781f7d use std::optional instead of boost::optional 4 years ago
psi29a 0dc7715c35 Merge branch 'object_paging_retry' into 'master'
Object Paging

See merge request OpenMW/openmw!209
5 years ago
elsid b095ca6c86
Use actor speed to define area cost for pathfinding 5 years ago
bzzt lost a hitlab login c1ebd9474b stop navmesh updates when ai off
Signed-off-by: Bret Curtis <psi29a@gmail.com>
5 years ago
elsid c4cd3b2c4f
Add pathgrid to navmesh as off mesh connection 5 years ago
elsid 7ae7cb181d
Support recast mesh rendering 5 years ago
elsid 349040ffb2
Use status codes to handle navigator errors instead of exceptions
For find path use case.
5 years ago
elsid f7caeefddb
Fallback to straight path when navmesh and pathgrind are not available 5 years ago
elsid 1e106013a0
Use navmesh to find wander destination outside pathgrid for ground based actors
Use dtNavMeshQuery::findRandomPointAroundCircle from recastnavigation
5 years ago
elsid 4624f31788
Report navigator stats 6 years ago
Bret Curtis cb1a5f3679
Merge pull request #2245 from elsid/navigator_refactor
Refactor navigator related code
6 years ago
elsid 8d2af94b75
Use default objects for NavigatorStub methods result 6 years ago
elsid 614d5243c3
Make NavMeshCacheItem consistent
Move all logic related to this type into its methods.
6 years ago