Remove unused code
This commit is contained in:
parent
0200d876b1
commit
a6d89fb2e5
|
@ -1,9 +1,6 @@
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use crate::{
|
use crate::gfx::{BulkBufferBuilder, Context};
|
||||||
gfx::{BulkBufferBuilder, Context},
|
|
||||||
math,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum BrickgridFlag {
|
pub enum BrickgridFlag {
|
||||||
|
@ -78,9 +75,15 @@ impl Brickgrid {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Panics if position maps to out of range index
|
pub fn get_buffer(&self) -> &wgpu::Buffer {
|
||||||
// pub fn set(&mut self, pos: glam::UVec3, value: BrickgridElement) -> BrickgridElement {
|
&self.buffer
|
||||||
// let index = math::to_1d_index(pos, self.dimensions);
|
}
|
||||||
|
|
||||||
|
pub fn get_upload_buffer(&self) -> &wgpu::Buffer {
|
||||||
|
&self.upload_buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Panics if index out of range
|
||||||
pub fn set(&mut self, index: usize, value: BrickgridElement) -> BrickgridElement {
|
pub fn set(&mut self, index: usize, value: BrickgridElement) -> BrickgridElement {
|
||||||
let current = self.data[index];
|
let current = self.data[index];
|
||||||
self.data[index] = value;
|
self.data[index] = value;
|
||||||
|
@ -88,9 +91,7 @@ impl Brickgrid {
|
||||||
current
|
current
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Panics if position maps to out of range index
|
/// Panics if index out of range
|
||||||
// pub fn get(&mut self, pos: glam::UVec3) -> BrickgridElement {
|
|
||||||
// let index = math::to_1d_index(pos, self.dimensions);
|
|
||||||
pub fn get(&mut self, index: usize) -> BrickgridElement {
|
pub fn get(&mut self, index: usize) -> BrickgridElement {
|
||||||
self.data[index]
|
self.data[index]
|
||||||
}
|
}
|
||||||
|
@ -128,12 +129,4 @@ impl Brickgrid {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_buffer(&self) -> &wgpu::Buffer {
|
|
||||||
&self.buffer
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_upload_buffer(&self) -> &wgpu::Buffer {
|
|
||||||
&self.upload_buffer
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
use crate::voxel::world::{Voxel, WorldManager};
|
use crate::voxel::world::{Voxel, WorldManager};
|
||||||
|
|
||||||
use super::brickgrid::BrickgridFlag;
|
|
||||||
|
|
||||||
pub fn cull_interior_voxels(
|
pub fn cull_interior_voxels(
|
||||||
world: &mut WorldManager,
|
world: &mut WorldManager,
|
||||||
grid_pos: glam::IVec3,
|
grid_pos: glam::IVec3,
|
||||||
|
@ -103,10 +101,6 @@ pub fn cull_interior_voxels(
|
||||||
(bitmask_data, albedo_data)
|
(bitmask_data, albedo_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_brickgrid_element(brickmap_cache_idx: u32, flags: BrickgridFlag) -> u32 {
|
|
||||||
(brickmap_cache_idx << 8) + flags as u32
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn grid_pos_to_world_pos(
|
pub fn grid_pos_to_world_pos(
|
||||||
world: &mut WorldManager,
|
world: &mut WorldManager,
|
||||||
grid_pos: glam::IVec3,
|
grid_pos: glam::IVec3,
|
||||||
|
|
Loading…
Reference in New Issue