* Adds ScenePresence.TeleportWithMomentum - same as .Teleport, but preserves velocity.

0.6.5-rc1
Adam Frisby 2009-05-12 21:21:33 +00:00
parent 9f5679e60f
commit 3a28f748d5
2 changed files with 19 additions and 1 deletions

View File

@ -1015,6 +1015,24 @@ namespace OpenSim.Region.Framework.Scenes
SendTerseUpdateToAllClients(); 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();
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

View File

@ -61,7 +61,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
public Vector3 WorldPosition public Vector3 WorldPosition
{ {
get { return GetSP().AbsolutePosition; } get { return GetSP().AbsolutePosition; }
set { GetSP().AbsolutePosition = value; } set { GetSP().TeleportWithMomentum(value); }
} }
} }
} }