Merge branch 'master' into careminster

avinationmerge
Melanie 2009-12-31 23:31:45 +00:00
commit aa51b83fdc
3 changed files with 293 additions and 64 deletions

View File

@ -413,6 +413,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.
@ -457,6 +460,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; }
@ -1885,7 +1899,14 @@ namespace OpenSim.Region.Framework.Scenes
return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
if (obj != null)
{
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;
@ -1898,6 +1919,30 @@ namespace OpenSim.Region.Framework.Scenes
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
{
ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences();
@ -1907,6 +1952,34 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence av = avlist[i];
if (av.LocalId == localId)
{
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;
@ -1920,6 +1993,9 @@ namespace OpenSim.Region.Framework.Scenes
colliding.Add(detobj);
}
}
}
}
}
}
if (colliding.Count > 0)
@ -1931,7 +2007,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);
}
}
@ -1956,7 +2035,14 @@ namespace OpenSim.Region.Framework.Scenes
return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
if (obj != null)
{
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;
@ -1969,6 +2055,30 @@ namespace OpenSim.Region.Framework.Scenes
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
{
ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences();
@ -1978,10 +2088,16 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence av = avlist[i];
if (av.LocalId == localId)
{
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.Name;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
@ -1990,6 +2106,31 @@ namespace OpenSim.Region.Framework.Scenes
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);
}
}
}
}
}
}
@ -2025,7 +2166,14 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null)
return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
if (obj != null)
{
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;
@ -2038,6 +2186,30 @@ namespace OpenSim.Region.Framework.Scenes
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
{
ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences();
@ -2047,10 +2219,16 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence av = avlist[i];
if (av.LocalId == localId)
{
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.Name;
detobj.nameStr = av.ControllingClient.Name;
detobj.ownerUUID = av.UUID;
detobj.posVector = av.AbsolutePosition;
detobj.rotQuat = av.Rotation;
@ -2059,6 +2237,31 @@ namespace OpenSim.Region.Framework.Scenes
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

@ -2812,7 +2812,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)
@ -4333,7 +4341,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()