From ddff2f246cb4862abcac5308ae2532c9828691fb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 21 Dec 2011 15:17:26 -0800 Subject: Moved an external test into the method that uses those preconditions. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 30 +++++++++--------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 36d8c0b..526fab3 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1161,10 +1161,10 @@ namespace OpenSim.Region.Framework.Scenes public void CompleteMovement(IClientAPI client, bool openChildAgents) { // DateTime startTime = DateTime.Now; - -// m_log.DebugFormat( -// "[SCENE PRESENCE]: Completing movement of {0} into region {1}", -// client.Name, Scene.RegionInfo.RegionName); + + m_log.DebugFormat( + "[SCENE PRESENCE]: Completing movement of {0} into region {1} in position {2}", + client.Name, Scene.RegionInfo.RegionName, AbsolutePosition); Vector3 look = Velocity; if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) @@ -2383,9 +2383,7 @@ namespace OpenSim.Region.Framework.Scenes m_lastVelocity = Velocity; } - // followed suggestion from mic bowman. reversed the two lines below. - if (ParentID == 0 && PhysicsActor != null || ParentID != 0) // Check that we have a physics actor or we're sitting on something - CheckForBorderCrossing(); + CheckForBorderCrossing(); CheckForSignificantMovement(); // sends update to the modules. } @@ -2741,7 +2739,8 @@ namespace OpenSim.Region.Framework.Scenes /// protected void CheckForBorderCrossing() { - if (IsChildAgent) + // Check that we we are not a child and have a physics actor or we're sitting on something + if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0)) return; Vector3 pos2 = AbsolutePosition; @@ -2757,7 +2756,6 @@ namespace OpenSim.Region.Framework.Scenes if (!IsInTransit) { // Checks if where it's headed exists a region - bool needsTransit = false; if (m_scene.TestBorderCross(pos2, Cardinals.W)) { @@ -2828,7 +2826,7 @@ namespace OpenSim.Region.Framework.Scenes Velocity = Vector3.Zero; AbsolutePosition = pos; -// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); + m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); AddToPhysicalScene(isFlying); } @@ -2861,22 +2859,16 @@ namespace OpenSim.Region.Framework.Scenes } } else - { - // We must remove the agent from the physical scene if it has been placed in transit. If we don't, - // then this method continues to be called from ScenePresence.Update() until the handover of the client between - // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms - // event queue polling response from the server), this results in the avatar pausing on the border - // for the handover period. - RemoveFromPhysicalScene(); - + { // This constant has been inferred from experimentation // I'm not sure what this value should be, so I tried a few values. timeStep = 0.04f; pos2 = AbsolutePosition; pos2.X = pos2.X + (vel.X * timeStep); pos2.Y = pos2.Y + (vel.Y * timeStep); - pos2.Z = pos2.Z + (vel.Z * timeStep); + // Don't touch the Z m_pos = pos2; + m_log.ErrorFormat("m_pos={0}", m_pos); } } -- cgit v1.1 From 219ec7ef20ccefb257be5ec650a13758b2a3cda3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 22 Dec 2011 08:18:03 -0800 Subject: Fixing a bug introduced yesterday. This put the precondition test inside CheckForBorderCrossing the right way. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 214 ++++++++++++----------- 1 file changed, 109 insertions(+), 105 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f02475..040cbfc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2736,137 +2736,141 @@ namespace OpenSim.Region.Framework.Scenes /// protected void CheckForBorderCrossing() { - // Check that we we are not a child and have a physics actor or we're sitting on something - if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0)) + // Check that we we are not a child + if (IsChildAgent) return; - Vector3 pos2 = AbsolutePosition; - Vector3 vel = Velocity; - int neighbor = 0; - int[] fix = new int[2]; + // We only do this if we have a physics actor or we're sitting on something + if (ParentID == 0 && PhysicsActor != null || ParentID != 0) + { + Vector3 pos2 = AbsolutePosition; + Vector3 vel = Velocity; + int neighbor = 0; + int[] fix = new int[2]; - float timeStep = 0.1f; - pos2.X = pos2.X + (vel.X*timeStep); - pos2.Y = pos2.Y + (vel.Y*timeStep); - pos2.Z = pos2.Z + (vel.Z*timeStep); + float timeStep = 0.1f; + pos2.X = pos2.X + (vel.X * timeStep); + pos2.Y = pos2.Y + (vel.Y * timeStep); + pos2.Z = pos2.Z + (vel.Z * timeStep); - if (!IsInTransit) - { - // Checks if where it's headed exists a region - bool needsTransit = false; - if (m_scene.TestBorderCross(pos2, Cardinals.W)) + if (!IsInTransit) { - if (m_scene.TestBorderCross(pos2, Cardinals.S)) + // Checks if where it's headed exists a region + bool needsTransit = false; + if (m_scene.TestBorderCross(pos2, Cardinals.W)) { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); - } - else if (m_scene.TestBorderCross(pos2, Cardinals.N)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); + if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.SW, ref fix); + } + else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.NW, ref fix); + } + else + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); + } } - else + else if (m_scene.TestBorderCross(pos2, Cardinals.E)) { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.W, ref fix); + if (m_scene.TestBorderCross(pos2, Cardinals.S)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); + } + else if (m_scene.TestBorderCross(pos2, Cardinals.N)) + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); + } + else + { + needsTransit = true; + neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); + } } - } - else if (m_scene.TestBorderCross(pos2, Cardinals.E)) - { - if (m_scene.TestBorderCross(pos2, Cardinals.S)) + else if (m_scene.TestBorderCross(pos2, Cardinals.S)) { needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.SE, ref fix); + neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); } else if (m_scene.TestBorderCross(pos2, Cardinals.N)) { needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.NE, ref fix); + neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); } - else - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.E, ref fix); - } - } - else if (m_scene.TestBorderCross(pos2, Cardinals.S)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.S, ref fix); - } - else if (m_scene.TestBorderCross(pos2, Cardinals.N)) - { - needsTransit = true; - neighbor = m_scene.HaveNeighbor(Cardinals.N, ref fix); - } - // Makes sure avatar does not end up outside region - if (neighbor <= 0) - { - if (needsTransit) + // Makes sure avatar does not end up outside region + if (neighbor <= 0) { - if (m_requestedSitTargetUUID == UUID.Zero) + if (needsTransit) { - bool isFlying = Flying; - RemoveFromPhysicalScene(); - - Vector3 pos = AbsolutePosition; - if (AbsolutePosition.X < 0) - pos.X += Velocity.X * 2; - else if (AbsolutePosition.X > Constants.RegionSize) - pos.X -= Velocity.X * 2; - if (AbsolutePosition.Y < 0) - pos.Y += Velocity.Y * 2; - else if (AbsolutePosition.Y > Constants.RegionSize) - pos.Y -= Velocity.Y * 2; - Velocity = Vector3.Zero; - AbsolutePosition = pos; - - m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); - - AddToPhysicalScene(isFlying); + if (m_requestedSitTargetUUID == UUID.Zero) + { + bool isFlying = Flying; + RemoveFromPhysicalScene(); + + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.X * 2; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.X * 2; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y * 2; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y * 2; + Velocity = Vector3.Zero; + AbsolutePosition = pos; + + m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); + + AddToPhysicalScene(isFlying); + } } } - } - else if (neighbor > 0) - { - if (!CrossToNewRegion()) + else if (neighbor > 0) { - if (m_requestedSitTargetUUID == UUID.Zero) + if (!CrossToNewRegion()) { - bool isFlying = Flying; - RemoveFromPhysicalScene(); - - Vector3 pos = AbsolutePosition; - if (AbsolutePosition.X < 0) - pos.X += Velocity.X * 2; - else if (AbsolutePosition.X > Constants.RegionSize) - pos.X -= Velocity.X * 2; - if (AbsolutePosition.Y < 0) - pos.Y += Velocity.Y * 2; - else if (AbsolutePosition.Y > Constants.RegionSize) - pos.Y -= Velocity.Y * 2; - Velocity = Vector3.Zero; - AbsolutePosition = pos; - - AddToPhysicalScene(isFlying); + if (m_requestedSitTargetUUID == UUID.Zero) + { + bool isFlying = Flying; + RemoveFromPhysicalScene(); + + Vector3 pos = AbsolutePosition; + if (AbsolutePosition.X < 0) + pos.X += Velocity.X * 2; + else if (AbsolutePosition.X > Constants.RegionSize) + pos.X -= Velocity.X * 2; + if (AbsolutePosition.Y < 0) + pos.Y += Velocity.Y * 2; + else if (AbsolutePosition.Y > Constants.RegionSize) + pos.Y -= Velocity.Y * 2; + Velocity = Vector3.Zero; + AbsolutePosition = pos; + + AddToPhysicalScene(isFlying); + } } } } - } - else - { - // This constant has been inferred from experimentation - // I'm not sure what this value should be, so I tried a few values. - timeStep = 0.04f; - pos2 = AbsolutePosition; - pos2.X = pos2.X + (vel.X * timeStep); - pos2.Y = pos2.Y + (vel.Y * timeStep); - // Don't touch the Z - m_pos = pos2; - m_log.ErrorFormat("m_pos={0}", m_pos); - } + else + { + // This constant has been inferred from experimentation + // I'm not sure what this value should be, so I tried a few values. + timeStep = 0.04f; + pos2 = AbsolutePosition; + pos2.X = pos2.X + (vel.X * timeStep); + pos2.Y = pos2.Y + (vel.Y * timeStep); + // Don't touch the Z + m_pos = pos2; + m_log.DebugFormat("[SCENE PRESENCE]: In transit m_pos={0}", m_pos); + } + } } /// -- cgit v1.1 From 2347593dac0d435851fb1437b87c42a5fd4f9060 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Dec 2011 16:48:52 +0000 Subject: Harmonizing SP with Avination --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 96 ++++++++++++++---------- 1 file changed, 55 insertions(+), 41 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 040cbfc..c578fc0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes /// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is /// necessary. /// - protected List m_attachments = new List(); + private List m_attachments = new List(); public Object AttachmentsSyncLock { get; private set; } @@ -550,8 +550,12 @@ namespace OpenSim.Region.Framework.Scenes } } - m_pos = value; - ParentPosition = Vector3.Zero; + // Don't update while sitting + if (ParentID == 0) + { + m_pos = value; + ParentPosition = Vector3.Zero; + } //m_log.DebugFormat( // "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", @@ -566,6 +570,13 @@ namespace OpenSim.Region.Framework.Scenes public Vector3 OffsetPosition { get { return m_pos; } + set + { + // There is no offset position when not seated + if (ParentID == 0) + return; + m_pos = value; + } } /// @@ -2740,8 +2751,10 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - // We only do this if we have a physics actor or we're sitting on something - if (ParentID == 0 && PhysicsActor != null || ParentID != 0) + if (ParentID != 0) + return; + + if (!IsInTransit) { Vector3 pos2 = AbsolutePosition; Vector3 vel = Velocity; @@ -3100,30 +3113,28 @@ namespace OpenSim.Region.Framework.Scenes catch { } // Attachment objects - lock (m_attachments) + List attachments = GetAttachments(); + if (attachments.Count > 0) { - if (m_attachments.Count > 0) - { - cAgent.AttachmentObjects = new List(); - cAgent.AttachmentObjectStates = new List(); - // IScriptModule se = m_scene.RequestModuleInterface(); - InTransitScriptStates.Clear(); + cAgent.AttachmentObjects = new List(); + cAgent.AttachmentObjectStates = new List(); +// IScriptModule se = m_scene.RequestModuleInterface(); + InTransitScriptStates.Clear(); - foreach (SceneObjectGroup sog in m_attachments) - { - // We need to make a copy and pass that copy - // because of transfers withn the same sim - ISceneObject clone = sog.CloneForNewScene(); - // Attachment module assumes that GroupPosition holds the offsets...! - ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; - ((SceneObjectGroup)clone).IsAttachment = false; - cAgent.AttachmentObjects.Add(clone); - string state = sog.GetStateSnapshot(); - cAgent.AttachmentObjectStates.Add(state); - InTransitScriptStates.Add(state); - // Let's remove the scripts of the original object here - sog.RemoveScriptInstances(true); - } + foreach (SceneObjectGroup sog in attachments) + { + // We need to make a copy and pass that copy + // because of transfers withn the same sim + ISceneObject clone = sog.CloneForNewScene(); + // Attachment module assumes that GroupPosition holds the offsets...! + ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; + ((SceneObjectGroup)clone).IsAttachment = false; + cAgent.AttachmentObjects.Add(clone); + string state = sog.GetStateSnapshot(); + cAgent.AttachmentObjectStates.Add(state); + InTransitScriptStates.Add(state); + // Let's remove the scripts of the original object here + sog.RemoveScriptInstances(true); } } } @@ -3531,26 +3542,29 @@ namespace OpenSim.Region.Framework.Scenes /// The arguments for the event public void SendScriptEventToAttachments(string eventName, Object[] args) { - if (m_scriptEngines.Length == 0) - return; - - lock (m_attachments) + Util.FireAndForget(delegate(object x) { - foreach (SceneObjectGroup grp in m_attachments) + if (m_scriptEngines.Length == 0) + return; + + lock (m_attachments) { - // 16384 is CHANGED_ANIMATION - // - // Send this to all attachment root prims - // - foreach (IScriptModule m in m_scriptEngines) + foreach (SceneObjectGroup grp in m_attachments) { - if (m == null) // No script engine loaded - continue; + // 16384 is CHANGED_ANIMATION + // + // Send this to all attachment root prims + // + foreach (IScriptModule m in m_scriptEngines) + { + if (m == null) // No script engine loaded + continue; - m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); + m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); + } } } - } + }); } internal void PushForce(Vector3 impulse) -- cgit v1.1 From 6412349decb36a7278528477bacb5b71534ad657 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Dec 2011 16:51:51 +0000 Subject: Add a few comments, correct a merge artefact --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c578fc0..fc6eb6d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -570,6 +570,8 @@ namespace OpenSim.Region.Framework.Scenes public Vector3 OffsetPosition { get { return m_pos; } + // Don't remove setter. It's not currently used in core but + // upcoming Avination code needs it. set { // There is no offset position when not seated @@ -2751,7 +2753,10 @@ namespace OpenSim.Region.Framework.Scenes if (IsChildAgent) return; - if (ParentID != 0) + // If we don't have a PhysActor, we can't cross anyway + // Also don't do this while sat, sitting avatars cross with the + // object they sit on. + if (ParentID != 0 || PhysActor == null) return; if (!IsInTransit) -- cgit v1.1 From 7f527814d524fe6b0fb5243dbdb558e5b661e4a5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 22 Dec 2011 16:57:49 +0000 Subject: And a typo fix --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fc6eb6d..3d1c1b5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2756,7 +2756,7 @@ namespace OpenSim.Region.Framework.Scenes // If we don't have a PhysActor, we can't cross anyway // Also don't do this while sat, sitting avatars cross with the // object they sit on. - if (ParentID != 0 || PhysActor == null) + if (ParentID != 0 || PhysicsActor == null) return; if (!IsInTransit) -- cgit v1.1 From 48113f0fc811f21f4a113176caa9dbd78c0d3446 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Dec 2011 19:44:52 +0000 Subject: Make it possible to force all prims to be phantom via the collidable_prim boolean setting in the OpenSim.ini config [Startup] section. Naturally, default is true. When set to false, "phantom" flags on prims can be set as usual but all prims remain phantom. This setting is for test purposes. This switch does not affect the collision of avatars with the terrain. --- OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6666328..96e6863 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; @@ -651,6 +659,7 @@ namespace OpenSim.Region.Framework.Scenes m_useFlySlow = startupConfig.GetBoolean("enableflyslow", 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 b29ecc6..8fd136d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1473,6 +1473,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); @@ -4318,7 +4321,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( -- cgit v1.1 From f7dbdba447cf91b03749c09d24709b03bc9f7831 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Dec 2011 19:52:09 +0000 Subject: Remove unused m_physicalPrim parameter from SOG.ApplyPhysics() --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 1 - OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') 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 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 abea788..0585477 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -669,7 +669,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(); // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled // for the same object with very different properties. The caller must schedule the update. @@ -1239,8 +1239,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); -- cgit v1.1 From 7ccd8f8f1d8accb0c5f67e9e3bc9a43fbbfd93e2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 22 Dec 2011 19:57:50 +0000 Subject: rename Scene.m_physicalPrim to PhysicalPrims since its public and access external as a property --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 96e6863..b4972d6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -77,7 +77,7 @@ 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. @@ -658,7 +658,7 @@ 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/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8fd136d..aea47e6 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1742,7 +1742,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()) -- cgit v1.1 From f394cb2e8f1605809dbf3d5503b9ae00dc1f5180 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Thu, 22 Dec 2011 16:21:32 -0800 Subject: fix the UsesPhysics flag to reference the physics flag rather than the temponrez flag --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 0585477..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 /// public bool UsesPhysics { - get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; } + get { return (RootPart.Flags & PrimFlags.Physics) != 0; } } /// -- cgit v1.1 From 56dbcae402000e199e556827944dfdd1bb3a64be Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 30 Dec 2011 21:32:28 -0800 Subject: Bug fix in map tiles in standalone: the map has been blank since commit 01ae916bad672722aa62ee712b7b580d6f5f4370 r/17324 (Nov.18, justincc). But the root cause comes from commit 02e54c57c4901167779f07ed3e89fb1d24ffc22a Author: Oren Hurvitz Date: 7/22/2011 This is a nasty situation. The map tile UUID is, in principle, stored authoritatively in RegionSettings. However, it also needs to be stored in the Grid Service because that's how other sims can retrieve it to send it in Map Blocks to non-V3 viewers. So every time the tile image changes, that change needs to propagate to the Grid Service, and this is done via RegisterRegion (ugh!). Interestingly, this problem didn't affect grids because by default AllowRemoteDelete is false, so the prior images aren't being deleted from the asset servers -- but they were not being correctly updated in the map either, the map was stuck with old images. --- OpenSim/Region/Framework/Scenes/Scene.cs | 33 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index b4972d6..0f84da9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -710,7 +710,7 @@ namespace OpenSim.Region.Framework.Scenes if (maptileRefresh != 0) { m_mapGenerationTimer.Interval = maptileRefresh * 1000; - m_mapGenerationTimer.Elapsed += RegenerateMaptile; + m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister; m_mapGenerationTimer.AutoReset = true; m_mapGenerationTimer.Start(); } @@ -1647,21 +1647,17 @@ namespace OpenSim.Region.Framework.Scenes { m_sceneGridService.SetScene(this); + //// Unfortunately this needs to be here and it can't be async. + //// The map tile image is stored in RegionSettings, but it also needs to be + //// stored in the GridService, because that's what the world map module uses + //// to send the map image UUIDs (of other regions) to the viewer... + if (m_generateMaptiles) + RegenerateMaptile(); + GridRegion region = new GridRegion(RegionInfo); string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); if (error != String.Empty) - { throw new Exception(error); - } - - // Generate the maptile asynchronously, because sometimes it can be very slow and we - // don't want this to delay starting the region. - if (m_generateMaptiles) - { - Util.FireAndForget(delegate { - RegenerateMaptile(null, null); - }); - } } #endregion @@ -5032,13 +5028,24 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public void RegenerateMaptile(object sender, ElapsedEventArgs e) + private void RegenerateMaptile() { IWorldMapModule mapModule = RequestModuleInterface(); if (mapModule != null) mapModule.GenerateMaptile(); } + private void RegenerateMaptileAndReregister(object sender, ElapsedEventArgs e) + { + RegenerateMaptile(); + + // We need to propagate the new image UUID to the grid service + // so that all simulators can retrieve it + string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); + if (error != string.Empty) + throw new Exception(error); + } + // This method is called across the simulation connector to // determine if a given agent is allowed in this region // AS A ROOT AGENT. Returning false here will prevent them -- cgit v1.1 From 983b49c0c872e997576d7fc167319e28e6f970e3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 3 Jan 2012 18:25:31 +0000 Subject: commented out "Prevented flyoff" log message for now as this becomes problematic with bot testing. Please uncomment if still needed. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3d1c1b5..42cd4be 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2844,7 +2844,7 @@ namespace OpenSim.Region.Framework.Scenes Velocity = Vector3.Zero; AbsolutePosition = pos; - m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); +// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); AddToPhysicalScene(isFlying); } -- cgit v1.1