mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
Allow setting a specific target velocity on TeleportWithMomentum
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user