make Stopped a bit sloppier which should help address any float round off issues

afrisby
Sean Dague 2007-11-15 19:11:25 +00:00
parent 91b0c44563
commit 886f8b5548
1 changed files with 7 additions and 6 deletions

View File

@ -122,12 +122,13 @@ namespace OpenSim.DataStore.MonoSqlite
private bool Stopped(SceneObjectPart prim) private bool Stopped(SceneObjectPart prim)
{ {
return (prim.Velocity.X == 0.0 && double threshold = 0.02;
prim.Velocity.Y == 0.0 && return (Math.Abs(prim.Velocity.X) < threshold &&
prim.Velocity.Z == 0.0 && Math.Abs(prim.Velocity.Y) < threshold &&
prim.AngularVelocity.X == 0.0 && Math.Abs(prim.Velocity.Z) < threshold &&
prim.AngularVelocity.Y == 0.0 && Math.Abs(prim.AngularVelocity.X) < threshold &&
prim.AngularVelocity.Z == 0.0); Math.Abs(prim.AngularVelocity.Y) < threshold &&
Math.Abs(prim.AngularVelocity.Z) < threshold);
} }
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)