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)
|
||||
{
|
||||
TeleportWithMomentum(pos, null);
|
||||
}
|
||||
|
||||
public void TeleportWithMomentum(Vector3 pos, Vector3? v)
|
||||
{
|
||||
bool isFlying = Flying;
|
||||
Vector3 vel = Velocity;
|
||||
|
@ -1083,7 +1088,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
AbsolutePosition = pos;
|
||||
AddToPhysicalScene(isFlying);
|
||||
if (PhysicsActor != null)
|
||||
PhysicsActor.SetMomentum(vel);
|
||||
{
|
||||
if (v.HasValue)
|
||||
PhysicsActor.SetMomentum((Vector3)v);
|
||||
else
|
||||
PhysicsActor.SetMomentum(vel);
|
||||
}
|
||||
|
||||
SendTerseUpdateToAllClients();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue