-
Notifications
You must be signed in to change notification settings - Fork 2
Views, Cameras, and Viewports
A View is Gondwana’s answer to the question: what part of the world is being shown, and where is it being shown on screen?
A view combines two things:
- a Camera — what world-space region you are looking at
- a Viewport — where that image appears on the render surface
This separation is deliberate. The camera moves through world space. The viewport does not. The viewport only defines a screen-space rectangle and zoom behavior.
The Camera stores a world-space upper-left position in pixels. It can:
- snap instantly
- center on points or tiles
- smoothly follow a target
- pan over time
- clamp itself to world bounds
- use a dead zone for less twitchy follow behavior
When the camera moves, Gondwana marks the scene for a full refresh. That is expected: changing the camera changes what every visible layer should look like.
The Viewport defines:
- target screen rectangle
- zoom level
- optional screen offset
- derived visible world size
Viewport zoom is animated independently from camera movement. This makes “zoom toward cursor” and cinematic pan/zoom behavior possible without mixing concerns.
Because rendering flows through views, multiple cameras are not a bolt-on feature. Split-screen, picture-in-picture, minimaps, and layered overlays are natural outcomes of the model.
- Camera = “where am I looking in the world?”
- Viewport = “where does that view appear on screen?”
- View = both, together
Gondwana/Rendering/Views/View.csGondwana/Rendering/Views/Camera.csGondwana/Rendering/Views/Viewport.csGondwana/Rendering/Views/ViewManager.cs