Merge branch 'master' into bigmerge
Conflicts: OpenSim/Region/Framework/Scenes/ScenePresence.csavinationmerge
commit
2cf6172689
|
@ -1129,13 +1129,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public Quaternion SitTargetOrientation
|
public Quaternion SitTargetOrientation
|
||||||
{
|
{
|
||||||
get { return m_sitTargetOrientation; }
|
get { return m_sitTargetOrientation; }
|
||||||
set { m_sitTargetOrientation = value; }
|
set
|
||||||
|
{
|
||||||
|
m_sitTargetOrientation = value;
|
||||||
|
// m_log.DebugFormat("[SCENE OBJECT PART]: Set sit target orientation {0} for {1} {2}", m_sitTargetOrientation, Name, LocalId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3 SitTargetPosition
|
public Vector3 SitTargetPosition
|
||||||
{
|
{
|
||||||
get { return m_sitTargetPosition; }
|
get { return m_sitTargetPosition; }
|
||||||
set { m_sitTargetPosition = value; }
|
set
|
||||||
|
{
|
||||||
|
m_sitTargetPosition = value;
|
||||||
|
// m_log.DebugFormat("[SCENE OBJECT PART]: Set sit target position to {0} for {1} {2}", m_sitTargetPosition, Name, LocalId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This sort of sucks, but I'm adding these in to make some of
|
// This sort of sucks, but I'm adding these in to make some of
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f);
|
// private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f);
|
||||||
// Value revised by KF 091121 by comparison with SL.
|
// Value revised by KF 091121 by comparison with SL.
|
||||||
private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.418f);
|
public static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.418f);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Movement updates for agents in neighboring regions are sent directly to clients.
|
/// Movement updates for agents in neighboring regions are sent directly to clients.
|
||||||
|
@ -2617,7 +2617,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
RemoveFromPhysicalScene();
|
RemoveFromPhysicalScene();
|
||||||
Animator.TrySetMovementAnimation(sitAnimation);
|
Animator.TrySetMovementAnimation(sitAnimation);
|
||||||
SendAvatarDataToAllAgents();
|
SendAvatarDataToAllAgents();
|
||||||
//SendTerseUpdateToAllClients();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal)
|
public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal)
|
||||||
|
|
|
@ -208,7 +208,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
ScenePresence sp;
|
ScenePresence sp;
|
||||||
scene.TryGetScenePresence(agentID, out sp);
|
scene.TryGetScenePresence(agentID, out sp);
|
||||||
sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero);
|
sp.HandleAgentRequestSit(m_avatars[agentID], agentID, partID, Vector3.Zero);
|
||||||
sp.HandleAgentSit(m_avatars[agentID], agentID);
|
// sp.HandleAgentSit(m_avatars[agentID], agentID);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,7 +231,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSitAndStand()
|
public void TestSitAndStandWithSitTarget()
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
@ -245,12 +245,49 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
|
||||||
ScenePresence npc = scene.GetScenePresence(npcId);
|
ScenePresence npc = scene.GetScenePresence(npcId);
|
||||||
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||||
|
|
||||||
// We must have a non Vector3.Zero sit target position otherwise part.SitTargetAvatar doesn't get set!
|
|
||||||
part.SitTargetPosition = new Vector3(0, 0, 1);
|
part.SitTargetPosition = new Vector3(0, 0, 1);
|
||||||
npcModule.Sit(npc.UUID, part.UUID, scene);
|
npcModule.Sit(npc.UUID, part.UUID, scene);
|
||||||
|
|
||||||
Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId));
|
Assert.That(part.SitTargetAvatar, Is.EqualTo(npcId));
|
||||||
Assert.That(npc.ParentID, Is.EqualTo(part.LocalId));
|
Assert.That(npc.ParentID, Is.EqualTo(part.LocalId));
|
||||||
|
Assert.That(
|
||||||
|
npc.AbsolutePosition,
|
||||||
|
Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT));
|
||||||
|
|
||||||
|
npcModule.Stand(npc.UUID, scene);
|
||||||
|
|
||||||
|
Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
|
||||||
|
Assert.That(npc.ParentID, Is.EqualTo(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSitAndStandWithNoSitTarget()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
||||||
|
|
||||||
|
// FIXME: To get this to work for now, we are going to place the npc right next to the target so that
|
||||||
|
// the autopilot doesn't trigger
|
||||||
|
Vector3 startPos = new Vector3(1, 1, 1);
|
||||||
|
|
||||||
|
INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
|
||||||
|
UUID npcId = npcModule.CreateNPC("John", "Smith", startPos, scene, sp.Appearance);
|
||||||
|
|
||||||
|
ScenePresence npc = scene.GetScenePresence(npcId);
|
||||||
|
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||||
|
|
||||||
|
npcModule.Sit(npc.UUID, part.UUID, scene);
|
||||||
|
|
||||||
|
Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero));
|
||||||
|
Assert.That(npc.ParentID, Is.EqualTo(part.LocalId));
|
||||||
|
|
||||||
|
// FIXME: This is different for live avatars - z position is adjusted. This is half the height of the
|
||||||
|
// default avatar.
|
||||||
|
Assert.That(
|
||||||
|
npc.AbsolutePosition,
|
||||||
|
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, 0.8857438f)));
|
||||||
|
|
||||||
npcModule.Stand(npc.UUID, scene);
|
npcModule.Stand(npc.UUID, scene);
|
||||||
|
|
||||||
|
|
|
@ -1269,7 +1269,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force.
|
// m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force.
|
||||||
doForce(m_taintForce);
|
doForce(m_taintForce);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_taintForce = Vector3.Zero;
|
m_taintForce = Vector3.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2250,7 +2250,10 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
{
|
{
|
||||||
if (!m_isSelected)
|
if (!m_isSelected)
|
||||||
{
|
{
|
||||||
|
// Not sure exactly why this sleep is here, but from experimentation it appears to stop an avatar
|
||||||
|
// walking through a default rez size prim if it keeps kicking it around - justincc.
|
||||||
Thread.Sleep(20);
|
Thread.Sleep(20);
|
||||||
|
|
||||||
if (IsPhysical)
|
if (IsPhysical)
|
||||||
{
|
{
|
||||||
if (Body != IntPtr.Zero)
|
if (Body != IntPtr.Zero)
|
||||||
|
|
Loading…
Reference in New Issue