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.
0.6.0-stable
MW 2008-10-10 16:01:59 +00:00
parent 1edfbc652a
commit 5be7442736
5 changed files with 36 additions and 4 deletions

View File

@ -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<SurfaceTouchEventArgs> surfaceArgs);
public delegate void ParcelAccessListRequest(
UUID agentID, UUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client);

View File

@ -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;
}
}

View File

@ -4725,8 +4725,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (handlerGrabUpdate != null)
{
List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
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:

View File

@ -68,7 +68,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
{ this.Stale = true; };
client.OnDelinkObjects += delegate(List<uint> primIds) { this.Stale = true; };
client.OnGrabUpdate += delegate(UUID objectID, Vector3 offset, Vector3 grapPos,
IClientAPI remoteClient) { this.Stale = true; };
IClientAPI remoteClient, List<SurfaceTouchEventArgs> 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,

View File

@ -1214,7 +1214,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="offset"></param>
/// <param name="pos"></param>
/// <param name="remoteClient"></param>
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<SurfaceTouchEventArgs> surfaceArgs)
{
SceneObjectGroup group = GetGroupByPrim(objectID);
if (group != null)