Commit Graph

40 Commits (88ec8a95231341e7962b85716510d414e9f0c424)

Author SHA1 Message Date
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
elsid 6ae15f08e0
Avoid chained operator() calls to prevent formatting issues 2 years ago
Project579 a13709c510 Replace implicit convertions from std::filesystem::path to std::string with correctly converting functions. 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 e2d566b89d
Store changed tiles in TileCachedRecastMeshManager 2 years ago
elsid 948e2f5db9
Do not use collision shapes with visual only collision to generate navmesh
These collision shapes are not used for actors movement physics simulation.
2 years ago
elsid b1fb42a28c
Cleanup detournavigator includes 2 years ago
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2 years ago
elsid 8b8e4f78b6
Support cylinder and rotating box collision shape types for actors
Cylinder collision shape should give the best consistency between physics
simulation and pathfinding. Rotating box is already used by some actors, so
add it to have the same collision shape type for all actors.
2 years ago
elsid 7e6c13630a Use target_precompile_headers for the most expensive headers 3 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
uramer fd7965d77f Use correctMeshPath instead of string constants 3 years ago
ζeh Matt d5ec959449
Create platform component for platform specific things 3 years ago
psi29a c7449dc272 Merge branch 'bullet_includes' into 'master'
Clean up bullet includes

See merge request OpenMW/openmw!1974
3 years ago
jvoisin 72a6d1f69f Clean up bullet includes 3 years ago
elsid 3affe9913f
Limit the number of simultaneously open not actively used content files
Use LRU cache for ESMReaders. When cache capacity is reached close least
recently used ESMReader. Remember the file name if a reader was open. Once the
reader requested again open the file if there is stored name for it. Put
released ESMReader to the back of the free items list. Close ESMReader's from
the front of the free items list.

Cached item can be used only by one client at the same time. If the same item is
requested twice exception is thrown. This should never happen in practice. If
this happens need to fix the client logic.

It's allowed to go over the capacity limit when requesting different readers.
Ideally this should never happen but there will be system error anyway
signalizing about too many open files. Need to fix client logic in this case.

All places that were using a vector of ESMReaders now using the cache. Cache is
local for each use case and there is no need for a thread safety.
3 years ago
elsid 92a64b0bbd
Fix typo in navmeshtool log message 3 years ago
jvoisin 0554afeb67 Remove boost::filesystem from navmashtool 3 years ago
elsid 5b592e09e6
Log more information when navmeshtool fails on not enough space 3 years ago
Petr Mikheev c7ab67c2c1 Allow relative paths in openmw.cfg; support --replace=config. 3 years ago
elsid 2d5ccc804b
Exchange binary messages between navmeshtool and launcher 3 years ago
elsid 5b9dd10cbe
Limit max navmeshdb file size
Use "pragma max_page_count" to define max allowed file size in combination with
"pragma page_size" based on a new setting "max navmeshdb file size".

* Stop navmeshtool on the first db error.
* Disable writes to db in the engine on first "database or disk is full"
  SQLite3 error. There is no special error code for this error.
* Change default "write to navmeshdb" to true.
* Use time intervals for transaction duration instead of number of changes.
3 years ago
elsid 42d6032c8b
Support compilation with c++20 3 years ago
elsid ab1a6e034e
Add navmeshtool flag to remove unused tiles from navmesh disk cache
* Remove tiles outside processing range. Useful when new content profile map
  has different bounds.
* Remove ignored tiles. For a case when content profile maps have intersection
  but there is no more data for navmesh.
* Remove older tiles at the same worldspace position. If navmesh tile data has
  changed with new content, the old ones unlikely to be used.
* Vacuum the database when there are modifications. SQLite leaves empty pages
  in the file on database modification. Vacuum cleans up unused pages reducing
  the file size.
3 years ago
elsid 67741402b5
Replace reference to const std::string by std::string_view for navmeshdb related arguments 3 years ago
elsid 2e38f0b641
Fix btAABB initialization 3 years ago
psi29a becffef142 Merge branch 'cull_navmesh_objects' into 'master'
Cull navmesh objects by scene bounds (#5858)

Closes #5858

See merge request OpenMW/openmw!1625
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 1b2954f2db
Remove unused z coordinate 3 years ago
Petr Mikheev a453e5c198 Reuse the same code to load settings in apps/openmw, apps/launcher, apps/opencs 3 years ago
Petr Mikheev 5ca56a4f8a New option "config" for specifying additional config directories. 3 years ago
psi29a 6f7a067e0c Merge branch 'esmrename' into 'master'
esm refactor work

See merge request OpenMW/openmw!1575
3 years ago
elsid ecc654a369 Limit and filter navmesh input (#5858) 3 years ago
Bret Curtis 74e7cfc023 remove unused includes: part1
remove unused imports: part2

revert one tidy we will keep for c++20
3 years ago
Bret Curtis d1fb854521 move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo

esm typo
3 years ago
elsid ba281a0da0 Fix coverity issues 3 years ago
elsid b0c2317d34
Fix build on ubuntu 18.04
/<<BUILDDIR>>/openmw-0.47.0+git202112160802~ubuntu18.04.1/apps/navmeshtool/worldspacedata.cpp:213:109: error: class template argument deduction failed:
             heightfields.emplace_back(std::vector(std::begin(landData.mHeights), std::end(landData.mHeights)));
                                                                                                             ^
/<<BUILDDIR>>/openmw-0.47.0+git202112160802~ubuntu18.04.1/apps/navmeshtool/worldspacedata.cpp:213:109: error: no matching function for call to ‘vector(float*, float*)’
In file included from /usr/include/c++/7/vector:64:0,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202112160802~ubuntu18.04.1/components/esm/loadpgrd.hpp:5,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202112160802~ubuntu18.04.1/components/misc/convert.hpp:5,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202112160802~ubuntu18.04.1/components/bullethelpers/collisionobject.hpp:4,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202112160802~ubuntu18.04.1/apps/navmeshtool/worldspacedata.hpp:4,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202112160802~ubuntu18.04.1/apps/navmeshtool/worldspacedata.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:411:2: note: candidate: template<class _Tp, class _Alloc, class _InputIterator, class> vector(_InputIterator, _InputIterator, const _Alloc&)-> std::vector<_Tp, _Alloc>
  vector(_InputIterator __first, _InputIterator __last,
  ^~~~~~
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