aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2012-04-25 04:00:01 +0100
committerMelanie2012-04-25 04:00:01 +0100
commit3be3189ee067b26fa6486535a65a0c0e99a9ef5b (patch)
tree4212e9a6d4f763d26a9321a3bf6589330e8b7bca /OpenSim/Region
parentrefactor: Combine ScenePresence.Teleport() and TeleportWithMomentum() (diff)
downloadopensim-SC_OLD-3be3189ee067b26fa6486535a65a0c0e99a9ef5b.zip
opensim-SC_OLD-3be3189ee067b26fa6486535a65a0c0e99a9ef5b.tar.gz
opensim-SC_OLD-3be3189ee067b26fa6486535a65a0c0e99a9ef5b.tar.bz2
opensim-SC_OLD-3be3189ee067b26fa6486535a65a0c0e99a9ef5b.tar.xz
Commit the avination Teleport() methods (adaptedto justincc's changes)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs13
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 }