pub struct Quat {
pub w: f32,
pub x: f32,
pub y: f32,
pub z: f32,
}Expand description
A rotation as a unit quaternion.
Fields§
§w: f32§x: f32§y: f32§z: f32Implementations§
Source§impl Quat
impl Quat
pub const IDENTITY: Quat
Sourcepub fn from_axis_angle(axis: [f32; 3], angle: f32) -> Quat
pub fn from_axis_angle(axis: [f32; 3], angle: f32) -> Quat
A right-handed rotation of angle radians about axis (which must be unit length).
Sourcepub fn from_euler(e: Euler) -> Quat
pub fn from_euler(e: Euler) -> Quat
Builds the rotation with the given heading, pitch and roll (see Euler).
pub fn conjugate(self) -> Quat
pub fn normalized(self) -> Quat
Sourcepub fn to_matrix(self) -> [[f32; 3]; 3]
pub fn to_matrix(self) -> [[f32; 3]; 3]
The rotation as a matrix, indexed [row][column]. Column k is where the
controller’s axis k points in the world.
Trait Implementations§
impl Copy for Quat
impl StructuralPartialEq for Quat
Auto Trait Implementations§
impl Forget for Quat
impl Freeze for Quat
impl Move for Quat
impl RefUnwindSafe for Quat
impl Send for Quat
impl Sync for Quat
impl Unpin for Quat
impl UnsafeUnpin for Quat
impl UnwindSafe for Quat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more