diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c2ba893a0f..b828f39dee 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -77,7 +77,15 @@ namespace OpenSim.Region.Framework.Scenes
/// Controls whether physics can be applied to prims. Even if false, prims still have entries in a
/// PhysicsScene in order to perform collision detection
///
- public bool m_physicalPrim;
+ public bool PhysicalPrims { get; private set; }
+
+ ///
+ /// 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;
@@ -673,7 +681,8 @@ namespace OpenSim.Region.Framework.Scenes
//Animation states
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
- m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
+ PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
+ CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index cd825ebaaf..6c57d57f0f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -374,7 +374,6 @@ namespace OpenSim.Region.Framework.Scenes
if (rot != null)
sceneObject.UpdateGroupRotationR((Quaternion)rot);
- //group.ApplyPhysics(m_physicalPrim);
if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
{
sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 948dca2361..7723ebab7f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -769,7 +769,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
}
- ApplyPhysics(m_scene.m_physicalPrim);
+ ApplyPhysics();
if (RootPart.PhysActor != null)
RootPart.Buoyancy = RootPart.Buoyancy;
@@ -1564,8 +1564,7 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Apply physics to this group
///
- ///
- public void ApplyPhysics(bool m_physicalPrim)
+ public void ApplyPhysics()
{
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index fd70bfda93..fa8b1c0174 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1521,6 +1521,9 @@ namespace OpenSim.Region.Framework.Scenes
///
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
{
+ if (!ParentGroup.Scene.CollidablePrims)
+ return;
+
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
// Name, LocalId, UUID, m_physicalPrim);
@@ -1790,7 +1793,7 @@ namespace OpenSim.Region.Framework.Scenes
///
public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
{
- if (!ParentGroup.Scene.m_physicalPrim && UsePhysics)
+ if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
return;
if (IsJoint())
@@ -4375,7 +4378,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 = ParentGroup.Scene.PhysicsScene.AddPrimShape(
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 6a83a98143..d2345bac83 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -181,6 +181,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