Struct nalgebra::Quat
[−]
[src]
pub struct Quat<N> { pub w: N, pub i: N, pub j: N, pub k: N, }
A quaternion.
Fields
w | The scalar component of the quaternion. |
i | The first vector component of the quaternion. |
j | The second vector component of the quaternion. |
k | The third vector component of the quaternion. |
Methods
impl<N> Quat<N>
fn new(w: N, i: N, j: N, k: N) -> Quat<N>
Creates a new quaternion from its components.
fn vector<'a>(&'a self) -> &'a Vec3<N>
The vector part (i, j, k)
of this quaternion.
fn scalar<'a>(&'a self) -> &'a N
The scalar part w
of this quaternion.
impl<N: Neg<Output=N> + Copy> Quat<N>
fn conjugate(&self) -> Quat<N>
Compute the conjugate of this quaternion.
fn conjugate_mut(&mut self)
Replaces this quaternion by its conjugate.
impl<N: Zero + One> Quat<N>
fn w() -> Quat<N>
Create a unit vector with its $compN
component equal to 1.0.
fn i() -> Quat<N>
Create a unit vector with its $compN
component equal to 1.0.
fn j() -> Quat<N>
Create a unit vector with its $compN
component equal to 1.0.
fn k() -> Quat<N>
Create a unit vector with its $compN
component equal to 1.0.
impl<N> Quat<N>
fn as_array(&self) -> &[N; 4]
View this vector as an array.
fn as_array_mut(&mut self) -> &mut [N; 4]
View this vector as a mutable array.
fn from_array_ref(array: &[N; 4]) -> &Quat<N>
View an array as a vector.
fn from_array_mut(array: &mut [N; 4]) -> &mut Quat<N>
View an array as a vector.
impl<N: Copy> Quat<N>
unsafe fn at_fast(&self, i: usize) -> N
Unsafe read access to a vector element by index.
unsafe fn set_fast(&mut self, i: usize, val: N)
Unsafe write access to a vector element by index.