1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 22:49:55 +00:00
Commit graph

34 commits

Author SHA1 Message Date
Frederic Chardon
bb5213670c Use bigger hammer to set Actor's position after teleporting. Otherwise traceDown() would use old collision object transform and gives incorrect results, making the Actor "fall" in the new position. 2020-11-16 11:35:50 +01:00
fredzio
d64ed6cf53 Get rid of the StandingActorsMap. Just embed the necessary info into
Actor class.
2020-11-15 01:58:21 +01:00
fredzio
e5fa457fe7 Properly account for interleaved move of actors.
Before this change, if an actor position was changed while the physics
simulation was running, the simulation result would be discarded. It is
fine in case of one off event such as teleport, but in the case of
scripts making use of this functionality to make lifts or conveyor (such
as Sotha Sil Expanded mod) it broke actor movement.

To alleviate this issue, at the end of the simulation, the position of the Actor
in the world is compared to the position it had at the beginning of the
simulation. A difference indicate a force move occured. In this case,
the Actor mPosition and mPreviousPosition are translated by the difference of position.

Since the Actor position will be really set while the next simulation runs, we
save it in the mNextPosition field.
2020-11-14 20:39:16 +01:00
fredzio
3c2504b442 Process movement queue in one or several background threads
Before movement calculation, the main thread prepare a
vector of ActorFrameData, which contains all data necessary to perform
the simulation, and feed it to the solver. At the same time it fetches
the result from the previous background simulation, which in turn is
used by the game mechanics.
Other functions of the physics system (weapon hit for instance)
interrupt the background simulation, with some exceptions described
below.

The number of threads is controlled by the numeric setting

[Physics]
async num threads

In case 'async num threads' > 1 and Bullet doesn't support multiple threads,
1 async thread will be used. 0 means synchronous solver.
Additional settings (will be silently switched off if async num threads = 0)

[Physics]
defer aabb update

Update AABBs of actors and objects in the background thread(s). It is not an especially
costly operation, but it needs exclusive access to the collision world, which blocks
other operations. Since AABB needs to be updated for collision detection, one can queue
them to defer update before start of the movement solver. Extensive tests on as much
as one installation (mine) show no drawback having that switched on.

[Physics]
lineofsight keep inactive cache

Control for how long (how many frames) the line of sight (LOS) request will be kept updated.
When a request for LOS is made for the first time, the background threads are stopped to
service it. From now on, the LOS will be refreshed preemptively as part of the background
routine until it is not required for lineofsight keep inactive cache frames. This mean
that subsequent request will not interrupt the background computation.
2020-10-15 06:41:35 +02:00
fredzio
4ef36973fb Make the Actor class manage its collision object and position. 2020-10-15 06:41:08 +02:00
fredzio
82da2045a9 Non functionnal changes in preparation for async physics feature 2020-10-15 06:41:03 +02:00
elsid
43b39e8418
Use not scaled player half extents as default to find path 2019-03-04 22:59:38 +03:00
Bret Curtis
14c93b3df0 Revert "Merge pull request #2204 from elsid/fix_navigator_update"
This reverts commit 26fb0e7a0f, reversing
changes made to 42b2391303.
2019-03-04 11:06:15 +01:00
elsid
c066ee9dc5
Use not scaled player half extents as default to find path 2019-03-03 16:21:12 +03:00
Grigory Latyshev
3872d7476b Move makeOsgVec3f() to settingsutils.hpp
Remove all other makeOsgVec3f() implementations
2019-02-28 20:03:42 +00:00
Andrei Kortunov
61e6e359c4 Allow creatures to use the autogenerated collision box (feature #2787) 2018-10-22 15:48:23 +04:00
scrawl
99ffaafe30
Revert "Merge pull request #1701 from akortunov/standfix"
This reverts commit da47fc79f5, reversing
changes made to 7324bd368f.
2018-05-26 11:35:48 +00:00
Andrei Kortunov
3636cf2015 Do not apply queue movement for standing actors 2018-05-05 22:41:26 +04:00
scrawl
a8005c33d9 Revert unintended change to mOnGround variable that was somehow introduced with 38a2de3c51 2017-08-31 21:58:12 +00:00
Ewan Higgs
38a2de3c51 convert std::autor_ptr to std::unique_ptr, originally by Ewan Higgs and updated by Bret Curtis 2017-06-09 16:49:25 +02:00
scrawl
fb073e5c14 Avoid unnecessary AABB update for rotationally invariant collision shapes 2017-02-24 02:58:41 +01:00
scrawl
b3d5c2bd7f Use the actor's collision shape in findGround()
The cylinder base is no longer appropriate as of the change to capsules.

This also works around a bug when tracing a small cylinder/box shape apparently introduced with bullet 2.86.
2017-02-10 02:00:52 +01:00
scrawl
91939c4687 Switch actors to capsule shapes now that the jumping bug is gone (Fixes #2116, Fixes #2909)
The culprit was - surprise, surprise - d39d4f2619
2017-02-06 05:40:49 +01:00
scrawl
03aa270551 Construct PhysicActor as on ground by default to avoid a jumping animation from playing in the first frame after a savegame load 2017-02-06 05:23:00 +01:00
scrawl
541fbb4792 Movement solver: add usage of 'on slope' flag to improve handling of steep slopes
Previously we were handling 'on slope' synonymously with 'in air' which caused some odd effects.

Practical changes:
 - Sliding down a slope no longer applies fall damage.
 - Fixed a climbing exploit that would allow climbing steep slopes with repeated use of the Jump function.
2017-02-06 04:50:58 +01:00
Aussiemon
b794aa7c2f Helper methods for updateCollisionMask(), prevent water collision being removed twice, remove Bullet 2.8.5 methods 2016-12-16 12:22:07 -07:00
Aussiemon
e30dfb13d3 Added check before attempting to remove actor's collision object from world 2016-12-14 19:05:30 -07:00
scrawl
383524c688 Run physics in fixed timesteps, use the remainder to interpolate between current and previous state
Based on http://gafferongames.com/game-physics/fix-your-timestep/
2016-02-13 03:03:34 +01:00
scrawl
3552b3a82c Don't create a BulletShapeInstance for actors 2016-02-09 18:51:17 +01:00
scrawl
2c51e7345f Use a separate collision type for doors (Fixes #1962) 2015-12-18 18:32:42 +01:00
scrawl
62169a7039 Use a single-precision PositionAttitudeTransform in speed critical places 2015-11-22 19:54:26 +01:00
scrawl
8cf57ef6ac Move BulletShapeManager and BulletShape to resource/ 2015-11-17 00:20:15 +01:00
scrawl
a5f8ffb83d aimToTarget: Fix the collision box translation not being taken into account 2015-11-03 18:15:47 +01:00
scrawl
bd9dc58560 Use the correct scale for actor swim height (Fixes #2833) 2015-11-01 21:45:58 +01:00
scrawl
1f00174c02 Use a btCollisionWorld instead of btDiscreteDynamicsWorld
Slightly improves performance, since we no longer need to stepSimulation(). We don't use any Dynamics (yet).
2015-05-27 23:09:38 +02:00
scrawl
fe439e53ff Bullet include cleanup 2015-05-27 22:32:11 +02:00
scrawl
3dcb167066 Map rendering 2015-05-26 16:40:44 +02:00
scrawl
2bc95df265 Actor collision object placement fix 2015-05-12 16:49:28 +02:00
scrawl
47758c11cd Readded collision objects and movement physics 2015-05-12 03:02:15 +02:00