mirror of
https://github.com/lisk77/comet.git
synced 2025-12-15 18:18:50 +00:00
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:
parent
4e9e296ba4
commit
445818b79b
4 changed files with 20 additions and 41 deletions
|
|
@ -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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue