aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs16
-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.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs7
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs4
6 files changed, 36 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index b9d5d32..cbef6ce 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1705,9 +1705,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1705 uint x = 0, y = 0; 1705 uint x = 0, y = 0;
1706 Utils.LongToUInts(newRegionHandle, out x, out y); 1706 Utils.LongToUInts(newRegionHandle, out x, out y);
1707 GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); 1707 GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
1708 if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) 1708
1709 if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent))
1709 { 1710 {
1711 m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
1712
1713 // We are going to move the object back to the old position so long as the old position
1714 // is in the region
1715 oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
1716 oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
1717 oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
1718
1710 grp.RootPart.GroupPosition = oldGroupPosition; 1719 grp.RootPart.GroupPosition = oldGroupPosition;
1720
1721 // Need to turn off the physics flags, otherwise the object will continue to attempt to
1722 // move out of the region creating an infinite loop of failed attempts to cross
1723 grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
1724
1711 grp.ScheduleGroupForFullUpdate(); 1725 grp.ScheduleGroupForFullUpdate();
1712 } 1726 }
1713 } 1727 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6666328..b4972d6 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;
@@ -650,7 +658,8 @@ namespace OpenSim.Region.Framework.Scenes
650 //Animation states 658 //Animation states
651 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); 659 m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
652 660
653 m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); 661 PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
662 CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
654 663
655 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); 664 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
656 if (RegionInfo.NonphysPrimMax > 0) 665 if (RegionInfo.NonphysPrimMax > 0)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index a3e4b46..1e2901b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -333,7 +333,6 @@ namespace OpenSim.Region.Framework.Scenes
333 if (rot != null) 333 if (rot != null)
334 sceneObject.UpdateGroupRotationR((Quaternion)rot); 334 sceneObject.UpdateGroupRotationR((Quaternion)rot);
335 335
336 //group.ApplyPhysics(m_physicalPrim);
337 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) 336 if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
338 { 337 {
339 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); 338 sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index abea788..8860764 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -210,7 +210,7 @@ namespace OpenSim.Region.Framework.Scenes
210 /// </remarks> 210 /// </remarks>
211 public bool UsesPhysics 211 public bool UsesPhysics
212 { 212 {
213 get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; } 213 get { return (RootPart.Flags & PrimFlags.Physics) != 0; }
214 } 214 }
215 215
216 /// <summary> 216 /// <summary>
@@ -669,7 +669,7 @@ namespace OpenSim.Region.Framework.Scenes
669 //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); 669 //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);
670 } 670 }
671 671
672 ApplyPhysics(m_scene.m_physicalPrim); 672 ApplyPhysics();
673 673
674 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled 674 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
675 // for the same object with very different properties. The caller must schedule the update. 675 // for the same object with very different properties. The caller must schedule the update.
@@ -1239,8 +1239,7 @@ namespace OpenSim.Region.Framework.Scenes
1239 /// <summary> 1239 /// <summary>
1240 /// Apply physics to this group 1240 /// Apply physics to this group
1241 /// </summary> 1241 /// </summary>
1242 /// <param name="m_physicalPrim"></param> 1242 public void ApplyPhysics()
1243 public void ApplyPhysics(bool m_physicalPrim)
1244 { 1243 {
1245 // Apply physics to the root prim 1244 // Apply physics to the root prim
1246 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive); 1245 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 b29ecc6..aea47e6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1473,6 +1473,9 @@ namespace OpenSim.Region.Framework.Scenes
1473 /// <param name="VolumeDetectActive"></param> 1473 /// <param name="VolumeDetectActive"></param>
1474 public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive) 1474 public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
1475 { 1475 {
1476 if (!ParentGroup.Scene.CollidablePrims)
1477 return;
1478
1476// m_log.DebugFormat( 1479// m_log.DebugFormat(
1477// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}", 1480// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
1478// Name, LocalId, UUID, m_physicalPrim); 1481// Name, LocalId, UUID, m_physicalPrim);
@@ -1739,7 +1742,7 @@ namespace OpenSim.Region.Framework.Scenes
1739 /// <param name="isNew"></param> 1742 /// <param name="isNew"></param>
1740 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew) 1743 public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
1741 { 1744 {
1742 if (!ParentGroup.Scene.m_physicalPrim && UsePhysics) 1745 if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
1743 return; 1746 return;
1744 1747
1745 if (IsJoint()) 1748 if (IsJoint())
@@ -4318,7 +4321,7 @@ namespace OpenSim.Region.Framework.Scenes
4318 if (ParentGroup.Scene == null) 4321 if (ParentGroup.Scene == null)
4319 return; 4322 return;
4320 4323
4321 if (PhysActor == null) 4324 if (ParentGroup.Scene.CollidablePrims && PhysActor == null)
4322 { 4325 {
4323 // It's not phantom anymore. So make sure the physics engine get's knowledge of it 4326 // It's not phantom anymore. So make sure the physics engine get's knowledge of it
4324 PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( 4327 PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 04ba738..2194ff0 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Physics.OdePlugin
110 private const uint m_regionWidth = Constants.RegionSize; 110 private const uint m_regionWidth = Constants.RegionSize;
111 private const uint m_regionHeight = Constants.RegionSize; 111 private const uint m_regionHeight = Constants.RegionSize;
112 112
113 private float ODE_STEPSIZE = 0.020f; 113 private float ODE_STEPSIZE = 0.0178f;
114 private float metersInSpace = 29.9f; 114 private float metersInSpace = 29.9f;
115 private float m_timeDilation = 1.0f; 115 private float m_timeDilation = 1.0f;
116 116
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Physics.OdePlugin
456 mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f); 456 mAvatarObjectContactFriction = physicsconfig.GetFloat("m_avatarobjectcontact_friction", 75f);
457 mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f); 457 mAvatarObjectContactBounce = physicsconfig.GetFloat("m_avatarobjectcontact_bounce", 0.1f);
458 458
459 ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", 0.020f); 459 ODE_STEPSIZE = physicsconfig.GetFloat("world_stepsize", ODE_STEPSIZE);
460 m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10); 460 m_physicsiterations = physicsconfig.GetInt("world_internal_steps_without_collisions", 10);
461 461
462 avDensity = physicsconfig.GetFloat("av_density", 80f); 462 avDensity = physicsconfig.GetFloat("av_density", 80f);