mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
impl VoxelShape for ArrayVoxelShape
This commit is contained in:
parent
9b3eb8fa82
commit
cf3fcc2bbf
2 changed files with 13 additions and 6 deletions
|
@ -43,9 +43,12 @@ pub trait DiscreteVoxelShape {
|
|||
}
|
||||
false
|
||||
}
|
||||
|
||||
// i don't know how to do this properly
|
||||
fn clone(&self) -> Box<dyn DiscreteVoxelShape>;
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
#[derive(Default, Clone)]
|
||||
pub struct BitSetDiscreteVoxelShape {
|
||||
x_size: u32,
|
||||
y_size: u32,
|
||||
|
@ -152,4 +155,8 @@ impl DiscreteVoxelShape for BitSetDiscreteVoxelShape {
|
|||
fn last_full_z(&self) -> u32 {
|
||||
self.z_max
|
||||
}
|
||||
|
||||
fn clone(&self) -> Box<dyn DiscreteVoxelShape> {
|
||||
Box::new(Clone::clone(self))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,25 +87,25 @@ impl CubeVoxelShape {
|
|||
|
||||
impl VoxelShape for ArrayVoxelShape {
|
||||
fn shape(&self) -> Box<dyn DiscreteVoxelShape> {
|
||||
todo!()
|
||||
self.shape.clone()
|
||||
}
|
||||
|
||||
fn get_x_coords(&self) -> Vec<f64> {
|
||||
todo!()
|
||||
self.xs.clone()
|
||||
}
|
||||
|
||||
fn get_y_coords(&self) -> Vec<f64> {
|
||||
todo!()
|
||||
self.ys.clone()
|
||||
}
|
||||
|
||||
fn get_z_coords(&self) -> Vec<f64> {
|
||||
todo!()
|
||||
self.zs.clone()
|
||||
}
|
||||
}
|
||||
|
||||
impl VoxelShape for CubeVoxelShape {
|
||||
fn shape(&self) -> Box<dyn DiscreteVoxelShape> {
|
||||
todo!()
|
||||
self.shape.clone()
|
||||
}
|
||||
|
||||
fn get_x_coords(&self) -> Vec<f64> {
|
||||
|
|
Loading…
Add table
Reference in a new issue