diff options
| author | mat <git@matdoes.dev> | 2025-08-04 16:17:41 -0900 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-08-04 19:33:00 -0545 |
| commit | 827d943c3f27c65724ff83689b40c87d1cd1838c (patch) | |
| tree | 52d0145a8d482e912ceccb076accddce4da75c5e /azalea-entity/src | |
| parent | 013cd9f17674a4939d885ef91b7058b5a59d9ae1 (diff) | |
| download | azalea-drasl-827d943c3f27c65724ff83689b40c87d1cd1838c.tar.xz | |
fix wrong float rounding in get_friction_influenced_speed
Diffstat (limited to 'azalea-entity/src')
| -rw-r--r-- | azalea-entity/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index 18e9e1a1..984cce27 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -12,6 +12,7 @@ mod plugin; pub mod vec_delta_codec; use std::{ + f64::consts::PI, fmt::{self, Debug}, hash::{Hash, Hasher}, }; @@ -59,8 +60,8 @@ pub fn input_vector(direction: LookDirection, speed: f32, acceleration: Vec3) -> acceleration } .scale(speed as f64); - let y_rot = math::sin(direction.y_rot * 0.017453292f32); - let x_rot = math::cos(direction.y_rot * 0.017453292f32); + let y_rot = math::sin(direction.y_rot * (PI / 180.) as f32); + let x_rot = math::cos(direction.y_rot * (PI / 180.) as f32); Vec3 { x: acceleration.x * (x_rot as f64) - acceleration.z * (y_rot as f64), y: acceleration.y, |
