From 1b1871120516552fd5e51e15fa95c2f881647088 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Fri, 16 Sep 2016 19:33:49 +0100
Subject: move SpinObject funtions from Scenegraph to PacketHandlers, close to
grab handles, since they are related operations (possible should be moving to
graph, not clear this files roles)
---
.../Framework/Scenes/Scene.PacketHandlers.cs | 58 ++++++++++++++++++++++
OpenSim/Region/Framework/Scenes/Scene.cs | 10 ++--
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 40 ---------------
3 files changed, 64 insertions(+), 44 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index d27af09..b041986 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -413,6 +413,64 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ ///
+ /// Start spinning the given object
+ ///
+ ///
+ ///
+ ///
+ public virtual void ProcessSpinStart(UUID objectID, IClientAPI remoteClient)
+ {
+ SceneObjectGroup group = GetGroupByPrim(objectID);
+ if (group != null)
+ {
+ if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
+ {
+ group.SpinStart(remoteClient);
+ }
+ }
+ }
+
+ ///
+ /// Spin the given object
+ ///
+ ///
+ ///
+ ///
+ public virtual void ProcessSpinObject(UUID objectID, Quaternion rotation, IClientAPI remoteClient)
+ {
+ SceneObjectGroup group = GetGroupByPrim(objectID);
+ if (group != null)
+ {
+ if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
+ {
+ 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 virtual void ProcessSpinObjectStop(UUID objectID, IClientAPI remoteClient)
+ {
+ SceneObjectGroup group = GetGroupByPrim(objectID);
+ if (group != null)
+ {
+ if (Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
+ {
+// 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,
UUID itemID)
{
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 0d6af77..d77b8ae 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3329,8 +3329,6 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectRequest += RequestPrim;
client.OnObjectSelect += SelectPrim;
client.OnObjectDeselect += DeselectPrim;
- client.OnSpinStart += m_sceneGraph.SpinStart;
- client.OnSpinUpdate += m_sceneGraph.SpinObject;
client.OnDeRezObject += DeRezObjects;
client.OnObjectName += m_sceneGraph.PrimName;
@@ -3346,6 +3344,9 @@ namespace OpenSim.Region.Framework.Scenes
client.OnGrabObject += ProcessObjectGrab;
client.OnGrabUpdate += ProcessObjectGrabUpdate;
client.OnDeGrabObject += ProcessObjectDeGrab;
+ client.OnSpinStart += ProcessSpinStart;
+ client.OnSpinUpdate += ProcessSpinObject;
+ client.OnSpinStop += ProcessSpinObjectStop;
client.OnUndo += m_sceneGraph.HandleUndo;
client.OnRedo += m_sceneGraph.HandleRedo;
client.OnObjectDescription += m_sceneGraph.PrimDescription;
@@ -3456,8 +3457,6 @@ namespace OpenSim.Region.Framework.Scenes
client.OnObjectRequest -= RequestPrim;
client.OnObjectSelect -= SelectPrim;
client.OnObjectDeselect -= DeselectPrim;
- client.OnSpinStart -= m_sceneGraph.SpinStart;
- client.OnSpinUpdate -= m_sceneGraph.SpinObject;
client.OnDeRezObject -= DeRezObjects;
client.OnObjectName -= m_sceneGraph.PrimName;
client.OnObjectClickAction -= m_sceneGraph.PrimClickAction;
@@ -3472,6 +3471,9 @@ namespace OpenSim.Region.Framework.Scenes
client.OnGrabObject -= ProcessObjectGrab;
client.OnGrabUpdate -= ProcessObjectGrabUpdate;
client.OnDeGrabObject -= ProcessObjectDeGrab;
+ client.OnSpinStart -= ProcessSpinStart;
+ client.OnSpinUpdate -= ProcessSpinObject;
+ client.OnSpinStop -= ProcessSpinObjectStop;
client.OnUndo -= m_sceneGraph.HandleUndo;
client.OnRedo -= m_sceneGraph.HandleRedo;
client.OnObjectDescription -= m_sceneGraph.PrimDescription;
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 0e5720f..4947083 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1700,46 +1700,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
*/
- ///
- /// Start spinning the given object
- ///
- ///
- ///
- ///
- protected internal void SpinStart(UUID objectID, IClientAPI remoteClient)
- {
- SceneObjectGroup group = GetGroupByPrim(objectID);
- if (group != null)
- {
- if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
- {
- group.SpinStart(remoteClient);
- }
- }
- }
-
- ///
- /// Spin the given object
- ///
- ///
- ///
- ///
- protected internal void SpinObject(UUID objectID, Quaternion rotation, IClientAPI remoteClient)
- {
- SceneObjectGroup group = GetGroupByPrim(objectID);
- if (group != null)
- {
- if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
- {
- 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();
- }
- }
///
///
--
cgit v1.1