From 5be74427365c3b712099aba8f8345f5fd92ca2fc Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 10 Oct 2008 16:01:59 +0000 Subject: [PATCH] added a list of SurfaceTouchEventArgs to the IClientAPI.OnGrabUpdate event, for the new surface touch parameters in 1.21 viewers. TODO: add the touch args to OnGrabObject and OnDeGrabObject. --- OpenSim/Framework/IClientAPI.cs | 2 +- OpenSim/Framework/SurfaceTouchEventArgs.cs | 17 +++++++++++++++++ .../ClientStack/LindenUDP/LLClientView.cs | 17 ++++++++++++++++- OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 2 +- OpenSim/Region/Environment/Scenes/InnerScene.cs | 2 +- 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 OpenSim/Framework/SurfaceTouchEventArgs.cs diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 5bf0d19fad..26ab586855 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -144,7 +144,7 @@ namespace OpenSim.Framework public delegate void AvatarPickerRequest(IClientAPI remoteClient, UUID agentdata, UUID queryID, string UserQuery ); - public delegate void MoveObject(UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient); + public delegate void MoveObject(UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient, List surfaceArgs); public delegate void ParcelAccessListRequest( UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client); diff --git a/OpenSim/Framework/SurfaceTouchEventArgs.cs b/OpenSim/Framework/SurfaceTouchEventArgs.cs new file mode 100644 index 0000000000..f34d8bab32 --- /dev/null +++ b/OpenSim/Framework/SurfaceTouchEventArgs.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using OpenMetaverse; + +namespace OpenSim.Framework +{ + public class SurfaceTouchEventArgs + { + public Vector3 Binormal; + public int FaceIndex; + public Vector3 Normal; + public Vector3 Position; + public Vector3 STCoord; + public Vector3 UVCoord; + } +} diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 563d83b808..d82b0cc6d9 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -4725,8 +4725,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (handlerGrabUpdate != null) { + List touchArgs = new List(); + if ((grabUpdate.SurfaceInfo != null) && (grabUpdate.SurfaceInfo.Length > 0)) + { + foreach (ObjectGrabUpdatePacket.SurfaceInfoBlock surfaceInfo in grabUpdate.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); + } + } handlerGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial, - grabUpdate.ObjectData.GrabPosition, this); + grabUpdate.ObjectData.GrabPosition, this, touchArgs); } break; case PacketType.ObjectDeGrab: diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index 49d9aec57c..c77de96c29 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.DataSnapshot.Providers { this.Stale = true; }; client.OnDelinkObjects += delegate(List primIds) { this.Stale = true; }; client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos, - IClientAPI remoteClient) { this.Stale = true; }; + IClientAPI remoteClient, List surfaceArgs) { this.Stale = true; }; client.OnObjectAttach += delegate(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, Quaternion rot) { this.Stale = true; }; client.OnObjectDuplicate += delegate(uint localID, Vector3 offset, uint dupeFlags, UUID AgentID, diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 4840133d87..80d01516bb 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -1214,7 +1214,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - protected internal void MoveObject(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient) + protected internal void MoveObject(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List surfaceArgs) { SceneObjectGroup group = GetGroupByPrim(objectID); if (group != null)