aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs')
-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;