|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
| void Flint::Camera::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.
| targetPos | target world pos (e.g. player centre). |
| bufferSize | view size in pixels (logical, not world units). |
| mapPixelSize | world/map size in pixels. |
| smoothing | lerp factor applied this call (0..1). |