aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-entity/src/lib.rs')
-rw-r--r--azalea-entity/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs
index b8644546..340b6f25 100644
--- a/azalea-entity/src/lib.rs
+++ b/azalea-entity/src/lib.rs
@@ -226,8 +226,10 @@ pub struct LookDirection {
}
impl LookDirection {
+ /// Create a new look direction, while clamping and wrapping the rotations
+ /// to the allowed values.
pub fn new(y_rot: f32, x_rot: f32) -> Self {
- Self { y_rot, x_rot }
+ apply_clamp_look_direction(Self { y_rot, x_rot })
}
}