aboutsummaryrefslogtreecommitdiff
path: root/azalea-physics/src/collision
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2023-12-10 00:08:08 -0600
committerGitHub <noreply@github.com>2023-12-10 00:08:08 -0600
commit348c71b97b2dfc45d7412ec33f6131e20592bb14 (patch)
tree2490f6fe8e4d8181a526b66e0397ceea96ec8961 /azalea-physics/src/collision
parentf15f0325c0a9d62f10ea22b891ab7134391b04fb (diff)
downloadazalea-drasl-348c71b97b2dfc45d7412ec33f6131e20592bb14.tar.xz
Climbing (#121)
* start implementing climbing * fix tests * fix bots running at lower tick rate
Diffstat (limited to 'azalea-physics/src/collision')
-rw-r--r--azalea-physics/src/collision/mod.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs
index 2c739b24..72151b6b 100644
--- a/azalea-physics/src/collision/mod.rs
+++ b/azalea-physics/src/collision/mod.rs
@@ -136,7 +136,7 @@ pub fn move_colliding(
_mover_type: &MoverType,
movement: &Vec3,
world: &Instance,
- mut position: Mut<azalea_entity::Position>,
+ position: &mut Mut<azalea_entity::Position>,
physics: &mut azalea_entity::Physics,
) -> Result<(), MoveEntityError> {
// TODO: do all these
@@ -175,8 +175,8 @@ pub fn move_colliding(
}
};
- if new_pos != **position {
- **position = new_pos;
+ if new_pos != ***position {
+ ***position = new_pos;
}
}
@@ -185,11 +185,14 @@ pub fn move_colliding(
let horizontal_collision = x_collision || z_collision;
let vertical_collision = movement.y != collide_result.y;
let on_ground = vertical_collision && movement.y < 0.;
+
+ physics.horizontal_collision = horizontal_collision;
+ physics.vertical_collision = vertical_collision;
physics.on_ground = on_ground;
// TODO: minecraft checks for a "minor" horizontal collision here
- let _block_pos_below = azalea_entity::on_pos_legacy(&world.chunks, &position);
+ let _block_pos_below = azalea_entity::on_pos_legacy(&world.chunks, position);
// let _block_state_below = self
// .world
// .get_block_state(&block_pos_below)