Commit Graph

436 Commits (96845081c03ed0bfd7effa86273ddb2ce74ece5b)

Author SHA1 Message Date
Brian Kelley ee41b94a73 Enable compilation on apple silicon 3 years ago
elsid 3b6184dcda
Add missing include
In file included from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.cpp:1:0:
/<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.hpp:93:48: error: field ‘mSettings’ has incomplete type ‘std::reference_wrapper<const DetourNavigator::Settings>’
         std::reference_wrapper<const Settings> mSettings;
                                                ^~~~~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/nested_exception.h:40,
                 from /usr/include/c++/7/exception:143,
                 from /usr/include/c++/7/ios:39,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/dtstatus.hpp:6,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.hpp:4,
                 from /<<BUILDDIR>>/openmw-0.47.0+git202111080927~ubuntu18.04.1/components/detournavigator/findsmoothpath.cpp:1:
/usr/include/c++/7/type_traits:2125:11: note: declaration of ‘class std::reference_wrapper<const DetourNavigator::Settings>’
     class reference_wrapper;
3 years ago
elsid 5972520b1a
Make sure areas size is 2 for rectangle 3 years ago
elsid 671e1e5424
Avoid copy when adding heightfield to vector 3 years ago
elsid 5f5163905a
Remove unused operator< for RecastMesh 3 years ago
elsid e0c4f08aa5
Remove redundant includes 3 years ago
psi29a 256ec4c752 Merge branch 'fix_tile_bounds' into 'master'
Fix tile bounds scaling

See merge request OpenMW/openmw!1353
3 years ago
psi29a 627f816348 Merge branch 'navigator_impl' into 'master'
Reduce the size of included code from detournavigator/ into the engine

See merge request OpenMW/openmw!1355
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 3f80725ebe
Remove duplicated implementation of Misc::Convert::toOsg 3 years ago
elsid 5db4898bec
Fix tile bounds scaling
OscillatingRecastMeshObject::update should be called with tile bounds in real
coordinates not in navmesh. But proper scaling was done only in
RecastMeshManager::getMesh and RecastMeshManager::updateObject used tile bounds
in navmesh coordinates.

Add a new function to create tile bounds with proper scaling and pass correct
value into RecastMeshManager constructor through CachedRecastMeshManager
constuctor from TileCachedRecastMeshManager member functions.
3 years ago
psi29a 523289c531 Merge branch 'refactor_bullet_shape' into 'master'
Refactor bullet shape

See merge request OpenMW/openmw!1333
3 years ago
elsid 9c5f8b8719
Store holder only in parent RecastMeshObject 3 years ago
elsid 8e71c246bf
Remove redundant BulletShape getters 3 years ago
psi29a 2765bcee5e Merge branch 'serialization' into 'master'
Add helpers for binary serialization

See merge request OpenMW/openmw!1319
3 years ago
Andrei Kortunov 0f3c0cb0a0 Fix argument types mismatch 3 years ago
Andrei Kortunov 107a9ecb17 Fix variables hiding 3 years ago
elsid a58f1a94e3
Add helpers for binary serialization
To construct serializer from given entities:
* Data source/destination - any value that has to be serialized/deserialized,
  usually already existing type.
* Format - functional object to define high level serialization logic to
  define specific format and data schema. Like order of fields, allocation.
* Visitor - functional object to define low level serialization logic to
  operator on given data part.
  * BinaryWriter - copies given value into provided buffer.
  * BinaryReader - copies value into given destination from provided buffer.
  * SizeAccumulator - calculates required buffer size for given data.
3 years ago
elsid 06ea47f74b
Fix crash in DetourNavigator::fixupCorridor
Handle situation when resulting path does not fit into destination vector.
3 years ago
elsid f6d1689bb9
Avoid redundant polygon path reallocations
Use separate variable to store size and make all operations in-place.
3 years ago
elsid 79665cea66
Avoid access to the path vector element out of range
polygonPath.front() in some cases might reference to a first element of empty
vector. Copy the value into a local variable to be able to access later.
3 years ago
elsid 6986feb81b
Initialize navigator max climb and max slope settings in makeSettingsFromSettingsManager
To avoid having multiple places to initialize them when they will be required
by multiple binaries.
3 years ago
psi29a f9124ccea6 Merge branch 'recast_mesh_slope' into 'master'
Use different colors for walkable and non-walkable recast mesh triangles

See merge request OpenMW/openmw!1277
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 88ac77df1f
Fix writing to file for RecastMesh
Add missing scaling and y, z coordinates swap.
3 years ago
Andrei Kortunov fc2076db1a
Fix MSVC warnings about local variables redeclaration (#3130) 3 years ago
jvoisin d4e3575f1d Don't use `const` for objects returned by value.
This prevents the usage of std::move semantics,
and makes clang-tidy sad.
3 years ago
psi29a e8057d9fd1 Merge branch 'aipursue_path' into 'master'
Make AiPursue path destination to be as close as possible to target (#6211)

Closes #6211

See merge request OpenMW/openmw!1154
3 years ago
elsid ee63ee9d93
Fix coverity warning
CID 332936 (#1 of 1): Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
integer_division: Dividing integer expressions size and 2, and then converting
the integer quotient to type float. Any remainder, or fractional part of the
quotient, is ignored.
3 years ago
elsid 0066c446f8
Remove navmesh tiles outside allowed range first
* Change job change type to remove when tile is outside allowed range.
* Swap try number and change type in job priority. To make sure remove jobs
  always processed before any other.
3 years ago
elsid 0f11acf709
Report more stats from AsyncNavMeshUpdater 3 years ago
elsid 431501e23a
Remove redundant job distribution between threads
Instead don't take jobs from queue until job for the same tile is processing.
3 years ago
elsid 277a1268c0
Avoid access to removed map item
To fix ASAN warning:
=11799==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c000436058 at pc 0x55c90acccaa8 bp 0x7f787eeac830 sp 0x7f787eeac820
READ of size 8 at 0x60c000436058 thread T18
    #0 0x55c90acccaa7 in std::operator==(std::_Deque_iterator<std::_List_iterator<DetourNavigator::Job>, std::_List_iterator<DetourNavigator::Job>&, std::_List_iterator<DetourNavigator::Job>*> const&, std::_Deque_iterator<std::_List_iterator<DetourNavigator::Job>, std::_List_iterator<DetourNavigator::Job>&, std::_List_iterator<DetourNavigator::Job>*> const&) /usr/include/c++/11.1.0/bits/stl_deque.h:269
    #1 0x55c90acccaa7 in std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > >::empty() const /usr/include/c++/11.1.0/bits/stl_deque.h:1311
    #2 0x55c90acccaa7 in operator() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:350
    #3 0x55c90acccaa7 in wait_until<std::chrono::_V2::steady_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> >, DetourNavigator::AsyncNavMeshUpdater::getNextJob()::<lambda()> > /usr/include/c++/11.1.0/condition_variable:151
    #4 0x55c90acccaa7 in wait_for<long int, std::ratio<1, 1000>, DetourNavigator::AsyncNavMeshUpdater::getNextJob()::<lambda()> > /usr/include/c++/11.1.0/condition_variable:175
    #5 0x55c90acccaa7 in DetourNavigator::AsyncNavMeshUpdater::getNextJob() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:353
    #6 0x55c90accdb2d in DetourNavigator::AsyncNavMeshUpdater::process() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:257
    #7 0x55c90acce464 in operator() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:98
    #8 0x55c90acce464 in __invoke_impl<void, DetourNavigator::AsyncNavMeshUpdater::AsyncNavMeshUpdater(const DetourNavigator::Settings&, DetourNavigator::TileCachedRecastMeshManager&, DetourNavigator::OffMeshConnectionsManager&)::<lambda()> > /usr/include/c++/11.1.0/bits/invoke.h:61
    #9 0x55c90acce464 in __invoke<DetourNavigator::AsyncNavMeshUpdater::AsyncNavMeshUpdater(const DetourNavigator::Settings&, DetourNavigator::TileCachedRecastMeshManager&, DetourNavigator::OffMeshConnectionsManager&)::<lambda()> > /usr/include/c++/11.1.0/bits/invoke.h:96
    #10 0x55c90acce464 in _M_invoke<0> /usr/include/c++/11.1.0/bits/std_thread.h:253
    #11 0x55c90acce464 in operator() /usr/include/c++/11.1.0/bits/std_thread.h:260
    #12 0x55c90acce464 in _M_run /usr/include/c++/11.1.0/bits/std_thread.h:211
    #13 0x7f78c38fd3c3 in execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82
    #14 0x7f78c36b1258 in start_thread (/usr/lib/libpthread.so.0+0x9258)
    #15 0x7f78c35da5e2 in __GI___clone (/usr/lib/libc.so.6+0xfe5e2)

0x60c000436058 is located 88 bytes inside of 120-byte region [0x60c000436000,0x60c000436078)
freed by thread T0 here:
    #0 0x7f78c688cd69 in operator delete(void*, unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:172
    #1 0x55c90acdbe20 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::deallocate(std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >*, unsigned long) /usr/include/c++/11.1.0/ext/new_allocator.h:139
    #2 0x55c90acdbe20 in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > > >::deallocate(std::allocator<std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >&, std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >*, unsigned long) /usr/include/c++/11.1.0/bits/alloc_traits.h:492
    #3 0x55c90acdbe20 in std::_Rb_tree<std:🧵:id, std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > >, std::_Select1st<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::_M_put_node(std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:565
    #4 0x55c90acdbe20 in std::_Rb_tree<std:🧵:id, std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > >, std::_Select1st<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::_M_drop_node(std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:632
    #5 0x55c90acdbe20 in std::_Rb_tree<std:🧵:id, std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > >, std::_Select1st<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::_M_erase(std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >*) /usr/include/c++/11.1.0/bits/stl_tree.h:1889
    #6 0x55c90acc0569 in std::_Rb_tree<std:🧵:id, std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > >, std::_Select1st<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::clear() /usr/include/c++/11.1.0/bits/stl_tree.h:1254
    #7 0x55c90acc0569 in std::map<std:🧵:id, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::clear() /usr/include/c++/11.1.0/bits/stl_map.h:1134
    #8 0x55c90acc0569 in DetourNavigator::AsyncNavMeshUpdater::~AsyncNavMeshUpdater() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:105
    #9 0x55c90acab2dc in DetourNavigator::NavigatorImpl::~NavigatorImpl() (/home/elsid/dev/openmw/build/gcc/asan/openmw+0x2d152dc)
    #10 0x55c9097db4b5 in std::default_delete<DetourNavigator::Navigator>::operator()(DetourNavigator::Navigator*) const /usr/include/c++/11.1.0/bits/unique_ptr.h:85
    #11 0x55c9097db4b5 in std::unique_ptr<DetourNavigator::Navigator, std::default_delete<DetourNavigator::Navigator> >::~unique_ptr() /usr/include/c++/11.1.0/bits/unique_ptr.h:361
    #12 0x55c9097db4b5 in MWWorld::World::~World() /home/elsid/dev/openmw/apps/openmw/mwworld/worldimp.cpp:534
    #13 0x55c9097dc3a4 in MWWorld::World::~World() /home/elsid/dev/openmw/apps/openmw/mwworld/worldimp.cpp:534
    #14 0x55c90a1925e4 in MWBase::Environment::cleanup() /home/elsid/dev/openmw/apps/openmw/mwbase/environment.cpp:192
    #15 0x55c90a1f544d in OMW::Engine::~Engine() /home/elsid/dev/openmw/apps/openmw/engine.cpp:434
    #16 0x55c90a1f6700 in OMW::Engine::~Engine() /home/elsid/dev/openmw/apps/openmw/engine.cpp:455
    #17 0x55c90a19d523 in std::default_delete<OMW::Engine>::operator()(OMW::Engine*) const /usr/include/c++/11.1.0/bits/unique_ptr.h:85
    #18 0x55c90a19d523 in std::unique_ptr<OMW::Engine, std::default_delete<OMW::Engine> >::~unique_ptr() /usr/include/c++/11.1.0/bits/unique_ptr.h:361
    #19 0x55c90a19d523 in runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:320
    #20 0x55c90a955634 in wrapApplication(int (*)(int, char**), int, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/components/debug/debugging.cpp:205
    #21 0x55c90a193be0 in main /home/elsid/dev/openmw/apps/openmw/main.cpp:328
    #22 0x7f78c3503b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)

previously allocated by thread T18 here:
    #0 0x7f78c688bca1 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99
    #1 0x55c90ace8c73 in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::allocate(unsigned long, void const*) /usr/include/c++/11.1.0/ext/new_allocator.h:121
    #2 0x55c90ace8c73 in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > > >::allocate(std::allocator<std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >&, unsigned long) /usr/include/c++/11.1.0/bits/alloc_traits.h:460
    #3 0x55c90ace8c73 in std::_Rb_tree<std:🧵:id, std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > >, std::_Select1st<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::_M_get_node() /usr/include/c++/11.1.0/bits/stl_tree.h:561
    #4 0x55c90ace8c73 in std::_Rb_tree_node<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >* std::_Rb_tree<std:🧵:id, std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > >, std::_Select1st<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::_M_create_node<std::piecewise_construct_t const&, std::tuple<std:🧵:id const&>, std::tuple<> >(std::piecewise_construct_t const&, std::tuple<std:🧵:id const&>&&, std::tuple<>&&) /usr/include/c++/11.1.0/bits/stl_tree.h:611
    #5 0x55c90ace8c73 in std::_Rb_tree_iterator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > std::_Rb_tree<std:🧵:id, std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > >, std::_Select1st<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<std:🧵:id const&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > >, std::piecewise_construct_t const&, std::tuple<std:🧵:id const&>&&, std::tuple<>&&) /usr/include/c++/11.1.0/bits/stl_tree.h:2429
    #6 0x55c90accc5fb in std::map<std:🧵:id, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > >, std::less<std:🧵:id>, std::allocator<std::pair<std:🧵:id const, std::deque<std::_List_iterator<DetourNavigator::Job>, std::allocator<std::_List_iterator<DetourNavigator::Job> > > > > >::operator[](std:🧵:id const&) /usr/include/c++/11.1.0/bits/stl_map.h:501
    #7 0x55c90accc5fb in DetourNavigator::AsyncNavMeshUpdater::getNextJob() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:344
    #8 0x55c90accdb2d in DetourNavigator::AsyncNavMeshUpdater::process() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:257
    #9 0x55c90acce464 in operator() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:98
    #10 0x55c90acce464 in __invoke_impl<void, DetourNavigator::AsyncNavMeshUpdater::AsyncNavMeshUpdater(const DetourNavigator::Settings&, DetourNavigator::TileCachedRecastMeshManager&, DetourNavigator::OffMeshConnectionsManager&)::<lambda()> > /usr/include/c++/11.1.0/bits/invoke.h:61
    #11 0x55c90acce464 in __invoke<DetourNavigator::AsyncNavMeshUpdater::AsyncNavMeshUpdater(const DetourNavigator::Settings&, DetourNavigator::TileCachedRecastMeshManager&, DetourNavigator::OffMeshConnectionsManager&)::<lambda()> > /usr/include/c++/11.1.0/bits/invoke.h:96
    #12 0x55c90acce464 in _M_invoke<0> /usr/include/c++/11.1.0/bits/std_thread.h:253
    #13 0x55c90acce464 in operator() /usr/include/c++/11.1.0/bits/std_thread.h:260
    #14 0x55c90acce464 in _M_run /usr/include/c++/11.1.0/bits/std_thread.h:211
    #15 0x7f78c38fd3c3 in execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82

Thread T18 created by T0 here:
    #0 0x7f78c682bfa7 in __interceptor_pthread_create /build/gcc/src/gcc/libsanitizer/asan/asan_interceptors.cpp:216
    #1 0x7f78c38fd6aa in std:🧵:_M_start_thread(std::unique_ptr<std:🧵:_State, std::default_delete<std:🧵:_State> >, void (*)()) /build/gcc/src/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:663
    #2 0x55c90ae008d1 in DetourNavigator::NavMeshManager::NavMeshManager(DetourNavigator::Settings const&) /home/elsid/dev/openmw/components/detournavigator/navmeshmanager.cpp:47
    #3 0x55c90aca3bfe in DetourNavigator::NavigatorImpl::NavigatorImpl(DetourNavigator::Settings const&) /home/elsid/dev/openmw/components/detournavigator/navigatorimpl.cpp:13
    #4 0x55c9097d9e6f in MWWorld::World::World(osgViewer::Viewer*, osg::ref_ptr<osg::Group>, Resource::ResourceSystem*, SceneUtil::WorkQueue*, Files::Collections const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ToUTF8::Utf8Encoder*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/apps/openmw/mwworld/worldimp.cpp:196
    #5 0x55c90a1e9992 in OMW::Engine::prepareEngine(Settings::Manager&) /home/elsid/dev/openmw/apps/openmw/engine.cpp:789
    #6 0x55c90a1ed138 in OMW::Engine::go() /home/elsid/dev/openmw/apps/openmw/engine.cpp:949
    #7 0x55c90a19d4cb in runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:316
    #8 0x55c90a955634 in wrapApplication(int (*)(int, char**), int, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/elsid/dev/openmw/components/debug/debugging.cpp:205
    #9 0x55c90a193be0 in main /home/elsid/dev/openmw/apps/openmw/main.cpp:328
    #10 0x7f78c3503b24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)

SUMMARY: AddressSanitizer: heap-use-after-free /usr/include/c++/11.1.0/bits/stl_deque.h:269 in std::operator==(std::_Deque_iterator<std::_List_iterator<DetourNavigator::Job>, std::_List_iterator<DetourNavigator::Job>&, std::_List_iterator<DetourNavigator::Job>*> const&, std::_Deque_iterator<std::_List_iterator<DetourNavigator::Job>, std::_List_iterator<DetourNavigator::Job>&, std::_List_iterator<DetourNavigator::Job>*> const&)
Shadow bytes around the buggy address:
  0x0c188007ebb0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c188007ebc0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
  0x0c188007ebd0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c188007ebe0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c188007ebf0: 00 00 00 00 00 00 07 fa fa fa fa fa fa fa fa fa
=>0x0c188007ec00: fd fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fa
  0x0c188007ec10: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c188007ec20: 00 00 00 00 00 00 02 fa fa fa fa fa fa fa fa fa
  0x0c188007ec30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c188007ec40: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c188007ec50: 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==11799==ABORTING
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
psi29a 6360bdc859 Merge branch 'navmesh_job' into 'master'
Store async navmesh jobs in the same container until they are processed

See merge request OpenMW/openmw!1131
3 years ago
psi29a 6595c731f7 Merge branch 'fix_rc_poly_mesh_flags_length' into 'master'
Fix flags length for rcPolyMesh

See merge request OpenMW/openmw!1134
3 years ago
elsid 46fa3ce083
Fix flags length for rcPolyMesh
recastnavigation documentation of rcPolyMesh is misleading. It says flags field
length is maxpolys when actually it's allocated as npolys.
3 years ago
elsid 54a676f2e3
Add functions to get length of recast type arrays
To avoid duplicating same formulas in multiple places.
3 years ago
elsid 05258ed644
Remove redundant TileCachedRecastMeshManager::hasTile function
It's used only for tests. getMesh is a valid replacement.
3 years ago
elsid 8ac8d56e8c
Mark TileCachedRecastMeshManager member functions as const where possible 3 years ago
elsid 09b1a2e3c6
Make unchanging Job fields const 3 years ago
elsid 21ce4fe637
Use structured binding 3 years ago
elsid 8bca9eec80
Use single set to store pushed tiles 3 years ago
elsid a97b2ced27
Use single map to store last updates 3 years ago
elsid bfcc430822
Use single map to store processing tiles 3 years ago
elsid 902b0f9f84
Store jobs in the same container until they are processed
Push to queue and reorder only iterators.
3 years ago
elsid 8db640289c
Use single set to store pushed jobs for tiles 3 years ago
elsid a99266a60e
Do not measure total navmesh generation duration
This is not a useful thing anymore.
3 years ago
elsid 9460a8760e
Move operator<< for UpdateNavMeshStatus to header 3 years ago
elsid 94e71d9b14
Avoid division by zero 3 years ago
elsid 0985d8e03d
Handle failed NavMesh allocation 3 years ago
elsid a6260453ea
Add missing initialization 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 3cbe93358a
Move dtNavMeshParams initialization to where it's required 3 years ago
elsid 41b02ff1aa
Copy only required RecastMeshObject fields 3 years ago
elsid c91ef34a70
Avoid using a specific type for stored ref_ptr to extend lifetime 3 years ago
elsid 050b7d31aa
Create RecastMesh outside critical section
To not lock main thread when it tries to update objects.
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 fdee9db20c
Consider RecastMeshManager not empty when there is water 3 years ago
elsid 24b802b3d8
Simplify adding water to recast mesh
Remove redundant computations and conversions.
3 years ago
elsid 5d6c93566d
Rename DetourNavigator::Water -> Cell 3 years ago
elsid 753767d6d9
Store only water shift
Rotation is not used.
3 years ago
elsid da4ec31cd8
Remove redundant RecastMeshManager::Water 3 years ago
elsid a1549321d7
Move Water struct out of RecastMesh class 3 years ago
elsid d60edb36aa
Make RecastMesh independent from recast scale factor
To avoid scaling until it's required by delaying coordinates conversion until
navmesh generation.
3 years ago
elsid af7059373c
Make RecastMesh independent from the order of RecastMeshBuilder calls
To make sure RecastMesh objects are equal if built with the same data but in
different order. Will be used later when there will be more than one place
building RecasMesh objects.
3 years ago
elsid 07c70dfb73
Remove unused local variables 3 years ago
elsid d2b935684d
Add missing include 4 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
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
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
Evil Eye eb07818f13 Ignore agents without bounding boxes 4 years ago
psi29a 937549c99e Merge branch 'fix_still_actors' into 'master'
Make actor flee from a combat when cannot reach a target (#5851)

See merge request OpenMW/openmw!601
4 years ago
elsid bc67669a97
Comment unused argument 4 years ago
elsid 4983684fda
Fix implicit int to float conversion warning 4 years ago
elsid bb0c478954
Add missing include and use std malloc and free 4 years ago
elsid 3a9b1ce63a
Use camel case for local constant 4 years ago
elsid a7fe6c7ba1
Move duplicated usage patter of dtNavMeshQuery::findNearestPoly into a separate function 4 years ago
elsid d3ab6c972f
Avoid set unused position from dtNavMeshQuery::findNearestPoly result 4 years ago
elsid 8dba61f7ae
Use navmesh raycast to find reachable position around target 4 years ago
elsid 68fe6b9114
Use only item size to check whether item fits cache
Item size has to be counted anyway and there is no reason to check only navmesh
data first.
4 years ago
elsid 3a2cea5271
Use raw recast mesh data and off mesh connections for navmesh key
Serialization into a vector of chars produces inconsistent results that leads
to reduced cache hit rate. Using a structured object is a more clear solution
and allows to remove serialization and nontrivial key compare logic with more
straigt forward structured object comparison.
4 years ago
elsid ad1f8c1e84
Sort water and off mesh connections for recast mesh
Inconsisten order of these objects in navmesh cache key leads to cache misses
due to key inequality.
4 years ago
elsid 489107c5ee
Count navmesh cache key once in item size
Key is stored only in NavMeshTilesCache::Item, TileMap uses KeyView with
a pointer to a vector.
4 years ago
elsid 88ca4a1db6
Count navmesh cache hit rate 4 years ago
elsid d2d8a7a940
Fix passing null to memcpy
/home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:36:24: runtime error: null pointer passed as argument 2, which is declared to never be null
    #0 0x55e37ba4cda5 in makeNavMeshKey /home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:36
    #1 0x55e37ba4cda5 in DetourNavigator::NavMeshTilesCache::set(osg::Vec3f const&, osg::Vec2i const&, DetourNavigator::RecastMesh const&, std::vector<DetourNavigator::OffMeshConnection, std::allocator<DetourNavigator::OffMeshConnection> > const&, DetourNavigator::NavMeshData&&) /home/elsid/dev/openmw/components/detournavigator/navmeshtilescache.cpp:81
    #2 0x55e37fe3c861 in DetourNavigator::updateNavMesh(osg::Vec3f const&, DetourNavigator::RecastMesh const*, osg::Vec2i const&, osg::Vec2i const&, std::vector<DetourNavigator::OffMeshConnection, std::allocator<DetourNavigator::OffMeshConnection> > const&, DetourNavigator::Settings const&, std::shared_ptr<Misc::ScopeGuarded<DetourNavigator::NavMeshCacheItem> > const&, DetourNavigator::NavMeshTilesCache&) /home/elsid/dev/openmw/components/detournavigator/makenavmesh.cpp:582
    #3 0x55e37fb796ce in DetourNavigator::AsyncNavMeshUpdater::processJob(DetourNavigator::AsyncNavMeshUpdater::Job const&) /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:178
    #4 0x55e37fb9a125 in DetourNavigator::AsyncNavMeshUpdater::process() /home/elsid/dev/openmw/components/detournavigator/asyncnavmeshupdater.cpp:144
    #5 0x7f013f585c23 in execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
    #6 0x7f013f8c63e8 in start_thread (/usr/lib/libpthread.so.0+0x93e8)
    #7 0x7f013e91d292 in __GI___clone (/usr/lib/libc.so.6+0x100292)
4 years ago
Andrei Kortunov 8084a336b5 Replace zeroes and nulls by nullptrs 4 years ago
elsid 9b11b8a27b
Fix boundary check 4 years ago
Bret Curtis 0e0c091e15 add more optionals and casserts for windows 4 years ago
Bret Curtis 4a54d375cc add cassert for windows 4 years ago
Bret Curtis f6bead88a9 purge boost/optional.hpp headers 4 years ago
Bret Curtis 62b0781f7d use std::optional instead of boost::optional 4 years ago
Bret Curtis 5a824d0333 components/compiler cleanup; also cleaned up related cascading warnings; fixed up final/override issues 4 years ago
Assumeru 72549651e0
Rework container resolution (#3006)
* Rework container resolution

* add optional argument to getCount

* remove now-redundant changes

* undo worldimp changes

* move save-fixing code to InventoryState

* replace Rng instances with Seeds
4 years ago
psi29a 9a912486f9 Merge branch 'deprecated-exception' into 'master'
Use C++11 exception specification

See merge request OpenMW/openmw!343
4 years ago
fredzio 460e69e92a Get rid of warning: dynamic exception specifications are deprecated 4 years ago
elsid 7591d45008
Use memcpy to create navmesh key
Implementation with memcpy is ~13 times faster.
4 years ago
elsid f637dc38bd
Add cached flag to update navmesh status 4 years ago
elsid eb140ed15f
Write unknown status numeric value 4 years ago
elsid 7d73e73cad
Consider tile as not removed when it is not found 4 years ago
psi29a 0dc7715c35 Merge branch 'object_paging_retry' into 'master'
Object Paging

See merge request OpenMW/openmw!209
5 years ago
elsid 00197e1cd9
Optimize recast mesh size by vertex deduplication 5 years ago
elsid b095ca6c86
Use actor speed to define area cost for pathfinding 5 years ago
elsid 439588d10e
Remove unused mOffMeshConnectionIds 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 14d0ca4cd3
Cast float to btScalar 5 years ago
elsid b150d681a9
Update same navmesh tile with limited frequency 5 years ago
elsid 10daadefbe
Add missing include 5 years ago
Bret Curtis b7f7aabd8b
Merge pull request #2806 from elsid/detournavigator_tests
Add detournavigator test for multiple worker threads
5 years ago
elsid 899a6b5aa3
Workaround for GCC 5 bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61636
5 years ago
elsid bd1ef4dd6d
Add detournavigator test for multiple worker threads 5 years ago
Alexei Dobrohotov d42cb4f16d
Merge pull request #2805 from elsid/detournavigator_update_callback
Use callback to handle changed tiles
5 years ago
elsid df6e85b619
Use callback to handle changed tiles
Instead of collecting changed tiles into a temporary vector.
5 years ago
elsid 7502db1570
Add number of thread jobs to update jobs stats 5 years ago
elsid 208a50340d
Specialize DetourNavigator::ObjectId ctor for pointers
To fix msvc error:
components\detournavigator\objectid.hpp(14,13): error C2440: 'reinterpret_cast': cannot convert from 'const T' to 'size_t'
          with
          [
              T=unsigned long
          ]
5 years ago
Andrei Kortunov 2e7712a390 Fix C5204 warnings by adding default virtual destructors 5 years ago
elsid 5168f2059f
Compare revisions by equality to support overflow 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
Andrei Kortunov 3704acf857 Unify streams usage to support non-ASCII paths (bug #5239) 5 years ago
Andrei Kortunov cd81f81fb6 Initialize variables to avoid GCC warnings 5 years ago
elsid 7ec5a20c64
Filter recast mesh triangles by global bounding box
Except heightfields to reduce slow down.
5 years ago
elsid 7729e396b2
Fix exceptions logging 5 years ago
Andrei Kortunov 6832a2fa9a Remove BOM from CPP files (allows to build OpenMW with LCC on Elbrus) 6 years ago
elsid c683dc8565
Lock navmesh tile by thread while processing
To avoid duplicated work on a same tile by different threads.
If tile is locked by another thread, then post job into this thread queue.
6 years ago
Andrei Kortunov 14b756a692 Use a generic logging system for RecastNavigation 6 years ago
Bret Curtis 45221418bd
Merge pull request #2260 from elsid/fix_clean_unused_navmeshes
Fix clean unused navmeshes
6 years ago
elsid 4624f31788
Report navigator stats 6 years ago
elsid 8adc83f6e2
Fix clean unused navmeshes
weak_ptr doesn't have constructor for shared_ptr&& type, so ptr wasn't
moved, just copied.
6 years ago
elsid dd0b45ede6
Do not pass nullptr to std::memcmp 6 years ago
Bret Curtis cb1a5f3679
Merge pull request #2245 from elsid/navigator_refactor
Refactor navigator related code
6 years ago
Bret Curtis 7b793b8809
Merge pull request #2244 from elsid/navmesh_cache_item_refactor
Make NavMeshCacheItem consistent
6 years ago
elsid 68948bc847
Avoid key allocation to find tile in cache 6 years ago
elsid 849f2078c1
Swap outside critical section 6 years ago
elsid 8d2af94b75
Use default objects for NavigatorStub methods result 6 years ago
elsid ece111d05a
Check for jobs using predicate 6 years ago
elsid c05fc9e054
Add missing cleanup 6 years ago
elsid ce9aebcba1
Clear all changed tiles after post 6 years ago
elsid 9d61c49478
Store key by reference in tiles map 6 years ago
elsid 614d5243c3
Make NavMeshCacheItem consistent
Move all logic related to this type into its methods.
6 years ago
elsid f6a1d3cecf
Store weak pointers to navmesh in jobs queue
To avoid useless processing for removed navmeshes.
6 years ago
elsid ccc709a316
Store guarded navmesh cache item in shared_ptr
Remove useless SharedGuarded type.
6 years ago
elsid 0479ebf5ae
Remove unused actors and navmeshes on update
When there is only one actor (player) on a scene and it moving to other
cell first it will be removed from navigator then added. Remove cause
navmesh removing for its half extents. After it is added navmesh for
same half extents is created and added. While this all happens there are
still jobs for old navmesh are processing. Old navmesh still exists
because it is stored by shared pointer. So jobs take tiles from cache
and place them into old navmesh. After that other jobs take same tiles
from cache (half extents and coordinates are equal) and place them into
other navmesh. dtNavMesh changes tile data on add and remove. Adding tile
to two dtNavMesh corrupts tile in both nameshes.
6 years ago
Bret Curtis c20e69ef24
Merge pull request #2227 from elsid/fix_twitchy_massive_creatures
Fix twitchy movement for massive creatures (bug #4907)
6 years ago
elsid b9f21ec81a
Use custom steps size to make smooth path depending on half extents 6 years ago