Readds llCollisionFilter and adds llPassCollision.

Applied with whitespace cleanup

Signed-off-by: Melanie <melanie@t-data.com>
mysql-performance
Revolution 2009-12-31 11:41:07 -06:00 committed by Melanie
parent 004c751a1b
commit 3ec502f551
3 changed files with 293 additions and 64 deletions

View File

@ -341,6 +341,17 @@ namespace OpenSim.Region.Framework.Scenes
get { return true; }
}
private bool m_passCollision;
public bool PassCollision
{
get { return m_passCollision; }
set
{
m_passCollision = value;
HasGroupChanged = true;
}
}
public bool IsSelected
{
get { return m_isSelected; }

View File

@ -141,6 +141,9 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore]
public UUID FromItemID;
[XmlIgnore]
private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>();
/// <value>
/// The UUID of the user inventory item from which this object was rezzed if this is a root part.
/// If UUID.Zero then either this is not a root part or there is no connection with a user inventory item.
@ -452,6 +455,17 @@ namespace OpenSim.Region.Framework.Scenes
}
}
[XmlIgnore]
public Dictionary<int, string> CollisionFilter
{
get { return m_CollisionFilter; }
set
{
m_CollisionFilter = value;
}
}
public ulong RegionHandle
{
get { return m_regionHandle; }
@ -1876,18 +1890,49 @@ namespace OpenSim.Region.Framework.Scenes
return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
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(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object
if(found)
{
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 it is 0, it is to not accept collisions from this object
else
{
}
}
else
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(found)
{
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
{
@ -1899,16 +1944,47 @@ namespace OpenSim.Region.Framework.Scenes
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 = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar
if(found)
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this avatar
else
{
}
}
else
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(found)
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
}
}
}
}
@ -1922,7 +1998,10 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null)
return;
if(m_parentGroup.PassCollision == true)
{
//TODO: Add pass to root prim!
}
m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage);
}
}
@ -1947,18 +2026,49 @@ namespace OpenSim.Region.Framework.Scenes
return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
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(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object
if(found)
{
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 it is 0, it is to not accept collisions from this object
else
{
}
}
else
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(found)
{
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
{
@ -1970,16 +2080,47 @@ namespace OpenSim.Region.Framework.Scenes
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 = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar
if(found)
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this avatar
else
{
}
}
else
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(found)
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
}
}
}
}
@ -2016,18 +2157,49 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null)
return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
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(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object
if(found)
{
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 it is 0, it is to not accept collisions from this object
else
{
}
}
else
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
if(found)
{
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
{
@ -2039,16 +2211,47 @@ namespace OpenSim.Region.Framework.Scenes
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 = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar
if(found)
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
//If it is 0, it is to not accept collisions from this avatar
else
{
}
}
else
{
bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
//If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
if(found)
{
DetectedObject detobj = new DetectedObject();
detobj.keyUUID = av.UUID;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
detobj.velVector = av.Velocity;
detobj.colliderType = 0;
detobj.groupUUID = av.ControllingClient.ActiveGroupId;
colliding.Add(detobj);
}
}
}
}
}

View File

@ -2752,7 +2752,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llCollisionFilter(string name, string id, int accept)
{
m_host.AddScriptLPS(1);
NotImplemented("llCollisionFilter");
m_host.CollisionFilter.Clear();
if(id != null)
{
m_host.CollisionFilter.Add(accept,id);
}
else
{
m_host.CollisionFilter.Add(accept,name);
}
}
public void llTakeControls(int controls, int accept, int pass_on)
@ -4232,7 +4240,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llPassCollisions(int pass)
{
m_host.AddScriptLPS(1);
NotImplemented("llPassCollisions");
if(pass == 0)
{
m_host.ParentGroup.PassCollision = false;
}
else
{
m_host.ParentGroup.PassCollision = true;
}
}
public LSL_String llGetScriptName()