From 3a28f748d5cb586a5401b9b4d1f2f108af79ace1 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 12 May 2009 21:21:33 +0000 Subject: * Adds ScenePresence.TeleportWithMomentum - same as .Teleport, but preserves velocity. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8fd4b47..8950942 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1015,6 +1015,24 @@ namespace OpenSim.Region.Framework.Scenes SendTerseUpdateToAllClients(); } + public void TeleportWithMomentum(Vector3 pos) + { + bool isFlying = false; + if (m_physicsActor != null) + isFlying = m_physicsActor.Flying; + + RemoveFromPhysicalScene(); + AbsolutePosition = pos; + AddToPhysicalScene(isFlying); + if (m_appearance != null) + { + if (m_appearance.AvatarHeight > 0) + SetHeight(m_appearance.AvatarHeight); + } + + SendTerseUpdateToAllClients(); + } + /// /// /// -- cgit v1.1