Skip to content

Add MapCameraPosition.fov and padding emulation - #41

Merged
wf9a5m75 merged 2 commits into
developfrom
feat/camera-paddings
Nov 12, 2026
Merged

wf9a5m75 merged 2 commits into
developfrom
feat/camera-paddings

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Summary

  • New read-only MapCameraPosition.fov: the vertical field of view of the camera as currently rendered (0 = tilt drawn without perspective, null = unknown / the map cannot tilt). Each provider reports its own engine's value; core holds no default.
  • New internal helper that emulates paddings for engines without a native padding API: it moves the camera centre so the target sits at the centre of the padded area, using the provider's fov (pinhole camera for fov > 0, squashed plane for fov 0, plain pixel shift when unknown), plus the inverse for read-back.

Provider PRs on feat/camera-paddings depend on this one.

Commits

  • Add MapCameraPosition.fov and a padding emulation helper
  • Merge remote-tracking branch 'origin/develop' into feat/camera-paddings

fov is the vertical field of view, in degrees, of the camera the
provider actually renders with, for the current map size. 0 means the
tilt is drawn without perspective; null means unknown or the map cannot
tilt. Like visibleRegion it is filled when the camera is read and
ignored on moves; copy keeps it and equals ignores it. Core holds no
fov value: each provider reports its own.

CameraPaddingEmulation (driver API) lets a provider without a usable
padding API honour MapCameraPosition.paddings by moving the camera
center instead: the screen offset of the padded-area center, (L-R)/2
and (T-B)/2 dp, is solved on the ground with a pinhole camera for the
provider's fov (orthographic for fov 0, flat for null), and inverted
when the camera is read back. Unit tests check the result against an
independent pinhole projection at tilt 0-60, three headings and three
fovs.
@wf9a5m75
wf9a5m75 merged commit 82ced5b into develop Nov 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant