* Adds ScenePresence.TeleportWithMomentum - same as .Teleport, but preserves velocity.
parent
9f5679e60f
commit
3a28f748d5
|
@ -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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
|||
public Vector3 WorldPosition
|
||||
{
|
||||
get { return GetSP().AbsolutePosition; }
|
||||
set { GetSP().AbsolutePosition = value; }
|
||||
set { GetSP().TeleportWithMomentum(value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue