本文整理汇总了C#中Aurora.ScriptEngine.AuroraDotNetEngine.DetectParams.Populate方法的典型用法代码示例。如果您正苦于以下问题:C# DetectParams.Populate方法的具体用法?C# DetectParams.Populate怎么用?C# DetectParams.Populate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.ScriptEngine.AuroraDotNetEngine.DetectParams
的用法示例。
在下文中一共展示了DetectParams.Populate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: land_collision_end
public void land_collision_end (ISceneChildEntity part, ColliderArgs col)
{
List<DetectParams> det = new List<DetectParams>();
foreach (DetectedObject detobj in col.Colliders)
{
DetectParams d = new DetectParams();
d.Position = new LSL_Types.Vector3(detobj.posVector.X,
detobj.posVector.Y,
detobj.posVector.Z);
d.Key = detobj.keyUUID;
d.Populate(part.ParentEntity.Scene);
d.LinkNum = part.LinkNum;
det.Add(d);
}
if (det.Count != 0)
{
ScriptData[] datas = ScriptEngine.ScriptProtection.GetScripts(part.UUID);
if (datas == null || datas.Length == 0)
{
//datas = ScriptEngine.ScriptProtection.GetScripts(part.ParentGroup.RootPart.UUID);
//if (datas == null || datas.Length == 0)
return;
}
string functionName = "land_collision_end";
object[] param = new Object[] { new LSL_Types.Vector3(det[0].Position) };
foreach (ScriptData ID in datas)
{
if (CheckIfEventShouldFire(ID, functionName, param))
m_scriptEngine.AddToScriptQueue(ID, functionName, det.ToArray(), EventPriority.FirstStart, param);
}
}
}
示例2: collision_start
public void collision_start (ISceneChildEntity part, ColliderArgs col)
{
// Add to queue for all scripts in ObjectID object
List<DetectParams> det = new List<DetectParams>();
foreach (DetectedObject detobj in col.Colliders)
{
DetectParams d = new DetectParams();
d.Key = detobj.keyUUID;
d.Populate(part.ParentEntity.Scene);
d.LinkNum = part.LinkNum;
det.Add(d);
}
if (det.Count > 0)
{
ScriptData[] datas = ScriptEngine.ScriptProtection.GetScripts(part.UUID);
if (datas == null || datas.Length == 0)
{
//datas = ScriptEngine.ScriptProtection.GetScripts(part.ParentGroup.RootPart.UUID);
//if (datas == null || datas.Length == 0)
return;
}
string functionName = "collision_start";
object[] param = new Object[] { new LSL_Types.LSLInteger(det.Count) };
foreach (ScriptData ID in datas)
{
if (CheckIfEventShouldFire(ID, functionName, param))
m_scriptEngine.AddToScriptQueue(ID, functionName, det.ToArray(), EventPriority.FirstStart, param);
}
}
}
示例3: touch
public void touch(ISceneChildEntity part, ISceneChildEntity child, Vector3 offsetPos,
IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs)
{
Dictionary<UUID, DetectParams> det = new Dictionary<UUID, DetectParams>();
if (!CoalescedTouchEvents.TryGetValue(part.LocalId, out det))
det = new Dictionary<UUID, DetectParams>();
// Add to queue for all scripts in ObjectID object
DetectParams detparam = new DetectParams();
detparam = new DetectParams
{
Key = remoteClient.AgentId,
OffsetPos = new LSL_Types.Vector3(offsetPos.X,
offsetPos.Y,
offsetPos.Z)
};
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";
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
}
示例4: touch_end
public void touch_end (ISceneChildEntity part, ISceneChildEntity child, IClientAPI remoteClient,
SurfaceTouchEventArgs surfaceArgs)
{
Dictionary<UUID, DetectParams> det = new Dictionary<UUID, DetectParams>();
if (!CoalescedTouchEvents.TryGetValue(part.LocalId, out det))
det = new Dictionary<UUID, DetectParams>();
// Add to queue for all scripts in ObjectID object
DetectParams detparam = new DetectParams();
detparam = new DetectParams();
detparam.Key = remoteClient.AgentId;
detparam.Populate(m_scriptEngine.findPrimsScene(part.LocalId));
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_end";
object[] param = new Object[] { new LSL_Types.LSLInteger (det.Count) };
foreach (ScriptData ID in datas)
{
if (CheckIfEventShouldFire(ID, functionName, param))
m_scriptEngine.AddToScriptQueue(ID, functionName, new List<DetectParams>(det.Values).ToArray(), EventPriority.FirstStart, param);
}
//Remove us from the det param list
det.Remove(remoteClient.AgentId);
CoalescedTouchEvents[part.LocalId] = det;
}
示例5: touch_start
/// <summary>
/// Handles piping the proper stuff to The script engine for touching
/// Including DetectedParams
/// </summary>
/// <param name="localID"></param>
/// <param name="originalID"></param>
/// <param name="offsetPos"></param>
/// <param name="remoteClient"></param>
/// <param name="surfaceArgs"></param>
public void touch_start(SceneObjectPart part, 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();
detparam.Key = remoteClient.AgentId;
detparam.Populate(part.ParentGroup.Scene);
detparam.LinkNum = part.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(1) };
foreach (ScriptData ID in datas)
{
if (CheckIfEventShouldFire(ID, functionName, param))
m_scriptEngine.AddToScriptQueue(ID, functionName, new List<DetectParams>(det.Values).ToArray(), ID.VersionID, EventPriority.FirstStart, param);
}
}