From d7eccba2055cd7784a0db6d9ee8692a4f3510931 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sat, 15 Aug 2026 22:46:53 -0700 Subject: fire, optimize viewport rendering --- src/camera.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/camera.rs') diff --git a/src/camera.rs b/src/camera.rs index 0b69833..d14adbd 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -20,6 +20,14 @@ impl Camera { (1.0 / half_w, -1.0 / half_h) } + // xl, xu, yl, yu + pub fn viewport_bounds_world(&self) -> (f32, f32, f32, f32) { + let (xl, yl) = self.screen_position_to_world(0.0, 0.0); + let (xu, yu) = + self.screen_position_to_world(self.screen_size.0 as f32, self.screen_size.1 as f32); + (xl, xu, yl, yu) + } + pub fn handle_camera_input(&mut self, input: &Input, delta_time: f32) { // wasd movement let x: f32 = if input.is_left_pressed { -- cgit v1.3.1