Commit Graph

1222 Commits (144862aa35333c3854bcf7bec135df71b9ab1984)

Author SHA1 Message Date
elsid 144862aa35
Define default actor half extents in settings
Player's half extents may change over time when wolfskin model is used for
example. Having it in settings is a more presistent approach.
3 years ago
Bo Svensson ef906cbfa8
improves MWClass mapping (#3166)
Currently, we use a peculiar mapping of ESM classes by their std::type_info::name. This mapping is an undefined behaviour because std::type_info::name is strictly implementation defined. It could return a non-unique value on some platforms. With this PR we use the unsigned int sRecordId of the ESM class as a more efficient lookup type that does not build on undefined behaviour. We can expect marginally faster save-game loading with these changes as well.
3 years ago
Evil Eye f6eeee3ad5 Detect keys and enchanted items in containers without custom data 3 years ago
psi29a 2c8c36fe5d Merge branch 'master' into 'effective_magic'
# Conflicts:
#   CHANGELOG.md
3 years ago
Evil Eye b8e4f18751 Clear temporary effects before unloading actors to prevent absorb effects becoming permanent 3 years ago
Evil Eye dc1fe62dde Overhaul magic effects to work with onApply and onEnd events 3 years ago
elsid c0ef4417c3
Check AiTravel destination for other actors presence
Use faster aabbTest but without destance filter. To avoid dependency on a
specific constant and correctly handle situations when there is a big
difference between actors sizes.
3 years ago
Evil Eye 77a23dab09 Only add enabled objects to the scene 3 years ago
psi29a 2cee222e73 Merge branch 'explosion_at_impact' into 'master'
Bring arrow behaviour in line with vanilla (#6233 and other change)

See merge request OpenMW/openmw!1188
3 years ago
Petr Mikheev 83e0d9aeef Minor refactoring: use Misc::normalizeAngle in worldimp.cpp 3 years ago
fredzio 0bce6c09e1 Change projectile behaviour to be like in vanilla wrt. water plane:
- enchanted arrow explode upon hit the water plane
- non enchanted arrow disappear (or more accurately, they hit nothingness)
- enchanted arrow shot underwater explode immediately
- non enchanted arrow disappear immediately

Also, solve a bug that occured previously and could theoritically still happens where we use the last tested collision position for instead of the last registered hit:
Use the hit position as saved inside Projectile::hit() instead of the last position saved inside the callback.
If a projectile collides with several objects (bottom of the sea and water surface for instance), the last collision tested won't necessarily be the impact position as we have no control over the order in which the tests are performed.
3 years ago
jvoisin 7a015d24c6 Sprinkle some const-ref 3 years ago
elsid c8987bda2f
Store reference to BulletShapeInstance for btCollisionShape
To keep btCollisionShape lifetime.
3 years ago
fredzio 35928cf4d3 Refactor a bit the physics simulation to make it not actor centric:
- inline PhysicsSystem::applyQueuedMovements() into PhysicsSystem::stepSimulation()
- rename PhysicsTaskScheduler::moveActors() to PhysicsTaskScheduler::applyQueuedMovements()
- move the actor movement code from World::doPhysics() to
  PhysicsSystem::moveActors() (analogically to the projectile manager)
3 years ago
fredzio a7b190ad29 Change rotateObject() to take a osg::Vec3f argument instead of 3 floats
for readability.
3 years ago
fredzio 88a5ca440b Change moveObject() to take a osg::Vec3f argument instead of 3 floats
for readability.
3 years ago
Petr Mikheev 43b7e6964a Add function World::isCellActive 3 years ago
Petr Mikheev 1268597676 Make loaded but inactive objects available in Lua scripts. 3 years ago
Petr Mikheev 914e604e06 Interactions between LuaManager and other parts of OpenMW 3 years ago
Petr Mikheev 6db2450c90 Initial support of generated RefNums with negative mContentFile. 3 years ago
elsid c7c0d11cab
Trigger navmesh update when any navigator object has been updated
Set World::mShouldUpdateNavigator to true when this happens. Previously
assignment to true was missing for object rotation and moving.
3 years ago
Evil Eye 4f264af5a9 Merge branch 'staticsload' into 'master'
Loads statics before actors II (#5379)

See merge request OpenMW/openmw!588
3 years ago
fredzio c795e0bce6 Some actors are supposed to spawn on an object that belongs to an adjacent cell.
Since actors can be active in 3x3 grid around the player, we need to
first load all objects in a 5x5 grid around the player.

Split load and unloading in 2 phases. Add an mInactiveCells set into the
scene, which contains all cells inside the aforementioned 5x5 grid.
These cells contains only heightfields and non-animated physics objects.

Animated objects are tied to the scene graph, which doesn't exists yet
in these cells, so we skip them.
3 years ago
psi29a 7d8949ec3f Merge branch 'positively_glowing' into 'master'
Detach objects from the active grid when attempting to get their animation

Closes #6105

See merge request OpenMW/openmw!951
3 years ago
jvoisin 1123dc46ee Add a ton of const refs 3 years ago
Evil Eye 692615fd3c Detach objects from the active grid when attempting to get their animation 3 years ago
Léo Peltier 5c4e1252e9 Handle AutoCalc flag when getting spell cost
Fixes #5483

This only applies to "base game" spells.
When adding an AutoCalc spell with TES:CS its cost is computed and
stored inside game files. This stored cost was being used by OpenMW and
the actual cost was never recomputed at runtime whereas Morrowind.exe
discards the stored cost.
While this worked fine in vanilla, mods can update AutoCalc spell
effects without ever updating the stored cost.

The formula was mostly there already but there was a few differences,
namely a 1 second offset in duration.
3 years ago
Evil Eye b8472e1303 Use modified paralyze magnitude to fall and float 3 years ago
fredzio 4fa0972b2d Tone down actor's skip simulation flag to an optional skip collision
detection flag.
3 years ago
Andrei Kortunov 9647b670e4 Do not declare unused variables 3 years ago
fredzio 36bb2d5f15 An actor needs not be in active cell. As such we can't use
PhysicsSystem::getActor() to determine that a ptr is not actor.
3 years ago
fredzio f137b7341f Another fallout from MR 722: objects were treated like actors by
accident. Net effect was that calls to Move/MoveWorld didn't update
position of collision object.
3 years ago
fredzio 8874a5be22 Change (again) the way SetPos behave.
Instead of registering the desired change of position and rely on
physics simulation to apply it to the world, immediately change the
position in the world without reset the simulation.
3 years ago
Andrei Kortunov 59720aea9a Restore old aiming for melee combat 3 years ago
fredzio 7a67492d81 Unbreak SetPos and the mods using it.
To make SetPos works with async physics, it was modified to register a
position offset that would be applied to the real position during the
simulation.

A common pattern to teleport NPC in scripts is a sequence of SetPos/Disable/Enable in the same frame.
Since Disable/Enable creates a new physics actor using last known
RefData::Position, the registered offset never get a chance to be applied.

Modify disable() to call moveObject with the offset applied, so that the newly created physics actor will have up-to-date position
3 years ago
Andrei Kortunov 5fce5b12f4 Merge branch 'drop_the_bird' into 'master'
Disallow inserting containers, creatures, and npcs from the save game not present in content files

Closes #5884

See merge request OpenMW/openmw!683
3 years ago
Max 2cd96e56d5 create constant and use constant in other parts of the code base 3 years ago
Max e56efdd562 change aim calculation 3 years ago
Evil Eye cf5a93d712 Also run NPC validation for modified base records 3 years ago
Alexei Dobrohotov 2bfee281fd Merge branch 'restore_caster' into 'master'
Restore projectile caster from savegame (#5860)

See merge request OpenMW/openmw!616

(cherry picked from commit d595c7adb0fb45eafed6d3d0403ad640a91411ed)

c5426bec In the savegame, projectile caster is identified by its actor id. When
3 years ago
elsid 561628087c Merge branch 'profiler_fix' into 'master'
Fix profiler glitches (#5850)

See merge request OpenMW/openmw!605
3 years ago
fredzio 9d90e250cf Physics is not running while paused, so zero the stats for the async
thread instead of keeping whatever value was before the pause.
3 years ago
Evil Eye 2e73d2c145 Fallback to default cell name for door destination 3 years ago
Evil Eye 6aa75c287a Don't check magicka when casting free spells 3 years ago
Andrei Kortunov 7b727e4d70 Revert "Remove physics dependency on basenode"
This reverts commit 165c731492.
3 years ago
Andrei Kortunov 3b9f8b5fa2 Avoid null dereference for objects without cells 3 years ago
Andrei Kortunov d12a0fdcb3 Mark only instances from groundcover files as groundcover objects 3 years ago
Andrei Kortunov 14cf0ce1dc Implement instanced groundcover 3 years ago
fredzio 165c731492 Remove physics dependency on basenode
Necessary to be able to load physics objects from inactive cells.
3 years ago
Andrei Kortunov 799bd3379c Move screenshots handling to the separate class 3 years ago