Calculates the jump velocity required such that when user presses the jump binding they will be able to jump up to the given height. */
| 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. */ |
| 1014 | float PhysicsComp_CalcJumpVelocity(float jumpHeight) { |
| 1015 | float jumpVel = 0.0f; |
| 1016 | if (jumpHeight == 0.0f) return jumpVel; |
| 1017 | |
| 1018 | if (jumpHeight >= 256.0f) jumpVel = 10.0f; |
| 1019 | if (jumpHeight >= 512.0f) jumpVel = 16.5f; |
| 1020 | if (jumpHeight >= 768.0f) jumpVel = 22.5f; |
| 1021 | |
| 1022 | while (PhysicsComp_CalcMaxHeight(jumpVel) <= jumpHeight) { jumpVel += 0.001f; } |
| 1023 | return jumpVel; |
| 1024 | } |
| 1025 | |
| 1026 | void PhysicsComp_DoEntityPush(struct Entity* entity) { |
| 1027 | struct Entity* other; |
no test coverage detected