diff options
author | UbitUmarov | 2015-11-20 19:11:26 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-20 19:11:26 +0000 |
commit | 395d160c414ad4a99ec875718dad72a1dd8c55e2 (patch) | |
tree | 7736f6a773289653e4bb119362592f380ac4f0c7 /OpenSim/Region/PhysicsModules | |
parent | remove Ode.Net - missing file. ( old ode may be broken now) (diff) | |
download | opensim-SC_OLD-395d160c414ad4a99ec875718dad72a1dd8c55e2.zip opensim-SC_OLD-395d160c414ad4a99ec875718dad72a1dd8c55e2.tar.gz opensim-SC_OLD-395d160c414ad4a99ec875718dad72a1dd8c55e2.tar.bz2 opensim-SC_OLD-395d160c414ad4a99ec875718dad72a1dd8c55e2.tar.xz |
stop a Vehicle on a failed region cross (or empty border) (old ode)
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs | 6 |
2 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs index 739a7b3..ff19384 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs | |||
@@ -607,6 +607,13 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
607 | m_body = pBody; | 607 | m_body = pBody; |
608 | } | 608 | } |
609 | 609 | ||
610 | internal void Stop() | ||
611 | { | ||
612 | m_lastLinearVelocityVector = Vector3.Zero; | ||
613 | m_lastAngularVelocity = Vector3.Zero; | ||
614 | m_lastPositionVector = d.BodyGetPosition(Body); | ||
615 | } | ||
616 | |||
610 | internal void Step(float pTimestep, OdeScene pParentScene) | 617 | internal void Step(float pTimestep, OdeScene pParentScene) |
611 | { | 618 | { |
612 | if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE) | 619 | if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE) |
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs index 82b0999..a31110b 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs | |||
@@ -2676,10 +2676,16 @@ Console.WriteLine(" JointCreateFixed"); | |||
2676 | 2676 | ||
2677 | m_lastVelocity = _velocity; | 2677 | m_lastVelocity = _velocity; |
2678 | 2678 | ||
2679 | |||
2680 | |||
2681 | if(m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) | ||
2682 | m_vehicle.Stop(); | ||
2683 | |||
2679 | if (Body != IntPtr.Zero) | 2684 | if (Body != IntPtr.Zero) |
2680 | { | 2685 | { |
2681 | d.BodySetLinearVel(Body, 0, 0, 0); // stop it | 2686 | d.BodySetLinearVel(Body, 0, 0, 0); // stop it |
2682 | d.BodySetPosition(Body, _position.X, _position.Y, _position.Z); | 2687 | d.BodySetPosition(Body, _position.X, _position.Y, _position.Z); |
2688 | enableBodySoft(); | ||
2683 | } | 2689 | } |
2684 | 2690 | ||
2685 | outofBounds = false; | 2691 | outofBounds = false; |