1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Reduce calls in CharacterController::updateIdleStormState

This commit is contained in:
ζeh Matt 2022-04-09 01:21:34 +03:00
parent e85a979f10
commit dd222b9ef1
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0

View File

@ -1101,9 +1101,10 @@ void CharacterController::updateIdleStormState(bool inwater)
return;
}
if (MWBase::Environment::get().getWorld()->isInStorm())
auto* world = MWBase::Environment::get().getWorld();
if (world->isInStorm())
{
osg::Vec3f stormDirection = MWBase::Environment::get().getWorld()->getStormDirection();
osg::Vec3f stormDirection = world->getStormDirection();
osg::Vec3f characterDirection = mPtr.getRefData().getBaseNode()->getAttitude() * osg::Vec3f(0,1,0);
stormDirection.normalize();
characterDirection.normalize();