diff --git a/Cargo.toml b/Cargo.toml index 11172ccc..e7fbe96d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ exclude = [".devcontainer", ".github", "docs", "dist", "build", "assets", "credi [dependencies] bevy = "0.11.2" +bevy_panorbit_camera = "0.8.0" ply-rs = "0.1.3" diff --git a/src/main.rs b/src/main.rs index 8cd24ec0..789d7d2a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,10 @@ use bevy::{ FrameTimeDiagnosticsPlugin, }, }; +use bevy_panorbit_camera::{ + PanOrbitCamera, + PanOrbitCameraPlugin, +}; use bevy_gaussian_splatting::{ GaussianSplattingBundle, @@ -44,7 +48,13 @@ fn setup_gaussian_cloud( ..Default::default() }); - commands.spawn(Camera3dBundle::default()); + commands.spawn(( + Camera3dBundle { + transform: Transform::from_translation(Vec3::new(0.0, 1.5, 5.0)), + ..default() + }, + PanOrbitCamera::default(), + )); } @@ -70,6 +80,9 @@ fn example_app() { ..default() }) ); + app.add_plugins(( + PanOrbitCameraPlugin, + )); if config.esc_close { app.add_systems(Update, esc_close);