Skip to main content

FrameOutput

Struct FrameOutput 

Source
pub struct FrameOutput {
    pub view_projection: DMat4,
    pub frustum: Option<Frustum>,
    pub tiles: Arc<Vec<VisibleTile>>,
    pub terrain: Arc<Vec<TerrainMeshData>>,
    pub hillshade: Arc<Vec<PreparedHillshadeRaster>>,
    pub vectors: Arc<Vec<VectorMeshData>>,
    pub models: Arc<Vec<ModelInstance>>,
    pub symbols: Arc<Vec<PlacedSymbol>>,
    pub visualization: Arc<Vec<VisualizationOverlay>>,
    pub placeholders: Arc<Vec<LoadingPlaceholder>>,
    pub image_overlays: Arc<Vec<ImageOverlayData>>,
    pub zoom_level: u8,
}
Expand description

Bundled per-frame snapshot produced by MapState::update for renderers.

Contains everything a renderer needs to draw a single frame, avoiding the need to reach into MapState internals. All data is owned (Cloned from MapState), so the struct can be sent to a render thread without holding a lock.

§Usage

state.update();
let frame = state.frame_output();
// Send `frame` to the GPU thread ...

Fields§

§view_projection: DMat4

View-projection matrix (f64 precision, camera-relative origin).

Cast to glam::Mat4 (f32) when uploading to a GPU uniform buffer. The f64 source preserves precision for CPU-side picking and culling.

§frustum: Option<Frustum>

View frustum planes for CPU-side culling.

None only before the first call to update().

§tiles: Arc<Vec<VisibleTile>>

Visible tiles (loaded imagery or parent-tile fallbacks).

Wrapped in Arc for zero-copy sharing with render threads.

§terrain: Arc<Vec<TerrainMeshData>>

Terrain meshes to render (one per visible tile with elevation data).

Wrapped in Arc for zero-copy sharing with render threads.

§hillshade: Arc<Vec<PreparedHillshadeRaster>>

Prepared DEM-derived hillshade rasters aligned to the visible terrain set.

§vectors: Arc<Vec<VectorMeshData>>

Tessellated vector meshes (polygons, lines, points).

Wrapped in Arc for zero-copy sharing with render threads.

§models: Arc<Vec<ModelInstance>>

Placed 3D model instances to render.

Wrapped in Arc for zero-copy sharing with render threads.

§symbols: Arc<Vec<PlacedSymbol>>

Placed symbol instances after collision resolution.

§visualization: Arc<Vec<VisualizationOverlay>>

Visualization overlay data (grids, columns, etc.) from the last update.

§placeholders: Arc<Vec<LoadingPlaceholder>>

Loading placeholders for visible tiles that have no data yet.

Renderers should draw styled rectangles at these world bounds before or behind the opaque tile pass so that loading areas never appear as blank gaps.

§image_overlays: Arc<Vec<ImageOverlayData>>

Georeferenced image overlays (image/video/canvas sources).

Each entry is a textured quad defined by four world-space corners plus RGBA8 pixel data. Renderers should draw these between the tile and vector passes.

§zoom_level: u8

Current integer zoom level (0-22).

Trait Implementations§

Source§

impl Debug for FrameOutput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FrameOutput

Source§

fn default() -> FrameOutput

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.