Remove unused translate matrix

This commit is contained in:
Maximilian Ammann 2022-01-29 12:45:12 +01:00
parent 2c6ea39880
commit 3019605cf7

View File

@ -22,7 +22,6 @@ pub const FLIP_Y: cgmath::Matrix4<f64> = cgmath::Matrix4::new(
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Camera { pub struct Camera {
pub translation: cgmath::Matrix4<f64>,
pub position: cgmath::Point3<f64>, pub position: cgmath::Point3<f64>,
pub yaw: cgmath::Rad<f64>, pub yaw: cgmath::Rad<f64>,
pub pitch: cgmath::Rad<f64>, pub pitch: cgmath::Rad<f64>,
@ -45,7 +44,6 @@ impl Camera {
) -> Self { ) -> Self {
Self { Self {
position: position.into(), position: position.into(),
translation: Matrix4::identity(),
yaw: yaw.into(), yaw: yaw.into(),
pitch: pitch.into(), pitch: pitch.into(),
width: width as f64, width: width as f64,
@ -63,7 +61,7 @@ impl Camera {
self.position, self.position,
cgmath::Vector3::new(self.yaw.cos(), self.pitch.sin(), self.yaw.sin()).normalize(), cgmath::Vector3::new(self.yaw.cos(), self.pitch.sin(), self.yaw.sin()).normalize(),
cgmath::Vector3::unit_y(), cgmath::Vector3::unit_y(),
) * self.translation )
} }
pub fn calc_view_proj(&self, perspective: &Perspective) -> Matrix4<f64> { pub fn calc_view_proj(&self, perspective: &Perspective) -> Matrix4<f64> {