Definition at line 10 of file camera.h.
◆ followClamped()
| FLINT_API 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
-
| 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). |
◆ getCenter()
| FLINT_API Vec2f Flint::Camera::getCenter |
( |
| ) |
const |
Center of the current view in world units.
◆ getViewRect()
| FLINT_API FloatRect Flint::Camera::getViewRect |
( |
| ) |
const |
Current view rectangle in world units.
◆ getZoom()
| FLINT_API float Flint::Camera::getZoom |
( |
| ) |
const |
◆ screenToWorld()
| FLINT_API Vec2f Flint::Camera::screenToWorld |
( |
const Vec2f & | sp, |
|
|
const Vec2i & | screen ) const |
Transform screen‑space point back to world‑space.
- Parameters
-
| sp | logical renderer pixel coords (after zoom). |
| screen | logical size; unused but keeps API parity. |
◆ setTargetCenter()
| FLINT_API void Flint::Camera::setTargetCenter |
( |
Vec2f | center | ) |
|
Soft-lock camera center on a target (uses current smoothing).
- Parameters
-
| center | Target center in world coordinates. |
Call once per frame with your player/target center in world coords.
◆ setViewSize()
| FLINT_API void Flint::Camera::setViewSize |
( |
Vec2f | size | ) |
|
Update logical view size (e.g. after window resize).
◆ setWorldSize()
| FLINT_API void Flint::Camera::setWorldSize |
( |
Vec2f | size | ) |
|
Update world bounds rectangle.
◆ setZoom()
| FLINT_API void Flint::Camera::setZoom |
( |
float | zoom | ) |
|
Set zoom (clamped to >=0.01 to avoid division‑by‑zero).
◆ update()
| FLINT_API void Flint::Camera::update |
( |
float | smoothing = 0.25f | ) |
|
Adjust smoothing factor (lerp) used by future setTargetCenter.
- Parameters
-
| smoothing | 0 = no movement, 1 = instant snap (default 0.25f). |
The documentation for this class was generated from the following file: