aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2011-12-22 19:52:59 +0000
committerMelanie2011-12-22 19:52:59 +0000
commiteef6f920295f0d22b37513e6c8eb5eb42b7a0c75 (patch)
tree72a603500425f1fb628e4efa808f3c1ee03e763f
parentMerge branch 'master' into careminster (diff)
parentrename Scene.m_physicalPrim to PhysicalPrims since its public and access exte... (diff)
downloadopensim-SC-eef6f920295f0d22b37513e6c8eb5eb42b7a0c75.zip
opensim-SC-eef6f920295f0d22b37513e6c8eb5eb42b7a0c75.tar.gz
opensim-SC-eef6f920295f0d22b37513e6c8eb5eb42b7a0c75.tar.bz2
opensim-SC-eef6f920295f0d22b37513e6c8eb5eb42b7a0c75.tar.xz
Merge branch 'master' into careminster
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
-rw-r--r--bin/OpenSimDefaults.ini5
5 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index c2ba893..b828f39 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -77,7 +77,15 @@ namespace OpenSim.Region.Framework.Scenes
77 /// Controls whether physics can be applied to prims. Even if false, prims still have entries in a 77 /// Controls whether physics can be applied to prims. Even if false, prims still have entries in a
78 /// PhysicsScene in order to perform collision detection 78 /// PhysicsScene in order to perform collision detection
79 /// </summary> 79 /// </summary>
80 public bool m_physicalPrim; 80 public bool PhysicalPrims { get; private set; }
81
82 /// <summary>
83 /// Controls whether prims can be collided with.
84 /// </summary>
85 /// <remarks>
86 /// If this is set to false then prims cannot be subject to physics either.
87 /// </summary>
88 public bool CollidablePrims { get; private set; }
81 89
82 public float m_maxNonphys = 256; 90 public float m_maxNonphys = 256;
83 public float m_maxPhys = 10; 91 public float m_maxPhys = 10;
@@ -673,7 +681,8 @@ namespace OpenSim.Region.Framework.Scenes
673 //Animation states 681 //Animation states
674 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 682 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
675 683
676 m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); 684 PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
685 CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
677 686
678 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); 687 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
679 688
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index cd825eb..6c57d57 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -374,7 +374,6 @@ namespace OpenSim.Region.Framework.Scenes
374 if (rot != null) 374 if (rot != null)
375 sceneObject.UpdateGroupRotationR((Quaternion)rot); 375 sceneObject.UpdateGroupRotationR((Quaternion)rot);
376 376
377 //group.ApplyPhysics(m_physicalPrim);
378 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) 377 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
379 { 378 {
380 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); 379 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 948dca2..7723eba 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -769,7 +769,7 @@ namespace OpenSim.Region.Framework.Scenes
769 //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); 769 //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);
770 } 770 }
771 771
772 ApplyPhysics(m_scene.m_physicalPrim); 772 ApplyPhysics();
773 773
774 if (RootPart.PhysActor != null) 774 if (RootPart.PhysActor != null)
775 RootPart.Buoyancy = RootPart.Buoyancy; 775 RootPart.Buoyancy = RootPart.Buoyancy;
@@ -1564,8 +1564,7 @@ namespace OpenSim.Region.Framework.Scenes
1564 /// <summary> 1564 /// <summary>
1565 /// Apply physics to this group 1565 /// Apply physics to this group
1566 /// </summary> 1566 /// </summary>
1567 /// <param name="m_physicalPrim"></param> 1567 public void ApplyPhysics()
1568 public void ApplyPhysics(bool m_physicalPrim)
1569 { 1568 {
1570 // Apply physics to the root prim 1569 // Apply physics to the root prim
1571 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); 1570 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 fd70bfd..fa8b1c0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1521,6 +1521,9 @@ namespace OpenSim.Region.Framework.Scenes
1521 /// <param name="VolumeDetectActive"></param> 1521 /// <param name="VolumeDetectActive"></param>
1522 public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive) 1522 public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
1523 { 1523 {
1524 if (!ParentGroup.Scene.CollidablePrims)
1525 return;
1526
1524// m_log.DebugFormat( 1527// m_log.DebugFormat(
1525// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", 1528// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
1526// Name, LocalId, UUID, m_physicalPrim); 1529// Name, LocalId, UUID, m_physicalPrim);
@@ -1790,7 +1793,7 @@ namespace OpenSim.Region.Framework.Scenes
1790 /// <param name="isNew"></param> 1793 /// <param name="isNew"></param>
1791 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) 1794 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
1792 { 1795 {
1793 if (!ParentGroup.Scene.m_physicalPrim && UsePhysics) 1796 if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
1794 return; 1797 return;
1795 1798
1796 if (IsJoint()) 1799 if (IsJoint())
@@ -4375,7 +4378,7 @@ namespace OpenSim.Region.Framework.Scenes
4375 if (ParentGroup.Scene == null) 4378 if (ParentGroup.Scene == null)
4376 return; 4379 return;
4377 4380
4378 if (PhysActor == null) 4381 if (ParentGroup.Scene.CollidablePrims && PhysActor == null)
4379 { 4382 {
4380 // It's not phantom anymore. So make sure the physics engine get's knowledge of it 4383 // It's not phantom anymore. So make sure the physics engine get's knowledge of it
4381 PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( 4384 PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 6a83a98..d2345ba 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -181,6 +181,11 @@
181 ; ## PHYSICS 181 ; ## PHYSICS
182 ; ## 182 ; ##
183 183
184 ; If true then prims can be collided with by avatars, other prims, etc.
185 ; If false then all prims are phantom, no matter whether their phantom flag is checked or unchecked.
186 ; Also, no prims are subject to physics.
187 collidable_prim = true
188
184 ; If true then prims can be made subject to physics (gravity, pushing, etc.). 189 ; If true then prims can be made subject to physics (gravity, pushing, etc.).
185 ; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction 190 ; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction
186 physical_prim = true 191 physical_prim = true