From 6d0d694d0c98c35b03ef0d782e8f76c81581874c Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 20 Aug 2024 16:13:09 -0700 Subject: [PATCH] graphics: spaces --- src/graphics.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics.rs b/src/graphics.rs index 84dad48..6f5f71e 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -58,12 +58,12 @@ struct GraphicsCamera{ #[inline] fn perspective_rh(fov_x_slope:f32,fov_y_slope:f32,z_near:f32,z_far:f32)->glam::Mat4{ //glam_assert!(z_near > 0.0 && z_far > 0.0); - let r=z_far / (z_near-z_far); + let r=z_far/(z_near-z_far); glam::Mat4::from_cols( glam::Vec4::new(1.0/fov_x_slope,0.0,0.0,0.0), glam::Vec4::new(0.0,1.0/fov_y_slope,0.0,0.0), glam::Vec4::new(0.0,0.0,r,-1.0), - glam::Vec4::new(0.0,0.0,r * z_near,0.0), + glam::Vec4::new(0.0,0.0,r*z_near,0.0), ) } impl GraphicsCamera{ @@ -72,7 +72,7 @@ impl GraphicsCamera{ } pub fn world(&self,pos:glam::Vec3,angles:glam::Vec2)->glam::Mat4{ //f32 good enough for view matrix - glam::Mat4::from_translation(pos) * glam::Mat4::from_euler(glam::EulerRot::YXZ,angles.x,angles.y,0f32) + glam::Mat4::from_translation(pos)*glam::Mat4::from_euler(glam::EulerRot::YXZ,angles.x,angles.y,0f32) } pub fn to_uniform_data(&self,(pos,angles):(glam::Vec3,glam::Vec2))->[f32; 16 * 4]{