Skip to content

Commit

Permalink
Merge branch 'ulfricstormcloakjarlofwindhelm' into 'master'
Browse files Browse the repository at this point in the history
Revise storm wind effect on velocity (bug #8206)

Closes #8206

See merge request OpenMW/openmw!4426
  • Loading branch information
Assumeru committed Oct 28, 2024
2 parents e4f0227 + a239724 commit b288448
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
Bug #8172: Openmw-cs crashes when viewing `Dantooine, Sea`
Bug #8187: Intervention effects should use Chebyshev distance to determine the closest marker
Bug #8191: NiRollController does not work for sheath meshes
Bug #8206: Moving away from storm wind origin should make you faster
Bug #8207: Using hand-to-hand while sneaking plays the critical hit sound when the target is not getting hurt
Bug #8208: The launcher's view distance option's minimum value isn't capped to Vanilla's minimum
Feature #1415: Infinite fall failsafe
Expand Down
13 changes: 4 additions & 9 deletions apps/openmw/mwphysics/movementsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,10 @@ namespace MWPhysics
// Now that we have the effective movement vector, apply wind forces to it
if (worldData.mIsInStorm && velocity.length() > 0)
{
osg::Vec3f stormDirection = worldData.mStormDirection;
float angleDegrees = osg::RadiansToDegrees(
std::acos(stormDirection * velocity / (stormDirection.length() * velocity.length())));
static const float fStromWalkMult = MWBase::Environment::get()
.getESMStore()
->get<ESM::GameSetting>()
.find("fStromWalkMult")
->mValue.getFloat();
velocity *= 1.f - (fStromWalkMult * (angleDegrees / 180.f));
const MWWorld::ESMStore& store = *MWBase::Environment::get().getESMStore();
const float fStromWalkMult = store.get<ESM::GameSetting>().find("fStromWalkMult")->mValue.getFloat();
const float angleCos = worldData.mStormDirection * velocity / velocity.length();
velocity *= 1.f + fStromWalkMult * angleCos;
}

Stepper stepper(collisionWorld, actor.mCollisionObject);
Expand Down

0 comments on commit b288448

Please sign in to comment.