Merge commit 'b2356340d22578143af2daab979ea4633faa93dc' into bigmerge

Conflicts:
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
avinationmerge
Melanie 2011-10-11 22:11:44 +01:00
commit 6978ae0a59
4 changed files with 24 additions and 7 deletions

View File

@ -26,8 +26,10 @@
*/ */
using System; using System;
using System.Reflection;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Security.Permissions; using System.Security.Permissions;
using log4net;
using OpenSim.Framework; using OpenSim.Framework;
using OpenMetaverse; using OpenMetaverse;
@ -35,6 +37,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
public abstract class EntityBase : ISceneEntity public abstract class EntityBase : ISceneEntity
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary> /// <summary>
/// The scene to which this entity belongs /// The scene to which this entity belongs
/// </summary> /// </summary>
@ -71,12 +75,15 @@ namespace OpenSim.Region.Framework.Scenes
protected Vector3 m_pos; protected Vector3 m_pos;
/// <summary> /// <summary>
/// /// Absolute position of this entity in a scene.
/// </summary> /// </summary>
public virtual Vector3 AbsolutePosition public virtual Vector3 AbsolutePosition
{ {
get { return m_pos; } get { return m_pos; }
set { m_pos = value; } set
{
m_pos = value;
}
} }
protected Vector3 m_velocity; protected Vector3 m_velocity;

View File

@ -804,7 +804,7 @@ namespace OpenSim.Region.Framework.Scenes
if (av.LinkedPrim == m_uuid) if (av.LinkedPrim == m_uuid)
{ {
Vector3 offset = (m_offsetPosition - oldpos); Vector3 offset = (m_offsetPosition - oldpos);
av.OffsetPosition += offset; av.AbsolutePosition += offset;
av.SendAvatarDataToAllAgents(); av.SendAvatarDataToAllAgents();
} }
} }

View File

@ -492,7 +492,9 @@ namespace OpenSim.Region.Framework.Scenes
PhysicsActor actor = m_physicsActor; PhysicsActor actor = m_physicsActor;
// if (actor != null) // if (actor != null)
if ((actor != null) && (m_parentID == 0)) // KF Do NOT update m_pos here if Av is sitting! if ((actor != null) && (m_parentID == 0)) // KF Do NOT update m_pos here if Av is sitting!
{
m_pos = actor.Position; m_pos = actor.Position;
}
else else
{ {
// Obtain the correct position of a seated avatar. // Obtain the correct position of a seated avatar.
@ -540,16 +542,20 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
if (m_parentID == 0) // KF Do NOT update m_pos here if Av is sitting! // Changed this to update unconditionally to make npose work
// if (m_parentID == 0) // KF Do NOT update m_pos here if Av is sitting!
m_pos = value; m_pos = value;
m_parentPosition = Vector3.Zero; 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 public Vector3 OffsetPosition
{ {
get { return m_pos; } get { return m_pos; }
set { m_pos = value; }
} }
/// <summary> /// <summary>
@ -582,6 +588,10 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_velocity = value; m_velocity = value;
// m_log.DebugFormat(
// "[SCENE PRESENCE]: In {0} set velocity of {1} to {2}",
// Scene.RegionInfo.RegionName, Name, m_velocity);
} }
} }
@ -4340,4 +4350,4 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
} }
} }

View File

@ -7481,7 +7481,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
LSL_Vector v; LSL_Vector v;
v = rules.GetVector3Item(idx++); v = rules.GetVector3Item(idx++);
av.OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z); av.AbsolutePosition = new Vector3((float)v.x, (float)v.y, (float)v.z);
av.SendAvatarDataToAllAgents(); av.SendAvatarDataToAllAgents();
break; break;