aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorRobert Adams2012-11-29 08:03:30 -0800
committerRobert Adams2012-11-29 08:03:30 -0800
commitb8a7cbb9e916f0fe47e56a35a1bf3a6001ed02d0 (patch)
tree94f2a2df19976bddd3a29eb146085bb85d33df16 /OpenSim/Region
parentBulletSim: fix boats floating low by removing LIMIT_MOTOR_UP flag from TYPE_B... (diff)
downloadopensim-SC-b8a7cbb9e916f0fe47e56a35a1bf3a6001ed02d0.zip
opensim-SC-b8a7cbb9e916f0fe47e56a35a1bf3a6001ed02d0.tar.gz
opensim-SC-b8a7cbb9e916f0fe47e56a35a1bf3a6001ed02d0.tar.bz2
opensim-SC-b8a7cbb9e916f0fe47e56a35a1bf3a6001ed02d0.tar.xz
BulletSim: reverse direction of hover correction. Removes problem with vehicles being orbited.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index 3a73fba..a398b74 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -742,22 +742,22 @@ namespace OpenSim.Region.Physics.BulletSPlugin
742 else 742 else
743 { 743 {
744 float verticalError = pos.Z - m_VhoverTargetHeight; 744 float verticalError = pos.Z - m_VhoverTargetHeight;
745 // RA: where does the 50 come from? 745 float verticalCorrectionVelocity = pTimestep * (verticalError / m_VhoverTimescale);
746 float verticalCorrectionVelocity = pTimestep * ((verticalError * 50.0f) / m_VhoverTimescale); 746
747 // Replace Vertical speed with correction figure if significant 747 // TODO: implement m_VhoverEfficiency
748 if (verticalError > 0.01f) 748 if (verticalError > 0.01f)
749 { 749 {
750 ret = new Vector3(0f, 0f, verticalCorrectionVelocity); 750 // If error is positive (we're above the target height), push down
751 //KF: m_VhoverEfficiency is not yet implemented 751 ret = new Vector3(0f, 0f, -verticalCorrectionVelocity);
752 } 752 }
753 else if (verticalError < -0.01) 753 else if (verticalError < -0.01)
754 { 754 {
755 ret = new Vector3(0f, 0f, -verticalCorrectionVelocity); 755 ret = new Vector3(0f, 0f, verticalCorrectionVelocity);
756 } 756 }
757 } 757 }
758 758
759 VDetailLog("{0},MoveLinear,hover,pos={1},dir={2},height={3},target={4}", 759 VDetailLog("{0},MoveLinear,hover,pos={1},ret={2},hoverTS={3},height={4},target={5}",
760 Prim.LocalID, pos, ret, m_VhoverHeight, m_VhoverTargetHeight); 760 Prim.LocalID, pos, ret, m_VhoverTimescale, m_VhoverHeight, m_VhoverTargetHeight);
761 } 761 }
762 762
763 return ret; 763 return ret;