Commit Graph

26329 Commits (e4648cec48ba9b28e8907b23ffa68d63c9f1e6e8)
 

Author SHA1 Message Date
Cédric Mocquillon bfc9ea9e32 Fix warning on MSVC convertion from double to float 3 years ago
Cédric Mocquillon b0e30e4bb6 Change setting to clamp the local viewing distance to fix value (instead of coeff) 3 years ago
Cédric Mocquillon b27de8f188 Disable zooming when setting is off 3 years ago
Alexei Dobrohotov 0a73771f17 Merge branch 'navmesh_fixes' into 'master'
Minor navmesh fixes

See merge request OpenMW/openmw!1114
3 years ago
Alexei Dobrohotov 73e83fd3d8 Merge branch 'dontcrash' into 'master'
Fix #6208 (hopefully)

Closes #6208

See merge request OpenMW/openmw!1113
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
fredzio 8e3984ae5a Clear mActors when reseting the simulation. Otherwise during next run we can try to read past the end of mActorsFrameData. 3 years ago
Evil Eye a6c0c1921b Merge branch 'coverity_init' into 'master'
Fix two coverity issues about uninitialised variables

See merge request OpenMW/openmw!1112
3 years ago
jvoisin 586d8684d0 Fix two coverity issues about uninitialised variables 3 years ago
psi29a cb7a4d20dd Merge branch 'killmutex' into 'master'
Remove mutex from PtrHolder

See merge request OpenMW/openmw!1110
3 years ago
psi29a 3afa9829b3 Merge branch 'tracedown' into 'master'
Correct calls to traceDown in addActor

See merge request OpenMW/openmw!1109
3 years ago
psi29a 99e30115a9 Merge branch 'div0' into 'master'
Fix UBSAN warning

See merge request OpenMW/openmw!1107
3 years ago
fredzio c1e50f530b Calls directly MovementSolver::traceDown instead of
PhysicsSystem::traceDown before inserting into mActors.

The latter does nothing until the actor is inserted into mActors.
We can't move the call after the insertion either because then
the actor is part of the simulation, and we'd have a race.
3 years ago
AnyOldName3 8d93748f87 Fix rebase issue 3 years ago
AnyOldName3 cf15803e67 Disable triangle detection workaround when Bullet actually uses triangles 3 years ago
AnyOldName3 8b4c2d205d WIP-ish glPolygonOffset for Bullet debug geometry 3 years ago
fredzio b4dd9e6b4d Avoid division by zero in movementsolver when an actor is immobile and
in a storm
3 years ago
fredzio ee09f3095f At last kill PtrHolder mutex 3 years ago
fredzio 07fa1803f7 Use btCollisionObject* instead of MWWorld::Ptr inside of Projectile
collision handling and castRay() to avoid calling getPtr(). It is a step forward
removing the mutex inside of PtrHolder.

Do the same for DeepestNotMeContactTestResultCallback. It is used
only for not-ranged combat for now, but do it anyway for parity with all
other callback. This way, once the PtrHolder mutex is gone one will not
have to worry about wether it is safe to use the callback in a specific
context.

To avoid use-after-free with projectile / projectile collision, defer deletion of projectile.
Since instead of storing a copy of target Ptr we have a pointer to its collision object,
we can't delete projectiles until after we finished iterating over the loops.
3 years ago
fredzio e88b94d0b0 Move btCollisionObject* into PtrHolder
Remove unused function
3 years ago
psi29a 8ad3d3d792 Merge branch 'freezeandcool' into 'master'
Don't use FreezeOnCull for any particle system (#4744)

Closes #4744

See merge request OpenMW/openmw!1103
3 years ago
psi29a d939916369 Merge branch 'navmesh_save_cache_capacity' into 'master'
Do not cache navmesh when only object transformation is changed

See merge request OpenMW/openmw!1101
3 years ago
psi29a 932184bfc1 Merge branch 'fix_tsan_warning' into 'master'
Fix TSAN warning

See merge request OpenMW/openmw!1102
3 years ago
psi29a 8c81191d09 Merge branch 'schneller' into 'master'
Optimize actors physics simulation

See merge request OpenMW/openmw!1048
3 years ago
Alexei Dobrohotov fb6ee6a9b4 Merge branch 'consistent_debug_varying' into 'master'
Add missing interpolation qualifer

See merge request OpenMW/openmw!1104
3 years ago
glassmancody.info 81267e7be7 add missing centroid to debug vertex shaders 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
Alexei Dobrohotov 1fc7cb8191 Don't use FreezeOnCull for any particle system (#4744) 3 years ago
elsid 3cbe93358a
Move dtNavMeshParams initialization to where it's required 3 years ago
elsid fa1fb2a6b5
Reset mIsReleased before starting threads
To fix TSAN warning:

WARNING: ThreadSanitizer: data race (pid=68597)
  Write of size 1 at 0x7b3800079234 by main thread:
    #0 SceneUtil::WorkQueue::start(unsigned long) /home/elsid/dev/openmw/components/sceneutil/workqueue.cpp:51 (openmw+0x10daa10)
    #1 SceneUtil::WorkQueue::WorkQueue(unsigned long) /home/elsid/dev/openmw/components/sceneutil/workqueue.cpp:39 (openmw+0x10dad97)
    #2 OMW::Engine::prepareEngine(Settings::Manager&) /home/elsid/dev/openmw/apps/openmw/engine.cpp:700 (openmw+0xf7cb5a)
    #3 OMW::Engine::go() /home/elsid/dev/openmw/apps/openmw/engine.cpp:949 (openmw+0xf82688)
    #4 runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:316 (openmw+0xf62611)
    #5 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 (openmw+0x125df1c)
    #6 main /home/elsid/dev/openmw/apps/openmw/main.cpp:328 (openmw+0x596323)

  Previous read of size 1 at 0x7b3800079234 by thread T10 (mutexes: write M19275778865205896):
    #0 SceneUtil::WorkQueue::removeWorkItem() /home/elsid/dev/openmw/components/sceneutil/workqueue.cpp:86 (openmw+0x10d9e51)
    #1 SceneUtil::WorkThread::run() /home/elsid/dev/openmw/components/sceneutil/workqueue.cpp:127 (openmw+0x10da52a)
    #2 operator() /home/elsid/dev/openmw/components/sceneutil/workqueue.cpp:114 (openmw+0x10da664)
    #3 __invoke_impl<void, SceneUtil::WorkThread::WorkThread(SceneUtil::WorkQueue&)::<lambda()> > /usr/include/c++/11.1.0/bits/invoke.h:61 (openmw+0x10da664)
    #4 __invoke<SceneUtil::WorkThread::WorkThread(SceneUtil::WorkQueue&)::<lambda()> > /usr/include/c++/11.1.0/bits/invoke.h:96 (openmw+0x10da664)
    #5 _M_invoke<0> /usr/include/c++/11.1.0/bits/std_thread.h:253 (openmw+0x10da664)
    #6 operator() /usr/include/c++/11.1.0/bits/std_thread.h:260 (openmw+0x10da664)
    #7 _M_run /usr/include/c++/11.1.0/bits/std_thread.h:211 (openmw+0x10da664)
    #8 execute_native_thread_routine /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:82 (libstdc++.so.6+0xd33c3)

  Location is heap block of size 216 at 0x7b3800079220 allocated by main thread:
    #0 operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x91824)
    #1 OMW::Engine::prepareEngine(Settings::Manager&) /home/elsid/dev/openmw/apps/openmw/engine.cpp:700 (openmw+0xf7cb4c)
    #2 OMW::Engine::go() /home/elsid/dev/openmw/apps/openmw/engine.cpp:949 (openmw+0xf82688)
    #3 runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:316 (openmw+0xf62611)
    #4 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 (openmw+0x125df1c)
    #5 main /home/elsid/dev/openmw/apps/openmw/main.cpp:328 (openmw+0x596323)

  Mutex M19275778865205896 is already destroyed.

  Thread T10 (tid=68609, running) created by main thread at:
    #0 pthread_create /build/gcc/src/gcc/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x61c3a)
    #1 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 (libstdc++.so.6+0xd36aa)
    #2 std::_MakeUniq<SceneUtil::WorkThread>::__single_object std::make_unique<SceneUtil::WorkThread, SceneUtil::WorkQueue&>(SceneUtil::WorkQueue&) /usr/include/c++/11.1.0/bits/unique_ptr.h:962 (openmw+0x10da987)
    #3 SceneUtil::WorkQueue::start(unsigned long) /home/elsid/dev/openmw/components/sceneutil/workqueue.cpp:50 (openmw+0x10da987)
    #4 SceneUtil::WorkQueue::WorkQueue(unsigned long) /home/elsid/dev/openmw/components/sceneutil/workqueue.cpp:39 (openmw+0x10dad97)
    #5 OMW::Engine::prepareEngine(Settings::Manager&) /home/elsid/dev/openmw/apps/openmw/engine.cpp:700 (openmw+0xf7cb5a)
    #6 OMW::Engine::go() /home/elsid/dev/openmw/apps/openmw/engine.cpp:949 (openmw+0xf82688)
    #7 runApplication(int, char**) /home/elsid/dev/openmw/apps/openmw/main.cpp:316 (openmw+0xf62611)
    #8 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 (openmw+0x125df1c)
    #9 main /home/elsid/dev/openmw/apps/openmw/main.cpp:328 (openmw+0x596323)
3 years ago
psi29a e89b304fed Merge branch 'navmesh_optimize_get_recast_mesh' into 'master'
Reduce waiting while creating RecastMesh

See merge request OpenMW/openmw!1097
3 years ago
psi29a 1ccf377638 Merge branch 'welcome_to_the_scripted_casts' into 'master'
Don't stack cast packages

Closes #6197

See merge request OpenMW/openmw!1096
3 years ago
fredzio 5fc3b80406 Don't query actor halfextent in a tight loop, use the already existing
variable. These repeated calls become costly with > 150 actors.
3 years ago
fredzio 7dd5e715d7 Compute and store actor half extents. This is faster for 2 reasons:
- half extents changes when actor scale is modified, which is very rare
- we don't need to protect them by the actor mutex.
3 years ago
fredzio bcd6541d3e Reorganize ActorFrameData members:
- constify all read-only variables
- order them so that all variables modified as aprt of the simulation
  fits in one cache line
3 years ago
fredzio 0c5cf6ec19 Store the btCollisionObject* of the object we're standing on instead of
MWWorld::Ptr:
- they are equivalent
- btCollisionObject* is readily available from the simulation, it saves
  a call to a mutex
- btCollisionObject* is smaller
3 years ago
fredzio 26d9052b8c Move the weak_ptr<Actor> outside of ActorFrameData. 3 years ago
fredzio f68273c3c0 Remove Actor* from ActorFrameData 3 years ago
fredzio 9e911cc8b5 Introduce helper function to write back updated values inside parent Actor class 3 years ago
fredzio b04c958410 Modify the way swimming is handled:
- compute the swimming state instead of storing it, it changes as part of the simulation and was not updated, so it was wrong anyway.
- store the swim level in ActorFrameData, it is constant per Actor so no need to compute it inside the simulation
3 years ago
fredzio 6e51a9a512 Simplify a bit the solver 3 years ago
fredzio 51514e44cc Handle jump as part of the simulation preparation (inside of
PhysicsSystem) instead of inside the simulaiton.
For mechanics, we don't care how the jump is handled, just that it will be.
3 years ago
fredzio 1bfaf353be Explicitely store all the potential states an Actor can have into the
ActActorFrameData structure. It makes it easier to reason about the
simulation (and hopefully simplify it).
Remove atomics from Actor class as a side effect.

Rename mFloatToSurface to mInert to make is explicit what it represent, not what it is used for
Store the Actor rotation (1 Vec2) instead of the whole ESM::Position (2 Vec3)
3 years ago
fredzio 9472728fa4 Do not generate data for immobile actors instead of early out from the solver 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
Evil Eye 29921bf9fa Don't stack cast packages 3 years ago
psi29a b770373491 Merge branch 'OpenCS-enforce-str-length' into 'master'
OpenCS - Disallow entry of strings longer than the lengths allowed by the file format (#3066)

See merge request OpenMW/openmw!1088
3 years ago