elsid
5261f0c5cf
Modify PhysicsTaskScheduler::mCollisionObjects under lock
...
addCollisionObject is called from the main thread and removeCollisionObject is
usually called from the main thread and rarely from one of the physics worker
threads. This usually happens on cell unloading when object is already removed
from the scene but there is active simulation for it. Which possible because
it's a shared pointer.
There is getUserPointer function which only reads from the container but it's
called only when there is no active simulation so no lock is required.
2024-04-26 16:17:40 +02:00
elsid
acf1e51a28
Call getUserPointer only for not nullptr collision object
...
nullptr can't have user pointer anyway so it saves a lookup in the
unordered_map.
2024-04-26 15:32:27 +02:00
Cody Glassman
56b31ceaf5
add ignore list to raycasts
2024-02-12 07:52:47 -08:00
psi29a
c889026b71
Merge branch 'cleanup_physics_callbacks' into 'master'
...
Cleanup physics callbacks
See merge request OpenMW/openmw!3831
2024-02-12 14:16:26 +00:00
psi29a
a060a7297c
Merge branch 'dehardcode-skillprogression' into 'master'
...
Lua: Dehardcode skill and level progression
See merge request OpenMW/openmw!3779
2024-02-12 14:10:51 +00:00
elsid
506824cb9d
Cleanup physics callbacks
...
* Do not copy with allocations.
* Remove unused DeepestNotMeContactTestResultCallback.
* Avoid using pointers which should not be nullptr.
* Move constructors implementation to headers.
* Move types defined in .cpp are to unnamed namespace.
* Comment unused arguments.
* Avoid C-style casts.
2024-02-07 22:04:34 +01:00
Andrei Kortunov
66d1e036d2
Pass some arguments by references
2024-02-01 10:02:15 +04:00
Mads Buvik Sandvei
011d9d6493
Dehardcode skill and level progression
2024-01-30 21:25:36 +01:00
Evil Eye
467220e6d7
Base GetColliding script functions on collisions detected by the movement solver
2024-01-20 16:50:51 +01:00
Alexei Kotov
2fbdde34c6
Set paged refs' base node to null ( #6335 )
2024-01-02 02:31:47 +03:00
Mads Buvik Sandvei
9d3ede7575
Revert "Merge branch 'skating-olympics' into 'master'"
...
This reverts merge request !3631
2023-12-27 19:11:49 +00:00
Alexei Kotov
78a8f9d692
Merge branch 'skating-olympics' into 'master'
...
De-jank stationary animations
Closes #3330
See merge request OpenMW/openmw!3631
2023-12-20 12:35:41 +03:00
Mads Buvik Sandvei
00b1cd8c08
Replace movement() with eraseMovementIf()
2023-12-18 22:50:45 +01:00
Mads Buvik Sandvei
5a6dbf8714
Comments
2023-12-18 22:43:45 +01:00
Mads Buvik Sandvei
76232c49df
clang format
2023-12-09 20:42:14 +01:00
Mads Buvik Sandvei
c79446818e
Add a flag for jump when queueing movement, so inertia can be added accurately.
2023-12-09 16:48:04 +01:00
Mads Buvik Sandvei
32d391f548
Revert accumulating movement in the reset accum root callback.
2023-12-09 15:50:17 +01:00
Mads Buvik Sandvei
af9312d869
clang format
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
15c143e272
Comment
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
26817e9cc5
Change the comparison of positions to avoid a problem if both positions are large numbers.
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
0037fd78c1
Use std::numeric_limits<float>::epsilon() instead of picking our own epsilon.
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
edf8c3b81c
mSteps should be an int.
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
aa30ec81d6
more clang format
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
18a6422c1c
clang format
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
28eeef59bc
Reduce movement solver same-position epsilon size. The previous value causes very stable idles to very slightly slide.
2023-12-09 14:50:02 +01:00
Mads Buvik Sandvei
cedc5289d7
Dejank movement solver vs animation movement accumulation
2023-12-09 14:49:42 +01:00
Alexei Kotov
754c5a8e2a
Restore animated collision shape rescaling
2023-12-06 00:54:54 +03:00
elsid
4a7886816e
Use settings values for Physics settings
2023-10-08 12:19:02 +02:00
Alexei Kotov
440851ff48
Rewrite melee hit target selection (bug #3438 )
2023-09-19 22:31:45 +03:00
elsid
053a3caf7b
Pass cache expiry delay to GenericResourceManager constructor
2023-09-09 19:35:20 +02:00
elsid
eb77fd1813
Add height field to navigator in ESM4 cells
2023-08-13 02:26:45 +02:00
Andrei Kortunov
35561450f1
Do not copy osg::ref_ptr when possible
2023-07-31 20:43:46 +04:00
elsid
f6fce5ee15
Cleanup includes
2023-07-08 11:28:56 +02:00
elsid
6e8dcc16c6
Use settings values for Game settings
2023-07-01 00:59:35 +02:00
Mads Buvik Sandvei
410e8b100a
Elsid comments
2023-05-23 19:30:29 +02:00
florent.teppe
a3bd6e7e47
ESM::ExteriorCellIndex => ESM::ExteriorCellLocation
2023-05-12 22:05:55 +02:00
florent.teppe
75561abfca
Factorises code and fixes preload bug.
2023-05-12 22:05:54 +02:00
florent.teppe
141878f30d
int x, int y , ESM::RefId worldspace => ESM::ExteriorCellIndex
...
also removed the changeToExteriorCell that only took a position as input, didn't work with esm4.
2023-05-12 22:05:53 +02:00
florent.teppe
d8a782425b
can actually load and teleport to esm4 exterior spaces
2023-05-12 22:05:53 +02:00
Petr Mikheev
3a8a4e8bff
Revert "Replace rayTest
with convexSweepTest
MovementSolver::traceDown
. Needed to prevent teleporting down through sewer grates."
...
This reverts commit 917132e326447b5bd242e7b53c1004df23f74ee3.
2023-05-09 01:20:02 +02:00
Petr Mikheev
917132e326
Replace rayTest
with convexSweepTest
MovementSolver::traceDown
. Needed to prevent teleporting down through sewer grates.
2023-05-07 21:13:14 +02:00
Petr Mikheev
f1beaa7b8c
Put ESMStore to Environment
2023-04-20 21:45:49 +02:00
psi29a
d64eea2fc6
Merge branch '7113-move-from-std-atoi-to-std-from_char' into 'master'
...
Move from std::atoi to std::from_char
Closes #7113
See merge request OpenMW/openmw!2760
2023-03-18 09:30:48 +00:00
Shi Han
a90e3b8c3b
Move from std::atoi to std::from_char
2023-03-18 09:30:48 +00:00
fredzio
63d4564455
In 0.46, SetPos was setting position of actors before physics simulation, and from this position movement was simulated. This changed with async physics merging, and at the same time problems started, mostly with abot's scenic travel.
...
Skipping the simulation, switching off collisions, and other approaches were not correct as they either broke some mods, or some core mechanics of the engine such as teleportation or waterwalking. As it turns out, the way to go is to simply do _nothing_ (modulo some gymnastics to account for the 1 frame difference in case of async).
Scripted movement and the unstucking logic tends to collide. Early out of unstuck in case the actor doesn't attempt to move. This means there is no AI package for NPC, which are the case for some boats and striders, or the player is content with their position.
2023-03-16 22:07:26 +01:00
elsid
0040da3497
Do not use std::shared_mutex to wait for job for async physics
...
std::shared_mutex in combination with std::condition_variable_any may
lead to a situation when notify_all does not wake up all waiting threads
on Windows. Use separate std::mutex and std::condition_variable to
notify about new job. Encapsulate all workers synchronization logic into
a separate type.
2023-03-05 18:07:56 +01:00
elsid
949b9191a5
Limit max bullet supported threads by BT_MAX_THREAD_COUNT - 1
...
There is a check and assert for number of threads >= BT_MAX_THREAD_COUNT.
btDbvtBroadphase::m_rayTestStacks::size may return BT_MAX_THREAD_COUNT which
triggers the assert.
2023-03-04 02:08:45 +01:00
elsid
3d3cccb8e5
Fix clamping physics threads
2023-03-03 18:44:47 +01:00
elsid
076e772e3d
Use shared locks in physics system when using multithreaded bullet
2023-02-12 14:51:46 +01:00
elsid
36b33cc1a5
Support absence of player and other actors in physics system
2023-02-08 20:19:59 +01:00