| 1001 | } |
| 1002 | |
| 1003 | double PhysicsComp_CalcMaxHeight(float u) { |
| 1004 | /* equation below comes from solving diff(x(t, u))= 0 */ |
| 1005 | /* We only work in discrete timesteps, so test both rounded up and down */ |
| 1006 | double t = 34.30961849 * Math_Log2(0.247483075 * u + 0.9899323); |
| 1007 | double value_floor = PhysicsComp_YPosAt((int)t, u); |
| 1008 | double value_ceil = PhysicsComp_YPosAt((int)t + 1, u); |
| 1009 | return max(value_floor, value_ceil); |
| 1010 | } |
| 1011 | |
| 1012 | /* Calculates the jump velocity required such that when user presses |
| 1013 | the jump binding they will be able to jump up to the given height. */ |
no test coverage detected