diff --git a/Cargo.toml b/Cargo.toml index 6514f59..315f638 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ default-features = false features = ["3d", "f32", "async-collider", "default-collider", "parry-f32"] [dev-dependencies] -bevy-inspector-egui = "0.22" +bevy-inspector-egui = "0.23" rand = "0.8" bevy_xpbd_3d = "0.4" bevy_rapier3d = "0.25" @@ -56,8 +56,6 @@ features = [ "png", "x11", "tonemapping_luts", - # Faster compilation - "dynamic_linking" ] default-features = false diff --git a/examples/anchors_example.rs b/examples/anchors_example.rs index e19a60e..395990e 100644 --- a/examples/anchors_example.rs +++ b/examples/anchors_example.rs @@ -8,7 +8,7 @@ fn main() { App::new() .insert_resource(AmbientLight { color: Color::WHITE, - brightness: 1.0, + brightness: 500.0, }) .add_plugins(DefaultPlugins) .add_plugins(ResourceInspectorPlugin::::new()) diff --git a/examples/balloon_example.rs b/examples/balloon_example.rs index 0db1e6a..23605fb 100644 --- a/examples/balloon_example.rs +++ b/examples/balloon_example.rs @@ -8,7 +8,7 @@ fn main() { App::new() .insert_resource(AmbientLight { color: Color::WHITE, - brightness: 1.0, + brightness: 100.0, }) .add_plugins(DefaultPlugins) .add_plugins(WorldInspectorPlugin::default()) diff --git a/examples/camera_plugin.rs b/examples/camera_plugin.rs index c88966f..52186e4 100644 --- a/examples/camera_plugin.rs +++ b/examples/camera_plugin.rs @@ -6,56 +6,62 @@ use bevy::{ pub struct CameraPlugin; +#[derive(Debug, Component)] +pub struct OrbitController; + #[derive(Debug, Component)] pub struct CameraController; impl Plugin for CameraPlugin { fn build(&self, app: &mut App) { app.add_systems(Startup, setup) - .add_systems(PostUpdate, handle_camera); + .add_systems(PostUpdate, (handle_rotation, handle_zoom)); log::info!("Camera Plugin loaded"); } } pub fn setup(mut commands: Commands) { - commands.spawn(( - Camera3dBundle { - transform: Transform::from_xyz(-30.0, 30.0, -30.0).looking_at(Vec3::ZERO, Vec3::Y), - ..default() - }, - CameraController, - )); + commands + .spawn(( + TransformBundle::from_transform(Transform::from_rotation(Quat::from_rotation_z(-1.0))), + OrbitController, + )) + .with_children(|b| { + b.spawn(( + Camera3dBundle { + transform: Transform::from_xyz(0.0, 30.0, 0.0).looking_at(Vec3::ZERO, Vec3::Y), + ..default() + }, + CameraController, + )); + }); } -pub fn handle_camera( - mut cam_controls: Query<&mut Transform, With>, +pub fn handle_rotation( + mut cam_controls: Query<&mut Transform, With>, mut motion_evr: EventReader, - mut scroll_evr: EventReader, buttons: Res>, time: Res