From c30cb8a9cfd1a9688b81eb4112924eecfb7fae96 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 2 Mar 2020 04:05:18 +0000 Subject: [PATCH] change root part physics type none to apply physics --- .../Framework/Scenes/SceneObjectGroup.cs | 19 ++++++------------- .../Framework/Scenes/SceneObjectPart.cs | 7 ++++++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5f038c2c32..6b60123031 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3420,28 +3420,21 @@ namespace OpenSim.Region.Framework.Scenes linkPart.setGroupPosition(worldPos); linkPart.setOffsetPosition(Vector3.Zero); linkPart.setRotationOffset(worldRot); - linkPart.Rezzed = RootPart.Rezzed; // Create a new SOG to go around this unlinked and unattached SOP SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart); + m_scene.AddNewSceneObject(objectGroup, true); + linkPart.Rezzed = RootPart.Rezzed; + InvalidBoundsRadius(); InvalidatePartsLinkMaps(); - objectGroup.InvalidateEffectivePerms(); - - objectGroup.HasGroupChangedDueToDelink = true; - - // When we delete a group, we currently have to force persist to the database if the object id has changed - // (since delete works by deleting all rows which have a given object id) - - // this is as it seems to be in sl now - if (linkPart.PhysicsShapeType == (byte)PhysShapeType.none) - linkPart.PhysicsShapeType = linkPart.DefaultPhysicsShapeType(); // root prims can't have type none for now - - m_scene.AddNewSceneObject(objectGroup, true); + InvalidateEffectivePerms(); if (m_rootPart.PhysActor != null) m_rootPart.PhysActor.Building = false; + objectGroup.HasGroupChangedDueToDelink = true; + if (sendEvents) linkPart.TriggerScriptChangedEvent(Changed.LINK); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ac311d3fd2..96085948fd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2068,7 +2068,12 @@ namespace OpenSim.Region.Framework.Scenes return; if (PhysicsShapeType == (byte)PhysShapeType.none) - return; + { + if(ParentID == 0) + m_physicsShapeType = DefaultPhysicsShapeType(); + else + return; + } bool isPhysical = (_ObjectFlags & (uint) PrimFlags.Physics) != 0; bool isPhantom = (_ObjectFlags & (uint)PrimFlags.Phantom) != 0;