From cca94aaefc36fad366e789d6d2e902dda078e3f7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 6 Mar 2012 05:13:39 +0000 Subject: make copied parts have diferent LocalIds than original. More building control for ubitODE. for all let physics know about linking of physical parts. Assume UNTESTED --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 1c72b10..b132a19 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1727,8 +1727,6 @@ namespace OpenSim.Region.Framework.Scenes // Move afterwards ResetIDs as it clears the localID dupe.LocalId = localID; - if(dupe.PhysActor != null) - dupe.PhysActor.LocalID = localID; // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. dupe.LastOwnerID = OwnerID; @@ -1749,6 +1747,9 @@ namespace OpenSim.Region.Framework.Scenes dupe.DoPhysicsPropertyUpdate(UsePhysics, true); } + if (dupe.PhysActor != null) + dupe.PhysActor.LocalID = localID; + ParentGroup.Scene.EventManager.TriggerOnSceneObjectPartCopy(dupe, this, userExposed); // m_log.DebugFormat("[SCENE OBJECT PART]: Clone of {0} {1} finished", Name, UUID); -- cgit v1.1 From 17b1454d6f3b45618b1007c85fe97242284aff3c Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 6 Mar 2012 20:20:12 +0100 Subject: Null PhysActor on SOP.Copy() to prevent clobbering the original one --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b132a19..9c06786 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1691,10 +1691,9 @@ namespace OpenSim.Region.Framework.Scenes if (userExposed) dupe.UUID = UUID.Random(); - //memberwiseclone means it also clones the physics actor reference - // This will make physical prim 'bounce' if not set to null. - if (!userExposed) - dupe.PhysActor = null; + // The PhysActor cannot be valid on a copy because the copy is not in the scene yet. + // Null it, the caller has to create a new one once the object is added to a scene + dupe.PhysActor = null; dupe.OwnerID = AgentID; dupe.GroupID = GroupID; -- cgit v1.1