mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
stop a Vehicle on a failed region cross (or empty border) (old ode)
This commit is contained in:
@@ -607,6 +607,13 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
||||
m_body = pBody;
|
||||
}
|
||||
|
||||
internal void Stop()
|
||||
{
|
||||
m_lastLinearVelocityVector = Vector3.Zero;
|
||||
m_lastAngularVelocity = Vector3.Zero;
|
||||
m_lastPositionVector = d.BodyGetPosition(Body);
|
||||
}
|
||||
|
||||
internal void Step(float pTimestep, OdeScene pParentScene)
|
||||
{
|
||||
if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE)
|
||||
|
||||
@@ -2676,10 +2676,16 @@ Console.WriteLine(" JointCreateFixed");
|
||||
|
||||
m_lastVelocity = _velocity;
|
||||
|
||||
|
||||
|
||||
if(m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
|
||||
m_vehicle.Stop();
|
||||
|
||||
if (Body != IntPtr.Zero)
|
||||
{
|
||||
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
|
||||
d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
|
||||
enableBodySoft();
|
||||
}
|
||||
|
||||
outofBounds = false;
|
||||
|
||||
Reference in New Issue
Block a user