mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 17:09:41 +00:00
Improve face shielding behavior in general case (bug #4240)
This commit is contained in:
parent
883dc2136d
commit
e7208bb80e
3 changed files with 25 additions and 30 deletions
|
@ -12,6 +12,7 @@
|
||||||
Bug #3765: DisableTeleporting makes Mark/Recall/Intervention effects undetectable
|
Bug #3765: DisableTeleporting makes Mark/Recall/Intervention effects undetectable
|
||||||
Bug #3778: [Mod] Improved Thrown Weapon Projectiles - weapons have wrong transformation during throw animation
|
Bug #3778: [Mod] Improved Thrown Weapon Projectiles - weapons have wrong transformation during throw animation
|
||||||
Bug #3812: Wrong multiline tooltips width when word-wrapping is enabled
|
Bug #3812: Wrong multiline tooltips width when word-wrapping is enabled
|
||||||
|
Bug #4240: Ash storm origin coordinates and hand shielding animation behavior are incorrect
|
||||||
Bug #4329: Removed birthsign abilities are restored after reloading the save
|
Bug #4329: Removed birthsign abilities are restored after reloading the save
|
||||||
Bug #4383: Bow model obscures crosshair when arrow is drawn
|
Bug #4383: Bow model obscures crosshair when arrow is drawn
|
||||||
Bug #4384: Resist Normal Weapons only checks ammunition for ranged weapons
|
Bug #4384: Resist Normal Weapons only checks ammunition for ranged weapons
|
||||||
|
|
|
@ -1119,41 +1119,36 @@ void CharacterController::updatePtr(const MWWorld::Ptr &ptr)
|
||||||
|
|
||||||
void CharacterController::updateIdleStormState(bool inwater)
|
void CharacterController::updateIdleStormState(bool inwater)
|
||||||
{
|
{
|
||||||
bool inStormDirection = false;
|
if (!mAnimation->hasAnimation("idlestorm") || mUpperBodyState != UpperCharState_Nothing || inwater)
|
||||||
|
{
|
||||||
|
mAnimation->disable("idlestorm");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWorld()->isInStorm())
|
if (MWBase::Environment::get().getWorld()->isInStorm())
|
||||||
{
|
{
|
||||||
osg::Vec3f stormDirection = MWBase::Environment::get().getWorld()->getStormDirection();
|
osg::Vec3f stormDirection = MWBase::Environment::get().getWorld()->getStormDirection();
|
||||||
osg::Vec3f characterDirection = mPtr.getRefData().getBaseNode()->getAttitude() * osg::Vec3f(0,1,0);
|
osg::Vec3f characterDirection = mPtr.getRefData().getBaseNode()->getAttitude() * osg::Vec3f(0,1,0);
|
||||||
inStormDirection = std::acos(stormDirection * characterDirection / (stormDirection.length() * characterDirection.length()))
|
stormDirection.normalize();
|
||||||
> osg::DegreesToRadians(120.f);
|
characterDirection.normalize();
|
||||||
}
|
if (stormDirection * characterDirection < -0.5f)
|
||||||
if (inStormDirection && !inwater && mUpperBodyState == UpperCharState_Nothing && mAnimation->hasAnimation("idlestorm"))
|
|
||||||
{
|
|
||||||
float complete = 0;
|
|
||||||
mAnimation->getInfo("idlestorm", &complete);
|
|
||||||
|
|
||||||
if (complete == 0)
|
|
||||||
mAnimation->play("idlestorm", Priority_Storm, MWRender::Animation::BlendMask_RightArm, false,
|
|
||||||
1.0f, "start", "loop start", 0.0f, 0);
|
|
||||||
else if (complete == 1)
|
|
||||||
mAnimation->play("idlestorm", Priority_Storm, MWRender::Animation::BlendMask_RightArm, false,
|
|
||||||
1.0f, "loop start", "loop stop", 0.0f, ~0ul);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (mUpperBodyState == UpperCharState_Nothing)
|
|
||||||
{
|
{
|
||||||
if (mAnimation->isPlaying("idlestorm"))
|
if (!mAnimation->isPlaying("idlestorm"))
|
||||||
{
|
{
|
||||||
if (mAnimation->getCurrentTime("idlestorm") < mAnimation->getTextKeyTime("idlestorm: loop stop"))
|
mAnimation->play("idlestorm", Priority_Storm, MWRender::Animation::BlendMask_RightArm, true,
|
||||||
{
|
1.0f, "start", "stop", 0.0f, ~0ul);
|
||||||
mAnimation->play("idlestorm", Priority_Storm, MWRender::Animation::BlendMask_RightArm, true,
|
|
||||||
1.0f, "loop stop", "stop", 0.0f, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAnimation->setLoopingEnabled("idlestorm", true);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
mAnimation->disable("idlestorm");
|
|
||||||
|
if (mAnimation->isPlaying("idlestorm"))
|
||||||
|
{
|
||||||
|
mAnimation->setLoopingEnabled("idlestorm", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -710,10 +710,9 @@ void WeatherManager::update(float duration, bool paused, const TimeStamp& time,
|
||||||
if (mIsStorm)
|
if (mIsStorm)
|
||||||
{
|
{
|
||||||
osg::Vec3f playerPos (player.getRefData().getPosition().asVec3());
|
osg::Vec3f playerPos (player.getRefData().getPosition().asVec3());
|
||||||
osg::Vec3f redMountainPos (19950, 72032, 27831);
|
playerPos.z() = 0;
|
||||||
|
osg::Vec3f redMountainPos (25000, 70000, 0);
|
||||||
mStormDirection = (playerPos - redMountainPos);
|
mStormDirection = (playerPos - redMountainPos);
|
||||||
mStormDirection.z() = 0;
|
|
||||||
mStormDirection.normalize();
|
mStormDirection.normalize();
|
||||||
mRendering.getSkyManager()->setStormDirection(mStormDirection);
|
mRendering.getSkyManager()->setStormDirection(mStormDirection);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue