From: Chris Yeoh <yeohc@au1.ibm.com>

This patch ensures that the touch positions are set during touch_end
events (currently only working for touch_start and touch events).
0.6.6-post-fixes
Sean Dague 2009-06-19 12:21:20 +00:00
parent fa54ef5030
commit 1adeb8ad77
12 changed files with 52 additions and 18 deletions

View File

@ -605,7 +605,7 @@ namespace OpenSim.Client.MXP.ClientStack
public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicate OnObjectDuplicate;
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
public event GrabObject OnGrabObject; public event GrabObject OnGrabObject;
public event ObjectSelect OnDeGrabObject; public event DeGrabObject OnDeGrabObject;
public event MoveObject OnGrabUpdate; public event MoveObject OnGrabUpdate;
public event SpinStart OnSpinStart; public event SpinStart OnSpinStart;
public event SpinObject OnSpinUpdate; public event SpinObject OnSpinUpdate;

View File

@ -252,7 +252,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event ObjectDuplicate OnObjectDuplicate = delegate { }; public event ObjectDuplicate OnObjectDuplicate = delegate { };
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay = delegate { }; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay = delegate { };
public event GrabObject OnGrabObject = delegate { }; public event GrabObject OnGrabObject = delegate { };
public event ObjectSelect OnDeGrabObject = delegate { }; public event DeGrabObject OnDeGrabObject = delegate { };
public event MoveObject OnGrabUpdate = delegate { }; public event MoveObject OnGrabUpdate = delegate { };
public event SpinStart OnSpinStart = delegate { }; public event SpinStart OnSpinStart = delegate { };
public event SpinObject OnSpinUpdate = delegate { }; public event SpinObject OnSpinUpdate = delegate { };

View File

@ -155,6 +155,9 @@ namespace OpenSim.Framework
public delegate void GrabObject( public delegate void GrabObject(
uint localID, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs); uint localID, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs);
public delegate void DeGrabObject(
uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs);
public delegate void MoveObject( public delegate void MoveObject(
UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs
); );
@ -609,7 +612,7 @@ namespace OpenSim.Framework
event ObjectDuplicate OnObjectDuplicate; event ObjectDuplicate OnObjectDuplicate;
event ObjectDuplicateOnRay OnObjectDuplicateOnRay; event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
event GrabObject OnGrabObject; event GrabObject OnGrabObject;
event ObjectSelect OnDeGrabObject; event DeGrabObject OnDeGrabObject;
event MoveObject OnGrabUpdate; event MoveObject OnGrabUpdate;
event SpinStart OnSpinStart; event SpinStart OnSpinStart;
event SpinObject OnSpinUpdate; event SpinObject OnSpinUpdate;

View File

@ -197,7 +197,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private UpdatePrimTexture handlerUpdatePrimTexture; private UpdatePrimTexture handlerUpdatePrimTexture;
private GrabObject handlerGrabObject; //OnGrabObject; private GrabObject handlerGrabObject; //OnGrabObject;
private MoveObject handlerGrabUpdate; //OnGrabUpdate; private MoveObject handlerGrabUpdate; //OnGrabUpdate;
private ObjectSelect handlerDeGrabObject; //OnDeGrabObject; private DeGrabObject handlerDeGrabObject; //OnDeGrabObject;
private SpinStart handlerSpinStart; //OnSpinStart; private SpinStart handlerSpinStart; //OnSpinStart;
private SpinObject handlerSpinUpdate; //OnSpinUpdate; private SpinObject handlerSpinUpdate; //OnSpinUpdate;
private SpinStop handlerSpinStop; //OnSpinStop; private SpinStop handlerSpinStop; //OnSpinStop;
@ -1021,7 +1021,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event LinkObjects OnLinkObjects; public event LinkObjects OnLinkObjects;
public event DelinkObjects OnDelinkObjects; public event DelinkObjects OnDelinkObjects;
public event GrabObject OnGrabObject; public event GrabObject OnGrabObject;
public event ObjectSelect OnDeGrabObject; public event DeGrabObject OnDeGrabObject;
public event SpinStart OnSpinStart; public event SpinStart OnSpinStart;
public event SpinStop OnSpinStop; public event SpinStop OnSpinStop;
public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicate OnObjectDuplicate;
@ -5991,7 +5991,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
handlerDeGrabObject = OnDeGrabObject; handlerDeGrabObject = OnDeGrabObject;
if (handlerDeGrabObject != null) if (handlerDeGrabObject != null)
{ {
handlerDeGrabObject(deGrab.ObjectData.LocalID, this); List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
if ((deGrab.SurfaceInfo != null) && (deGrab.SurfaceInfo.Length > 0))
{
foreach (ObjectDeGrabPacket.SurfaceInfoBlock surfaceInfo in deGrab.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);
}
}
handlerDeGrabObject(deGrab.ObjectData.LocalID, this, touchArgs);
} }
break; break;
case PacketType.ObjectSpinStart: case PacketType.ObjectSpinStart:

View File

@ -94,7 +94,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event GodKickUser OnGodKickUser; public event GodKickUser OnGodKickUser;
public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicate OnObjectDuplicate;
public event GrabObject OnGrabObject; public event GrabObject OnGrabObject;
public event ObjectSelect OnDeGrabObject; public event DeGrabObject OnDeGrabObject;
public event MoveObject OnGrabUpdate; public event MoveObject OnGrabUpdate;
public event SpinStart OnSpinStart; public event SpinStart OnSpinStart;
public event SpinObject OnSpinUpdate; public event SpinObject OnSpinUpdate;

View File

@ -93,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes
public event OnShutdownDelegate OnShutdown; public event OnShutdownDelegate OnShutdown;
public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient); public delegate void ObjectDeGrabDelegate(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs);
public delegate void ScriptResetDelegate(uint localID, UUID itemID); public delegate void ScriptResetDelegate(uint localID, UUID itemID);
public delegate void OnPermissionErrorDelegate(UUID user, string reason); public delegate void OnPermissionErrorDelegate(UUID user, string reason);
@ -582,12 +582,12 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient) public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{ {
handlerObjectDeGrab = OnObjectDeGrab; handlerObjectDeGrab = OnObjectDeGrab;
if (handlerObjectDeGrab != null) if (handlerObjectDeGrab != null)
{ {
handlerObjectDeGrab(localID, originalID, remoteClient); handlerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs);
} }
} }

View File

@ -269,10 +269,14 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient) public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs)
{ {
List<EntityBase> EntityList = GetEntities(); List<EntityBase> EntityList = GetEntities();
SurfaceTouchEventArgs surfaceArg = null;
if (surfaceArgs != null && surfaceArgs.Count > 0)
surfaceArg = surfaceArgs[0];
foreach (EntityBase ent in EntityList) foreach (EntityBase ent in EntityList)
{ {
if (ent is SceneObjectGroup) if (ent is SceneObjectGroup)
@ -288,9 +292,9 @@ namespace OpenSim.Region.Framework.Scenes
// If the touched prim handles touches, deliver it // If the touched prim handles touches, deliver it
// If not, deliver to root prim // If not, deliver to root prim
if ((part.ScriptEvents & scriptEvents.touch_end) != 0) if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient); EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
else else
EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient); EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
return; return;
} }

View File

@ -679,7 +679,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicate OnObjectDuplicate;
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
public event GrabObject OnGrabObject; public event GrabObject OnGrabObject;
public event ObjectSelect OnDeGrabObject; public event DeGrabObject OnDeGrabObject;
public event MoveObject OnGrabUpdate; public event MoveObject OnGrabUpdate;
public event SpinStart OnSpinStart; public event SpinStart OnSpinStart;
public event SpinObject OnSpinUpdate; public event SpinObject OnSpinUpdate;

View File

@ -200,7 +200,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public event GodKickUser OnGodKickUser; public event GodKickUser OnGodKickUser;
public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicate OnObjectDuplicate;
public event GrabObject OnGrabObject; public event GrabObject OnGrabObject;
public event ObjectSelect OnDeGrabObject; public event DeGrabObject OnDeGrabObject;
public event MoveObject OnGrabUpdate; public event MoveObject OnGrabUpdate;
public event SpinStart OnSpinStart; public event SpinStart OnSpinStart;
public event SpinObject OnSpinUpdate; public event SpinObject OnSpinUpdate;

View File

@ -208,7 +208,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
det)); det));
} }
public void touch_end(uint localID, uint originalID, IClientAPI remoteClient) public void touch_end(uint localID, uint originalID, IClientAPI remoteClient,
SurfaceTouchEventArgs surfaceArgs)
{ {
// Add to queue for all scripts in ObjectID object // Add to queue for all scripts in ObjectID object
DetectParams[] det = new DetectParams[1]; DetectParams[] det = new DetectParams[1];
@ -232,6 +233,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
det[0].LinkNum = originalPart.LinkNum; det[0].LinkNum = originalPart.LinkNum;
} }
if (surfaceArgs != null)
{
det[0].SurfaceTouchArgs = surfaceArgs;
}
myScriptEngine.PostObjectEvent(localID, new EventParams( myScriptEngine.PostObjectEvent(localID, new EventParams(
"touch_end", new Object[] { new LSL_Types.LSLInteger(1) }, "touch_end", new Object[] { new LSL_Types.LSLInteger(1) },
det)); det));

View File

@ -156,7 +156,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
det)); det));
} }
public void touch_end(uint localID, uint originalID, IClientAPI remoteClient) public void touch_end(uint localID, uint originalID, IClientAPI remoteClient,
SurfaceTouchEventArgs surfaceArgs)
{ {
// Add to queue for all scripts in ObjectID object // Add to queue for all scripts in ObjectID object
DetectParams[] det = new DetectParams[1]; DetectParams[] det = new DetectParams[1];
@ -178,6 +179,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
det[0].LinkNum = originalPart.LinkNum; det[0].LinkNum = originalPart.LinkNum;
} }
if (surfaceArgs != null)
{
det[0].SurfaceTouchArgs = surfaceArgs;
}
myScriptEngine.PostObjectEvent(localID, new EventParams( myScriptEngine.PostObjectEvent(localID, new EventParams(
"touch_end", new Object[] { new LSL_Types.LSLInteger(1) }, "touch_end", new Object[] { new LSL_Types.LSLInteger(1) },
det)); det));

View File

@ -106,7 +106,7 @@ namespace OpenSim.Tests.Common.Mock
public event GodKickUser OnGodKickUser; public event GodKickUser OnGodKickUser;
public event ObjectDuplicate OnObjectDuplicate; public event ObjectDuplicate OnObjectDuplicate;
public event GrabObject OnGrabObject; public event GrabObject OnGrabObject;
public event ObjectSelect OnDeGrabObject; public event DeGrabObject OnDeGrabObject;
public event MoveObject OnGrabUpdate; public event MoveObject OnGrabUpdate;
public event SpinStart OnSpinStart; public event SpinStart OnSpinStart;
public event SpinObject OnSpinUpdate; public event SpinObject OnSpinUpdate;