File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -934,7 +934,29 @@ float AHuman::EstimateDigStrength() const {
934
934
}
935
935
936
936
float AHuman::EstimateJumpHeight () const {
937
- return 20 .0f ; // hardcoded for now
937
+ if (!m_pJetpack) {
938
+ return 0 .0F ;
939
+ }
940
+
941
+ float totalMass = GetMass ();
942
+ float fuelTime = m_pJetpack->GetJetTimeTotal ();
943
+ float fuelUseMultiplier = m_pJetpack->GetThrottleFactor ();
944
+ float impulseBurst = m_pJetpack->EstimateImpulse (true ) / totalMass;
945
+ float impulseThrust = m_pJetpack->EstimateImpulse (false ) / totalMass;
946
+
947
+ Vector globalAcc = g_SceneMan.GetGlobalAcc () * g_TimerMan.GetDeltaTimeSecs ();
948
+ Vector currentVelocity = Vector (0 .0F , -impulseBurst);
949
+ float totalHeight = 0 .0F ;
950
+ do {
951
+ currentVelocity += globalAcc;
952
+ totalHeight += currentVelocity.GetY ();
953
+ if (fuelTime > 0 .0F ) {
954
+ currentVelocity.m_Y -= impulseThrust;
955
+ fuelTime -= g_TimerMan.GetDeltaTimeMS () * fuelUseMultiplier;
956
+ }
957
+ } while (currentVelocity.GetY () < 0 .0F );
958
+
959
+ return totalHeight * -1 .0F * c_MPP;
938
960
}
939
961
940
962
bool AHuman::EquipShield () {
You can’t perform that action at this time.
0 commit comments