From e74ed047dbaf3877db4a89a2d589e992abd0bb11 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Thu, 14 Aug 2025 20:40:13 -0500 Subject: Sneaking (#237) * start implementing sneaking * fix horizontal_collision being inverted and cleanup * clippy * change dimensions and eye height based on pose * proper support for automatically crouching in certain cases * fix anticheat issues * add line to changelog and update a comment --- azalea-core/src/math.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'azalea-core/src/math.rs') diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs index 105069ef..e62a3d23 100644 --- a/azalea-core/src/math.rs +++ b/azalea-core/src/math.rs @@ -92,6 +92,10 @@ pub fn sign_as_int(num: f64) -> i32 { if num == 0. { 0 } else { num.signum() as i32 } } +pub fn equal(a: f64, b: f64) -> bool { + (b - a).abs() < 1.0e-5 +} + #[cfg(test)] mod tests { use super::*; -- cgit v1.2.3