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

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

View File

@ -140,6 +140,9 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore] [XmlIgnore]
public UUID FromItemID; public UUID FromItemID;
[XmlIgnore]
private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>();
/// <value> /// <value>
/// The UUID of the user inventory item from which this object was rezzed if this is a root part. /// The UUID of the user inventory item from which this object was rezzed if this is a root part.
@ -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 public ulong RegionHandle
{ {
get { return m_regionHandle; } get { return m_regionHandle; }
@ -1885,18 +1899,49 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
if (obj != null) if (obj != null)
{ {
DetectedObject detobj = new DetectedObject(); if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
detobj.keyUUID = obj.UUID; {
detobj.nameStr = obj.Name; bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
detobj.ownerUUID = obj._ownerID; //If it is 1, it is to accept ONLY collisions from this object
detobj.posVector = obj.AbsolutePosition; if(found)
detobj.rotQuat = obj.GetWorldRotation(); {
detobj.velVector = obj.Velocity; DetectedObject detobj = new DetectedObject();
detobj.colliderType = 0; detobj.keyUUID = obj.UUID;
detobj.groupUUID = obj._groupID; detobj.nameStr = obj.Name;
colliding.Add(detobj); 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 else
{ {
@ -1908,16 +1953,47 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
DetectedObject detobj = new DetectedObject(); if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
detobj.keyUUID = av.UUID; {
detobj.nameStr = av.ControllingClient.Name; bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
detobj.ownerUUID = av.UUID; //If it is 1, it is to accept ONLY collisions from this avatar
detobj.posVector = av.AbsolutePosition; if(found)
detobj.rotQuat = av.Rotation; {
detobj.velVector = av.Velocity; DetectedObject detobj = new DetectedObject();
detobj.colliderType = 0; detobj.keyUUID = av.UUID;
detobj.groupUUID = av.ControllingClient.ActiveGroupId; detobj.nameStr = av.ControllingClient.Name;
colliding.Add(detobj); 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);
}
}
} }
} }
} }
@ -1931,7 +2007,10 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null) if (m_parentGroup.Scene == null)
return; return;
if(m_parentGroup.PassCollision == true)
{
//TODO: Add pass to root prim!
}
m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage);
} }
} }
@ -1956,39 +2035,101 @@ namespace OpenSim.Region.Framework.Scenes
return; return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
if (obj != null) if (obj != null)
{ {
DetectedObject detobj = new DetectedObject(); if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
detobj.keyUUID = obj.UUID; {
detobj.nameStr = obj.Name; bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
detobj.ownerUUID = obj._ownerID; //If it is 1, it is to accept ONLY collisions from this object
detobj.posVector = obj.AbsolutePosition; if(found)
detobj.rotQuat = obj.GetWorldRotation(); {
detobj.velVector = obj.Velocity; DetectedObject detobj = new DetectedObject();
detobj.colliderType = 0; detobj.keyUUID = obj.UUID;
detobj.groupUUID = obj._groupID; detobj.nameStr = obj.Name;
colliding.Add(detobj); 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 else
{ {
ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences();
for (int i = 0; i < avlist.Length; i++) for (int i = 0; i < avlist.Length; i++)
{ {
ScenePresence av = avlist[i]; ScenePresence av = avlist[i];
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
DetectedObject detobj = new DetectedObject(); if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
detobj.keyUUID = av.UUID; {
detobj.nameStr = av.Name; bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
detobj.ownerUUID = av.UUID; //If it is 1, it is to accept ONLY collisions from this avatar
detobj.posVector = av.AbsolutePosition; if(found)
detobj.rotQuat = av.Rotation; {
detobj.velVector = av.Velocity; DetectedObject detobj = new DetectedObject();
detobj.colliderType = 0; detobj.keyUUID = av.UUID;
detobj.groupUUID = av.ControllingClient.ActiveGroupId; detobj.nameStr = av.ControllingClient.Name;
colliding.Add(detobj); 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);
}
}
} }
} }
} }
@ -2025,18 +2166,49 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup.Scene == null) if (m_parentGroup.Scene == null)
return; return;
SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
string data = "";
if (obj != null) if (obj != null)
{ {
DetectedObject detobj = new DetectedObject(); if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
detobj.keyUUID = obj.UUID; {
detobj.nameStr = obj.Name; bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
detobj.ownerUUID = obj._ownerID; //If it is 1, it is to accept ONLY collisions from this object
detobj.posVector = obj.AbsolutePosition; if(found)
detobj.rotQuat = obj.GetWorldRotation(); {
detobj.velVector = obj.Velocity; DetectedObject detobj = new DetectedObject();
detobj.colliderType = 0; detobj.keyUUID = obj.UUID;
detobj.groupUUID = obj._groupID; detobj.nameStr = obj.Name;
colliding.Add(detobj); 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 else
{ {
@ -2048,16 +2220,47 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LocalId == localId) if (av.LocalId == localId)
{ {
DetectedObject detobj = new DetectedObject(); if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
detobj.keyUUID = av.UUID; {
detobj.nameStr = av.Name; bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
detobj.ownerUUID = av.UUID; //If it is 1, it is to accept ONLY collisions from this avatar
detobj.posVector = av.AbsolutePosition; if(found)
detobj.rotQuat = av.Rotation; {
detobj.velVector = av.Velocity; DetectedObject detobj = new DetectedObject();
detobj.colliderType = 0; detobj.keyUUID = av.UUID;
detobj.groupUUID = av.ControllingClient.ActiveGroupId; detobj.nameStr = av.ControllingClient.Name;
colliding.Add(detobj); 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

@ -2812,7 +2812,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llCollisionFilter(string name, string id, int accept) public void llCollisionFilter(string name, string id, int accept)
{ {
m_host.AddScriptLPS(1); 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) 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) public void llPassCollisions(int pass)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llPassCollisions"); if(pass == 0)
{
m_host.ParentGroup.PassCollision = false;
}
else
{
m_host.ParentGroup.PassCollision = true;
}
} }
public LSL_String llGetScriptName() public LSL_String llGetScriptName()