From 449bebf16e424b8af5fc1768e880ae64c872773d Mon Sep 17 00:00:00 2001 From: nlin Date: Sat, 4 Apr 2009 13:13:14 +0000 Subject: Preliminary work to support ObjectSpin* packets when user invokes CTRL / SHIFT / MOUSE DRAG on a physical object Addresses Mantis #3381 --- OpenSim/Framework/IClientAPI.cs | 4 ++ .../Region/ClientStack/LindenUDP/LLClientView.cs | 45 ++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 8d6ca7d..79fb763 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -156,6 +156,10 @@ namespace OpenSim.Framework UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient, List surfaceArgs ); + public delegate void SpinStart(UUID objectID, IClientAPI remoteClient); + public delegate void SpinUpdate(UUID objectID, Quaternion rotation, IClientAPI remoteClient); + public delegate void SpinStop(UUID objectID, IClientAPI remoteClient); + public delegate void ParcelAccessListRequest( UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e021849..5c86964 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -170,6 +170,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private GrabObject handlerGrabObject; //OnGrabObject; private MoveObject handlerGrabUpdate; //OnGrabUpdate; private ObjectSelect handlerDeGrabObject; //OnDeGrabObject; + private SpinStart handlerSpinStart; //OnSpinStart; + private SpinUpdate handlerSpinUpdate; //OnSpinUpdate; + private SpinStop handlerSpinStop; //OnSpinStop; private GenericCall7 handlerObjectDescription; private GenericCall7 handlerObjectName; private GenericCall7 handlerObjectClickAction; @@ -929,9 +932,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event DelinkObjects OnDelinkObjects; public event GrabObject OnGrabObject; public event ObjectSelect OnDeGrabObject; + public event SpinStart OnSpinStart; + public event SpinStop OnSpinStop; public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; public event MoveObject OnGrabUpdate; + public event SpinUpdate OnSpinUpdate; public event AddNewPrim OnAddPrim; public event RequestGodlikePowers OnRequestGodlikePowers; public event GodKickUser OnGodKickUser; @@ -5229,6 +5235,41 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerDeGrabObject(deGrab.ObjectData.LocalID, this); } break; + case PacketType.ObjectSpinStart: + //m_log.Warn("[CLIENT]: unhandled ObjectSpinStart packet"); + ObjectSpinStartPacket spinStart = (ObjectSpinStartPacket)Pack; + + handlerSpinStart = OnSpinStart; + if (handlerSpinStart != null) + { + handlerSpinStart(spinStart.ObjectData.ObjectID, this); + } + break; + case PacketType.ObjectSpinUpdate: + //m_log.Warn("[CLIENT]: unhandled ObjectSpinUpdate packet"); + ObjectSpinUpdatePacket spinUpdate = (ObjectSpinUpdatePacket)Pack; + Vector3 axis; + float angle; + spinUpdate.ObjectData.Rotation.GetAxisAngle(out axis, out angle); + //m_log.Warn("[CLIENT]: ObjectSpinUpdate packet rot axis:" + axis + " angle:" + angle); + + handlerSpinUpdate = OnSpinUpdate; + if (handlerSpinUpdate != null) + { + handlerSpinUpdate(spinUpdate.ObjectData.ObjectID, spinUpdate.ObjectData.Rotation, this); + } + break; + case PacketType.ObjectSpinStop: + //m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet"); + ObjectSpinStopPacket spinStop = (ObjectSpinStopPacket)Pack; + + handlerSpinStop = OnSpinStop; + if (handlerSpinStop != null) + { + handlerSpinStop(spinStop.ObjectData.ObjectID, this); + } + break; + case PacketType.ObjectDescription: ObjectDescriptionPacket objDes = (ObjectDescriptionPacket)Pack; @@ -6866,10 +6907,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // TODO: handle this packet //m_log.Warn("[CLIENT]: unhandled AgentHeightWidth packet"); break; - case PacketType.ObjectSpinStop: - // TODO: handle this packet - //m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet"); - break; case PacketType.InventoryDescendents: // TODO: handle this packet -- cgit v1.1