refactor: Combine ScenePresence.Teleport() and TeleportWithMomentum()
These are identical apart from setting Velocity = zero, which has no practical effect anyway since this is zeroed when the avatar is added back to the physics scene.0.7.3-extended
parent
eaa840dbd9
commit
b3307850ab
|
@ -1055,22 +1055,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat("[SCENE PRESENCE]: Moving {0} to {1} in {2}", Name, pos, Scene.RegionInfo.RegionName);
|
// m_log.DebugFormat("[SCENE PRESENCE]: Moving {0} to {1} in {2}", Name, pos, Scene.RegionInfo.RegionName);
|
||||||
|
|
||||||
bool isFlying = Flying;
|
|
||||||
RemoveFromPhysicalScene();
|
|
||||||
Velocity = Vector3.Zero;
|
|
||||||
CheckLandingPoint(ref pos);
|
|
||||||
AbsolutePosition = pos;
|
|
||||||
AddToPhysicalScene(isFlying);
|
|
||||||
|
|
||||||
SendTerseUpdateToAllClients();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void TeleportWithMomentum(Vector3 pos)
|
|
||||||
{
|
|
||||||
// m_log.DebugFormat(
|
|
||||||
// "[SCENE PRESENCE]: Moving {0} to {1} with existing momentum {2} in {3} ",
|
|
||||||
// Name, pos, Velocity, Scene.RegionInfo.RegionName);
|
|
||||||
|
|
||||||
bool isFlying = Flying;
|
bool isFlying = Flying;
|
||||||
RemoveFromPhysicalScene();
|
RemoveFromPhysicalScene();
|
||||||
CheckLandingPoint(ref pos);
|
CheckLandingPoint(ref pos);
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public Vector3 WorldPosition
|
public Vector3 WorldPosition
|
||||||
{
|
{
|
||||||
get { return GetSP().AbsolutePosition; }
|
get { return GetSP().AbsolutePosition; }
|
||||||
set { GetSP().TeleportWithMomentum(value); }
|
set { GetSP().Teleport(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsChildAgent
|
public bool IsChildAgent
|
||||||
|
|
Loading…
Reference in New Issue