From 10e9ad0086056f4afde081d629eca7cc6520a1ba Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 29 May 2012 16:56:04 +0200 Subject: Fix collision filtering --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 2852c4b..a57e9bc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2495,21 +2495,21 @@ namespace OpenSim.Region.Framework.Scenes { } - private bool CollisionFilteredOut(SceneObjectPart dest, UUID objectID, string objectName) + public bool CollisionFilteredOut(UUID objectID, string objectName) { - if(dest.CollisionFilter.Count == 0) + if(CollisionFilter.Count == 0) return false; - if (dest.CollisionFilter.ContainsValue(objectID.ToString()) || - dest.CollisionFilter.ContainsValue(objectID.ToString() + objectName) || - dest.CollisionFilter.ContainsValue(UUID.Zero.ToString() + objectName)) + if (CollisionFilter.ContainsValue(objectID.ToString()) || + CollisionFilter.ContainsValue(objectID.ToString() + objectName) || + CollisionFilter.ContainsValue(UUID.Zero.ToString() + objectName)) { - if (dest.CollisionFilter.ContainsKey(1)) + if (CollisionFilter.ContainsKey(1)) return false; return true; } - if (dest.CollisionFilter.ContainsKey(1)) + if (CollisionFilter.ContainsKey(1)) return true; return false; @@ -2572,7 +2572,7 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId); if (obj != null) { - if (!dest.CollisionFilteredOut(this, obj.UUID, obj.Name)) + if (!dest.CollisionFilteredOut(obj.UUID, obj.Name)) colliding.Add(CreateDetObject(obj)); } else @@ -2580,7 +2580,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence av = ParentGroup.Scene.GetScenePresence(localId); if (av != null && (!av.IsChildAgent)) { - if (!dest.CollisionFilteredOut(this, av.UUID, av.Name)) + if (!dest.CollisionFilteredOut(av.UUID, av.Name)) colliding.Add(CreateDetObject(av)); } } @@ -2724,7 +2724,7 @@ namespace OpenSim.Region.Framework.Scenes SendCollisionEvent(scriptEvents.collision_start, startedColliders, ParentGroup.Scene.EventManager.TriggerScriptCollidingStart); if (!VolumeDetectActive) - SendCollisionEvent(scriptEvents.collision , m_lastColliders , ParentGroup.Scene.EventManager.TriggerScriptColliding); + SendCollisionEvent(scriptEvents.collision , m_lastColliders , ParentGroup.Scene.EventManager.TriggerScriptColliding); SendCollisionEvent(scriptEvents.collision_end , endedColliders , ParentGroup.Scene.EventManager.TriggerScriptCollidingEnd); if (startedColliders.Contains(0)) -- cgit v1.1 From 100d2968c4ebe3f544e770ef66826d7036d4ed77 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 29 May 2012 17:24:17 +0200 Subject: Add advanced collision processing into ScenePresence --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 324 +++++++++++------------ 1 file changed, 162 insertions(+), 162 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5a3b518..e2f32dd 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3499,7 +3499,7 @@ namespace OpenSim.Region.Framework.Scenes RaiseCollisionScriptEvents(coldata); - if (Invulnerable) + if (Invulnerable || GodLevel >= 200) return; float starthealth = Health; @@ -4096,199 +4096,199 @@ namespace OpenSim.Region.Framework.Scenes } } - private void RaiseCollisionScriptEvents(Dictionary coldata) + private DetectedObject CreateDetObject(SceneObjectPart obj) { - /* - lock(m_collisionEventLock) - { - if (m_collisionEventFlag) - return; - m_collisionEventFlag = true; - } + 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; - Util.FireAndForget(delegate(object x) + return detobj; + } + + private DetectedObject CreateDetObject(ScenePresence av) + { + 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; + + return detobj; + } + + private DetectedObject CreateDetObjectForGround() + { + DetectedObject detobj = new DetectedObject(); + detobj.keyUUID = UUID.Zero; + detobj.nameStr = ""; + detobj.ownerUUID = UUID.Zero; + detobj.posVector = AbsolutePosition; + detobj.rotQuat = Quaternion.Identity; + detobj.velVector = Vector3.Zero; + detobj.colliderType = 0; + detobj.groupUUID = UUID.Zero; + + return detobj; + } + + private ColliderArgs CreateColliderArgs(SceneObjectPart dest, List colliders) + { + ColliderArgs colliderArgs = new ColliderArgs(); + List colliding = new List(); + foreach (uint localId in colliders) { - */ - try + if (localId == 0) + continue; + + SceneObjectPart obj = m_scene.GetSceneObjectPart(localId); + if (obj != null) { - List thisHitColliders = new List(); - List endedColliders = new List(); - List startedColliders = new List(); - List soundinfolist = new List(); - CollisionForSoundInfo soundinfo; - ContactPoint curcontact; - - if (coldata.Count == 0) + if (!dest.CollisionFilteredOut(obj.UUID, obj.Name)) + colliding.Add(CreateDetObject(obj)); + } + else + { + ScenePresence av = m_scene.GetScenePresence(localId); + if (av != null && (!av.IsChildAgent)) { - if (m_lastColliders.Count == 0) - return; // nothing to do - - foreach (uint localID in m_lastColliders) - { - endedColliders.Add(localID); - } - m_lastColliders.Clear(); + if (!dest.CollisionFilteredOut(av.UUID, av.Name)) + colliding.Add(CreateDetObject(av)); } + } + } - else - { - foreach (uint id in coldata.Keys) - { - thisHitColliders.Add(id); - if (!m_lastColliders.Contains(id)) - { - startedColliders.Add(id); - curcontact = coldata[id]; - if (Math.Abs(curcontact.RelativeSpeed) > 0.2) - { - soundinfo = new CollisionForSoundInfo(); - soundinfo.colliderID = id; - soundinfo.position = curcontact.Position; - soundinfo.relativeVel = curcontact.RelativeSpeed; - soundinfolist.Add(soundinfo); - } - } - //m_log.Debug("[SCENE PRESENCE]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString()); - } + colliderArgs.Colliders = colliding; - // calculate things that ended colliding - foreach (uint localID in m_lastColliders) - { - if (!thisHitColliders.Contains(localID)) - { - endedColliders.Add(localID); - } - } - //add the items that started colliding this time to the last colliders list. - foreach (uint localID in startedColliders) - { - m_lastColliders.Add(localID); - } - // remove things that ended colliding from the last colliders list - foreach (uint localID in endedColliders) - { - m_lastColliders.Remove(localID); - } + return colliderArgs; + } - if (soundinfolist.Count > 0) - CollisionSounds.AvatarCollisionSound(this, soundinfolist); + private delegate void ScriptCollidingNotification(uint localID, ColliderArgs message); - // do event notification - if (startedColliders.Count > 0) - { + private void SendCollisionEvent(SceneObjectGroup dest, scriptEvents ev, List colliders, ScriptCollidingNotification notify) + { + ColliderArgs CollidingMessage; - ColliderArgs StartCollidingMessage = new ColliderArgs(); - List colliding = new List(); - foreach (uint localId in startedColliders) - { - if (localId == 0) - continue; + if (colliders.Count > 0) + { + if ((dest.RootPart.ScriptEvents & ev) != 0) + { + CollidingMessage = CreateColliderArgs(dest.RootPart, colliders); - SceneObjectPart obj = 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 (CollidingMessage.Colliders.Count > 0) + notify(dest.RootPart.LocalId, CollidingMessage); + } + } + } - if (colliding.Count > 0) - { - StartCollidingMessage.Colliders = colliding; + private void SendLandCollisionEvent(SceneObjectGroup dest, scriptEvents ev, ScriptCollidingNotification notify) + { + if ((dest.RootPart.ScriptEvents & ev) != 0) + { + ColliderArgs LandCollidingMessage = new ColliderArgs(); + List colliding = new List(); - foreach (SceneObjectGroup att in GetAttachments()) - Scene.EventManager.TriggerScriptCollidingStart(att.LocalId, StartCollidingMessage); - } - } - } + colliding.Add(CreateDetObjectForGround()); + LandCollidingMessage.Colliders = colliding; - if (endedColliders.Count > 0) - { - ColliderArgs EndCollidingMessage = new ColliderArgs(); - List colliding = new List(); - foreach (uint localId in endedColliders) - { - if (localId == 0) - continue; + notify(dest.RootPart.LocalId, LandCollidingMessage); + } + } - SceneObjectPart obj = 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); - } - } + private void RaiseCollisionScriptEvents(Dictionary coldata) + { + try + { + List thisHitColliders = new List(); + List endedColliders = new List(); + List startedColliders = new List(); + List soundinfolist = new List(); + CollisionForSoundInfo soundinfo; + ContactPoint curcontact; - if (colliding.Count > 0) - { - EndCollidingMessage.Colliders = colliding; + if (coldata.Count == 0) + { + if (m_lastColliders.Count == 0) + return; // nothing to do - foreach (SceneObjectGroup att in GetAttachments()) - Scene.EventManager.TriggerScriptCollidingEnd(att.LocalId, EndCollidingMessage); - } + foreach (uint localID in m_lastColliders) + { + endedColliders.Add(localID); } + m_lastColliders.Clear(); + } - if (thisHitColliders.Count > 0) + else + { + foreach (uint id in coldata.Keys) { - ColliderArgs CollidingMessage = new ColliderArgs(); - List colliding = new List(); - foreach (uint localId in thisHitColliders) + thisHitColliders.Add(id); + if (!m_lastColliders.Contains(id)) { - if (localId == 0) - continue; - - SceneObjectPart obj = Scene.GetSceneObjectPart(localId); - string data = ""; - if (obj != null) + startedColliders.Add(id); + curcontact = coldata[id]; + if (Math.Abs(curcontact.RelativeSpeed) > 0.2) { - 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); + soundinfo = new CollisionForSoundInfo(); + soundinfo.colliderID = id; + soundinfo.position = curcontact.Position; + soundinfo.relativeVel = curcontact.RelativeSpeed; + soundinfolist.Add(soundinfo); } } + //m_log.Debug("[SCENE PRESENCE]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString()); + } - if (colliding.Count > 0) + // calculate things that ended colliding + foreach (uint localID in m_lastColliders) + { + if (!thisHitColliders.Contains(localID)) { - CollidingMessage.Colliders = colliding; - - lock (m_attachments) - { - foreach (SceneObjectGroup att in m_attachments) - Scene.EventManager.TriggerScriptColliding(att.LocalId, CollidingMessage); - } + endedColliders.Add(localID); } } + //add the items that started colliding this time to the last colliders list. + foreach (uint localID in startedColliders) + { + m_lastColliders.Add(localID); + } + // remove things that ended colliding from the last colliders list + foreach (uint localID in endedColliders) + { + m_lastColliders.Remove(localID); + } + + if (soundinfolist.Count > 0) + CollisionSounds.AvatarCollisionSound(this, soundinfolist); } - finally + + foreach (SceneObjectGroup att in GetAttachments()) { - m_collisionEventFlag = false; + SendCollisionEvent(att, scriptEvents.collision_start, startedColliders, m_scene.EventManager.TriggerScriptCollidingStart); + SendCollisionEvent(att, scriptEvents.collision , m_lastColliders , m_scene.EventManager.TriggerScriptColliding); + SendCollisionEvent(att, scriptEvents.collision_end , endedColliders , m_scene.EventManager.TriggerScriptCollidingEnd); + + if (startedColliders.Contains(0)) + SendLandCollisionEvent(att, scriptEvents.land_collision_start, m_scene.EventManager.TriggerScriptLandCollidingStart); + if (m_lastColliders.Contains(0)) + SendLandCollisionEvent(att, scriptEvents.land_collision, m_scene.EventManager.TriggerScriptLandColliding); + if (endedColliders.Contains(0)) + SendLandCollisionEvent(att, scriptEvents.land_collision_end, m_scene.EventManager.TriggerScriptLandCollidingEnd); } -// }); + } + finally + { + m_collisionEventFlag = false; + } } private void TeleportFlagsDebug() { -- cgit v1.1 From 3e9a831e87432d971a6006966e35924df1ed855d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 29 May 2012 19:13:27 +0100 Subject: fix physics not reporting collisions only with terrain --- OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index 093bc3c..6e4e41f 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -1118,6 +1118,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (CollisionEventsThisFrame == null) CollisionEventsThisFrame = new CollisionEventUpdate(); CollisionEventsThisFrame.AddCollider(CollidedWith, contact); + _parent_scene.AddCollisionEventReporting(this); } public void SendCollisions() -- cgit v1.1 From 4358bb8f850863aec8a519c6f533c298630dc1af Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 May 2012 00:50:47 +0200 Subject: Fix the log standing attach-from-world bug. --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 50 +++++++++++++-------- .../Avatar/Attachments/AttachmentsModule.cs | 51 ++++++++++++---------- 2 files changed, 59 insertions(+), 42 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 2d46a5b..5912a15 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -3761,24 +3761,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP { SceneObjectPart part = (SceneObjectPart)update.Entity; - // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client - // will never receive an update after a prim kill. Even then, keeping the kill record may be a good - // safety measure. - // - // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update - // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs - // updates and kills on different threads with different scheduling strategies, hence this protection. - // - // This doesn't appear to apply to child prims - a client will happily ignore these updates - // after the root prim has been deleted. - lock (m_killRecord) - { - if (m_killRecord.Contains(part.LocalId)) - continue; - if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) - continue; - } - if (part.ParentGroup.IsDeleted) continue; @@ -3816,7 +3798,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP // attachments until the avatar becomes root. if (sp.IsChildAgent) continue; + + // If the object is an attachment we don't want it to be in the kill + // record. Else attaching from inworld and subsequently dropping + // it will no longer work. + lock (m_killRecord) + { + m_killRecord.Remove(part.LocalId); + m_killRecord.Remove(part.ParentGroup.RootPart.LocalId); + } } + else + { + // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client + // will never receive an update after a prim kill. Even then, keeping the kill record may be a good + // safety measure. + // + // If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update + // after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs + // updates and kills on different threads with different scheduling strategies, hence this protection. + // + // This doesn't appear to apply to child prims - a client will happily ignore these updates + // after the root prim has been deleted. + // + // We ignore this for attachments because attaching something from inworld breaks unless we do. + lock (m_killRecord) + { + if (m_killRecord.Contains(part.LocalId)) + continue; + if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId)) + continue; + } + } + if (part.ParentGroup.IsAttachment && m_disableFacelights) { if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 78ae5e9..d7c7283 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -631,19 +631,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}", // grp.Name, grp.LocalId, remoteClient.Name); - Vector3 inventoryStoredPosition = new Vector3 - (((grp.AbsolutePosition.X > (int)Constants.RegionSize) - ? (float)Constants.RegionSize - 6 - : grp.AbsolutePosition.X) - , - (grp.AbsolutePosition.Y > (int)Constants.RegionSize) - ? (float)Constants.RegionSize - 6 - : grp.AbsolutePosition.Y, - grp.AbsolutePosition.Z); - - Vector3 originalPosition = grp.AbsolutePosition; - - grp.AbsolutePosition = inventoryStoredPosition; +// Vector3 inventoryStoredPosition = new Vector3 +// (((grp.AbsolutePosition.X > (int)Constants.RegionSize) +// ? (float)Constants.RegionSize - 6 +// : grp.AbsolutePosition.X) +// , +// (grp.AbsolutePosition.Y > (int)Constants.RegionSize) +// ? (float)Constants.RegionSize - 6 +// : grp.AbsolutePosition.Y, +// grp.AbsolutePosition.Z); +// +// Vector3 originalPosition = grp.AbsolutePosition; +// +// grp.AbsolutePosition = inventoryStoredPosition; // If we're being called from a script, then trying to serialize that same script's state will not complete // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if @@ -651,7 +651,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // without state on relog. Arguably, this is what we want anyway. string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); - grp.AbsolutePosition = originalPosition; +// grp.AbsolutePosition = originalPosition; AssetBase asset = m_scene.CreateAsset( grp.GetPartName(grp.LocalId), @@ -679,21 +679,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments else // oopsies item.Folder = UUID.Zero; + // Nix the special bits we used to use for slam and the folded perms + uint allowablePermissionsMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move); + if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions()) { - item.BasePermissions = grp.RootPart.NextOwnerMask; - item.CurrentPermissions = grp.RootPart.NextOwnerMask; - item.NextPermissions = grp.RootPart.NextOwnerMask; - item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask; - item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask; + item.BasePermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; + item.CurrentPermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; + item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask; + item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; + item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask; } else { - item.BasePermissions = grp.RootPart.BaseMask; - item.CurrentPermissions = grp.RootPart.OwnerMask; - item.NextPermissions = grp.RootPart.NextOwnerMask; - item.EveryOnePermissions = grp.RootPart.EveryoneMask; - item.GroupPermissions = grp.RootPart.GroupMask; + item.BasePermissions = grp.RootPart.BaseMask & allowablePermissionsMask; + item.CurrentPermissions = grp.RootPart.OwnerMask & allowablePermissionsMask; + item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask; + item.EveryOnePermissions = grp.RootPart.EveryoneMask & allowablePermissionsMask; + item.GroupPermissions = grp.RootPart.GroupMask & allowablePermissionsMask; } item.CreationDate = Util.UnixTimeSinceEpoch(); -- cgit v1.1 From 86f786d673792b0499709d2f5e90b84b610d274e Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 May 2012 16:10:01 +0200 Subject: Prevent multiple requests to go physical from reaching the physics plugin --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index eb68038..ea78dc3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1312,6 +1312,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (!allow) return; + if (m_host.ParentGroup.RootPart.PhysActor != null && + m_host.ParentGroup.RootPart.PhysActor.IsPhysical) + return; + m_host.ScriptSetPhysicsStatus(true); } else -- cgit v1.1 From 058707911551dd2f20740a636a8bb195623c2100 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 May 2012 19:25:52 +0200 Subject: Whitespace fix --- OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 5109a6a..628b727 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs @@ -4066,4 +4066,4 @@ namespace OpenSim.Region.Physics.OdePlugin public Vector3 value; } } -} \ No newline at end of file +} -- cgit v1.1 From c548f4879173ca63972eb09bcac76ca8b36e7108 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 May 2012 19:32:02 +0200 Subject: Guard setting the building flag --- OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 628b727..ac049b2 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs @@ -3320,6 +3320,10 @@ namespace OpenSim.Region.Physics.OdePlugin protected void changeBuilding(bool newbuilding) { + // Check if we need to do anything + if (newbuilding == m_building) + return; + if ((bool)newbuilding) { m_building = true; -- cgit v1.1 From cc903992dd3d74a7ff859f0e1a6363ac0c074520 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 30 May 2012 21:32:15 +0100 Subject: ubitode prim: if makebody() is called already having a body, do a full destrution so there are no 'leaks'. --- OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index ac049b2..9a40ab5 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs @@ -1621,12 +1621,13 @@ namespace OpenSim.Region.Physics.OdePlugin if (Body != IntPtr.Zero) { - d.BodyDestroy(Body); - Body = IntPtr.Zero; +// d.BodyDestroy(Body); +// Body = IntPtr.Zero; + // do a more complet destruction + DestroyBody(); m_log.Warn("[PHYSICS]: MakeBody called having a body"); } - if (d.GeomGetBody(prim_geom) != IntPtr.Zero) { d.GeomSetBody(prim_geom, IntPtr.Zero); -- cgit v1.1