diff --git a/.gitignore b/.gitignore index 6a59f55..aea98f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target Cargo.lock -/.idea \ No newline at end of file +/.idea +.DS_Store diff --git a/Cargo.toml b/Cargo.toml index 3a0fd69..008f427 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ exclude = ["/docs"] members = ["demo"] [dependencies] -egui = "0.26" +egui = "0.26.2" glam = { version = "0.25.0", features = ["mint"] } mint = "0.5" diff --git a/demo/.gitignore b/demo/.gitignore index 6a59f55..aea98f6 100644 --- a/demo/.gitignore +++ b/demo/.gitignore @@ -1,3 +1,4 @@ /target Cargo.lock -/.idea \ No newline at end of file +/.idea +.DS_Store diff --git a/demo/Cargo.toml b/demo/Cargo.toml index 5f96a92..c611347 100644 --- a/demo/Cargo.toml +++ b/demo/Cargo.toml @@ -7,20 +7,18 @@ edition = "2021" license = "MIT" [dependencies] -bevy_egui_next = "0.26" -egui = "0.26" +bevy = "0.13" +bevy_egui = "0.25.0" +egui = "0.26.2" egui-gizmo = { path = ".." } -[dependencies.bevy] -version = "0.12.1" +[dependencies.bevy_infinite_grid] +git = "https://github.com/XYCaptain/bevy_infinite_grid.git" +rev = "1e5259a52a7dfaca65402c2c57c1d81c2bc443e9" [dependencies.bevy_math] version = "0.12.1" features = ["mint"] -[dependencies.bevy_infinite_grid] -git = "https://github.com/pcwalton/bevy_infinite_grid.git" -rev = "c752a23063b2b05163e307889eb276d6574115ab" - [lints] -workspace = true \ No newline at end of file +workspace = true diff --git a/demo/src/camera.rs b/demo/src/camera.rs index 2bac8f0..36b8604 100644 --- a/demo/src/camera.rs +++ b/demo/src/camera.rs @@ -39,7 +39,7 @@ pub fn update_camera( window_q: Query<&Window>, mut ev_motion: EventReader, mut ev_scroll: EventReader, - input_mouse: Res>, + input_mouse: Res>, mut query: Query<(&mut PanOrbitCamera, &mut Transform, &Projection)>, ) { let window = window_q.single(); diff --git a/demo/src/main.rs b/demo/src/main.rs index 1cc7e11..ffb4058 100644 --- a/demo/src/main.rs +++ b/demo/src/main.rs @@ -1,7 +1,8 @@ use bevy::prelude::*; +use bevy::render::render_asset::RenderAssetUsages; use bevy::render::texture::{CompressedImageFormats, ImageFormat, ImageSampler, ImageType}; use bevy::window::PresentMode; -use bevy_egui_next::{egui, EguiContexts, EguiPlugin}; +use bevy_egui::{egui, EguiContexts, EguiPlugin}; use bevy_infinite_grid::{InfiniteGridBundle, InfiniteGridPlugin, InfiniteGridSettings}; use egui::color_picker::Alpha; use egui::{pos2, Align2, Color32, FontId, LayerId, Ui, Widget}; @@ -23,7 +24,6 @@ fn main() { primary_window: Some(Window { title: "egui-gizmo demo".into(), present_mode: PresentMode::AutoNoVsync, - fit_canvas_to_parent: true, ..default() }), ..default() @@ -77,19 +77,21 @@ fn setup( CompressedImageFormats::all(), true, ImageSampler::Default, + RenderAssetUsages::default(), ) .unwrap(), ); commands.insert_resource(AmbientLight { color: Color::WHITE, - brightness: 0.2, + brightness: 300., + }); + let cube_handle = meshes.add(Cuboid { + half_size: Vec3::ONE, }); - - let cube_handle = meshes.add(Mesh::from(shape::Cube { size: 2.0 })); let cube_material_handle = materials.add(StandardMaterial { base_color_texture: Some(texture_handle.clone()), - unlit: false, + // unlit: true, ..default() }); @@ -117,7 +119,7 @@ fn update( camera_q: Query<(&Camera, &Transform), Without>, mut target_q: Query<&mut Transform, With>, mut gizmo_options: ResMut, - keys: Res>, + keys: Res>, ) { let (projection_matrix, view_matrix) = { let (camera, transform) = camera_q.single(); diff --git a/rust-toolchain b/rust-toolchain index 13a87da..4df24c9 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ [toolchain] -channel = "1.74.0" +channel = "1.76.0" components = ["rustfmt", "clippy"] -targets = ["wasm32-unknown-unknown"] \ No newline at end of file +targets = ["wasm32-unknown-unknown"] diff --git a/src/subgizmo/arcball.rs b/src/subgizmo/arcball.rs index 20a5f7e..d5f0257 100644 --- a/src/subgizmo/arcball.rs +++ b/src/subgizmo/arcball.rs @@ -46,6 +46,7 @@ impl SubGizmo for ArcballSubGizmo { let mat = self.config.view_projection.inverse(); let a = screen_to_world(self.config.viewport, mat, ray.screen_pos, 0.0); let b = screen_to_world(self.config.viewport, mat, state.last_pos, 0.0); + let origin = self.config.view_forward(); let a = (a - origin).normalize(); let b = (b - origin).normalize();