aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-08-05 05:49:49 +0400
committermat <git@matdoes.dev>2025-08-05 07:50:48 +0600
commit45cb5823f50ece7af86804d4331bd7ba2f6c5917 (patch)
tree0386a2596ff823828048d658ad9bf4db70c12226 /azalea-entity
parent23b7f20a0d88b54d430820baeb4a6da0316a009a (diff)
downloadazalea-drasl-45cb5823f50ece7af86804d4331bd7ba2f6c5917.tar.xz
use same pi value as java
Diffstat (limited to 'azalea-entity')
-rw-r--r--azalea-entity/src/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs
index 984cce27..095098f1 100644
--- a/azalea-entity/src/lib.rs
+++ b/azalea-entity/src/lib.rs
@@ -12,7 +12,6 @@ mod plugin;
pub mod vec_delta_codec;
use std::{
- f64::consts::PI,
fmt::{self, Debug},
hash::{Hash, Hasher},
};
@@ -60,8 +59,8 @@ pub fn input_vector(direction: LookDirection, speed: f32, acceleration: Vec3) ->
acceleration
}
.scale(speed as f64);
- let y_rot = math::sin(direction.y_rot * (PI / 180.) as f32);
- let x_rot = math::cos(direction.y_rot * (PI / 180.) as f32);
+ let y_rot = math::sin(direction.y_rot * (3.141592653589793 / 180.) as f32);
+ let x_rot = math::cos(direction.y_rot * (3.141592653589793 / 180.) as f32);
Vec3 {
x: acceleration.x * (x_rot as f64) - acceleration.z * (y_rot as f64),
y: acceleration.y,