stop a Vehicle on a failed region cross (or empty border) (old ode)
parent
53895289a6
commit
395d160c41
|
@ -607,6 +607,13 @@ namespace OpenSim.Region.PhysicsModule.ODE
|
||||||
m_body = pBody;
|
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)
|
internal void Step(float pTimestep, OdeScene pParentScene)
|
||||||
{
|
{
|
||||||
if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE)
|
if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE)
|
||||||
|
|
|
@ -2676,10 +2676,16 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
m_lastVelocity = _velocity;
|
m_lastVelocity = _velocity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
|
||||||
|
m_vehicle.Stop();
|
||||||
|
|
||||||
if (Body != IntPtr.Zero)
|
if (Body != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
|
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
|
||||||
d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
|
d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
|
||||||
|
enableBodySoft();
|
||||||
}
|
}
|
||||||
|
|
||||||
outofBounds = false;
|
outofBounds = false;
|
||||||
|
|
Loading…
Reference in New Issue