fix: swap W and S movement directions and double camera speed for correct control
This commit is contained in:
@@ -325,7 +325,7 @@ fn main() {
|
||||
// Handle keyboard input for camera movement and rotation
|
||||
if let Ok(keys) = pressed_keys.lock() {
|
||||
// movement speed
|
||||
let speed = 5.0 * delta_time;
|
||||
let speed = 10.0 * delta_time;
|
||||
// camera direction vectors based on yaw & pitch
|
||||
let front = glm::vec3(
|
||||
cam_yaw.sin() * cam_pitch.cos(),
|
||||
@@ -337,8 +337,8 @@ fn main() {
|
||||
for key in keys.iter() {
|
||||
match key {
|
||||
// Move relative to camera orientation
|
||||
VirtualKeyCode::W => { cam_pos += front * speed; }
|
||||
VirtualKeyCode::S => { cam_pos -= front * speed; }
|
||||
VirtualKeyCode::W => { cam_pos -= front * speed; }
|
||||
VirtualKeyCode::S => { cam_pos += front * speed; }
|
||||
VirtualKeyCode::A => { cam_pos -= right * speed; }
|
||||
VirtualKeyCode::D => { cam_pos += right * speed; }
|
||||
VirtualKeyCode::Space => { cam_pos += up_vec * speed; }
|
||||
|
||||
Reference in New Issue
Block a user