*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);

avinationmerge
UbitUmarov 2012-05-04 19:19:54 +01:00
parent 58a1a0710c
commit 12c9916193
2 changed files with 28 additions and 8 deletions

View File

@ -168,10 +168,11 @@ 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]; OpenSim.Framework.Animation[] theArray = new OpenSim.Framework.Animation[m_animations.Count + 1];
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;
} }
@ -184,8 +185,14 @@ 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.TrySetMovementAnimation("SIT"); // Animator.TryFixMovementAnimation("SIT");
} }
else else
{ {
@ -929,7 +929,15 @@ namespace OpenSim.Region.Framework.Scenes
} }
AbsolutePosition = pos; AbsolutePosition = pos;
AddToPhysicalScene(isFlying); if (m_teleportFlags == TeleportFlags.Default)
{
Vector3 vel = Velocity;
AddToPhysicalScene(isFlying);
if (PhysicsActor != null)
PhysicsActor.SetMomentum(vel);
}
else
AddToPhysicalScene(isFlying);
if (ForceFly) if (ForceFly)
{ {
@ -943,7 +951,8 @@ 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);
@ -980,6 +989,7 @@ 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);
@ -1020,6 +1030,8 @@ 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)
@ -1027,6 +1039,7 @@ 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);
@ -1053,9 +1066,9 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; // PhysicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients;
PhysicsActor.OnOutOfBounds -= OutOfBoundsCall; PhysicsActor.OnOutOfBounds -= OutOfBoundsCall;
m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
PhysicsActor.UnSubscribeEvents();
PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; PhysicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate;
PhysicsActor.UnSubscribeEvents();
m_scene.PhysicsScene.RemoveAvatar(PhysicsActor);
PhysicsActor = null; PhysicsActor = null;
} }
// else // else