diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index c811966dbd..b06fa2f1ee 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -449,7 +449,11 @@ namespace OpenSim.Region.Environment.Scenes new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); + + rootPart.doPhysicsPropertyUpdate(UsePhysics); + } + rootPart.ScheduleFullUpdate(); } } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 0470335e81..0b9d2180f6 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -647,6 +647,8 @@ namespace OpenSim.Region.Environment.Scenes // if not phantom, add to physics bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_physicalPrim); if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) + { + rootPart.PhysActor = phyScene.AddPrimShape( rootPart.Name, @@ -654,6 +656,10 @@ namespace OpenSim.Region.Environment.Scenes new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), new Quaternion(), UsePhysics); + // subscribe to physics events. + rootPart.doPhysicsPropertyUpdate(UsePhysics); + + } } } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 38e160942d..628bd72a21 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -480,6 +480,8 @@ namespace OpenSim.Region.Environment.Scenes new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X, dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z), dupe.RootPart.PhysActor.IsPhysical); + dupe.RootPart.doPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical); + } // Now we've made a copy that replaces this one, we need to // switch the owner to the person who did the copying @@ -859,6 +861,8 @@ namespace OpenSim.Region.Environment.Scenes new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y, linkPart.RotationOffset.Z), m_rootPart.PhysActor.IsPhysical); + m_rootPart.doPhysicsPropertyUpdate(m_rootPart.PhysActor.IsPhysical); + } SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart); @@ -1165,6 +1169,9 @@ namespace OpenSim.Region.Environment.Scenes new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z), m_rootPart.PhysActor.IsPhysical); + bool UsePhysics = ((m_rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0); + m_rootPart.doPhysicsPropertyUpdate(UsePhysics); + } } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 0da90d528c..18fe7856fa 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -892,10 +892,12 @@ namespace OpenSim.Region.Environment.Scenes new PhysicsVector(Scale.X, Scale.Y, Scale.Z), new Quaternion(RotationOffset.W, RotationOffset.X, RotationOffset.Y, RotationOffset.Z), UsePhysics); + doPhysicsPropertyUpdate(UsePhysics); } else { PhysActor.IsPhysical = UsePhysics; + doPhysicsPropertyUpdate(UsePhysics); } } diff --git a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs index c2bb019d8e..3b5fc575fe 100644 --- a/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs +++ b/OpenSim/Region/Environment/Scenes/SceneXmlLoader.cs @@ -46,6 +46,7 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_parentScene.m_physicalPrim); if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) + { rootPart.PhysActor = m_innerScene.PhyScene.AddPrimShape( rootPart.Name, rootPart.Shape, @@ -54,6 +55,9 @@ namespace OpenSim.Region.Environment.Scenes new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); + rootPart.doPhysicsPropertyUpdate(UsePhysics); + + } primCount++; } } @@ -112,6 +116,7 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); bool UsePhysics = (((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0) && m_parentScene.m_physicalPrim); if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0) + { rootPart.PhysActor = m_innerScene.PhyScene.AddPrimShape( rootPart.Name, rootPart.Shape, @@ -120,6 +125,8 @@ namespace OpenSim.Region.Environment.Scenes new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); + rootPart.doPhysicsPropertyUpdate(UsePhysics); + } } public void SavePrimsToXml2(string fileName)