make Stopped a property of the SceneObjectPart instead of in the

database code, so this is a shared concept.
afrisby
Sean Dague 2008-01-08 21:56:52 +00:00
parent b9dcb24175
commit ebba112379
2 changed files with 14 additions and 12 deletions

View File

@ -402,6 +402,19 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_shape.Scale; } get { return m_shape.Scale; }
} }
public bool Stopped
{
get {
double threshold = 0.02;
return (Math.Abs(Velocity.X) < threshold &&
Math.Abs(Velocity.Y) < threshold &&
Math.Abs(Velocity.Z) < threshold &&
Math.Abs(AngularVelocity.X) < threshold &&
Math.Abs(AngularVelocity.Y) < threshold &&
Math.Abs(AngularVelocity.Z) < threshold);
}
}
#endregion #endregion
public LLUUID ObjectOwner public LLUUID ObjectOwner

View File

@ -176,17 +176,6 @@ namespace OpenSim.DataStore.MonoSqlite
} }
} }
private bool Stopped(SceneObjectPart prim)
{
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) public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
{ {
lock (ds) lock (ds)
@ -198,7 +187,7 @@ namespace OpenSim.DataStore.MonoSqlite
MainLog.Instance.Verbose("DATASTORE", "Adding obj: " + obj.UUID + " to region: " + regionUUID); MainLog.Instance.Verbose("DATASTORE", "Adding obj: " + obj.UUID + " to region: " + regionUUID);
addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID)); addPrim(prim, Util.ToRawUuidString(obj.UUID), Util.ToRawUuidString(regionUUID));
} }
else if (Stopped(prim)) else if (prim.Stopped)
{ {
MainLog.Instance.Verbose("DATASTORE", MainLog.Instance.Verbose("DATASTORE",
"Adding stopped obj: " + obj.UUID + " to region: " + regionUUID); "Adding stopped obj: " + obj.UUID + " to region: " + regionUUID);