Replace right/up/forward and counter parts with local_x/local_y and local_z (#1476)
This commit is contained in:
parent
c2a427f1a3
commit
884dc46ffe
@ -75,35 +75,23 @@ impl GlobalTransform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn right(&self) -> Vec3 {
|
/// Get the unit vector in the local x direction
|
||||||
|
pub fn local_x(&self) -> Vec3 {
|
||||||
self.rotation * Vec3::unit_x()
|
self.rotation * Vec3::unit_x()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn left(&self) -> Vec3 {
|
/// Get the unit vector in the local y direction
|
||||||
-self.right()
|
pub fn local_y(&self) -> Vec3 {
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn up(&self) -> Vec3 {
|
|
||||||
self.rotation * Vec3::unit_y()
|
self.rotation * Vec3::unit_y()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn down(&self) -> Vec3 {
|
/// Get the unit vector in the local z direction
|
||||||
-self.up()
|
pub fn local_z(&self) -> Vec3 {
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn forward(&self) -> Vec3 {
|
|
||||||
self.rotation * Vec3::unit_z()
|
self.rotation * Vec3::unit_z()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn backward(&self) -> Vec3 {
|
|
||||||
-self.forward()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
/// Rotate the transform by the given rotation
|
/// Rotate the transform by the given rotation
|
||||||
pub fn rotate(&mut self, rotation: Quat) {
|
pub fn rotate(&mut self, rotation: Quat) {
|
||||||
|
|||||||
@ -75,35 +75,23 @@ impl Transform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn right(&self) -> Vec3 {
|
/// Get the unit vector in the local x direction
|
||||||
|
pub fn local_x(&self) -> Vec3 {
|
||||||
self.rotation * Vec3::unit_x()
|
self.rotation * Vec3::unit_x()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn left(&self) -> Vec3 {
|
/// Get the unit vector in the local y direction
|
||||||
-self.right()
|
pub fn local_y(&self) -> Vec3 {
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn up(&self) -> Vec3 {
|
|
||||||
self.rotation * Vec3::unit_y()
|
self.rotation * Vec3::unit_y()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn down(&self) -> Vec3 {
|
/// Get the unit vector in the local z direction
|
||||||
-self.up()
|
pub fn local_z(&self) -> Vec3 {
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn forward(&self) -> Vec3 {
|
|
||||||
self.rotation * Vec3::unit_z()
|
self.rotation * Vec3::unit_z()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn backward(&self) -> Vec3 {
|
|
||||||
-self.forward()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
/// Rotate the transform by the given rotation
|
/// Rotate the transform by the given rotation
|
||||||
pub fn rotate(&mut self, rotation: Quat) {
|
pub fn rotate(&mut self, rotation: Quat) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user