mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 22:15:35 +00:00
Avoid division by zero in movementsolver when an actor is immobile and
in a storm
This commit is contained in:
parent
8ad3d3d792
commit
b4dd9e6b4d
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,7 @@ namespace MWPhysics
|
|||
}
|
||||
|
||||
// Now that we have the effective movement vector, apply wind forces to it
|
||||
if (worldData.mIsInStorm)
|
||||
if (worldData.mIsInStorm && velocity.length() > 0)
|
||||
{
|
||||
osg::Vec3f stormDirection = worldData.mStormDirection;
|
||||
float angleDegrees = osg::RadiansToDegrees(std::acos(stormDirection * velocity / (stormDirection.length() * velocity.length())));
|
||||
|
|
Loading…
Reference in a new issue