mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-10 01:28:41 -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>,
|
controllers: View<FlyController>,
|
||||||
mut transforms: ViewMut<Transform>,
|
mut transforms: ViewMut<Transform>,
|
||||||
inputs: UniqueView<Inputs>,
|
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 }
|
if look == Vec2::ZERO { return }
|
||||||
for (_, mut transform) in (&controllers, &mut transforms).iter() {
|
for (_, mut transform) in (&controllers, &mut transforms).iter() {
|
||||||
let (scale, mut rotation, translation) = transform.0.to_scale_rotation_translation();
|
let (scale, mut rotation, translation) = transform.0.to_scale_rotation_translation();
|
||||||
|
|
|
@ -10,7 +10,7 @@ impl Default for GameSettings {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
render_distance: 5,
|
render_distance: 5,
|
||||||
mouse_sensitivity: 0.01,
|
mouse_sensitivity: 1.,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue