From 2006188ee5e5a7ce9cc3f879a37a49337f2e93f2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 27 Apr 2012 10:49:32 +0100 Subject: test --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ef281a6..840bdef 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1117,21 +1117,18 @@ namespace OpenSim.Region.Framework.Scenes } else { - if (rotateToVelXY) - { - float x = ((Vector3)newvel).X; - float y = ((Vector3)newvel).Y; - - x = 0.5f * (float)Math.Atan2(y, x); - y = (float)Math.Cos(x); - x = (float)Math.Sin(x); - Rotation = new Quaternion(0f, 0f, x, y); - m_log.DebugFormat("[avnLocalTeleport] final rotation {0}", Rotation); - } - if (PhysicsActor != null) PhysicsActor.SetMomentum((Vector3)newvel); m_velocity = (Vector3)newvel; + + if (rotateToVelXY) + { + Vector3 lookAt = (Vector3)newvel; + lookAt.Z = 0; + lookAt.Normalize(); + ControllingClient.SendLocalTeleport(newpos, lookAt, (uint)TeleportFlags.ViaLocation); + return; + } } } -- cgit v1.1