mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-21 18:40:01 +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
@ -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…
x
Reference in New Issue
Block a user