diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3b7c0d97b9..03ab7b0777 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -79,6 +79,14 @@ namespace OpenSim.Region.Framework.Scenes /// public bool m_physicalPrim; + /// + /// Controls whether prims can be collided with. + /// + /// + /// If this is set to false then prims cannot be subject to physics either. + /// + public bool CollidablePrims { get; private set; } + public float m_maxNonphys = 256; public float m_maxPhys = 10; public bool m_clampPrimSize; @@ -667,6 +675,7 @@ namespace OpenSim.Region.Framework.Scenes m_usePreJump = startupConfig.GetBoolean("enableprejump", false); m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); + CollidablePrims = startupConfig.GetBoolean("collidable_prim", true); m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); if (RegionInfo.NonphysPrimMax > 0) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index bae8202582..254c037af9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1503,6 +1503,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive, bool m_physicalPrim) { + if (!ParentGroup.Scene.CollidablePrims) + return; + // m_log.DebugFormat( // "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", // Name, LocalId, UUID, m_physicalPrim); @@ -4358,7 +4361,7 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup.Scene == null) return; - if (PhysActor == null) + if (ParentGroup.Scene.CollidablePrims && PhysActor == null) { // It's not phantom anymore. So make sure the physics engine get's knowledge of it PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index c46f4bfe23..6334ca24c5 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -173,6 +173,11 @@ ; ## PHYSICS ; ## + ; If true then prims can be collided with by avatars, other prims, etc. + ; If false then all prims are phantom, no matter whether their phantom flag is checked or unchecked. + ; Also, no prims are subject to physics. + collidable_prim = true + ; If true then prims can be made subject to physics (gravity, pushing, etc.). ; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction physical_prim = true