Commit Graph

16 Commits (master)

Author SHA1 Message Date
fredzio 20aefb5f5f Do not store btTransform into Object class: reduce its size by 104 bytes 3 years ago
fredzio c55db790f3 Make the code less verbose / more readable using for range loop and
structured binding.

No functional changes.
4 years ago
Andrei Kortunov 7b727e4d70 Revert "Remove physics dependency on basenode"
This reverts commit 165c731492.
4 years ago
Andrei Kortunov f8e8496d36 Revert "Revert a wrong change introduced in MR 546"
This reverts commit 23137d0c54.
4 years ago
fredzio 23137d0c54 Revert a wrong change introduced in MR 546
A prerequisite to create physics objects for statics was to remove the
dependency on base node (since it doesn't yet exists) for object
position. It is still necessary for animation though.

Restore the basenode (and the associated FIXME) so that animated objects works properly.
4 years ago
fredzio 165c731492 Remove physics dependency on basenode
Necessary to be able to load physics objects from inactive cells.
4 years ago
fredzio d015f17a6c Make all physics object manage their own resources
Use smart pointer for heightfields and their members.
Move collision object addition inside of Object's ctor, as for Actors and HeightFields
4 years ago
Andrei Kortunov dc7b48e92e Generate physics collisions for projectiles (bug #3372)
Remove redundant now mHit field
4 years ago
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.
4 years ago
fredzio d76cc5d0a9 Make the Object class manage its collision object and position. 4 years ago
fredzio 82da2045a9 Non functionnal changes in preparation for async physics feature 4 years ago
Andrei Kortunov 4a5fce8ca5 Use more C++11 in the physics code 5 years ago
Grigory Latyshev 3872d7476b Move makeOsgVec3f() to settingsutils.hpp
Remove all other makeOsgVec3f() implementations
6 years ago
Andrei Kortunov 3032b177a1 Remove redundant includes 6 years ago
elsid fa23b590a4
Add unwalkable areas to NavMesh 6 years ago
elsid c866fdff86
Move physics object, heightfield, ptrholder into separate files 6 years ago