Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim

This commit is contained in:
Melanie
2013-12-16 22:11:03 +00:00
11 changed files with 97 additions and 84 deletions

View File

@@ -2866,16 +2866,33 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 up = new Vector3((float)x, (float)y, (float)z);
Vector3 sitOffset = up * Appearance.AvatarHeight * 0.02638f;
m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
Vector3 newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
Quaternion newRot;
if (part.IsRoot)
{
newRot = sitTargetOrient;
}
else
{
newPos = newPos * part.RotationOffset;
newRot = part.RotationOffset * sitTargetOrient;
}
newPos += part.OffsetPosition;
m_pos = newPos;
Rotation = newRot;
// m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset;
Rotation = sitTargetOrient;
// ParentPosition = part.AbsolutePosition;
part.ParentGroup.AddAvatar(UUID);
}
else
{
m_pos -= part.AbsolutePosition;
// An viewer expects to specify sit positions as offsets to the root prim, even if a child prim is
// being sat upon.
m_pos -= part.GroupPosition;
// ParentPosition = part.AbsolutePosition;
part.ParentGroup.AddAvatar(UUID);

View File

@@ -111,15 +111,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart;
// We need to preserve this here because phys actor is removed by the sit.
Vector3 spPhysActorSize = m_sp.PhysicsActor.Size;
m_sp.HandleAgentRequestSit(m_sp.ControllingClient, m_sp.UUID, part.UUID, Vector3.Zero);
// 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(
m_sp.AbsolutePosition,
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, 0.845499337f)));
Is.EqualTo(part.AbsolutePosition + new Vector3(0, 0, spPhysActorSize.Z / 2)));
m_sp.StandUp();
@@ -147,9 +145,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
Assert.That(part.SitTargetAvatar, Is.EqualTo(m_sp.UUID));
Assert.That(m_sp.ParentID, Is.EqualTo(part.LocalId));
Assert.That(
m_sp.AbsolutePosition,
Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT));
// Assert.That(
// m_sp.AbsolutePosition,
// Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT));
Assert.That(m_sp.PhysicsActor, Is.Null);
Assert.That(part.GetSittingAvatarsCount(), Is.EqualTo(1));

View File

@@ -181,9 +181,18 @@ namespace OpenSim.Region.Framework.Scenes
if (part.ParticleSystem.Length > 0)
{
Primitive.ParticleSystem ps = new Primitive.ParticleSystem(part.ParticleSystem, 0);
if (ps.Texture != UUID.Zero)
assetUuids[ps.Texture] = AssetType.Texture;
try
{
Primitive.ParticleSystem ps = new Primitive.ParticleSystem(part.ParticleSystem, 0);
if (ps.Texture != UUID.Zero)
assetUuids[ps.Texture] = AssetType.Texture;
}
catch (Exception e)
{
m_log.WarnFormat(
"[UUID GATHERER]: Could not check particle system for part {0} {1} in object {2} {3} since it is corrupt. Continuing.",
part.Name, part.UUID, sceneObject.Name, sceneObject.UUID);
}
}
TaskInventoryDictionary taskDictionary = (TaskInventoryDictionary)part.TaskInventory.Clone();