From 886f8b5548fa7b781b4382f607a44734c88f549b Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 15 Nov 2007 19:11:25 +0000 Subject: make Stopped a bit sloppier which should help address any float round off issues --- .../OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 41bd718..44461df 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -122,12 +122,13 @@ namespace OpenSim.DataStore.MonoSqlite private bool Stopped(SceneObjectPart prim) { - return (prim.Velocity.X == 0.0 && - prim.Velocity.Y == 0.0 && - prim.Velocity.Z == 0.0 && - prim.AngularVelocity.X == 0.0 && - prim.AngularVelocity.Y == 0.0 && - prim.AngularVelocity.Z == 0.0); + double threshold = 0.02; + return (Math.Abs(prim.Velocity.X) < threshold && + Math.Abs(prim.Velocity.Y) < threshold && + Math.Abs(prim.Velocity.Z) < threshold && + Math.Abs(prim.AngularVelocity.X) < threshold && + Math.Abs(prim.AngularVelocity.Y) < threshold && + Math.Abs(prim.AngularVelocity.Z) < threshold); } public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID) -- cgit v1.1