Bret Curtis
c99bddc8dc
Revert "Move reference to the right cell according to its geographical position"
...
This reverts commit d0677c3f07
.
2021-08-09 22:11:00 +02:00
Bret Curtis
7dfaef7644
resolve issue of meshes that cross boundaries; should only be calculating the maxBound, not the minBound of y; also fix it in groundcover as it was copied blindly over;
2021-08-09 22:05:12 +02:00
psi29a
471454adcf
Merge branch 'totalspecularcontrol' into 'master'
...
Don't re-enable specularity w/ material controller for MW models
See merge request OpenMW/openmw!1115
2021-08-09 19:10:56 +00:00
Alexei Dobrohotov
956edca524
Don't re-enable specularity w/ material controller for MW models
2021-08-09 21:17:13 +03:00
Cédric Mocquillon
bfc9ea9e32
Fix warning on MSVC convertion from double to float
2021-08-09 19:43:35 +02:00
Cédric Mocquillon
b0e30e4bb6
Change setting to clamp the local viewing distance to fix value (instead of coeff)
2021-08-09 19:43:34 +02:00
Cédric Mocquillon
b27de8f188
Disable zooming when setting is off
2021-08-09 19:43:34 +02:00
Alexei Dobrohotov
0a73771f17
Merge branch 'navmesh_fixes' into 'master'
...
Minor navmesh fixes
See merge request OpenMW/openmw!1114
2021-08-09 17:22:59 +00:00
Alexei Dobrohotov
73e83fd3d8
Merge branch 'dontcrash' into 'master'
...
Fix #6208 (hopefully)
Closes #6208
See merge request OpenMW/openmw!1113
2021-08-09 17:10:11 +00:00
elsid
94e71d9b14
Avoid division by zero
2021-08-09 17:58:33 +02:00
elsid
0985d8e03d
Handle failed NavMesh allocation
2021-08-09 17:54:19 +02:00
elsid
a6260453ea
Add missing initialization
2021-08-09 17:54:19 +02:00
fredzio
8e3984ae5a
Clear mActors when reseting the simulation. Otherwise during next run we can try to read past the end of mActorsFrameData.
2021-08-09 14:46:41 +02:00
Evil Eye
a6c0c1921b
Merge branch 'coverity_init' into 'master'
...
Fix two coverity issues about uninitialised variables
See merge request OpenMW/openmw!1112
2021-08-09 11:54:30 +00:00
jvoisin
586d8684d0
Fix two coverity issues about uninitialised variables
2021-08-09 12:43:30 +02:00
psi29a
cb7a4d20dd
Merge branch 'killmutex' into 'master'
...
Remove mutex from PtrHolder
See merge request OpenMW/openmw!1110
2021-08-08 19:45:16 +00:00
psi29a
3afa9829b3
Merge branch 'tracedown' into 'master'
...
Correct calls to traceDown in addActor
See merge request OpenMW/openmw!1109
2021-08-08 19:41:53 +00:00
psi29a
99e30115a9
Merge branch 'div0' into 'master'
...
Fix UBSAN warning
See merge request OpenMW/openmw!1107
2021-08-08 17:19:13 +00:00
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.
2021-08-08 18:26:35 +02:00
AnyOldName3
8d93748f87
Fix rebase issue
2021-08-08 17:25:57 +01:00
AnyOldName3
cf15803e67
Disable triangle detection workaround when Bullet actually uses triangles
2021-08-08 16:53:14 +01:00
AnyOldName3
8b4c2d205d
WIP-ish glPolygonOffset for Bullet debug geometry
2021-08-08 16:53:08 +01:00
fredzio
b4dd9e6b4d
Avoid division by zero in movementsolver when an actor is immobile and
...
in a storm
2021-08-08 17:19:18 +02:00
fredzio
ee09f3095f
At last kill PtrHolder mutex
2021-08-08 15:05:07 +02:00
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.
2021-08-08 15:05:07 +02:00
fredzio
e88b94d0b0
Move btCollisionObject* into PtrHolder
...
Remove unused function
2021-08-08 15:05:07 +02:00
psi29a
8ad3d3d792
Merge branch 'freezeandcool' into 'master'
...
Don't use FreezeOnCull for any particle system (#4744 )
Closes #4744
See merge request OpenMW/openmw!1103
2021-08-08 12:35:26 +00:00
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
2021-08-08 12:31:58 +00:00
psi29a
932184bfc1
Merge branch 'fix_tsan_warning' into 'master'
...
Fix TSAN warning
See merge request OpenMW/openmw!1102
2021-08-08 12:29:44 +00:00
psi29a
8c81191d09
Merge branch 'schneller' into 'master'
...
Optimize actors physics simulation
See merge request OpenMW/openmw!1048
2021-08-08 12:27:53 +00:00
Alexei Dobrohotov
fb6ee6a9b4
Merge branch 'consistent_debug_varying' into 'master'
...
Add missing interpolation qualifer
See merge request OpenMW/openmw!1104
2021-08-08 02:08:23 +00:00
glassmancody.info
81267e7be7
add missing centroid to debug vertex shaders
2021-08-07 18:04:11 -07:00
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.
2021-08-08 02:38:20 +02:00
Alexei Dobrohotov
1fc7cb8191
Don't use FreezeOnCull for any particle system ( #4744 )
2021-08-08 03:36:35 +03:00
elsid
3cbe93358a
Move dtNavMeshParams initialization to where it's required
2021-08-08 02:30:48 +02:00
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)
2021-08-08 02:28:59 +02:00
psi29a
e89b304fed
Merge branch 'navmesh_optimize_get_recast_mesh' into 'master'
...
Reduce waiting while creating RecastMesh
See merge request OpenMW/openmw!1097
2021-08-07 20:05:01 +00:00
psi29a
1ccf377638
Merge branch 'welcome_to_the_scripted_casts' into 'master'
...
Don't stack cast packages
Closes #6197
See merge request OpenMW/openmw!1096
2021-08-07 19:43:33 +00:00
fredzio
5fc3b80406
Don't query actor halfextent in a tight loop, use the already existing
...
variable. These repeated calls become costly with > 150 actors.
2021-08-07 13:38:24 +02:00
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.
2021-08-07 13:38:24 +02:00
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
2021-08-07 13:38:24 +02:00
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
2021-08-07 13:38:24 +02:00
fredzio
26d9052b8c
Move the weak_ptr<Actor> outside of ActorFrameData.
2021-08-07 13:38:24 +02:00
fredzio
f68273c3c0
Remove Actor* from ActorFrameData
2021-08-07 13:38:24 +02:00
fredzio
9e911cc8b5
Introduce helper function to write back updated values inside parent Actor class
2021-08-07 13:38:24 +02:00
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
2021-08-07 13:38:24 +02:00
fredzio
6e51a9a512
Simplify a bit the solver
2021-08-07 13:38:24 +02:00
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.
2021-08-07 13:38:24 +02:00
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)
2021-08-07 13:38:24 +02:00
fredzio
9472728fa4
Do not generate data for immobile actors instead of early out from the solver
2021-08-07 13:38:24 +02:00