Make vehicles retain velocity when crossing between regions.

avinationmerge
Melanie 2012-02-20 19:49:01 +01:00
parent 8f8206f478
commit d6b8febbf4
1 changed files with 4 additions and 0 deletions

View File

@ -1539,6 +1539,7 @@ namespace OpenSim.Region.Framework.Scenes
// or flexible // or flexible
if (!isPhantom && !ParentGroup.IsAttachment && !(Shape.PathCurve == (byte)Extrusion.Flexible)) if (!isPhantom && !ParentGroup.IsAttachment && !(Shape.PathCurve == (byte)Extrusion.Flexible))
{ {
Vector3 velocity = Velocity;
try try
{ {
PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(
@ -1570,6 +1571,9 @@ namespace OpenSim.Region.Framework.Scenes
DoPhysicsPropertyUpdate(RigidBody, true); DoPhysicsPropertyUpdate(RigidBody, true);
PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0); PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
Velocity = velocity;
PhysActor.Velocity = velocity;
if (!building) if (!building)
PhysActor.Building = false; PhysActor.Building = false;
} }