Galactica/crates/render/src/renderstate.rs
2024-01-08 21:02:02 -08:00

29 lines
693 B
Rust

use cgmath::Point2;
use galactica_content::Content;
use galactica_world::{ParticleBuilder, ShipPhysicsHandle, World};
/// Bundles parameters passed to a single call to GPUState::render
pub struct RenderState<'a> {
/// Camera position, in world units
pub camera_pos: Point2<f32>,
/// Player ship
pub player: &'a ShipPhysicsHandle,
/// Height of screen, in world units
pub camera_zoom: f32,
/// The world state to render
pub world: &'a World,
// TODO: handle overflow. is it a problem?
/// The current time, in seconds
pub current_time: f32,
/// Game content
pub content: &'a Content,
/// Particles to spawn during this frame
pub particles: &'a mut Vec<ParticleBuilder>,
}