Allow setting a specific target velocity on TeleportWithMomentum
parent
5936e0c376
commit
411bd0574d
|
@ -1075,6 +1075,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TeleportWithMomentum(Vector3 pos)
|
public void TeleportWithMomentum(Vector3 pos)
|
||||||
|
{
|
||||||
|
TeleportWithMomentum(pos, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void TeleportWithMomentum(Vector3 pos, Vector3? v)
|
||||||
{
|
{
|
||||||
bool isFlying = Flying;
|
bool isFlying = Flying;
|
||||||
Vector3 vel = Velocity;
|
Vector3 vel = Velocity;
|
||||||
|
@ -1083,7 +1088,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
AddToPhysicalScene(isFlying);
|
AddToPhysicalScene(isFlying);
|
||||||
if (PhysicsActor != null)
|
if (PhysicsActor != null)
|
||||||
|
{
|
||||||
|
if (v.HasValue)
|
||||||
|
PhysicsActor.SetMomentum((Vector3)v);
|
||||||
|
else
|
||||||
PhysicsActor.SetMomentum(vel);
|
PhysicsActor.SetMomentum(vel);
|
||||||
|
}
|
||||||
|
|
||||||
SendTerseUpdateToAllClients();
|
SendTerseUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue