added pan/orbit camera and eguiplugin
This commit is contained in:
parent
6050607994
commit
142cec1235
4 changed files with 23 additions and 3 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
|
@ -1014,6 +1014,16 @@ dependencies = [
|
|||
"glam",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_panorbit_camera"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ca6e15e297754d0bcb7665620c390c4f05665d4ac4ac91b4b5d3c66b9fe1f0e6"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
"bevy_egui",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bevy_pbr"
|
||||
version = "0.16.0"
|
||||
|
|
@ -1472,6 +1482,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"bevy",
|
||||
"bevy_egui",
|
||||
"bevy_panorbit_camera",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ license = "MIT OR Apache-2.0"
|
|||
[dependencies]
|
||||
bevy = { version = "0.16.0", features = ["shader_format_wesl"] }
|
||||
bevy_egui = "0.34.1"
|
||||
bevy_panorbit_camera = { version = "0.26.0", features = ["bevy_egui"] }
|
||||
|
||||
# Enable a small amount of optimization in the dev profile.
|
||||
[profile.dev]
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
use bevy::prelude::*;
|
||||
use bevy_panorbit_camera::{PanOrbitCamera, PanOrbitCameraPlugin};
|
||||
|
||||
pub fn plugin(app: &mut App) {
|
||||
app.add_systems(Startup, setup);
|
||||
app.add_plugins(PanOrbitCameraPlugin)
|
||||
.add_systems(Startup, setup);
|
||||
}
|
||||
|
||||
fn setup(mut commands: Commands) {
|
||||
commands.spawn((
|
||||
Camera3d::default(),
|
||||
Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
|
||||
PanOrbitCamera::default(),
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use bevy::{color::palettes::css::RED, prelude::*, render::storage::ShaderStorageBuffer};
|
||||
use bevy_egui::EguiPlugin;
|
||||
use mandelbulb::{MandelbulbExtension, MandelbulbMaterial, MandelbulbStorage};
|
||||
|
||||
mod camera;
|
||||
|
|
@ -6,7 +7,12 @@ mod mandelbulb;
|
|||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugins((
|
||||
DefaultPlugins,
|
||||
EguiPlugin {
|
||||
enable_multipass_for_primary_context: false,
|
||||
},
|
||||
))
|
||||
.add_plugins((camera::plugin, mandelbulb::plugin))
|
||||
.add_systems(Startup, setup)
|
||||
.add_systems(Update, (rotate_things,))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue