| 328 | } |
| 329 | |
| 330 | bool MovementController::atWorldLimit(bool bottomOnly) const { |
| 331 | if (m_world) { |
| 332 | if (!collisionPoly().isNull()) { |
| 333 | auto bounds = collisionBoundBox(); |
| 334 | return bounds.yMin() <= 0 || (!bottomOnly && bounds.yMax() >= m_world->geometry().height()); |
| 335 | } else { |
| 336 | return yPosition() <= 0 || (!bottomOnly && yPosition() >= m_world->geometry().height()); |
| 337 | } |
| 338 | } |
| 339 | return false; |
| 340 | } |
| 341 | |
| 342 | void MovementController::setPosition(Vec2F position) { |
| 343 | if (m_world) |