|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
Collaboration diagram for Flint::Camera:Public Member Functions | |
| Camera (Vec2f viewSize, Vec2f worldSize) | |
| void | setTargetCenter (Vec2f center) |
| Soft‑lock camera centre on a target (uses current smoothing). | |
| void | setViewSize (Vec2f size) |
| void | setWorldSize (Vec2f size) |
| void | update (float smoothing=0.25f) |
Adjust smoothing factor (lerp) used by future setTargetCenter. | |
| FloatRect | getViewRect () const |
| Vec2f | getCenter () const |
| Vec2f | screenToWorld (const Vec2f &sp, const Vec2i &screen) const |
| Transform screen‑space point back to world‑space. | |
| void | setZoom (float zoom) |
| float | getZoom () const |
| void | followClamped (const Vec2f &targetPos, const Vec2i &bufferSize, const Vec2i &mapPixelSize, float smoothing=0.2f) |
| Follow a target but clamp so that the view never leaves map. | |