mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 08:18:43 -06:00
Mouse sensitivity is now affected by delta time
This commit is contained in:
parent
4c2a29e0a3
commit
d9ab57ba12
|
@ -19,9 +19,10 @@ fn update_look(
|
|||
controllers: View<FlyController>,
|
||||
mut transforms: ViewMut<Transform>,
|
||||
inputs: UniqueView<Inputs>,
|
||||
settings: UniqueView<GameSettings>
|
||||
settings: UniqueView<GameSettings>,
|
||||
dt: UniqueView<DeltaTime>,
|
||||
) {
|
||||
let look = inputs.look * settings.mouse_sensitivity;
|
||||
let look = inputs.look * settings.mouse_sensitivity * dt.0.as_secs_f32();
|
||||
if look == Vec2::ZERO { return }
|
||||
for (_, mut transform) in (&controllers, &mut transforms).iter() {
|
||||
let (scale, mut rotation, translation) = transform.0.to_scale_rotation_translation();
|
||||
|
|
|
@ -10,7 +10,7 @@ impl Default for GameSettings {
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
render_distance: 5,
|
||||
mouse_sensitivity: 0.01,
|
||||
mouse_sensitivity: 1.,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue