From 411bd0574d371315c0134b30f1984fc035d84272 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 18 Apr 2012 22:16:59 +0200 Subject: Allow setting a specific target velocity on TeleportWithMomentum --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') 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 public void TeleportWithMomentum(Vector3 pos) { + TeleportWithMomentum(pos, null); + } + + public void TeleportWithMomentum(Vector3 pos, Vector3? v) + { bool isFlying = Flying; Vector3 vel = Velocity; RemoveFromPhysicalScene(); @@ -1083,7 +1088,12 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = pos; AddToPhysicalScene(isFlying); if (PhysicsActor != null) - PhysicsActor.SetMomentum(vel); + { + if (v.HasValue) + PhysicsActor.SetMomentum((Vector3)v); + else + PhysicsActor.SetMomentum(vel); + } SendTerseUpdateToAllClients(); } -- cgit v1.1