diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8cb4921..e8178ce 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -990,13 +990,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
990 | /// <param name="pos"></param> | 990 | /// <param name="pos"></param> |
991 | public void Teleport(Vector3 pos) | 991 | public void Teleport(Vector3 pos) |
992 | { | 992 | { |
993 | // m_log.DebugFormat("[SCENE PRESENCE]: Moving {0} to {1} in {2}", Name, pos, Scene.RegionInfo.RegionName); | 993 | TeleportWithMomentum(pos, null); |
994 | } | ||
994 | 995 | ||
996 | public void TeleportWithMomentum(Vector3 pos, Vector3? v) | ||
997 | { | ||
995 | bool isFlying = Flying; | 998 | bool isFlying = Flying; |
999 | Vector3 vel = Velocity; | ||
996 | RemoveFromPhysicalScene(); | 1000 | RemoveFromPhysicalScene(); |
997 | CheckLandingPoint(ref pos); | 1001 | CheckLandingPoint(ref pos); |
998 | AbsolutePosition = pos; | 1002 | AbsolutePosition = pos; |
999 | AddToPhysicalScene(isFlying); | 1003 | AddToPhysicalScene(isFlying); |
1004 | if (PhysicsActor != null) | ||
1005 | { | ||
1006 | if (v.HasValue) | ||
1007 | PhysicsActor.SetMomentum((Vector3)v); | ||
1008 | else | ||
1009 | PhysicsActor.SetMomentum(vel); | ||
1010 | } | ||
1000 | 1011 | ||
1001 | SendTerseUpdateToAllClients(); | 1012 | SendTerseUpdateToAllClients(); |
1002 | } | 1013 | } |