Commit Graph

35 Commits (master)

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 7a7c20d49e
Define single UpdateGuard type in a separate file 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 1ef1de974d script blacklist => RefId
Applies changes from review

Fixed clang format

Clang format + review.
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
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 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 7dcb219ecf
Add raw heightfield data to navigator 3 years ago
elsid 8571c317d8
Add raw water data to navigator 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 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 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 bc67669a97
Comment unused argument 4 years ago
Bret Curtis 5a824d0333 components/compiler cleanup; also cleaned up related cascading warnings; fixed up final/override issues 4 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 4624f31788
Report navigator stats 6 years ago
elsid 8d2af94b75
Use default objects for NavigatorStub methods result 6 years ago
elsid 9626b6ec42
Add option to disable DetourNavigator component to find paths 6 years ago