pub struct VoxelEditor {
pub grid: VoxelGrid,
pub svo: Option<SparseVoxelOctree>,
pub material_table: Vec<VoxelMaterial>,
pub undo_history: VoxelUndoHistory,
pub active_tool: EditorTool,
pub brush: BrushSettings,
pub selection: HashSet<(i32, i32, i32)>,
pub clipboard: Option<VoxelClipboard>,
pub mesh: Option<GeneratedMesh>,
pub mesh_dirty: bool,
pub noise: PerlinNoise3D,
}Fields§
§grid: VoxelGrid§svo: Option<SparseVoxelOctree>§material_table: Vec<VoxelMaterial>§undo_history: VoxelUndoHistory§active_tool: EditorTool§brush: BrushSettings§selection: HashSet<(i32, i32, i32)>§clipboard: Option<VoxelClipboard>§mesh: Option<GeneratedMesh>§mesh_dirty: bool§noise: PerlinNoise3DImplementations§
Source§impl VoxelEditor
impl VoxelEditor
pub fn new(width: usize, height: usize, depth: usize) -> Self
pub fn apply_brush(&mut self, world_pos: Vec3)
pub fn undo(&mut self) -> bool
pub fn redo(&mut self) -> bool
pub fn select_at(&mut self, x: i32, y: i32, z: i32, add_to_selection: bool)
pub fn flood_select(&mut self, x: i32, y: i32, z: i32, same_material: bool)
pub fn copy_selection(&mut self)
pub fn paste(&mut self, offset: (i32, i32, i32))
pub fn rebuild_mesh(&mut self)
pub fn rebuild_svo(&mut self)
pub fn generate_terrain( &mut self, base_height: f32, height_scale: f32, noise_scale: f32, )
pub fn generate_caves( &mut self, num_worms: usize, worm_length: usize, radius: f32, )
pub fn ray_cast(&self, origin: Vec3, dir: Vec3) -> Option<(Vec3, u8)>
pub fn fill_selection(&mut self, material: u8)
pub fn delete_selection(&mut self)
pub fn apply_physics_destruction( &mut self, stress_threshold: f32, ) -> Vec<DebrisParticle>
pub fn voxel_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for VoxelEditor
impl RefUnwindSafe for VoxelEditor
impl Send for VoxelEditor
impl Sync for VoxelEditor
impl Unpin for VoxelEditor
impl UnsafeUnpin for VoxelEditor
impl UnwindSafe for VoxelEditor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.