aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
index 8402082..7cd2dd1 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
@@ -545,6 +545,8 @@ namespace OpenSim.Region.Physics.OdePlugin
545 if (value.IsFinite()) 545 if (value.IsFinite())
546 { 546 {
547 _velocity = value; 547 _velocity = value;
548 if (_velocity.ApproxEquals(Vector3.Zero,0.001f))
549 _acceleration = Vector3.Zero;
548 550
549 m_taintVelocity = value; 551 m_taintVelocity = value;
550 _parent_scene.AddPhysicsActorTaint(this); 552 _parent_scene.AddPhysicsActorTaint(this);
@@ -662,7 +664,14 @@ namespace OpenSim.Region.Physics.OdePlugin
662 664
663 public override Vector3 Acceleration // client updates read data via here 665 public override Vector3 Acceleration // client updates read data via here
664 { 666 {
665 get { return _acceleration; } 667 get
668 {
669 if (_zeroFlag)
670 {
671 return Vector3.Zero;
672 }
673 return _acceleration;
674 }
666 } 675 }
667 676
668 677
@@ -3122,6 +3131,7 @@ Console.WriteLine("ODEPrim JointCreateFixed !!!");
3122 _velocity.X = 0; 3131 _velocity.X = 0;
3123 _velocity.Y = 0; 3132 _velocity.Y = 0;
3124 _velocity.Z = 0; 3133 _velocity.Z = 0;
3134 m_lastVelocity = Vector3.Zero;
3125 m_rotationalVelocity.X = 0; 3135 m_rotationalVelocity.X = 0;
3126 m_rotationalVelocity.Y = 0; 3136 m_rotationalVelocity.Y = 0;
3127 m_rotationalVelocity.Z = 0; 3137 m_rotationalVelocity.Z = 0;
@@ -3169,6 +3179,7 @@ Console.WriteLine("ODEPrim JointCreateFixed !!!");
3169 // Stop it in the phys engine 3179 // Stop it in the phys engine
3170 d.BodySetLinearVel(Body, 0.0f, 0.0f, _velocity.Z); 3180 d.BodySetLinearVel(Body, 0.0f, 0.0f, _velocity.Z);
3171 d.BodySetAngularVel (Body, 0.0f, 0.0f, 0.0f); 3181 d.BodySetAngularVel (Body, 0.0f, 0.0f, 0.0f);
3182 d.BodySetForce(Body, 0f, 0f, 0f);
3172 3183
3173 if (!m_lastUpdateSent) 3184 if (!m_lastUpdateSent)
3174 { 3185 {
@@ -3620,6 +3631,7 @@ Console.WriteLine("ODEPrim JointCreateFixed !!!");
3620 d.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); 3631 d.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z);
3621 _target_velocity = Vector3.Zero; 3632 _target_velocity = Vector3.Zero;
3622 d.BodySetLinearVel(Body, _target_velocity.X, _target_velocity.Y, _target_velocity.Z); 3633 d.BodySetLinearVel(Body, _target_velocity.X, _target_velocity.Y, _target_velocity.Z);
3634 d.BodySetForce(Body, 0f, 0f, 0f);
3623 } 3635 }
3624 else 3636 else
3625 { 3637 {