Skip to content

Commit

Permalink
feat: pan-orbit camera
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Oct 2, 2023
1 parent 6ba8b1f commit 896b326
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
15 changes: 14 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ use bevy::{
FrameTimeDiagnosticsPlugin,
},
};
use bevy_panorbit_camera::{
PanOrbitCamera,
PanOrbitCameraPlugin,
};

use bevy_gaussian_splatting::{
GaussianSplattingBundle,
Expand Down Expand Up @@ -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(),
));
}


Expand All @@ -70,6 +80,9 @@ fn example_app() {
..default()
})
);
app.add_plugins((
PanOrbitCameraPlugin,
));

if config.esc_close {
app.add_systems(Update, esc_close);
Expand Down

0 comments on commit 896b326

Please sign in to comment.