本文整理汇总了C#中OpenSim.Framework.SurfaceTouchEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SurfaceTouchEventArgs类的具体用法?C# SurfaceTouchEventArgs怎么用?C# SurfaceTouchEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SurfaceTouchEventArgs类属于OpenSim.Framework命名空间,在下文中一共展示了SurfaceTouchEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TriggerObjectDeGrab
public void TriggerObjectDeGrab(uint localID, uint originalID, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
handlerObjectDeGrab = OnObjectDeGrab;
if (handlerObjectDeGrab != null)
{
handlerObjectDeGrab(localID, originalID, remoteClient, surfaceArgs);
}
}
示例2: touch_end
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];
det[0] = new DetectParams();
det[0].Key = remoteClient.AgentId;
det[0].Populate(myScriptEngine.World);
if (originalID == 0)
{
SceneObjectPart part = myScriptEngine.World.GetSceneObjectPart(localID);
if (part == null)
return;
det[0].LinkNum = part.LinkNum;
}
else
{
SceneObjectPart originalPart = myScriptEngine.World.GetSceneObjectPart(originalID);
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));
}
示例3: Touch
public bool Touch(UUID target)
{
SceneObjectPart part = m_scene.GetSceneObjectPart(target);
if (part == null)
return false;
bool objectTouchable = hasTouchEvents(part); // Only touch an object that is scripted to respond
if (!objectTouchable && !part.IsRoot)
objectTouchable = hasTouchEvents(part.ParentGroup.RootPart);
if (!objectTouchable)
return false;
// Set up the surface args as if the touch is from a client that does not support this
SurfaceTouchEventArgs surfaceArgs = new SurfaceTouchEventArgs();
surfaceArgs.FaceIndex = -1; // TOUCH_INVALID_FACE
surfaceArgs.Binormal = Vector3.Zero; // TOUCH_INVALID_VECTOR
surfaceArgs.Normal = Vector3.Zero; // TOUCH_INVALID_VECTOR
surfaceArgs.STCoord = new Vector3(-1.0f, -1.0f, 0.0f); // TOUCH_INVALID_TEXCOORD
surfaceArgs.UVCoord = surfaceArgs.STCoord; // TOUCH_INVALID_TEXCOORD
List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
touchArgs.Add(surfaceArgs);
Vector3 offset = part.OffsetPosition * -1.0f;
if (OnGrabObject == null)
return false;
OnGrabObject(part.LocalId, offset, this, touchArgs);
if (OnGrabUpdate != null)
OnGrabUpdate(part.UUID, offset, part.ParentGroup.RootPart.GroupPosition, this, touchArgs);
if (OnDeGrabObject != null)
OnDeGrabObject(part.LocalId, this, touchArgs);
return true;
}
示例4: ConvertIn
public override bool ConvertIn(RegionSyncModule pRegionContext)
{
bool ret = false;
if (base.ConvertIn(pRegionContext))
{
AgentID = DataMap["agentID"].AsUUID();
PrimID = DataMap["primID"].AsUUID();
OriginalPrimID = DataMap["originalPrimID"].AsUUID();
OffsetPos = DataMap["offsetPos"].AsVector3();
SurfaceArgs = new SurfaceTouchEventArgs();
SurfaceArgs.Binormal = DataMap["binormal"].AsVector3();
SurfaceArgs.FaceIndex = DataMap["faceIndex"].AsInteger();
SurfaceArgs.Normal = DataMap["normal"].AsVector3();
SurfaceArgs.Position = DataMap["position"].AsVector3();
SurfaceArgs.STCoord = DataMap["stCoord"].AsVector3();
SurfaceArgs.UVCoord = DataMap["uvCoord"].AsVector3();
ret = true;
}
return ret;
}
示例5: botTouchObject
public void botTouchObject(string bot, string objectID)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botTouchObject", m_host, "bot", m_itemID))
return;
SurfaceTouchEventArgs touchArgs = new SurfaceTouchEventArgs();
IScenePresence sp = World.GetScenePresence(UUID.Parse(bot));
if (sp == null)
return;
ISceneChildEntity child = World.GetSceneObjectPart(UUID.Parse(objectID));
if (child == null)
throw new Exception("Failed to find entity to touch");
World.EventManager.TriggerObjectGrab(child.ParentEntity.RootChild, child, Vector3.Zero, sp.ControllingClient,
touchArgs);
World.EventManager.TriggerObjectGrabbing(child.ParentEntity.RootChild, child, Vector3.Zero,
sp.ControllingClient, touchArgs);
World.EventManager.TriggerObjectDeGrab(child.ParentEntity.RootChild, child, sp.ControllingClient, touchArgs);
}
示例6: TriggerObjectDeGrab
public void TriggerObjectDeGrab (ISceneChildEntity part, ISceneChildEntity child, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
ObjectDeGrabDelegate handlerObjectDeGrab = OnObjectDeGrab;
if (handlerObjectDeGrab != null)
{
foreach (ObjectDeGrabDelegate d in handlerObjectDeGrab.GetInvocationList ())
{
try
{
d (part, child, remoteClient, surfaceArgs);
}
catch (Exception e)
{
m_log.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectDeGrab failed - continuing. {0} {1}",
e.ToString (), e.StackTrace);
}
}
}
}
示例7: TouchCallback
public TouchCallback(UUID obj, UUID req, UUID avt, Vector3 off, SurfaceTouchEventArgs ev)
{
ObjectID = obj;
RequestID = req;
AvatarID = avt;
OffsetPosition = off;
TouchEvent = ev;
}
示例8: TouchObject
public bool TouchObject(UUID objectID)
{
if (m_frozenUser)
return false;
SurfaceTouchEventArgs surfaceArg = new SurfaceTouchEventArgs();
ScenePresence sp = m_scene.GetScenePresence(AgentID);
if (sp == null)
return false;
SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
if (part == null)
return false;
m_scene.ProcessObjectGrab(part.LocalId, Vector3.Zero, this, null);
m_scene.ProcessObjectDeGrab(part.LocalId, this, null);
return true;
}
示例9: TriggerObjectGrab
public void TriggerObjectGrab (ISceneChildEntity part, ISceneChildEntity child, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
ObjectGrabDelegate handlerObjectGrab = OnObjectGrab;
if (handlerObjectGrab != null)
{
foreach (ObjectGrabDelegate d in handlerObjectGrab.GetInvocationList ())
{
try
{
d (part, child, offsetPos, remoteClient, surfaceArgs);
}
catch (Exception e)
{
MainConsole.Instance.ErrorFormat (
"[EVENT MANAGER]: Delegate for TriggerObjectGrab failed - continuing. {0} {1}",
e, e.StackTrace);
}
}
}
}
示例10: EventManager_OnObjectGrabUpdate
void EventManager_OnObjectGrabUpdate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
// Add to queue for all scripts in ObjectID object
DetectParams[] det = new DetectParams[1];
det[0] = new DetectParams();
det[0].Key = remoteClient.AgentId;
det[0].Populate(myScriptEngine.World);
det[0].OffsetPos = offsetPos;
if (originalID == 0)
{
SceneObjectPart part =
myScriptEngine.World.GetSceneObjectPart(localID);
if (part == null)
return;
det[0].LinkNum = part.LinkNum;
}
else
{
SceneObjectPart originalPart =
myScriptEngine.World.GetSceneObjectPart(originalID);
det[0].LinkNum = originalPart.LinkNum;
}
if (surfaceArgs != null)
{
det[0].SurfaceTouchArgs = surfaceArgs;
}
myScriptEngine.UpdateTouchData(localID, det);
}
示例11: touch_start
//(uint localID, Vector3 offsetPos, IClientAPI remoteClient)
public void touch_start(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
string EventParams = "\"touch_start\"," + localID.ToString() + "," + "\"" + remoteClient.AgentId.ToString() + "\"";
m_scriptEngine.ExecutePythonCommand("CreateEventWithName(" + EventParams + ")");
}
示例12: touch_start
/// <summary>
/// Handles piping the proper stuff to The script engine for touching
/// Including DetectedParams
/// </summary>
/// <param name = "part"></param>
/// <param name = "child"></param>
/// <param name = "offsetPos"></param>
/// <param name = "remoteClient"></param>
/// <param name = "surfaceArgs"></param>
public void touch_start(ISceneChildEntity part, ISceneChildEntity child, Vector3 offsetPos,
IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
// Add to queue for all scripts in ObjectID object
Dictionary<UUID, DetectParams> det = new Dictionary<UUID, DetectParams>();
if (!CoalescedTouchEvents.TryGetValue(part.LocalId, out det))
det = new Dictionary<UUID, DetectParams>();
DetectParams detparam = new DetectParams {Key = remoteClient.AgentId};
detparam.Populate(part.ParentEntity.Scene);
detparam.LinkNum = child.LinkNum;
if (surfaceArgs != null)
{
detparam.SurfaceTouchArgs = surfaceArgs;
}
det[remoteClient.AgentId] = detparam;
CoalescedTouchEvents[part.LocalId] = det;
ScriptData[] datas = ScriptEngine.ScriptProtection.GetScripts(part.UUID);
if (datas == null || datas.Length == 0)
return;
string functionName = "touch_start";
object[] param = new Object[] {new LSL_Types.LSLInteger(det.Count)};
#if (!ISWIN)
foreach (ScriptData ID in datas)
{
if (CheckIfEventShouldFire(ID, functionName, param))
{
m_scriptEngine.AddToScriptQueue(ID, functionName, new List<DetectParams>(det.Values).ToArray(), EventPriority.FirstStart, param);
}
}
#else
foreach (ScriptData ID in datas.Where(ID => CheckIfEventShouldFire(ID, functionName, param)))
{
m_scriptEngine.AddToScriptQueue(ID, functionName, new List<DetectParams>(det.Values).ToArray(),
EventPriority.FirstStart, param);
}
#endif
}
示例13: touch_start
/// -----------------------------------------------------------------
/// <summary>
/// </summary>
/// -----------------------------------------------------------------
public void touch_start(uint localID, uint originalID, Vector3 offsetPos,
IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
m_log.DebugFormat("[EventHandlers] Touch event received");
// Find the object UUID associated with the localID/originalID
UUID objectID;
if (originalID == 0)
{
SceneObjectPart part = m_scene.GetSceneObjectPart(localID);
if (part == null)
return;
objectID = part.ParentGroup.UUID;
}
else
{
SceneObjectPart part = m_scene.GetSceneObjectPart(originalID);
if (part == null)
return;
objectID = part.ParentGroup.UUID;
}
// And grab the callbacks we need to send
List<EventCallback> cblist = null;
lock (m_objectRegistry)
{
if (! m_objectRegistry.TryGetValue(objectID, out cblist))
return;
}
// Send the callback
TouchCallback touch = new RemoteControl.Messages.TouchCallback(objectID,UUID.Zero,remoteClient.AgentId,offsetPos,surfaceArgs);
foreach (EventCallback cb in cblist)
{
EndPoint ep = m_dispatcher.LookupEndPoint(cb.EndPointID);
if (ep == null)
{
m_log.WarnFormat("[EventHandlers] unable to locate endpoint {0}",cb.RequestID);
return;
}
touch.RequestID = cb.RequestID;
ep.Send(touch);
}
}
示例14: SyncMsgObjectGrabbing
public SyncMsgObjectGrabbing(RegionSyncModule pRegionContext, UUID pAgentID, UUID pPrimID, UUID pOrigPrimID, Vector3 pOffset, SurfaceTouchEventArgs pTouchArgs)
: base(MsgType.ObjectGrabbing, pRegionContext, pAgentID, pPrimID, pOrigPrimID, pOffset, pTouchArgs)
{
}
示例15: TriggerObjectGrabbing
public void TriggerObjectGrabbing(SceneObjectPart part, SceneObjectPart child, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
ObjectGrabDelegate handlerObjectGrabbing = OnObjectGrabbing;
if (handlerObjectGrabbing != null)
{
foreach (ObjectGrabDelegate d in handlerObjectGrabbing.GetInvocationList())
{
try
{
d(part, child, offsetPos, remoteClient, surfaceArgs);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerObjectGrabbing failed - continuing. {0} {1}",
e.ToString(), e.StackTrace);
}
}
}
}