From 0644977819c1704c9d7417984a6366ceefe04c4c Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 10 Oct 2008 17:05:43 +0000 Subject: added a list of SurfaceTouchEventArgs to the IClientAPI.OnGrab event, for the new surface touch parameters in 1.21 viewers. --- OpenSim/Framework/IClientAPI.cs | 4 +++- .../Region/ClientStack/LindenUDP/LLClientView.cs | 21 ++++++++++++++++++--- .../Environment/Modules/World/NPC/NPCAvatar.cs | 2 +- .../Environment/Scenes/Scene.PacketHandlers.cs | 2 +- .../Region/Examples/SimpleModule/MyNpcCharacter.cs | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 26ab586..dd905c9 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -144,6 +144,8 @@ namespace OpenSim.Framework public delegate void AvatarPickerRequest(IClientAPI remoteClient, UUID agentdata, UUID queryID, string UserQuery ); + public delegate void GrabObject(uint localID, Vector3 pos, IClientAPI remoteClient, List surfaceArgs); + public delegate void MoveObject(UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient, List surfaceArgs); public delegate void ParcelAccessListRequest( @@ -426,7 +428,7 @@ namespace OpenSim.Framework event ObjectDuplicate OnObjectDuplicate; event ObjectDuplicateOnRay OnObjectDuplicateOnRay; - event UpdateVector OnGrabObject; + event GrabObject OnGrabObject; event ObjectSelect OnDeGrabObject; event MoveObject OnGrabUpdate; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d82b0cc..7eda272 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -166,7 +166,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private ObjectIncludeInSearch handlerObjectIncludeInSearch = null; private UpdatePrimFlags handlerUpdatePrimFlags = null; //OnUpdatePrimFlags; private UpdatePrimTexture handlerUpdatePrimTexture = null; - private UpdateVector handlerGrabObject = null; //OnGrabObject; + private GrabObject handlerGrabObject = null; //OnGrabObject; private MoveObject handlerGrabUpdate = null; //OnGrabUpdate; private ObjectSelect handlerDeGrabObject = null; //OnDeGrabObject; private GenericCall7 handlerObjectDescription = null; @@ -866,7 +866,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event Action OnRequestAvatarsData; public event LinkObjects OnLinkObjects; public event DelinkObjects OnDelinkObjects; - public event UpdateVector OnGrabObject; + public event GrabObject OnGrabObject; public event ObjectSelect OnDeGrabObject; public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; @@ -4715,7 +4715,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (handlerGrabObject != null) { - handlerGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this); + List touchArgs = new List(); + if ((grab.SurfaceInfo != null) && (grab.SurfaceInfo.Length > 0)) + { + foreach (ObjectGrabPacket.SurfaceInfoBlock surfaceInfo in grab.SurfaceInfo) + { + SurfaceTouchEventArgs arg = new SurfaceTouchEventArgs(); + arg.Binormal = surfaceInfo.Binormal; + arg.FaceIndex = surfaceInfo.FaceIndex; + arg.Normal = surfaceInfo.Normal; + arg.Position = surfaceInfo.Position; + arg.STCoord = surfaceInfo.STCoord; + arg.UVCoord = surfaceInfo.UVCoord; + touchArgs.Add(arg); + } + } + handlerGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this, touchArgs); } break; case PacketType.ObjectGrabUpdate: diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index b438709..d0fbfb9 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -197,7 +197,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public event RequestGodlikePowers OnRequestGodlikePowers; public event GodKickUser OnGodKickUser; public event ObjectDuplicate OnObjectDuplicate; - public event UpdateVector OnGrabObject; + public event GrabObject OnGrabObject; public event ObjectSelect OnDeGrabObject; public event MoveObject OnGrabUpdate; public event ViewerEffectEventHandler OnViewerEffect; diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index b60efdc..e9a381d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -212,7 +212,7 @@ namespace OpenSim.Region.Environment.Scenes m_eventManager.TriggerLandBuy(this, args); } - public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient) + public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List surfaceArgs) { List EntityList = GetEntities(); diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 46c6425..6c2831e 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event RequestGodlikePowers OnRequestGodlikePowers; public event GodKickUser OnGodKickUser; public event ObjectDuplicate OnObjectDuplicate; - public event UpdateVector OnGrabObject; + public event GrabObject OnGrabObject; public event ObjectSelect OnDeGrabObject; public event MoveObject OnGrabUpdate; public event ViewerEffectEventHandler OnViewerEffect; -- cgit v1.1