Revert "*TO TEST/REVIEW* added current default animation in animationSet.cs to/fromArray in array element 0. This may cause compatibilities issues, but think this information is needed for proper crossings. OSG regions did survived tps in/out with this. ALso added velocity in crossings cases, for now detected by Teleport flag equal to Default (0);"

This reverts commit 12c9916193.
avinationmerge
Melanie 2012-05-04 20:02:14 +02:00
parent 12c9916193
commit 88c4c7283f
2 changed files with 8 additions and 28 deletions

View File

@ -168,11 +168,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public OpenSim.Framework.Animation[] ToArray() public OpenSim.Framework.Animation[] ToArray()
{ {
OpenSim.Framework.Animation[] theArray = new OpenSim.Framework.Animation[m_animations.Count + 1]; OpenSim.Framework.Animation[] theArray = new OpenSim.Framework.Animation[m_animations.Count];
uint i = 0; uint i = 0;
try try
{ {
theArray[i++] = m_defaultAnimation;
foreach (OpenSim.Framework.Animation anim in m_animations) foreach (OpenSim.Framework.Animation anim in m_animations)
theArray[i++] = anim; theArray[i++] = anim;
} }
@ -185,14 +184,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public void FromArray(OpenSim.Framework.Animation[] theArray) public void FromArray(OpenSim.Framework.Animation[] theArray)
{ {
// foreach (OpenSim.Framework.Animation anim in theArray) foreach (OpenSim.Framework.Animation anim in theArray)
// m_animations.Add(anim); m_animations.Add(anim);
if (theArray.Length > 0)
{
m_defaultAnimation = theArray[0];
for (int i = 1; i < theArray.Length; i++)
m_animations.Add(theArray[i]);
}
} }
} }
} }

View File

@ -866,7 +866,7 @@ namespace OpenSim.Region.Framework.Scenes
IsChildAgent = false; IsChildAgent = false;
// Animator.TryFixMovementAnimation("SIT"); Animator.TrySetMovementAnimation("SIT");
} }
else else
{ {
@ -929,15 +929,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
AbsolutePosition = pos; AbsolutePosition = pos;
if (m_teleportFlags == TeleportFlags.Default) AddToPhysicalScene(isFlying);
{
Vector3 vel = Velocity;
AddToPhysicalScene(isFlying);
if (PhysicsActor != null)
PhysicsActor.SetMomentum(vel);
}
else
AddToPhysicalScene(isFlying);
if (ForceFly) if (ForceFly)
{ {
@ -951,8 +943,7 @@ namespace OpenSim.Region.Framework.Scenes
// Don't send an animation pack here, since on a region crossing this will sometimes cause a flying // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying
// avatar to return to the standing position in mid-air. On login it looks like this is being sent // avatar to return to the standing position in mid-air. On login it looks like this is being sent
// elsewhere anyway // elsewhere anyway
// Animator.SendAnimPack(); // Animator.SendAnimPack();
m_scene.SwapRootAgentCount(false); m_scene.SwapRootAgentCount(false);
@ -989,7 +980,6 @@ namespace OpenSim.Region.Framework.Scenes
// If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will // If we don't reset the movement flag here, an avatar that crosses to a neighbouring sim and returns will
// stall on the border crossing since the existing child agent will still have the last movement // stall on the border crossing since the existing child agent will still have the last movement
// recorded, which stops the input from being processed. // recorded, which stops the input from being processed.
MovementFlag = 0; MovementFlag = 0;
m_scene.EventManager.TriggerOnMakeRootAgent(this); m_scene.EventManager.TriggerOnMakeRootAgent(this);
@ -1030,8 +1020,6 @@ namespace OpenSim.Region.Framework.Scenes
// as teleporting back // as teleporting back
TeleportFlags = TeleportFlags.Default; TeleportFlags = TeleportFlags.Default;
MovementFlag = 0;
// It looks like Animator is set to null somewhere, and MakeChild // It looks like Animator is set to null somewhere, and MakeChild
// is called after that. Probably in aborted teleports. // is called after that. Probably in aborted teleports.
if (Animator == null) if (Animator == null)
@ -1039,7 +1027,6 @@ namespace OpenSim.Region.Framework.Scenes
else else
Animator.ResetAnimations(); Animator.ResetAnimations();
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", // "[SCENE PRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}",
// Name, UUID, m_scene.RegionInfo.RegionName); // Name, UUID, m_scene.RegionInfo.RegionName);
@ -1066,9 +1053,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; // PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; PhysicsActor.OnOutOfBounds -= OutOfBoundsCall;
PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
PhysicsActor.UnSubscribeEvents();
m_scene.PhysicsScene.RemoveAvatar(PhysicsActor); m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
PhysicsActor.UnSubscribeEvents();
PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
PhysicsActor = null; PhysicsActor = null;
} }
// else // else