Commit Graph

113 Commits (master)

Author SHA1 Message Date
David Cernat f0a22495a2 [General] Synchronize origin and orientation for magical projectiles 3 years ago
fredzio 32108adc31 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 998cc97a4f And done! 4 years ago
Max 2cd96e56d5 create constant and use constant in other parts of the code base 4 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
4 years ago
fredzio 6e969ca3fa Use mesh collision box instead of node bounding sphere for projectile
size. The bounding sphere is much bigger than the mesh.
4 years ago
Evil Eye a2171875a0 Prevent nullptr access 4 years ago
fredzio 1f4c85520f Use convexSweepTest for projectile movement to solve any
imprecision issue with projectile collision detection.
Simplify the mechanics: manage hits in one spot.
Give magic projectiles a collision shape similar in size to their visible
model.

Rename the 2 convex result callback to clearly state their purpose.
4 years ago
fredzio b39437dfb6 Don't allow projectiles to stand still when they hit an ally.
When an NPC fire a projectile, it should affect only its targeted actor.
To this end, after a hit is detected the target is checked against the
list of AI targets and reactivated if necessary.
Problem occurs when the hit occurs as a result of a friendly actor going
into the projectile (detected in ClosestNotMeConvexResultCallback):
while the projectile is inside the friend's collision box, it is
deactivated, just to be immediately reactivated. Effectively, the
projectile does nothing until the actor moves out.

Add a check inside the ClosestNotMeConvexResultCallback before declaring
a hit.
Since the necessary data is not safely accessible from the async thread,
maintain a copy inside the Projectile class.
4 years ago
fredzio 4fbe1ed12c Ignore caster collision shape. Sometimes the magic bolt get launched
inside too near its caster.
4 years ago
fredzio 66fe3b0d38 Modify projectile collision to work with async physics 4 years ago
Andrei Kortunov dc7b48e92e Generate physics collisions for projectiles (bug #3372)
Remove redundant now mHit field
4 years ago
psi29a ba3aad31c1 Merge branch 'hitdebug' into 'master'
Visualize hits in the debug overlay

See merge request OpenMW/openmw!379
4 years ago
Alexei Dobrohotov 53f91a3aa5
Merge pull request #3018 from akortunov/emplace
Use emplace_back instead of push_back
4 years ago
fredzio e8c0a7bec0 Visualie projectile hits 4 years ago
Andrei Kortunov 065ed5138e Use emplace_back instead of push_back 4 years ago
Andrei Kortunov 8ca3c3b123 Mark overrided methods by override keyword 4 years ago
Petr Mikheev 0de6650add Add RayCastingInterface 4 years ago
Capostrophic 456f0f9f44 Clean up magic bolts of actors that are gone (#5451) 5 years ago
Bret Curtis 8a8107e837 as it says; revert vismask and uncomplicate openmw 5 years ago
Andrei Kortunov 7545256d1f Do not try to launch magic bolt when direction to target is empty (bug #5350) 5 years ago
Andrei Kortunov 84979fa8b7 Move VisMask to components 5 years ago
Andrei Kortunov d1e0fa575e Take in account caster's race height when launch magic bolt (bug #5209) 5 years ago
Andrei Kortunov f0cef772fa Refactor weapon types behaviour
1. Move weapon types behaviour from switches to the table (should allow
us to de-hardcode weapon types later)
2. Gereralize bones injection to actors skeletons (instead of using the
hardcoded xbase_anim_sh.nif)
5 years ago
Andrei Kortunov 8557346fbd Use glow for enchanted arrows (feature #5122) 5 years ago
Capostrophic f0433704b4 Only collect every unique magic bolt sound once (bug #4964) 6 years ago
Andrei Kortunov 4c21776b94 Use relative animation time only for bows and crossbows (bug #3778) 6 years ago
Andrei Kortunov 3032b177a1 Remove redundant includes 6 years ago
Andrei Kortunov 0937f02598 Get rid of unnecessary string streams 6 years ago
Andrei Kortunov 70ed8fd1a9 Use constants instead of widely used magic numbers (task #4645) 6 years ago
Capostrophic 7ef6fa9f61 Remove deprecated GMST get* functions 6 years ago
Andrei Kortunov 5a4d0cec3a Use new logging system for game itself 6 years ago
Miloslav Číž 4373fea21e Correct projectile rotation 7 years ago
Miloslav Číž d0a299caab Rotate thrown projectiles around the bb center 7 years ago
Miloslav Číž 38bda3bd71 Do not save thrown state for projectiles 7 years ago
Miloslav Číž 3dbcda6686 Make use of mEffectAnimationTime for projectile rotation 7 years ago
Miloslav Číž 2b9a0a7732 Save new projectile state 7 years ago
Miloslav Číž de42aa9d03 Make thrown projectiles rotate 7 years ago
MiroslavR b5f5268ff3 Clean up faraway projectiles 7 years ago
MiroslavR f15de6d3ca ESS-Importer: Convert magic projectiles (Closes #2320) 7 years ago
Chris Robinson 780e82480d Make the PlayMode and PlayType enums scoped
Also shorten them by putting them in the MWSound namespace
7 years ago
Chris Robinson 1fe60dd8e2 Replace some shared_ptrs with pointers to deque entries 7 years ago
Allofich 6b53541571 Prevent AI actors from hitting unintended targets
(Fixes #3254)
8 years ago
NeveHanter e82d542d89 Merge remote-tracking branch 'upstream/master' into bugfix-3617 8 years ago
NeveHanter 811e9ad9f3 Fixed bug https://bugs.openmw.org/issues/3617 by allowing touch and target enchantments from ranged weapons and their projectiles to explode even when colliding with non-activable objects, terrain, water slab or when shoot underwater.
Also allowed projectiles to fly through the dead bodies as in vanilla.
8 years ago
scrawl 7b5f3e3cdc Fix crash in ProjectileManager when a sound id fails to play or is not found 8 years ago
mrohrlach 71e74f5a93 Moved projectile light calculation to separate method 8 years ago
mrohrlach f5da179a90 Removed two more bad casts 8 years ago
mrohrlach 3b0c791892 Removed bad casts and unnecessary comments 8 years ago
mrohrlach c2e5f24e98 Tidying up 8 years ago