1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

no compile errors???

insane
This commit is contained in:
mat 2022-06-29 02:45:21 -05:00
parent 6e523ce914
commit 9b3eb8fa82
3 changed files with 4 additions and 2 deletions

View file

@ -76,7 +76,7 @@ impl<'a> BlockCollisions<'a> {
}
impl<'a> Iterator for BlockCollisions<'a> {
type Item = ArrayVoxelShape;
type Item = Box<dyn VoxelShape>;
fn next(&mut self) -> Option<Self::Item> {
while let Some(item) = self.cursor.next() {

View file

@ -91,7 +91,7 @@ impl HasPhysics for Entity {
let block_collisions =
dimension.get_block_collisions(entity, entity_bounding_box.expand_towards(movement));
collision_boxes.extend(block_collisions.map(Box::new).collect::<Vec<_>>());
collision_boxes.extend(block_collisions);
Self::collide_with_shapes(movement, &entity_bounding_box, &collision_boxes)
}

View file

@ -24,6 +24,8 @@ pub trait VoxelShape {
fn get_y_coords(&self) -> Vec<f64>;
fn get_z_coords(&self) -> Vec<f64>;
// TODO: optimization: should this be changed to return ArrayVoxelShape?
// i might change the implementation of empty_shape in the future so not 100% sure
fn move_relative(&self, x: f64, y: f64, z: f64) -> Box<dyn VoxelShape> {
if self.shape().is_empty() {
return empty_shape();