diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2024-12-11 19:51:12 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-11 19:51:12 -0600 |
| commit | e9136c9cbbf9010b8352127e129c1cd290f377bd (patch) | |
| tree | db83316a273153106dd3b343c9d6d4fce234d132 /azalea-core | |
| parent | 23932003d98db0f5f976146aa9a11e5d04a74695 (diff) | |
| download | azalea-drasl-e9136c9cbbf9010b8352127e129c1cd290f377bd.tar.xz | |
Implement EntityPositionSync (#196)
* implement EntityPositionSync
* fix EntityPositionSync setting the wrong vec_delta_codec and also move into a RelativeEntityUpdate
Diffstat (limited to 'azalea-core')
| -rwxr-xr-x | azalea-core/src/position.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 9b800e28..14ecfcc1 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -20,7 +20,7 @@ macro_rules! vec3_impl { ($name:ident, $type:ty) => { impl $name { #[inline] - pub fn new(x: $type, y: $type, z: $type) -> Self { + pub const fn new(x: $type, y: $type, z: $type) -> Self { Self { x, y, z } } @@ -223,6 +223,8 @@ pub struct Vec3 { vec3_impl!(Vec3, f64); impl Vec3 { + pub const ZERO: Vec3 = Vec3::new(0.0, 0.0, 0.0); + /// Get the distance of this vector to the origin by doing /// `sqrt(x^2 + y^2 + z^2)`. pub fn length(&self) -> f64 { |
