diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index b0419869bd..a5abe76376 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -456,6 +456,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void ProcessSpinObjectStop(UUID objectID, IClientAPI remoteClient) { +/* no op for now SceneObjectGroup group = GetGroupByPrim(objectID); if (group != null) { @@ -463,12 +464,9 @@ namespace OpenSim.Region.Framework.Scenes { // group.SpinMovement(rotation, remoteClient); } - // This is outside the above permissions condition - // so that if the object is locked the client moving the object - // get's it's position on the simulator even if it was the same as before - // This keeps the moving user's client in sync with the rest of the world. group.SendGroupTerseUpdate(); } +*/ } public void ProcessScriptReset(IClientAPI remoteClient, UUID objectID, diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 4947083063..77c66b61b7 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1674,32 +1674,6 @@ namespace OpenSim.Region.Framework.Scenes } } } -/* moved to scene ProcessObjectGrabUpdate - /// - /// Move the given object - /// - /// - /// - /// - /// - protected internal void MoveObject(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List surfaceArgs) - { - SceneObjectGroup group = GetGroupByPrim(objectID); - if (group != null) - { - if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) - { - group.GrabMovement(objectID, offset, pos, remoteClient); - } - - // This is outside the above permissions condition - // so that if the object is locked the client moving the object - // get's it's position on the simulator even if it was the same as before - // This keeps the moving user's client in sync with the rest of the world. - group.SendGroupTerseUpdate(); - } - } -*/ /// /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 00951d6623..17dfb85bf6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3607,7 +3607,7 @@ namespace OpenSim.Region.Framework.Scenes { if (m_rootPart.IsWaitingForFirstSpinUpdatePacket) { - // first time initialization of "old" orientation for calculation of delta rotations + // first time initialization of "old" orientation for calculation of delta rotations m_rootPart.SpinOldOrientation = newOrientation; m_rootPart.IsWaitingForFirstSpinUpdatePacket = false; } @@ -3620,16 +3620,21 @@ namespace OpenSim.Region.Framework.Scenes //m_log.Error("[SCENE OBJECT GROUP]: Incoming new orientation is " + newOrientation); // compute difference between previous old rotation and new incoming rotation - Quaternion minimalRotationFromQ1ToQ2 = Quaternion.Inverse(old) * newOrientation; + Quaternion minimalRotationFromQ1ToQ2 = newOrientation * Quaternion.Inverse(old); float rotationAngle; - Vector3 rotationAxis; - minimalRotationFromQ1ToQ2.GetAxisAngle(out rotationAxis, out rotationAngle); - rotationAxis.Normalize(); + Vector3 spinforce; + minimalRotationFromQ1ToQ2.GetAxisAngle(out spinforce, out rotationAngle); + if(Math.Abs(rotationAngle)< 0.001) + return; + + spinforce.Normalize(); //m_log.Error("SCENE OBJECT GROUP]: rotation axis is " + rotationAxis); - Vector3 spinforce = new Vector3(rotationAxis.X, rotationAxis.Y, rotationAxis.Z); - spinforce = (spinforce/8) * pa.Mass; // 8 is an arbitrary torque scaling factor + if(rotationAngle > 0) + spinforce = spinforce * pa.Mass * 0.1f; // 0.1 is an arbitrary torque scaling factor + else + spinforce = spinforce * pa.Mass * -0.1f; // 0.1 is an arbitrary torque scaling pa.AddAngularForce(spinforce,true); m_scene.PhysicsScene.AddPhysicsActorTaint(pa); }