feat: finally added a working multi-camera system where the highest priority Camera2D will be used to make the RenderCamera (unfortunately not very efficient because it creates a new RenderCamera every tick, but it works i guess)

This commit is contained in:
lisk77 2025-03-10 17:48:11 +01:00
parent 4e9e296ba4
commit 445818b79b
4 changed files with 20 additions and 41 deletions

View file

@ -1,32 +1,5 @@
use comet_math::Mat4;
mod camera;
pub mod renderer;
pub mod renderer2d;
mod render_pass;
mod render_group;
pub struct Projection {
aspect: f32,
fovy: f32,
znear: f32,
zfar: f32
}
impl Projection {
pub fn new(width: u32, height: u32, fovy: f32, znear: f32, zfar: f32) -> Self {
Self {
aspect: width as f32 / height as f32,
fovy,
znear,
zfar
}
}
pub fn resize(&mut self, width: u32, height: u32) { self.aspect = width as f32 / height as f32; }
/*pub fn calc_matrix(&self) -> Mat4 {
Mat4::perspective_matrix(self.fovy, self.aspect, self.znear, self.zfar)
}*/
}
mod render_group;