diff options
8 files changed, 97 insertions, 37 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); |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 918544f..67a65ff 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -341,26 +341,54 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
341 | 341 | ||
342 | public List<GridRegion> GetHyperlinks(UUID scopeID) | 342 | public List<GridRegion> GetHyperlinks(UUID scopeID) |
343 | { | 343 | { |
344 | // Hypergrid/linked regions are not supported | 344 | List<GridRegion> foundRegions = new List<GridRegion>(); |
345 | return new List<GridRegion>(); | 345 | |
346 | NameValueCollection requestArgs = new NameValueCollection | ||
347 | { | ||
348 | { "RequestMethod", "GetScenes" }, | ||
349 | { "HyperGrid", "true" }, | ||
350 | { "Enabled", "1" } | ||
351 | }; | ||
352 | |||
353 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | ||
354 | if (response["Success"].AsBoolean()) | ||
355 | { | ||
356 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] found regions with name {0}",name); | ||
357 | |||
358 | OSDArray array = response["Scenes"] as OSDArray; | ||
359 | if (array != null) | ||
360 | { | ||
361 | for (int i = 0; i < array.Count; i++) | ||
362 | { | ||
363 | GridRegion region = ResponseToGridRegion(array[i] as OSDMap); | ||
364 | if (region != null) | ||
365 | foundRegions.Add(region); | ||
366 | } | ||
367 | } | ||
368 | } | ||
369 | |||
370 | return foundRegions; | ||
346 | } | 371 | } |
347 | 372 | ||
348 | public int GetRegionFlags(UUID scopeID, UUID regionID) | 373 | public int GetRegionFlags(UUID scopeID, UUID regionID) |
349 | { | 374 | { |
350 | const int REGION_ONLINE = 4; | ||
351 | |||
352 | NameValueCollection requestArgs = new NameValueCollection | 375 | NameValueCollection requestArgs = new NameValueCollection |
353 | { | 376 | { |
354 | { "RequestMethod", "GetScene" }, | 377 | { "RequestMethod", "GetScene" }, |
355 | { "SceneID", regionID.ToString() } | 378 | { "SceneID", regionID.ToString() } |
356 | }; | 379 | }; |
357 | 380 | ||
358 | // m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); | 381 | m_log.DebugFormat("[SIMIAN GRID CONNECTOR] request region flags for {0}",regionID.ToString()); |
359 | 382 | ||
360 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); | 383 | OSDMap response = WebUtil.PostToService(m_ServerURI, requestArgs); |
361 | if (response["Success"].AsBoolean()) | 384 | if (response["Success"].AsBoolean()) |
362 | { | 385 | { |
363 | return response["Enabled"].AsBoolean() ? REGION_ONLINE : 0; | 386 | OSDMap extraData = response["ExtraData"] as OSDMap; |
387 | int enabled = response["Enabled"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.RegionOnline : 0; | ||
388 | int hypergrid = extraData["HyperGrid"].AsBoolean() ? (int) OpenSim.Data.RegionFlags.Hyperlink : 0; | ||
389 | int flags = enabled | hypergrid; | ||
390 | m_log.DebugFormat("[SGGC] enabled - {0} hg - {1} flags - {2}", enabled, hypergrid, flags); | ||
391 | return flags; | ||
364 | } | 392 | } |
365 | else | 393 | else |
366 | { | 394 | { |
@@ -411,24 +439,27 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
411 | Vector3d minPosition = response["MinPosition"].AsVector3d(); | 439 | Vector3d minPosition = response["MinPosition"].AsVector3d(); |
412 | region.RegionLocX = (int)minPosition.X; | 440 | region.RegionLocX = (int)minPosition.X; |
413 | region.RegionLocY = (int)minPosition.Y; | 441 | region.RegionLocY = (int)minPosition.Y; |
414 | 442 | ||
415 | Uri httpAddress = response["Address"].AsUri(); | 443 | if ( ! extraData["HyperGrid"] ) { |
416 | region.ExternalHostName = httpAddress.Host; | 444 | Uri httpAddress = response["Address"].AsUri(); |
417 | region.HttpPort = (uint)httpAddress.Port; | 445 | region.ExternalHostName = httpAddress.Host; |
418 | 446 | region.HttpPort = (uint)httpAddress.Port; | |
419 | region.ServerURI = extraData["ServerURI"].AsString(); | 447 | |
420 | 448 | IPAddress internalAddress; | |
421 | IPAddress internalAddress; | 449 | IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress); |
422 | IPAddress.TryParse(extraData["InternalAddress"].AsString(), out internalAddress); | 450 | if (internalAddress == null) |
423 | if (internalAddress == null) | 451 | internalAddress = IPAddress.Any; |
424 | internalAddress = IPAddress.Any; | 452 | |
425 | 453 | region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger()); | |
426 | region.InternalEndPoint = new IPEndPoint(internalAddress, extraData["InternalPort"].AsInteger()); | 454 | region.TerrainImage = extraData["MapTexture"].AsUUID(); |
427 | region.TerrainImage = extraData["MapTexture"].AsUUID(); | 455 | region.Access = (byte)extraData["Access"].AsInteger(); |
428 | region.Access = (byte)extraData["Access"].AsInteger(); | 456 | region.RegionSecret = extraData["RegionSecret"].AsString(); |
429 | region.RegionSecret = extraData["RegionSecret"].AsString(); | 457 | region.EstateOwner = extraData["EstateOwner"].AsUUID(); |
430 | region.EstateOwner = extraData["EstateOwner"].AsUUID(); | 458 | region.Token = extraData["Token"].AsString(); |
431 | region.Token = extraData["Token"].AsString(); | 459 | region.ServerURI = extraData["ServerURI"].AsString(); |
460 | } else { | ||
461 | region.ServerURI = response["Address"]; | ||
462 | } | ||
432 | 463 | ||
433 | return region; | 464 | return region; |
434 | } | 465 | } |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 972efe4..3e7f8a6 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 |