Same near&far plane for cam and lights

This commit is contained in:
Lauri Räsänen 2023-04-15 23:32:04 +03:00
parent b978091cd4
commit e153ff5b6b
2 changed files with 7 additions and 4 deletions

View file

@ -3,6 +3,9 @@ use std::time::Duration;
use cgmath::num_traits::clamp;
use winit::{dpi::PhysicalPosition, event::*};
pub const NEAR_PLANE: f32 = 0.1;
pub const FAR_PLANE: f32 = 3000.0;
pub struct Camera {
pub position: cgmath::Point3<f32>,
pub pitch: f32,
@ -42,8 +45,8 @@ impl Camera {
projection: PerspectiveProjection {
aspect,
fovy,
znear: 0.1,
zfar: 3000.0,
znear: NEAR_PLANE,
zfar: FAR_PLANE,
},
}
}