* Fixed it so you can do a lot more llDetected* methods in many additional situations and have it work.
* script Collision reporting works now in DotNetEngine0.6.0-stable
parent
c53892aa90
commit
6ecb7c05b3
|
@ -2860,137 +2860,224 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
endedColliders.Add(localID);
|
endedColliders.Add(localID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// remove things that ended colliding from the last colliders list
|
|
||||||
foreach (uint localID in endedColliders)
|
|
||||||
{
|
|
||||||
m_lastColliders.Remove(localID);
|
|
||||||
}
|
|
||||||
|
|
||||||
//add the items that started colliding this time to the last colliders list.
|
//add the items that started colliding this time to the last colliders list.
|
||||||
foreach (uint localID in startedColliders)
|
foreach (uint localID in startedColliders)
|
||||||
{
|
{
|
||||||
m_lastColliders.Add(localID);
|
m_lastColliders.Add(localID);
|
||||||
}
|
}
|
||||||
// do event notification
|
// remove things that ended colliding from the last colliders list
|
||||||
if (startedColliders.Count > 0)
|
foreach (uint localID in endedColliders)
|
||||||
{
|
{
|
||||||
ColliderArgs StartCollidingMessage = new ColliderArgs();
|
m_lastColliders.Remove(localID);
|
||||||
List<DetectedObject> colliding = new List<DetectedObject>();
|
|
||||||
foreach (uint localId in startedColliders)
|
|
||||||
{
|
|
||||||
// always running this check because if the user deletes the object it would return a null reference.
|
|
||||||
if (m_parentGroup == null)
|
|
||||||
return;
|
|
||||||
if (m_parentGroup.Scene == null)
|
|
||||||
return;
|
|
||||||
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
|
||||||
if (obj != null)
|
|
||||||
{
|
|
||||||
DetectedObject detobj = new DetectedObject();
|
|
||||||
detobj.keyUUID = obj.UUID;
|
|
||||||
detobj.nameStr = obj.Name;
|
|
||||||
detobj.ownerUUID = obj.OwnerID;
|
|
||||||
detobj.posVector = obj.AbsolutePosition;
|
|
||||||
detobj.rotQuat = obj.GetWorldRotation();
|
|
||||||
detobj.velVector = obj.Velocity;
|
|
||||||
detobj.colliderType = 0;
|
|
||||||
detobj.groupUUID = obj.GroupID;
|
|
||||||
colliding.Add(detobj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (colliding.Count > 0)
|
|
||||||
{
|
|
||||||
StartCollidingMessage.Colliders = colliding;
|
|
||||||
// always running this check because if the user deletes the object it would return a null reference.
|
|
||||||
if (m_parentGroup == null)
|
|
||||||
return;
|
|
||||||
if (m_parentGroup.Scene == null)
|
|
||||||
return;
|
|
||||||
m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (m_lastColliders.Count > 0)
|
if (m_parentGroup == null)
|
||||||
|
return;
|
||||||
|
if (m_parentGroup.RootPart == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0)
|
||||||
{
|
{
|
||||||
ColliderArgs CollidingMessage = new ColliderArgs();
|
// do event notification
|
||||||
List<DetectedObject> colliding = new List<DetectedObject>();
|
if (startedColliders.Count > 0)
|
||||||
foreach (uint localId in m_lastColliders)
|
|
||||||
{
|
{
|
||||||
// always running this check because if the user deletes the object it would return a null reference.
|
ColliderArgs StartCollidingMessage = new ColliderArgs();
|
||||||
if (localId == 0)
|
List<DetectedObject> colliding = new List<DetectedObject>();
|
||||||
continue;
|
foreach (uint localId in startedColliders)
|
||||||
|
|
||||||
if (m_parentGroup == null)
|
|
||||||
return;
|
|
||||||
if (m_parentGroup.Scene == null)
|
|
||||||
return;
|
|
||||||
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
|
||||||
if (obj != null)
|
|
||||||
{
|
{
|
||||||
DetectedObject detobj = new DetectedObject();
|
// always running this check because if the user deletes the object it would return a null reference.
|
||||||
detobj.keyUUID = obj.UUID;
|
if (m_parentGroup == null)
|
||||||
detobj.nameStr = obj.Name;
|
return;
|
||||||
detobj.ownerUUID = obj.OwnerID;
|
if (m_parentGroup.Scene == null)
|
||||||
detobj.posVector = obj.AbsolutePosition;
|
return;
|
||||||
detobj.rotQuat = obj.GetWorldRotation();
|
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
||||||
detobj.velVector = obj.Velocity;
|
if (obj != null)
|
||||||
detobj.colliderType = 0;
|
{
|
||||||
detobj.groupUUID = obj.GroupID;
|
DetectedObject detobj = new DetectedObject();
|
||||||
colliding.Add(detobj);
|
detobj.keyUUID = obj.UUID;
|
||||||
}
|
detobj.nameStr = obj.Name;
|
||||||
}
|
detobj.ownerUUID = obj.OwnerID;
|
||||||
if (colliding.Count > 0)
|
detobj.posVector = obj.AbsolutePosition;
|
||||||
{
|
detobj.rotQuat = obj.GetWorldRotation();
|
||||||
CollidingMessage.Colliders = colliding;
|
detobj.velVector = obj.Velocity;
|
||||||
// always running this check because if the user deletes the object it would return a null reference.
|
detobj.colliderType = 0;
|
||||||
if (m_parentGroup == null)
|
detobj.groupUUID = obj.GroupID;
|
||||||
return;
|
colliding.Add(detobj);
|
||||||
if (m_parentGroup.Scene == null)
|
}
|
||||||
return;
|
else
|
||||||
m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, CollidingMessage);
|
{
|
||||||
}
|
List<ScenePresence> avlist = m_parentGroup.Scene.GetScenePresences();
|
||||||
|
if (avlist != null)
|
||||||
|
{
|
||||||
|
foreach (ScenePresence av in avlist)
|
||||||
|
{
|
||||||
|
if (av.LocalId == localId)
|
||||||
|
{
|
||||||
|
DetectedObject detobj = new DetectedObject();
|
||||||
|
detobj.keyUUID = av.UUID;
|
||||||
|
detobj.nameStr = av.ControllingClient.Name;
|
||||||
|
detobj.ownerUUID = av.UUID;
|
||||||
|
detobj.posVector = av.AbsolutePosition;
|
||||||
|
detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w);
|
||||||
|
detobj.velVector = av.Velocity;
|
||||||
|
detobj.colliderType = 0;
|
||||||
|
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
|
||||||
|
colliding.Add(detobj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (colliding.Count > 0)
|
||||||
|
{
|
||||||
|
StartCollidingMessage.Colliders = colliding;
|
||||||
|
// always running this check because if the user deletes the object it would return a null reference.
|
||||||
|
if (m_parentGroup == null)
|
||||||
|
return;
|
||||||
|
if (m_parentGroup.Scene == null)
|
||||||
|
return;
|
||||||
|
m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (endedColliders.Count > 0)
|
if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision) != 0)
|
||||||
{
|
{
|
||||||
ColliderArgs EndCollidingMessage = new ColliderArgs();
|
if (m_lastColliders.Count > 0)
|
||||||
List<DetectedObject> colliding = new List<DetectedObject>();
|
|
||||||
foreach (uint localId in endedColliders)
|
|
||||||
{
|
{
|
||||||
if (localId == 0)
|
ColliderArgs CollidingMessage = new ColliderArgs();
|
||||||
continue;
|
List<DetectedObject> colliding = new List<DetectedObject>();
|
||||||
|
foreach (uint localId in m_lastColliders)
|
||||||
// always running this check because if the user deletes the object it would return a null reference.
|
|
||||||
if (m_parentGroup == null)
|
|
||||||
return;
|
|
||||||
if (m_parentGroup.Scene == null)
|
|
||||||
return;
|
|
||||||
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
|
||||||
if (obj != null)
|
|
||||||
{
|
{
|
||||||
DetectedObject detobj = new DetectedObject();
|
// always running this check because if the user deletes the object it would return a null reference.
|
||||||
detobj.keyUUID = obj.UUID;
|
if (localId == 0)
|
||||||
detobj.nameStr = obj.Name;
|
continue;
|
||||||
detobj.ownerUUID = obj.OwnerID;
|
|
||||||
detobj.posVector = obj.AbsolutePosition;
|
|
||||||
detobj.rotQuat = obj.GetWorldRotation();
|
|
||||||
detobj.velVector = obj.Velocity;
|
|
||||||
detobj.colliderType = 0;
|
|
||||||
detobj.groupUUID = obj.GroupID;
|
|
||||||
colliding.Add(detobj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (colliding.Count > 0)
|
|
||||||
{
|
|
||||||
EndCollidingMessage.Colliders = colliding;
|
|
||||||
// always running this check because if the user deletes the object it would return a null reference.
|
|
||||||
if (m_parentGroup == null)
|
|
||||||
return;
|
|
||||||
if (m_parentGroup.Scene == null)
|
|
||||||
return;
|
|
||||||
m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, EndCollidingMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (m_parentGroup == null)
|
||||||
|
return;
|
||||||
|
if (m_parentGroup.Scene == null)
|
||||||
|
return;
|
||||||
|
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
||||||
|
if (obj != null)
|
||||||
|
{
|
||||||
|
DetectedObject detobj = new DetectedObject();
|
||||||
|
detobj.keyUUID = obj.UUID;
|
||||||
|
detobj.nameStr = obj.Name;
|
||||||
|
detobj.ownerUUID = obj.OwnerID;
|
||||||
|
detobj.posVector = obj.AbsolutePosition;
|
||||||
|
detobj.rotQuat = obj.GetWorldRotation();
|
||||||
|
detobj.velVector = obj.Velocity;
|
||||||
|
detobj.colliderType = 0;
|
||||||
|
detobj.groupUUID = obj.GroupID;
|
||||||
|
colliding.Add(detobj);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<ScenePresence> avlist = m_parentGroup.Scene.GetScenePresences();
|
||||||
|
if (avlist != null)
|
||||||
|
{
|
||||||
|
foreach (ScenePresence av in avlist)
|
||||||
|
{
|
||||||
|
if (av.LocalId == localId)
|
||||||
|
{
|
||||||
|
DetectedObject detobj = new DetectedObject();
|
||||||
|
detobj.keyUUID = av.UUID;
|
||||||
|
detobj.nameStr = av.Name;
|
||||||
|
detobj.ownerUUID = av.UUID;
|
||||||
|
detobj.posVector = av.AbsolutePosition;
|
||||||
|
detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w);
|
||||||
|
detobj.velVector = av.Velocity;
|
||||||
|
detobj.colliderType = 0;
|
||||||
|
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
|
||||||
|
colliding.Add(detobj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (colliding.Count > 0)
|
||||||
|
{
|
||||||
|
CollidingMessage.Colliders = colliding;
|
||||||
|
// always running this check because if the user deletes the object it would return a null reference.
|
||||||
|
if (m_parentGroup == null)
|
||||||
|
return;
|
||||||
|
if (m_parentGroup.Scene == null)
|
||||||
|
return;
|
||||||
|
m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0)
|
||||||
|
{
|
||||||
|
if (endedColliders.Count > 0)
|
||||||
|
{
|
||||||
|
ColliderArgs EndCollidingMessage = new ColliderArgs();
|
||||||
|
List<DetectedObject> colliding = new List<DetectedObject>();
|
||||||
|
foreach (uint localId in endedColliders)
|
||||||
|
{
|
||||||
|
if (localId == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// always running this check because if the user deletes the object it would return a null reference.
|
||||||
|
if (m_parentGroup == null)
|
||||||
|
return;
|
||||||
|
if (m_parentGroup.Scene == null)
|
||||||
|
return;
|
||||||
|
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
|
||||||
|
if (obj != null)
|
||||||
|
{
|
||||||
|
DetectedObject detobj = new DetectedObject();
|
||||||
|
detobj.keyUUID = obj.UUID;
|
||||||
|
detobj.nameStr = obj.Name;
|
||||||
|
detobj.ownerUUID = obj.OwnerID;
|
||||||
|
detobj.posVector = obj.AbsolutePosition;
|
||||||
|
detobj.rotQuat = obj.GetWorldRotation();
|
||||||
|
detobj.velVector = obj.Velocity;
|
||||||
|
detobj.colliderType = 0;
|
||||||
|
detobj.groupUUID = obj.GroupID;
|
||||||
|
colliding.Add(detobj);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
List<ScenePresence> avlist = m_parentGroup.Scene.GetScenePresences();
|
||||||
|
if (avlist != null)
|
||||||
|
{
|
||||||
|
foreach (ScenePresence av in avlist)
|
||||||
|
{
|
||||||
|
if (av.LocalId == localId)
|
||||||
|
{
|
||||||
|
DetectedObject detobj = new DetectedObject();
|
||||||
|
detobj.keyUUID = av.UUID;
|
||||||
|
detobj.nameStr = av.Name;
|
||||||
|
detobj.ownerUUID = av.UUID;
|
||||||
|
detobj.posVector = av.AbsolutePosition;
|
||||||
|
detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w);
|
||||||
|
detobj.velVector = av.Velocity;
|
||||||
|
detobj.colliderType = 0;
|
||||||
|
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
|
||||||
|
colliding.Add(detobj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (colliding.Count > 0)
|
||||||
|
{
|
||||||
|
EndCollidingMessage.Colliders = colliding;
|
||||||
|
// always running this check because if the user deletes the object it would return a null reference.
|
||||||
|
if (m_parentGroup == null)
|
||||||
|
return;
|
||||||
|
if (m_parentGroup.Scene == null)
|
||||||
|
return;
|
||||||
|
m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -563,6 +563,32 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
return resolveName(SensedUUID);
|
return resolveName(SensedUUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScriptManager sm;
|
||||||
|
IScript script = null;
|
||||||
|
|
||||||
|
if ((sm = m_ScriptEngine.m_ScriptManager) != null)
|
||||||
|
{
|
||||||
|
if (sm.Scripts.ContainsKey(m_localID))
|
||||||
|
{
|
||||||
|
if ((script = sm.GetScript(m_localID, m_itemID)) != null)
|
||||||
|
{
|
||||||
|
//System.Console.WriteLine(number + " - " + script.llDetectParams._key.Length);
|
||||||
|
if (script.llDetectParams._string != null)
|
||||||
|
{
|
||||||
|
if (script.llDetectParams._string.Length > number)
|
||||||
|
{
|
||||||
|
if (script.llDetectParams._string[number] != null)
|
||||||
|
{
|
||||||
|
return script.llDetectParams._string[number];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return String.Empty;
|
return String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,9 +614,13 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
{
|
{
|
||||||
if ((script = sm.GetScript(m_localID, m_itemID)) != null)
|
if ((script = sm.GetScript(m_localID, m_itemID)) != null)
|
||||||
{
|
{
|
||||||
if (script.llDetectParams._key[0])
|
//System.Console.WriteLine(number + " - " + script.llDetectParams._key.Length);
|
||||||
|
if (script.llDetectParams._key.Length > number)
|
||||||
{
|
{
|
||||||
return new LLUUID(script.llDetectParams._key[0]);
|
if (script.llDetectParams._key[number])
|
||||||
|
{
|
||||||
|
return new LLUUID(script.llDetectParams._key[number]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -615,6 +645,36 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
return SensedObject;
|
return SensedObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ScriptManager sm;
|
||||||
|
IScript script = null;
|
||||||
|
|
||||||
|
if ((sm = m_ScriptEngine.m_ScriptManager) != null)
|
||||||
|
{
|
||||||
|
if (sm.Scripts.ContainsKey(m_localID))
|
||||||
|
{
|
||||||
|
if ((script = sm.GetScript(m_localID, m_itemID)) != null)
|
||||||
|
{
|
||||||
|
//System.Console.WriteLine(number + " - " + script.llDetectParams._key.Length);
|
||||||
|
if (script.llDetectParams._key.Length > number)
|
||||||
|
{
|
||||||
|
if (script.llDetectParams._key[number])
|
||||||
|
{
|
||||||
|
LLUUID SensedUUID = new LLUUID(script.llDetectParams._key[number]);
|
||||||
|
EntityBase SensedObject = null;
|
||||||
|
lock (World.Entities)
|
||||||
|
{
|
||||||
|
World.Entities.TryGetValue(SensedUUID, out SensedObject);
|
||||||
|
}
|
||||||
|
return SensedObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,33 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
// Add to queue for all scripts in ObjectID object
|
// Add to queue for all scripts in ObjectID object
|
||||||
EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
|
EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
|
||||||
detstruct._key = new LSL_Types.key[1];
|
detstruct._key = new LSL_Types.key[1];
|
||||||
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
detstruct._key2 = new LSL_Types.key[1];
|
||||||
|
detstruct._string = new string[1];
|
||||||
|
detstruct._Vector3 = new LSL_Types.Vector3[1];
|
||||||
|
detstruct._Vector32 = new LSL_Types.Vector3[1];
|
||||||
|
detstruct._Quaternion = new LSL_Types.Quaternion[1];
|
||||||
|
detstruct._int = new int[1];
|
||||||
|
ScenePresence av = myScriptEngine.World.GetScenePresence(remoteClient.AgentId);
|
||||||
|
if (av != null)
|
||||||
|
{
|
||||||
|
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._string[0] = remoteClient.Name;
|
||||||
|
detstruct._int[0] = 0;
|
||||||
|
detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x,av.Rotation.y,av.Rotation.z,av.Rotation.w);
|
||||||
|
detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X,av.AbsolutePosition.Y,av.AbsolutePosition.Z);
|
||||||
|
detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._string[0] = remoteClient.Name;
|
||||||
|
detstruct._int[0] = 0;
|
||||||
|
detstruct._Quaternion[0] = new LSL_Types.Quaternion(0, 0, 0, 1);
|
||||||
|
detstruct._Vector3[0] = new LSL_Types.Vector3(0, 0, 0);
|
||||||
|
detstruct._Vector32[0] = new LSL_Types.Vector3(0, 0, 0);
|
||||||
|
}
|
||||||
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
|
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +156,33 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
// Add to queue for all scripts in ObjectID object
|
// Add to queue for all scripts in ObjectID object
|
||||||
EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
|
EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct();
|
||||||
detstruct._key = new LSL_Types.key[1];
|
detstruct._key = new LSL_Types.key[1];
|
||||||
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
detstruct._key2 = new LSL_Types.key[1];
|
||||||
|
detstruct._string = new string[1];
|
||||||
|
detstruct._Vector3 = new LSL_Types.Vector3[1];
|
||||||
|
detstruct._Vector32 = new LSL_Types.Vector3[1];
|
||||||
|
detstruct._Quaternion = new LSL_Types.Quaternion[1];
|
||||||
|
detstruct._int = new int[1];
|
||||||
|
ScenePresence av = myScriptEngine.World.GetScenePresence(remoteClient.AgentId);
|
||||||
|
if (av != null)
|
||||||
|
{
|
||||||
|
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._string[0] = remoteClient.Name;
|
||||||
|
detstruct._int[0] = 0;
|
||||||
|
detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w);
|
||||||
|
detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X, av.AbsolutePosition.Y, av.AbsolutePosition.Z);
|
||||||
|
detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X, av.Velocity.Y, av.Velocity.Z);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString());
|
||||||
|
detstruct._string[0] = remoteClient.Name;
|
||||||
|
detstruct._int[0] = 0;
|
||||||
|
detstruct._Quaternion[0] = new LSL_Types.Quaternion(0, 0, 0, 1);
|
||||||
|
detstruct._Vector3[0] = new LSL_Types.Vector3(0, 0, 0);
|
||||||
|
detstruct._Vector32[0] = new LSL_Types.Vector3(0, 0, 0);
|
||||||
|
}
|
||||||
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
|
myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,6 +236,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
|
detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
|
||||||
detstruct._int = new int[col.Colliders.Count];
|
detstruct._int = new int[col.Colliders.Count];
|
||||||
detstruct._key = new LSL_Types.key[col.Colliders.Count];
|
detstruct._key = new LSL_Types.key[col.Colliders.Count];
|
||||||
|
detstruct._key2 = new LSL_Types.key[col.Colliders.Count];
|
||||||
detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
|
detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
|
||||||
detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
|
detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
|
||||||
detstruct._bool = new bool[col.Colliders.Count];
|
detstruct._bool = new bool[col.Colliders.Count];
|
||||||
|
@ -192,6 +245,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
foreach (DetectedObject detobj in col.Colliders)
|
foreach (DetectedObject detobj in col.Colliders)
|
||||||
{
|
{
|
||||||
detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
|
detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
|
||||||
|
detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString());
|
||||||
detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
|
detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
|
||||||
detstruct._string[i] = detobj.nameStr;
|
detstruct._string[i] = detobj.nameStr;
|
||||||
detstruct._int[i] = detobj.colliderType;
|
detstruct._int[i] = detobj.colliderType;
|
||||||
|
@ -211,6 +265,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
|
detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
|
||||||
detstruct._int = new int[col.Colliders.Count];
|
detstruct._int = new int[col.Colliders.Count];
|
||||||
detstruct._key = new LSL_Types.key[col.Colliders.Count];
|
detstruct._key = new LSL_Types.key[col.Colliders.Count];
|
||||||
|
detstruct._key2 = new LSL_Types.key[col.Colliders.Count];
|
||||||
detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
|
detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
|
||||||
detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
|
detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
|
||||||
detstruct._bool = new bool[col.Colliders.Count];
|
detstruct._bool = new bool[col.Colliders.Count];
|
||||||
|
@ -219,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
foreach (DetectedObject detobj in col.Colliders)
|
foreach (DetectedObject detobj in col.Colliders)
|
||||||
{
|
{
|
||||||
detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
|
detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
|
||||||
|
detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString());
|
||||||
detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
|
detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
|
||||||
detstruct._string[i] = detobj.nameStr;
|
detstruct._string[i] = detobj.nameStr;
|
||||||
detstruct._int[i] = detobj.colliderType;
|
detstruct._int[i] = detobj.colliderType;
|
||||||
|
@ -236,6 +292,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
|
detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count];
|
||||||
detstruct._int = new int[col.Colliders.Count];
|
detstruct._int = new int[col.Colliders.Count];
|
||||||
detstruct._key = new LSL_Types.key[col.Colliders.Count];
|
detstruct._key = new LSL_Types.key[col.Colliders.Count];
|
||||||
|
detstruct._key2 = new LSL_Types.key[col.Colliders.Count];
|
||||||
detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
|
detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count];
|
||||||
detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
|
detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count];
|
||||||
detstruct._bool = new bool[col.Colliders.Count];
|
detstruct._bool = new bool[col.Colliders.Count];
|
||||||
|
@ -244,6 +301,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
foreach (DetectedObject detobj in col.Colliders)
|
foreach (DetectedObject detobj in col.Colliders)
|
||||||
{
|
{
|
||||||
detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
|
detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString());
|
||||||
|
detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString());
|
||||||
detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
|
detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W);
|
||||||
detstruct._string[i] = detobj.nameStr;
|
detstruct._string[i] = detobj.nameStr;
|
||||||
detstruct._int[i] = detobj.colliderType;
|
detstruct._int[i] = detobj.colliderType;
|
||||||
|
|
|
@ -153,7 +153,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
||||||
{
|
{
|
||||||
// More or less just a placeholder for the actual moving of additional data
|
// More or less just a placeholder for the actual moving of additional data
|
||||||
// should be fixed to something better :)
|
// should be fixed to something better :)
|
||||||
public LSL_Types.key[] _key;
|
public LSL_Types.key[] _key; // detected key
|
||||||
|
public LSL_Types.key[] _key2; // ownerkey
|
||||||
public LSL_Types.Quaternion[] _Quaternion;
|
public LSL_Types.Quaternion[] _Quaternion;
|
||||||
public LSL_Types.Vector3[] _Vector3; // Pos
|
public LSL_Types.Vector3[] _Vector3; // Pos
|
||||||
public LSL_Types.Vector3[] _Vector32; // Vel
|
public LSL_Types.Vector3[] _Vector32; // Vel
|
||||||
|
|
Loading…
Reference in New Issue