From 8e6c20b27fdb95b9008614eb36678508407a4d19 Mon Sep 17 00:00:00 2001 From: nlin Date: Fri, 10 Apr 2009 06:39:52 +0000 Subject: Handle ObjectSpin* packets to spin physical prims on Ctrl+Shift+Drag Addresses Mantis #3381 The current implementation works as expected if the object has no rotation or only rotation around the Z axis; you can spin the object left or right (around the world Z axis). It works a little unexpectedly if the object has a non-Z-axis rotation; in this case the body is spun about its local Z axis, not the world Z-axis. (But SL also behaves oddly with a spin on an arbitrarily rotated object.) --- OpenSim/Region/Framework/Scenes/EventManager.cs | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs') diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 8621f70..7496af0 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -132,6 +132,14 @@ namespace OpenSim.Region.Framework.Scenes public event SceneGroupGrabed OnSceneGroupGrab; + public delegate bool SceneGroupSpinStarted(UUID groupID); + + public event SceneGroupSpinStarted OnSceneGroupSpinStart; + + public delegate bool SceneGroupSpun(UUID groupID, Quaternion rotation); + + public event SceneGroupSpun OnSceneGroupSpin; + public delegate void LandObjectAdded(ILandObject newParcel); public event LandObjectAdded OnLandObjectAdded; @@ -381,6 +389,8 @@ namespace OpenSim.Region.Framework.Scenes private StopScript handlerStopScript = null; //OnStopScript; private SceneGroupMoved handlerSceneGroupMove = null; //OnSceneGroupMove; private SceneGroupGrabed handlerSceneGroupGrab = null; //OnSceneGroupGrab; + private SceneGroupSpinStarted handlerSceneGroupSpinStarted = null; //OnSceneGroupSpinStart; + private SceneGroupSpun handlerSceneGroupSpin = null; //OnSceneGroupSpin; private LandObjectAdded handlerLandObjectAdded = null; //OnLandObjectAdded; private LandObjectRemoved handlerLandObjectRemoved = null; //OnLandObjectRemoved; private AvatarEnteringNewParcel handlerAvatarEnteringNewParcel = null; //OnAvatarEnteringNewParcel; @@ -636,6 +646,28 @@ namespace OpenSim.Region.Framework.Scenes return true; } + public bool TriggerGroupSpinStart(UUID groupID) + { + handlerSceneGroupSpinStarted = OnSceneGroupSpinStart; + + if (handlerSceneGroupSpinStarted != null) + { + return handlerSceneGroupSpinStarted(groupID); + } + return true; + } + + public bool TriggerGroupSpin(UUID groupID, Quaternion rotation) + { + handlerSceneGroupSpin = OnSceneGroupSpin; + + if (handlerSceneGroupSpin != null) + { + return handlerSceneGroupSpin(groupID, rotation); + } + return true; + } + public void TriggerGroupGrab(UUID groupID, Vector3 offset, UUID userID) { handlerSceneGroupGrab = OnSceneGroupGrab; -- cgit v1.1