Filter NaN and Infinity values at SOP AngularVelocity setter

inv-download
dahlia 2015-02-16 19:06:01 -08:00
parent f62008f728
commit 2700b096bc
1 changed files with 6 additions and 1 deletions

View File

@ -959,7 +959,12 @@ namespace OpenSim.Region.Framework.Scenes
}
set
{
if (float.IsNaN(value.X) || float.IsNaN(value.Y) || float.IsNaN(value.Z)
|| float.IsInfinity(value.X) || float.IsInfinity(value.Y) || float.IsInfinity(value.Z))
m_angularVelocity = Vector3.Zero;
else
m_angularVelocity = value;
PhysicsActor actor = PhysActor;
if ((actor != null) && actor.IsPhysical)
actor.RotationalVelocity = m_angularVelocity;