Fix TestSitAndStandWithNoSitTarget NPC and SP tests.

These stopped working because current code calculates sit heights based on avatar physics rather than appearance data.
Also changed BasicPhysics to not divide Z param of all set sizes by 2 - there's no obvious good reason for this and basicphysics is only used in tests
master-beforevarregion
Justin Clark-Casey (justincc) 2013-12-14 00:10:32 +00:00
parent 11f177d6a8
commit 54cc229768
3 changed files with 4 additions and 15 deletions

View File

@ -119,7 +119,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
// printing out npc.AbsolutePosition will give <0, 0, 0.8454993> not <0, 0, 0.845499337>
Assert.That(
m_sp.AbsolutePosition,
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, 0.845499337f)));
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, sp.PhysicsActor.Size.Z / 2)));
m_sp.StandUp();

View File

@ -337,7 +337,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
public void TestSitAndStandWithNoSitTarget()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
// TestHelpers.EnableLogging();
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
@ -355,13 +355,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
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.
// Curiously, Vector3.ToString() will not display the last two places of the float. For example,
// printing out npc.AbsolutePosition will give <0, 0, 0.8454993> not <0, 0, 0.845499337>
Assert.That(
npc.AbsolutePosition,
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, 0.845499337f)));
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, sp.PhysicsActor.Size.Z / 2)));
m_npcMod.Stand(npc.UUID, m_scene);

View File

@ -118,14 +118,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
public override Vector3 Position { get; set; }
public override Vector3 Size
{
get { return _size; }
set {
_size = value;
_size.Z = _size.Z / 2.0f;
}
}
public override Vector3 Size { get; set; }
public override PrimitiveBaseShape Shape
{