From 7a23ef27347f5f289d659101546986f319965425 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 31 Aug 2023 12:04:18 -0700 Subject: [PATCH] add walking --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index af0354c2..cdd96b20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,6 +30,7 @@ struct Camera { controls: u32, mv: f32, grounded: bool, + walkspeed: f32, } const CONTROL_MOVEFORWARD:u32 = 0b00000001; @@ -221,6 +222,7 @@ impl strafe_client::framework::Example for Skybox { mv: 2.7, controls:0, grounded: true, + walkspeed: 18.0, }; let raw_uniforms = camera.to_uniform_data(); let uniform_buf = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { @@ -533,10 +535,12 @@ impl strafe_client::framework::Example for Skybox { } if self.camera.grounded { let applied_friction=self.camera.friction*dt; - if applied_friction*applied_friction