diff --git a/src/vvedit/editor_ui.rs b/src/vvedit/editor_ui.rs index 29acd45..c809701 100644 --- a/src/vvedit/editor_ui.rs +++ b/src/vvedit/editor_ui.rs @@ -7,7 +7,10 @@ use bevy::{ transform::components::GlobalTransform, window::Window, }; -use bevy_egui::{egui, EguiContexts, EguiPlugin}; +use bevy_egui::{ + egui::{self, color_picker, Color32}, + EguiContexts, EguiPlugin, +}; use rand::Rng; use crate::{ @@ -86,13 +89,7 @@ pub fn edit_click_events( if collision.is_some() { let col = collision.unwrap(); - let x = edit_octtree.remove_voxel(col.voxel_index_location); - if x == 0 { - dbg!(edit_octtree); - dbg!(col.voxel_index_location); - } else { - println!("Successfully culled {} voxels!", x); - } + edit_octtree.remove_voxel(col.voxel_index_location); } } else if let Some(_) = insert.filter(|input| input.pressed()) { if collision.is_some() { @@ -114,6 +111,7 @@ pub fn edit_window_ui( mut oct_assets: ResMut>, mut pairs: ResMut, ) { + let mut color: Color32 = Default::default(); egui::Window::new("VVEdit").show(contexts.ctx_mut(), |ui| { let mut label = String::from("Pre-Alpha"); use std::fmt::Write; @@ -122,6 +120,7 @@ pub fn edit_window_ui( writeln!(label, "R+click removes a voxel:").ok(); writeln!(label, "E+click paints (edits) a voxel:").ok(); + color_picker::color_picker_color32(ui, &mut color, color_picker::Alpha::Opaque); ui.label(label); if ui.button("Add Origin Voxel").clicked() { // diff --git a/src/vvlib/octtree.rs b/src/vvlib/octtree.rs index 6040f22..141f5d7 100644 --- a/src/vvlib/octtree.rs +++ b/src/vvlib/octtree.rs @@ -2,8 +2,7 @@ use std::mem::swap; -use bevy::math::{vec3, Vec3}; -use rand::Rng; +use bevy::math::Vec3; use crate::vvlib::intersections::aa_bounds_contains; @@ -627,6 +626,7 @@ pub fn test_path() { } #[test] pub fn fuzztestpath() { + use rand::Rng; let origin = Vec3::ZERO; let mut test_oct = OctTree::::new(origin, 1); let range = 10000.;