aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2012-04-18 22:16:59 +0200
committerMelanie2012-04-18 22:16:59 +0200
commit411bd0574d371315c0134b30f1984fc035d84272 (patch)
tree37f1e6108cc7384d3b5576351c90d19978891284 /OpenSim/Region/Framework
parentAllow scripts in attachments owned by the NPC to control the NPC (diff)
downloadopensim-SC_OLD-411bd0574d371315c0134b30f1984fc035d84272.zip
opensim-SC_OLD-411bd0574d371315c0134b30f1984fc035d84272.tar.gz
opensim-SC_OLD-411bd0574d371315c0134b30f1984fc035d84272.tar.bz2
opensim-SC_OLD-411bd0574d371315c0134b30f1984fc035d84272.tar.xz
Allow setting a specific target velocity on TeleportWithMomentum
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8ac09e9..1211792 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1076,6 +1076,11 @@ namespace OpenSim.Region.Framework.Scenes
1076 1076
1077 public void TeleportWithMomentum(Vector3 pos) 1077 public void TeleportWithMomentum(Vector3 pos)
1078 { 1078 {
1079 TeleportWithMomentum(pos, null);
1080 }
1081
1082 public void TeleportWithMomentum(Vector3 pos, Vector3? v)
1083 {
1079 bool isFlying = Flying; 1084 bool isFlying = Flying;
1080 Vector3 vel = Velocity; 1085 Vector3 vel = Velocity;
1081 RemoveFromPhysicalScene(); 1086 RemoveFromPhysicalScene();
@@ -1083,7 +1088,12 @@ namespace OpenSim.Region.Framework.Scenes
1083 AbsolutePosition = pos; 1088 AbsolutePosition = pos;
1084 AddToPhysicalScene(isFlying); 1089 AddToPhysicalScene(isFlying);
1085 if (PhysicsActor != null) 1090 if (PhysicsActor != null)
1086 PhysicsActor.SetMomentum(vel); 1091 {
1092 if (v.HasValue)
1093 PhysicsActor.SetMomentum((Vector3)v);
1094 else
1095 PhysicsActor.SetMomentum(vel);
1096 }
1087 1097
1088 SendTerseUpdateToAllClients(); 1098 SendTerseUpdateToAllClients();
1089 } 1099 }