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
parent
fa54ef5030
commit
1adeb8ad77
|
@ -605,7 +605,7 @@ namespace OpenSim.Client.MXP.ClientStack
|
|||
public event ObjectDuplicate OnObjectDuplicate;
|
||||
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
|
||||
public event GrabObject OnGrabObject;
|
||||
public event ObjectSelect OnDeGrabObject;
|
||||
public event DeGrabObject OnDeGrabObject;
|
||||
public event MoveObject OnGrabUpdate;
|
||||
public event SpinStart OnSpinStart;
|
||||
public event SpinObject OnSpinUpdate;
|
||||
|
|
|
@ -252,7 +252,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
|||
public event ObjectDuplicate OnObjectDuplicate = delegate { };
|
||||
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay = delegate { };
|
||||
public event GrabObject OnGrabObject = delegate { };
|
||||
public event ObjectSelect OnDeGrabObject = delegate { };
|
||||
public event DeGrabObject OnDeGrabObject = delegate { };
|
||||
public event MoveObject OnGrabUpdate = delegate { };
|
||||
public event SpinStart OnSpinStart = delegate { };
|
||||
public event SpinObject OnSpinUpdate = delegate { };
|
||||
|
|
|
@ -155,6 +155,9 @@ namespace OpenSim.Framework
|
|||
public delegate void GrabObject(
|
||||
uint localID, Vector3 pos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs);
|
||||
|
||||
public delegate void DeGrabObject(
|
||||
uint localID, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs);
|
||||
|
||||
public delegate void MoveObject(
|
||||
UUID objectID, Vector3 offset, Vector3 grapPos, IClientAPI remoteClient, List<SurfaceTouchEventArgs> surfaceArgs
|
||||
);
|
||||
|
@ -609,7 +612,7 @@ namespace OpenSim.Framework
|
|||
event ObjectDuplicate OnObjectDuplicate;
|
||||
event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
|
||||
event GrabObject OnGrabObject;
|
||||
event ObjectSelect OnDeGrabObject;
|
||||
event DeGrabObject OnDeGrabObject;
|
||||
event MoveObject OnGrabUpdate;
|
||||
event SpinStart OnSpinStart;
|
||||
event SpinObject OnSpinUpdate;
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
private UpdatePrimTexture handlerUpdatePrimTexture;
|
||||
private GrabObject handlerGrabObject; //OnGrabObject;
|
||||
private MoveObject handlerGrabUpdate; //OnGrabUpdate;
|
||||
private ObjectSelect handlerDeGrabObject; //OnDeGrabObject;
|
||||
private DeGrabObject handlerDeGrabObject; //OnDeGrabObject;
|
||||
private SpinStart handlerSpinStart; //OnSpinStart;
|
||||
private SpinObject handlerSpinUpdate; //OnSpinUpdate;
|
||||
private SpinStop handlerSpinStop; //OnSpinStop;
|
||||
|
@ -1021,7 +1021,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
public event LinkObjects OnLinkObjects;
|
||||
public event DelinkObjects OnDelinkObjects;
|
||||
public event GrabObject OnGrabObject;
|
||||
public event ObjectSelect OnDeGrabObject;
|
||||
public event DeGrabObject OnDeGrabObject;
|
||||
public event SpinStart OnSpinStart;
|
||||
public event SpinStop OnSpinStop;
|
||||
public event ObjectDuplicate OnObjectDuplicate;
|
||||
|
@ -5991,7 +5991,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
handlerDeGrabObject = OnDeGrabObject;
|
||||
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;
|
||||
case PacketType.ObjectSpinStart:
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
|||
public event GodKickUser OnGodKickUser;
|
||||
public event ObjectDuplicate OnObjectDuplicate;
|
||||
public event GrabObject OnGrabObject;
|
||||
public event ObjectSelect OnDeGrabObject;
|
||||
public event DeGrabObject OnDeGrabObject;
|
||||
public event MoveObject OnGrabUpdate;
|
||||
public event SpinStart OnSpinStart;
|
||||
public event SpinObject OnSpinUpdate;
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
public event OnShutdownDelegate OnShutdown;
|
||||
|
||||
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 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;
|
||||
if (handlerObjectDeGrab != null)
|
||||
{
|
||||
handlerObjectDeGrab(localID, originalID, remoteClient);
|
||||
handlerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
SurfaceTouchEventArgs surfaceArg = null;
|
||||
if (surfaceArgs != null && surfaceArgs.Count > 0)
|
||||
surfaceArg = surfaceArgs[0];
|
||||
|
||||
foreach (EntityBase ent in EntityList)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
|
@ -288,9 +292,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// If the touched prim handles touches, deliver it
|
||||
// If not, deliver to root prim
|
||||
if ((part.ScriptEvents & scriptEvents.touch_end) != 0)
|
||||
EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient);
|
||||
EventManager.TriggerObjectDeGrab(part.LocalId, 0, remoteClient, surfaceArg);
|
||||
else
|
||||
EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient);
|
||||
EventManager.TriggerObjectDeGrab(obj.RootPart.LocalId, part.LocalId, remoteClient, surfaceArg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -679,7 +679,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
|||
public event ObjectDuplicate OnObjectDuplicate;
|
||||
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
|
||||
public event GrabObject OnGrabObject;
|
||||
public event ObjectSelect OnDeGrabObject;
|
||||
public event DeGrabObject OnDeGrabObject;
|
||||
public event MoveObject OnGrabUpdate;
|
||||
public event SpinStart OnSpinStart;
|
||||
public event SpinObject OnSpinUpdate;
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
|||
public event GodKickUser OnGodKickUser;
|
||||
public event ObjectDuplicate OnObjectDuplicate;
|
||||
public event GrabObject OnGrabObject;
|
||||
public event ObjectSelect OnDeGrabObject;
|
||||
public event DeGrabObject OnDeGrabObject;
|
||||
public event MoveObject OnGrabUpdate;
|
||||
public event SpinStart OnSpinStart;
|
||||
public event SpinObject OnSpinUpdate;
|
||||
|
|
|
@ -208,7 +208,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
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
|
||||
DetectParams[] det = new DetectParams[1];
|
||||
|
@ -232,6 +233,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
|
|||
det[0].LinkNum = originalPart.LinkNum;
|
||||
}
|
||||
|
||||
if (surfaceArgs != null)
|
||||
{
|
||||
det[0].SurfaceTouchArgs = surfaceArgs;
|
||||
}
|
||||
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"touch_end", new Object[] { new LSL_Types.LSLInteger(1) },
|
||||
det));
|
||||
|
|
|
@ -156,7 +156,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
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
|
||||
DetectParams[] det = new DetectParams[1];
|
||||
|
@ -178,6 +179,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
|||
det[0].LinkNum = originalPart.LinkNum;
|
||||
}
|
||||
|
||||
if (surfaceArgs != null)
|
||||
{
|
||||
det[0].SurfaceTouchArgs = surfaceArgs;
|
||||
}
|
||||
|
||||
myScriptEngine.PostObjectEvent(localID, new EventParams(
|
||||
"touch_end", new Object[] { new LSL_Types.LSLInteger(1) },
|
||||
det));
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace OpenSim.Tests.Common.Mock
|
|||
public event GodKickUser OnGodKickUser;
|
||||
public event ObjectDuplicate OnObjectDuplicate;
|
||||
public event GrabObject OnGrabObject;
|
||||
public event ObjectSelect OnDeGrabObject;
|
||||
public event DeGrabObject OnDeGrabObject;
|
||||
public event MoveObject OnGrabUpdate;
|
||||
public event SpinStart OnSpinStart;
|
||||
public event SpinObject OnSpinUpdate;
|
||||
|
|
Loading…
Reference in New Issue