mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-13 00:43:05 +00:00
Reduce calls in CharacterController::updateIdleStormState
This commit is contained in:
parent
e85a979f10
commit
dd222b9ef1
1 changed files with 3 additions and 2 deletions
|
|
@ -1101,9 +1101,10 @@ void CharacterController::updateIdleStormState(bool inwater)
|
||||||
return;
|
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);
|
osg::Vec3f characterDirection = mPtr.getRefData().getBaseNode()->getAttitude() * osg::Vec3f(0,1,0);
|
||||||
stormDirection.normalize();
|
stormDirection.normalize();
|
||||||
characterDirection.normalize();
|
characterDirection.normalize();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue