| 55 | } |
| 56 | |
| 57 | void DrawCamera::smooth_move_to(World& w, const CoordSpaceHelper& newCoords, Vector2f windowSize, bool instantJump) { |
| 58 | smoothMove.start = c; |
| 59 | smoothMove.end = newCoords; |
| 60 | smoothMove.endWindowSize = windowSize; |
| 61 | smoothMove.startCenter = c.pos + c.dir_from_space(w.main.window.size.cast<float>() * 0.5f); |
| 62 | smoothMove.endCenter = newCoords.pos + newCoords.dir_from_space(windowSize * 0.5f); |
| 63 | |
| 64 | float a1(w.main.window.size.x() / windowSize.x()); |
| 65 | float a2(w.main.window.size.y() / windowSize.y()); |
| 66 | smoothMove.endUniformZoom = std::max(smoothMove.end.inverseScale.multiply_double((a1 < a2) ? a1 : a2), WorldScalar(1)); |
| 67 | |
| 68 | smoothMove.occurring = true; |
| 69 | smoothMove.moveTime = (instantJump || w.main.conf.jumpTransitionTime <= 0.01f) ? w.main.conf.jumpTransitionTime : 0.0f; |
| 70 | } |
| 71 | |
| 72 | void DrawCamera::scale_up(World& w, const WorldScalar& scaleUpAmount) { |
| 73 | smoothMove.occurring = false; |
no test coverage detected