Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches

◆ followClamped()

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.

Parameters
targetPostarget world pos (e.g. player centre).
bufferSizeview size in pixels (logical, not world units).
mapPixelSizeworld/map size in pixels.
smoothinglerp factor applied this call (0..1).