| 802 | } |
| 803 | |
| 804 | void MovementController::updateLiquidPercentage() { |
| 805 | auto pos = position(); |
| 806 | auto body = collisionBody(); |
| 807 | RectF boundBox = body.boundBox(); |
| 808 | |
| 809 | LiquidLevel cll; |
| 810 | if (boundBox.isEmpty()) |
| 811 | cll = world()->liquidLevel(Vec2I::floor(pos)); |
| 812 | else |
| 813 | cll = world()->liquidLevel(boundBox); |
| 814 | |
| 815 | m_liquidPercentage = clamp(cll.level, 0.0f, 1.0f); |
| 816 | m_liquidId = cll.liquid; |
| 817 | } |
| 818 | |
| 819 | void MovementController::setOnGround(bool onGround) { |
| 820 | m_onGround.set(onGround); |
nothing calls this directly
no test coverage detected