Skip to content

Commit

Permalink
framerate independent smoothing
Browse files Browse the repository at this point in the history
  • Loading branch information
aevyrie committed Jan 6, 2024
1 parent b9744f2 commit da21de2
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 94 deletions.
Binary file not shown.
9 changes: 5 additions & 4 deletions examples/demo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::time::Duration;
use std::{thread::sleep, time::Duration};

use bevy::{
core_pipeline::{bloom::BloomSettings, tonemapping::Tonemapping},
Expand All @@ -8,7 +8,7 @@ use bevy_editor_cam::{prelude::*, skybox::SkyboxCamConfig};

fn main() {
App::new()
.insert_resource(bevy::winit::WinitSettings::desktop_app())
// .insert_resource(bevy::winit::WinitSettings::desktop_app())
.add_plugins((
DefaultPlugins,
bevy_mod_picking::DefaultPickingPlugins,
Expand All @@ -24,6 +24,7 @@ fn send_events(keyboard: Res<Input<KeyCode>>) {
if keyboard.just_pressed(KeyCode::P) {
// cam_events.send(ChangeProjection::To);
}
sleep(Duration::from_millis(0));
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
Expand Down Expand Up @@ -89,8 +90,8 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// OrbitMode::Free,
Smoothness {
pan: Duration::from_millis(20),
orbit: Duration::from_millis(60),
zoom: Duration::from_millis(80),
orbit: Duration::from_millis(40),
zoom: Duration::from_millis(100),
},
Sensitivity::same(1.0),
Momentum {
Expand Down
Loading

0 comments on commit da21de2

Please sign in to comment.