From b2356340d22578143af2daab979ea4633faa93dc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 16 Sep 2011 22:51:36 +0100 Subject: Remove setter from SP.OffsetPosition, since all sets should flow through SP.AbsolutePosition OffsetPosition is also misnamed - it returns the absolute position and never contains an offset. --- OpenSim/Region/Framework/Scenes/EntityBase.cs | 11 +++++++++-- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 ++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs index 213431a..320b904 100644 --- a/OpenSim/Region/Framework/Scenes/EntityBase.cs +++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs @@ -26,8 +26,10 @@ */ using System; +using System.Reflection; using System.Runtime.Serialization; using System.Security.Permissions; +using log4net; using OpenSim.Framework; using OpenMetaverse; @@ -35,6 +37,8 @@ namespace OpenSim.Region.Framework.Scenes { public abstract class EntityBase : ISceneEntity { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// /// The scene to which this entity belongs /// @@ -71,12 +75,15 @@ namespace OpenSim.Region.Framework.Scenes protected Vector3 m_pos; /// - /// + /// Absolute position of this entity in a scene. /// public virtual Vector3 AbsolutePosition { get { return m_pos; } - set { m_pos = value; } + set + { + m_pos = value; + } } protected Vector3 m_velocity; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a8eff70..2b7966b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -467,7 +467,9 @@ namespace OpenSim.Region.Framework.Scenes { PhysicsActor actor = m_physicsActor; if (actor != null) + { m_pos = actor.Position; + } else { // Obtain the correct position of a seated avatar. @@ -517,13 +519,16 @@ namespace OpenSim.Region.Framework.Scenes m_pos = value; m_parentPosition = Vector3.Zero; + +// m_log.DebugFormat( +// "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}", +// Scene.RegionInfo.RegionName, Name, m_pos); } } public Vector3 OffsetPosition { get { return m_pos; } - set { m_pos = value; } } /// @@ -556,6 +561,10 @@ namespace OpenSim.Region.Framework.Scenes } m_velocity = value; + +// m_log.DebugFormat( +// "[SCENE PRESENCE]: In {0} set velocity of {1} to {2}", +// Scene.RegionInfo.RegionName, Name, m_velocity); } } @@ -1219,7 +1228,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) { -// m_log.DebugFormat("[SCENE PRESENCE]: Received agent update from {0}", remoteClient.Name); +// m_log.DebugFormat( +// "[SCENE PRESENCE]: In {0} received agent update from {1}", +// Scene.RegionInfo.RegionName, remoteClient.Name); //if (m_isChildAgent) //{ @@ -3323,7 +3334,7 @@ namespace OpenSim.Region.Framework.Scenes //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) // The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents( // as of this comment the interval is set in AddToPhysicalScene - if (Animator!=null) + if (Animator != null) Animator.UpdateMovementAnimations(); CollisionEventUpdate collisionData = (CollisionEventUpdate)e; -- cgit v1.1