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.

impl<N> Quat<N>

fn len(&self) -> usize

Trait Implementations

impl<N: BaseFloat + ApproxEq<N>> Inv for Quat<N>

fn inv(&self) -> Option<Quat<N>>

fn inv_mut(&mut self) -> bool

impl<N: BaseFloat> Norm<N> for Quat<N>

fn sqnorm(&self) -> N

fn normalize(&self) -> Quat<N>

fn normalize_mut(&mut self) -> N

fn norm(&self) -> N

impl<N> Mul<Quat<N>> for Quat<N> where N: Copy + Mul<N, Output=N> + Sub<N, Output=N> + Add<N, Output=N>

type Output = Quat<N>

fn mul(self, right: Quat<N>) -> Quat<N>

impl<N: ApproxEq<N> + BaseFloat> Div<Quat<N>> for Quat<N>

type Output = Quat<N>

fn div(self, right: Quat<N>) -> Quat<N>

impl<N: Rand> Rand for Quat<N>

fn rand<R: Rng>(rng: &mut R) -> Quat<N>

impl<N: BaseFloat> POrd for Quat<N>

fn inf(&self, other: &Quat<N>) -> Quat<N>

fn sup(&self, other: &Quat<N>) -> Quat<N>

fn partial_cmp(&self, other: &Quat<N>) -> POrdering

fn partial_lt(&self, other: &Quat<N>) -> bool

fn partial_le(&self, other: &Quat<N>) -> bool

fn partial_gt(&self, other: &Quat<N>) -> bool

fn partial_ge(&self, other: &Quat<N>) -> bool

fn partial_min<'a>(&'a self, other: &'a Self) -> Option<&'a Self>

fn partial_max<'a>(&'a self, other: &'a Self) -> Option<&'a Self>

fn partial_clamp<'a>(&'a self, min: &'a Self, max: &'a Self) -> Option<&'a Self>

impl<Nin: Copy, Nout: Copy + Cast<Nin>> Cast<Quat<Nin>> for Quat<Nout>

fn from(v: Quat<Nin>) -> Quat<Nout>

impl<N> Index<usize> for Quat<N>

type Output = N

fn index(&self, i: usize) -> &N

impl<N> IndexMut<usize> for Quat<N>

fn index_mut(&mut self, i: usize) -> &mut N

impl<N> Shape<usize> for Quat<N>

fn shape(&self) -> usize

impl<N: Copy> Indexable<usize, N> for Quat<N>

fn swap(&mut self, i1: usize, i2: usize)

unsafe fn unsafe_at(&self, i: usize) -> N

unsafe fn unsafe_set(&mut self, i: usize, val: N)

impl<N: Copy> Repeat<N> for Quat<N>

fn repeat(val: N) -> Quat<N>

impl<N> Dim for Quat<N>

fn dim(_: Option<Quat<N>>) -> usize

impl<N: Add<N, Output=N>> Add<Quat<N>> for Quat<N>

type Output = Quat<N>

fn add(self, right: Quat<N>) -> Quat<N>

impl<N: Sub<N, Output=N>> Sub<Quat<N>> for Quat<N>

type Output = Quat<N>

fn sub(self, right: Quat<N>) -> Quat<N>

impl<N: Copy + Add<N, Output=N>> Add<N> for Quat<N>

type Output = Quat<N>

fn add(self, right: N) -> Quat<N>

impl<N: Copy + Sub<N, Output=N>> Sub<N> for Quat<N>

type Output = Quat<N>

fn sub(self, right: N) -> Quat<N>

impl<N: Copy + Mul<N, Output=N>> Mul<N> for Quat<N>

type Output = Quat<N>

fn mul(self, right: N) -> Quat<N>

impl<N: Copy + Div<N, Output=N>> Div<N> for Quat<N>

type Output = Quat<N>

fn div(self, right: N) -> Quat<N>

impl<N: Neg<Output=N> + Copy> Neg for Quat<N>

type Output = Quat<N>

fn neg(self) -> Quat<N>

impl<N> One for Quat<N> where N: Copy + One + Sub<N, Output=N> + Add<N, Output=N>

fn one() -> Quat<N>

impl<N: Zero> Zero for Quat<N>

fn zero() -> Quat<N>

fn is_zero(&self) -> bool

impl<N: ApproxEq<N>> ApproxEq<N> for Quat<N>

fn approx_epsilon(_: Option<Quat<N>>) -> N

fn approx_ulps(_: Option<Quat<N>>) -> u32

fn approx_eq(&self, other: &Quat<N>) -> bool

fn approx_eq_eps(&self, other: &Quat<N>, eps: &N) -> bool

fn approx_eq_ulps(&self, other: &Quat<N>, ulps: u32) -> bool

impl<N> FromIterator<N> for Quat<N>

fn from_iter<I: IntoIterator<Item=N>>(iterator: I) -> Quat<N>

impl<N: Bounded> Bounded for Quat<N>

fn max_value() -> Quat<N>

fn min_value() -> Quat<N>

impl<N: Axpy<N>> Axpy<N> for Quat<N>

fn axpy(&mut self, a: &N, x: &Quat<N>)

impl<N> Iterable<N> for Quat<N>

fn iter<'l>(&'l self) -> Iter<'l, N>

impl<N> IterableMut<N> for Quat<N>

fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N>

Derived Implementations

impl<N: Copy> Copy for Quat<N>

impl<N: Debug> Debug for Quat<N>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<N: Hash> Hash for Quat<N>

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<N: Clone> Clone for Quat<N>

fn clone(&self) -> Quat<N>

fn clone_from(&mut self, source: &Self)

impl<N: Decodable> Decodable for Quat<N>

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Quat<N>, __D::Error>

impl<N: Encodable> Encodable for Quat<N>

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl<N: PartialEq> PartialEq for Quat<N>

fn eq(&self, __arg_0: &Quat<N>) -> bool

fn ne(&self, __arg_0: &Quat<N>) -> bool

impl<N: Eq> Eq for Quat<N>