Add yaw()
to Transform
.
This commit is contained in:
parent
1837591ba5
commit
0a38e65d26
11
src/core.rs
11
src/core.rs
|
@ -479,6 +479,17 @@ impl From<&dyn PointLike> for (i32, i32) {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait TransformExt {
|
||||
fn yaw(&self) -> Angle;
|
||||
}
|
||||
|
||||
impl TransformExt for Transform {
|
||||
fn yaw(&self) -> Angle {
|
||||
let forward = self.right();
|
||||
Angle::Radians(forward.y.atan2(forward.x))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GlobalTransformExt {
|
||||
fn yaw(&self) -> Angle;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user