From 19e0ada93af347cff93a3950f66abe245399f8b2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 17 Feb 2008 10:41:08 +0000 Subject: * Located and destroyed the weird velocity and rotation transfers. It turned out to be that the Static PhysicsVector.Zero was transferring velocities between all non fixed objects. Not so static after all :(. Finding it was cruel and unusual punishment from the CLR. * Therefore, when you run through a pile of prim you won't see things rotate when they're not supposed to anymore. * Avatars don't float off either. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 2b02ab9..67b07f6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -77,8 +77,11 @@ namespace OpenSim.Region.Environment.Scenes private bool m_newForce = false; private bool m_newCoarseLocations = true; private bool m_gotAllObjectsInScene = false; - + private bool m_lastPhysicsStoppedStatus = false; + + private LLVector3 m_lastVelocity = LLVector3.Zero; + // Default AV Height private float m_avHeight = 127.0f; @@ -1263,11 +1266,17 @@ namespace OpenSim.Region.Environment.Scenes m_updateCount = 0; } } - else if (Util.GetDistanceTo(lastPhysPos, AbsolutePosition) > 0.02) // physics-related movement + else if ((Util.GetDistanceTo(lastPhysPos, AbsolutePosition) > 0.02) || (Util.GetDistanceTo(m_lastVelocity, m_velocity) > 0.02)) // physics-related movement { + + + // Send Terse Update to all clients updates lastPhysPos and m_lastVelocity + // doing the above assures us that we know what we sent the clients last SendTerseUpdateToAllClients(); m_updateCount = 0; - lastPhysPos = AbsolutePosition; + + + } // followed suggestion from mic bowman. reversed the two lines below. @@ -1308,6 +1317,9 @@ namespace OpenSim.Region.Environment.Scenes m_scene.Broadcast(SendTerseUpdateToClient); + m_lastVelocity = m_velocity; + lastPhysPos = AbsolutePosition; + m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); } @@ -1729,7 +1741,7 @@ namespace OpenSim.Region.Environment.Scenes AbsolutePosition.Z); m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec); - m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; + //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; } -- cgit v1.1