diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2023-03-07 14:14:36 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 14:14:36 -0600 |
| commit | 719379a8a76ab0685f2bd14bebe2f0cd1e97f06b (patch) | |
| tree | ce5d6c62bc36fb1d1ec31083bc8e81a0109c12df /azalea-physics/src/collision | |
| parent | bf4ff517890cad3ff4e36b4b78959504192e5374 (diff) | |
| download | azalea-drasl-719379a8a76ab0685f2bd14bebe2f0cd1e97f06b.tar.xz | |
Bevy 0.10 (#79)
* replace 0.9.1 with 0.10.0
* start migrating to bevy .10
* well it compiles
* doesn't immediately panic
* remove unused imports
* fmt
* delete azalea-ecs
* make RelativeEntityUpdate an EntityCommand
* fix a doc test
* explain what FixedUpdate does
Diffstat (limited to 'azalea-physics/src/collision')
| -rw-r--r-- | azalea-physics/src/collision/mod.rs | 8 | ||||
| -rw-r--r-- | azalea-physics/src/collision/world_collisions.rs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs index 7d934020..53efd2fe 100644 --- a/azalea-physics/src/collision/mod.rs +++ b/azalea-physics/src/collision/mod.rs @@ -7,7 +7,7 @@ mod world_collisions; use azalea_core::{Axis, Vec3, AABB, EPSILON}; use azalea_world::{ entity::{self}, - MoveEntityError, World, + Instance, MoveEntityError, }; pub use blocks::BlockWithShape; pub use discrete_voxel_shape::*; @@ -52,7 +52,7 @@ pub enum MoverType { // return var4; // } -fn collide(movement: &Vec3, world: &World, physics: &entity::Physics) -> Vec3 { +fn collide(movement: &Vec3, world: &Instance, physics: &entity::Physics) -> Vec3 { let entity_bounding_box = physics.bounding_box; // TODO: get_entity_collisions // let entity_collisions = world.get_entity_collisions(self, @@ -73,7 +73,7 @@ fn collide(movement: &Vec3, world: &World, physics: &entity::Physics) -> Vec3 { pub fn move_colliding( _mover_type: &MoverType, movement: &Vec3, - world: &World, + world: &Instance, position: &mut entity::Position, physics: &mut entity::Physics, ) -> Result<(), MoveEntityError> { @@ -186,7 +186,7 @@ pub fn move_colliding( fn collide_bounding_box( movement: &Vec3, entity_bounding_box: &AABB, - world: &World, + world: &Instance, entity_collisions: Vec<VoxelShape>, ) -> Vec3 { let mut collision_boxes: Vec<VoxelShape> = Vec::with_capacity(entity_collisions.len() + 1); diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index 9ffc62a5..aa55150e 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -2,16 +2,16 @@ use super::Shapes; use crate::collision::{BlockWithShape, VoxelShape, AABB}; use azalea_block::BlockState; use azalea_core::{ChunkPos, ChunkSectionPos, Cursor3d, CursorIterationType, EPSILON}; -use azalea_world::{Chunk, World}; +use azalea_world::{Chunk, Instance}; use parking_lot::RwLock; use std::sync::Arc; -pub fn get_block_collisions(world: &World, aabb: AABB) -> BlockCollisions<'_> { +pub fn get_block_collisions(world: &Instance, aabb: AABB) -> BlockCollisions<'_> { BlockCollisions::new(world, aabb) } pub struct BlockCollisions<'a> { - pub world: &'a World, + pub world: &'a Instance, pub aabb: AABB, pub entity_shape: VoxelShape, pub cursor: Cursor3d, @@ -19,7 +19,7 @@ pub struct BlockCollisions<'a> { } impl<'a> BlockCollisions<'a> { - pub fn new(world: &'a World, aabb: AABB) -> Self { + pub fn new(world: &'a Instance, aabb: AABB) -> Self { let origin_x = (aabb.min_x - EPSILON).floor() as i32 - 1; let origin_y = (aabb.min_y - EPSILON).floor() as i32 - 1; let origin_z = (aabb.min_z - EPSILON).floor() as i32 - 1; |
