aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-core/src')
-rwxr-xr-xazalea-core/src/position.rs4
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 {