summaryrefslogtreecommitdiff
path: root/engine/src/camera/fly.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-11-25 23:44:22 +0100
committerHampusM <hampus@hampusmat.com>2024-11-25 23:44:22 +0100
commit9d59f8b283e8a4d84c1909a750d0e789de866c6a (patch)
tree0c591229b029243864644a6d792fe000f6b6345a /engine/src/camera/fly.rs
parenta160998b84dec6d72afde9efb7f3bf9489863469 (diff)
refactor(engine): compare key states with == in fly cameraHEADmaster
Diffstat (limited to 'engine/src/camera/fly.rs')
-rw-r--r--engine/src/camera/fly.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/engine/src/camera/fly.rs b/engine/src/camera/fly.rs
index 1333360..99739e3 100644
--- a/engine/src/camera/fly.rs
+++ b/engine/src/camera/fly.rs
@@ -121,23 +121,23 @@ fn update(
camera.global_up = cam_right.cross(&direction).normalize();
- if matches!(keys.get_key_state(Key::W), KeyState::Pressed) {
+ if keys.get_key_state(Key::W) == KeyState::Pressed {
camera_pos.position +=
direction * fly_camera.speed * delta_time.as_secs_f32();
}
- if matches!(keys.get_key_state(Key::S), KeyState::Pressed) {
+ if keys.get_key_state(Key::S) == KeyState::Pressed {
camera_pos.position -=
direction * fly_camera.speed * delta_time.as_secs_f32();
}
- if matches!(keys.get_key_state(Key::A), KeyState::Pressed) {
+ if keys.get_key_state(Key::A) == KeyState::Pressed {
let cam_left = -direction.cross(&Vec3::UP).normalize();
camera_pos.position += cam_left * fly_camera.speed * delta_time.as_secs_f32();
}
- if matches!(keys.get_key_state(Key::D), KeyState::Pressed) {
+ if keys.get_key_state(Key::D) == KeyState::Pressed {
let cam_right = direction.cross(&Vec3::UP).normalize();
camera_pos.position +=