1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-28 14:53:58 +00:00

470 Commits

Author SHA1 Message Date
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
elsid
c79c14da91
Fix -Wnon-virtual-dtor warnings 2023-02-03 23:00:09 +01:00
Alexei Kotov
b261f3bf65 Fix animated object physics 2023-01-16 17:08:48 +03:00
Alexei Kotov
434b4deda1 Don't use xkf if xnif is merely the base model (bug #5371) 2023-01-14 04:55:12 +03:00
Petr Mikheev
313df72be0 Remove raycasting functions from MWWorld::World 2022-11-13 15:35:26 +01:00
elsid
843753da14
Remove unused includes 2022-10-09 16:44:18 +02:00
jvoisin
3cbf1dc042 First pass with include-what-you-use 2022-10-09 10:39:43 +00:00
elsid
1fc7bd7775
Do not consider falling actors as grounded 2022-09-24 17:49:44 +02:00
clang-format-bot
ddb0522bbf
Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid
aeb4611d6c
Mark MWPhysics::Actor constructor and assignment operators as deleted 2022-09-17 01:14:04 +02:00
elsid
bceca33699
Do not lock mutex in MWPhysics::Actor constructor 2022-09-17 01:14:04 +02:00
elsid
bd98404890
Initialize PtrHolder::mPtr and positions by its constructor 2022-09-17 01:14:04 +02:00
elsid
cdc9141e2f
Reuse physics actors positions buffer 2022-09-08 01:57:45 +02:00
psi29a
fcd9b78cac Merge branch 'REFACTOR_STORE' into 'master'
Refactoring the ESM store to better support many new ESM4 types

See merge request OpenMW/openmw!2161
2022-09-07 20:22:29 +00:00
elsid
277211c5b4
Reuse physics simulations buffer
To avoid redundant allocations.

Use 2 buffers to make sure there is no overlap between main and the background
threads.
2022-09-07 03:06:59 +02:00
florent.teppe
0dd529ab1d With the records include removed from store.hpp, need to include the relevant files accross the codebase.Lots of touched files, but very little done 2022-09-06 13:26:13 +02:00
elsid
948e2f5db9
Do not use collision shapes with visual only collision to generate navmesh
These collision shapes are not used for actors movement physics simulation.
2022-08-25 00:56:03 +02:00
elsid
e4a254deb7
Replace Misc::Span by std::span 2022-08-21 23:53:27 +02:00
elsid
5498c169e3
Cleanup openmw render, physics, world, dialogue, gui, input includes 2022-08-17 18:45:52 +02:00
psi29a
454684bad3 Merge branch 'custom_actor_collision_shape_type' into 'master'
Support cylinder and rotating box collision shape types for actors (#6138)

Closes #6138

See merge request OpenMW/openmw!2043
2022-08-01 11:00:23 +00:00
Alexei Kotov
bccdefd63f Discard momentum upon teleportation (bug #6545) 2022-08-01 07:59:14 +03:00
elsid
8b8e4f78b6
Support cylinder and rotating box collision shape types for actors
Cylinder collision shape should give the best consistency between physics
simulation and pathfinding. Rotating box is already used by some actors, so
add it to have the same collision shape type for all actors.
2022-07-30 14:28:21 +02:00
elsid
49f8445f87
Move AiSetting out of MWMechanics::CreatureStats
To replace creaturestats.hpp include in mwworld/class.hpp with forward
declaration reducing total size of preprocessed code.
2022-07-16 16:43:33 +02:00
elsid
22ed6d5c1e
Use unsigned to define number of threads 2022-07-12 15:19:52 +02:00
elsid
8c3c65fe9f
Use variant and optional to implement Maybe*Locks
To avoid calling lock and unlock on the mutex. User-defined destructor is no
more needed.
2022-07-12 15:19:52 +02:00
elsid
fdf6e58ea3
Split apps/openmw/mwmechanics/actorutil.hpp 2022-06-26 16:42:29 +02:00
elsid
1a12c453d6
Support different agent collision shape type for pathfinding
Actors may have different collision shapes. Currently there are axis-aligned
bounding boxes and rotating bounding boxes. With AABB it's required to use
bounding cylinder for navmesh agent to avoid providing paths where actor can't
pass. But for rotating bounding boxes cylinder with diameter equal to the front
face width should be used to not reduce of available paths. For example rats
have rotating bounding box as collision shape because of the difference between
front and side faces width.

* Add agent bounds to navmesh tile db cache key. This is required to distinguish
  tiles for agents with different bounds.
* Increase navmesh version because navmesh tile db cache key and data has changed.
* Move navmesh version to the code to avoid misconfiguration by users.
* Fix all places where wrong half extents were used for pathfinding.
2022-06-21 12:57:32 +02:00
jvoisin
72a6d1f69f Clean up bullet includes 2022-06-04 20:15:10 +02:00
psi29a
af82140dda Merge branch 'filter_physics_actors' into 'master'
Do not perform physics simulation for actors outside processing range

See merge request OpenMW/openmw!1934
2022-05-29 19:19:35 +00:00
Evil Eye
3c83117e99 Replace new with make_unique in openmw 2022-05-29 13:24:48 +02:00
elsid
ac5844cad2
Do not perform physics simulation for actors outside processing range
Actors with disabled collisions still have physics simulations. Assuming they
should not be processed at all instead of disabling collision add a new flag to
make them inactive.
2022-05-26 10:36:03 +02:00
elsid
617cd4ceb6
Make sure physics simulation does not reset flags for nonprocessed actors
Actor::getOnGround and Actor::getOnSlope is used to initialize ActorFrameData.
After a physics simulation the result is copied back. But when actor is outside
processing range, Actor::mInternalCollisionMode is false and physics simulation
does not recalculate OnGround and OnSlope flags. So the flags are always set to
false that makes actor play landing animation when they exit and then enter
actors processing range.
2022-05-24 23:25:35 +02:00
elsid
94dc696f4f
Fix gcc build
In file included from /home/elsid/dev/openmw/apps/openmw/mwphysics/actor.hpp:7,
                 from /home/elsid/dev/openmw/apps/openmw/mwphysics/trace.cpp:9:
/home/elsid/dev/openmw/apps/openmw/mwphysics/ptrholder.hpp: In member function ‘osg::Vec3f MWPhysics::PtrHolder::velocity()’:
/home/elsid/dev/openmw/apps/openmw/mwphysics/ptrholder.hpp:42:25: error: ‘exchange’ is not a member of ‘std’
   42 |             return std::exchange(mVelocity, osg::Vec3f());
      |                         ^~~~~~~~
2022-05-16 15:59:18 +02:00
elsid
79676aee15
Make Environment a storage of referencing pointers instead of owned
Engine controls lifetime of managers therefore it should own them. Environment
is only access provider.

This allows to avoid redundant virtual calls and also some functions from
managers base classes can be removed if they are used only by Engine.
2022-05-06 23:44:01 +02:00
fredzio
d05a2facf3 Handle NCC flag in Nif files. Objects with this flag will collide only with camera.
Expose objects with NC flag to be used by Lua mods.
2022-04-17 20:03:00 +02:00