QArray

Struct QArray 

Source
pub struct QArray<F>
where F: Float,
{ /* private fields */ }
Expand description

The QArray is a wrapper around a D sized array of Floats.

It provides implementations of the traits required for a Vector trait, hence it can be used for a Vector of any size D.

Trait Implementations§

Source§

impl<'a> Add<&'a QArray<f32>> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the + operation. Read more
Source§

impl<'a> Add<&'a QArray<f64>> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the + operation. Read more
Source§

impl<'a, D: Deref<Target = [f32; 4]>> Add<D> for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: D) -> QArray<f32>

Performs the + operation. Read more
Source§

impl<'a, D: Deref<Target = [f64; 4]>> Add<D> for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: D) -> QArray<f64>

Performs the + operation. Read more
Source§

impl<D: Deref<Target = [f32; 4]>> Add<D> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: D) -> QArray<f32>

Performs the + operation. Read more
Source§

impl<D: Deref<Target = [f64; 4]>> Add<D> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: D) -> QArray<f64>

Performs the + operation. Read more
Source§

impl<'a> Add for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the + operation. Read more
Source§

impl<'a> Add for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the + operation. Read more
Source§

impl<'a> AddAssign<&'a QArray<f32>> for &mut QArray<f32>

Source§

fn add_assign(&mut self, other: &'a QArray<f32>)

Performs the += operation. Read more
Source§

impl<'a> AddAssign<&'a QArray<f32>> for QArray<f32>

Source§

fn add_assign(&mut self, other: &'a QArray<f32>)

Performs the += operation. Read more
Source§

impl<'a> AddAssign<&'a QArray<f64>> for &mut QArray<f64>

Source§

fn add_assign(&mut self, other: &'a QArray<f64>)

Performs the += operation. Read more
Source§

impl<'a> AddAssign<&'a QArray<f64>> for QArray<f64>

Source§

fn add_assign(&mut self, other: &'a QArray<f64>)

Performs the += operation. Read more
Source§

impl<D: Deref<Target = [f32; 4]>> AddAssign<D> for &mut QArray<f32>

Source§

fn add_assign(&mut self, other: D)

Performs the += operation. Read more
Source§

impl<D: Deref<Target = [f64; 4]>> AddAssign<D> for &mut QArray<f64>

Source§

fn add_assign(&mut self, other: D)

Performs the += operation. Read more
Source§

impl<D: Deref<Target = [f32; 4]>> AddAssign<D> for QArray<f32>

Source§

fn add_assign(&mut self, other: D)

Performs the += operation. Read more
Source§

impl<D: Deref<Target = [f64; 4]>> AddAssign<D> for QArray<f64>

Source§

fn add_assign(&mut self, other: D)

Performs the += operation. Read more
Source§

impl AsMut<[f32; 4]> for QArray<f32>

Source§

fn as_mut(&mut self) -> &mut [f32; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsMut<[f64; 4]> for QArray<f64>

Source§

fn as_mut(&mut self) -> &mut [f64; 4]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<[f32; 4]> for QArray<f32>

Source§

fn as_ref(&self) -> &[f32; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<[f64; 4]> for QArray<f64>

Source§

fn as_ref(&self) -> &[f64; 4]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<F> Clone for QArray<F>
where F: Float + Clone,

Source§

fn clone(&self) -> QArray<F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<F> Debug for QArray<F>
where F: Float + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for QArray<f32>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Default for QArray<f64>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Deref for QArray<f32>

Source§

type Target = [f32; 4]

The resulting type after dereferencing.
Source§

fn deref(&self) -> &[f32; 4]

Dereferences the value.
Source§

impl Deref for QArray<f64>

Source§

type Target = [f64; 4]

The resulting type after dereferencing.
Source§

fn deref(&self) -> &[f64; 4]

Dereferences the value.
Source§

impl DerefMut for QArray<f32>

Source§

fn deref_mut(&mut self) -> &mut [f32; 4]

Mutably dereferences the value.
Source§

impl DerefMut for QArray<f64>

Source§

fn deref_mut(&mut self) -> &mut [f64; 4]

Mutably dereferences the value.
Source§

impl<'de> Deserialize<'de> for QArray<f32>

Source§

fn deserialize<DE>(deserializer: DE) -> Result<Self, DE::Error>
where DE: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'de> Deserialize<'de> for QArray<f64>

Source§

fn deserialize<DE>(deserializer: DE) -> Result<Self, DE::Error>
where DE: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for QArray<f32>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for QArray<f64>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Div<&'a [f32; 4]> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a [f32; 4]) -> QArray<f32>

Performs the / operation. Read more
Source§

impl<'a> Div<&'a [f64; 4]> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a [f64; 4]) -> QArray<f64>

Performs the / operation. Read more
Source§

impl<'a> Div<&'a QArray<f32>> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the / operation. Read more
Source§

impl<'a> Div<&'a QArray<f64>> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the / operation. Read more
Source§

impl<'a> Div<&'a f32> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a f32) -> QArray<f32>

Performs the / operation. Read more
Source§

impl<'a> Div<&'a f64> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a f64) -> QArray<f64>

Performs the / operation. Read more
Source§

impl<'a> Div<QArray<f32>> for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: QArray<f32>) -> QArray<f32>

Performs the / operation. Read more
Source§

impl<'a> Div<QArray<f64>> for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: QArray<f64>) -> QArray<f64>

Performs the / operation. Read more
Source§

impl<'a> Div<f32> for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> QArray<f32>

Performs the / operation. Read more
Source§

impl Div<f32> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> QArray<f32>

Performs the / operation. Read more
Source§

impl<'a> Div<f64> for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> QArray<f64>

Performs the / operation. Read more
Source§

impl Div<f64> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> QArray<f64>

Performs the / operation. Read more
Source§

impl<'a> Div for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the / operation. Read more
Source§

impl<'a> Div for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the / operation. Read more
Source§

impl Div for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the / operator.
Source§

fn div(self, other: QArray<f32>) -> QArray<f32>

Performs the / operation. Read more
Source§

impl Div for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the / operator.
Source§

fn div(self, other: QArray<f64>) -> QArray<f64>

Performs the / operation. Read more
Source§

impl<'a> DivAssign<&'a [f32; 4]> for QArray<f32>

Source§

fn div_assign(&mut self, other: &'a [f32; 4])

Performs the /= operation. Read more
Source§

impl<'a> DivAssign<&'a [f64; 4]> for QArray<f64>

Source§

fn div_assign(&mut self, other: &'a [f64; 4])

Performs the /= operation. Read more
Source§

impl<'a> DivAssign<&'a QArray<f32>> for QArray<f32>

Source§

fn div_assign(&mut self, other: &'a QArray<f32>)

Performs the /= operation. Read more
Source§

impl<'a> DivAssign<&'a QArray<f64>> for QArray<f64>

Source§

fn div_assign(&mut self, other: &'a QArray<f64>)

Performs the /= operation. Read more
Source§

impl<'a> DivAssign<&'a f32> for QArray<f32>

Source§

fn div_assign(&mut self, other: &'a f32)

Performs the /= operation. Read more
Source§

impl<'a> DivAssign<&'a f64> for QArray<f64>

Source§

fn div_assign(&mut self, other: &'a f64)

Performs the /= operation. Read more
Source§

impl DivAssign<f32> for QArray<f32>

Source§

fn div_assign(&mut self, other: f32)

Performs the /= operation. Read more
Source§

impl DivAssign<f64> for QArray<f64>

Source§

fn div_assign(&mut self, other: f64)

Performs the /= operation. Read more
Source§

impl DivAssign for QArray<f32>

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

impl DivAssign for QArray<f64>

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

impl<'a> From<&'a [f32; 4]> for QArray<f32>

Source§

fn from(data: &'a [f32; 4]) -> QArray<f32>

Converts to this type from the input type.
Source§

impl<'a> From<&'a [f64; 4]> for QArray<f64>

Source§

fn from(data: &'a [f64; 4]) -> QArray<f64>

Converts to this type from the input type.
Source§

impl<'a> From<&'a QArray<f32>> for &'a [f32; 4]

Source§

fn from(s: &'a QArray<f32>) -> &'a [f32; 4]

Converts to this type from the input type.
Source§

impl<'a> From<&'a QArray<f32>> for [f32; 4]

Source§

fn from(s: &'a QArray<f32>) -> [f32; 4]

Converts to this type from the input type.
Source§

impl<'a> From<&'a QArray<f64>> for &'a [f64; 4]

Source§

fn from(s: &'a QArray<f64>) -> &'a [f64; 4]

Converts to this type from the input type.
Source§

impl<'a> From<&'a QArray<f64>> for [f64; 4]

Source§

fn from(s: &'a QArray<f64>) -> [f64; 4]

Converts to this type from the input type.
Source§

impl From<[f32; 4]> for QArray<f32>

Source§

fn from(data: [f32; 4]) -> QArray<f32>

Converts to this type from the input type.
Source§

impl From<[f64; 4]> for QArray<f64>

Source§

fn from(data: [f64; 4]) -> QArray<f64>

Converts to this type from the input type.
Source§

impl From<QArray<f32>> for [f32; 4]

Source§

fn from(s: QArray<f32>) -> [f32; 4]

Converts to this type from the input type.
Source§

impl From<QArray<f64>> for [f64; 4]

Source§

fn from(s: QArray<f64>) -> [f64; 4]

Converts to this type from the input type.
Source§

impl Index<usize> for QArray<f32>

Source§

type Output = f32

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &f32

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<usize> for QArray<f64>

Source§

type Output = f64

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &f64

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for QArray<f32>

Source§

fn index_mut(&mut self, index: usize) -> &mut f32

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl IndexMut<usize> for QArray<f64>

Source§

fn index_mut(&mut self, index: usize) -> &mut f64

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a> Mul<&'a QArray<f32>> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the * operation. Read more
Source§

impl<'a> Mul<&'a QArray<f64>> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the * operation. Read more
Source§

impl<'a, V: Vector<f32, 3>> Mul<&'a V> for &'a QArray<f32>

Source§

type Output = V

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a V) -> V

Performs the * operation. Read more
Source§

impl<'a, V: Vector<f64, 3>> Mul<&'a V> for &'a QArray<f64>

Source§

type Output = V

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a V) -> V

Performs the * operation. Read more
Source§

impl<'a, V: Vector<f32, 3>> Mul<&'a V> for QArray<f32>

Source§

type Output = V

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a V) -> V

Performs the * operation. Read more
Source§

impl<'a, V: Vector<f64, 3>> Mul<&'a V> for QArray<f64>

Source§

type Output = V

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a V) -> V

Performs the * operation. Read more
Source§

impl<'a> Mul<&'a f32> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a f32) -> QArray<f32>

Performs the * operation. Read more
Source§

impl<'a> Mul<&'a f64> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a f64) -> QArray<f64>

Performs the * operation. Read more
Source§

impl<'a> Mul<QArray<f32>> for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: QArray<f32>) -> QArray<f32>

Performs the * operation. Read more
Source§

impl<'a> Mul<QArray<f64>> for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: QArray<f64>) -> QArray<f64>

Performs the * operation. Read more
Source§

impl<'a> Mul<f32> for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> QArray<f32>

Performs the * operation. Read more
Source§

impl Mul<f32> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> QArray<f32>

Performs the * operation. Read more
Source§

impl<'a> Mul<f64> for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> QArray<f64>

Performs the * operation. Read more
Source§

impl Mul<f64> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> QArray<f64>

Performs the * operation. Read more
Source§

impl<'a> Mul for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the * operation. Read more
Source§

impl<'a> Mul for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the * operation. Read more
Source§

impl Mul for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, other: QArray<f32>) -> QArray<f32>

Performs the * operation. Read more
Source§

impl Mul for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, other: QArray<f64>) -> QArray<f64>

Performs the * operation. Read more
Source§

impl<'a> MulAssign<&'a QArray<f32>> for QArray<f32>

Source§

fn mul_assign(&mut self, other: &'a QArray<f32>)

Performs the *= operation. Read more
Source§

impl<'a> MulAssign<&'a QArray<f64>> for QArray<f64>

Source§

fn mul_assign(&mut self, other: &'a QArray<f64>)

Performs the *= operation. Read more
Source§

impl<'a> MulAssign<&'a f32> for QArray<f32>

Source§

fn mul_assign(&mut self, other: &'a f32)

Performs the *= operation. Read more
Source§

impl<'a> MulAssign<&'a f64> for QArray<f64>

Source§

fn mul_assign(&mut self, other: &'a f64)

Performs the *= operation. Read more
Source§

impl MulAssign<f32> for QArray<f32>

Source§

fn mul_assign(&mut self, other: f32)

Performs the *= operation. Read more
Source§

impl MulAssign<f64> for QArray<f64>

Source§

fn mul_assign(&mut self, other: f64)

Performs the *= operation. Read more
Source§

impl MulAssign for QArray<f32>

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl MulAssign for QArray<f64>

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl<'a> Neg for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<'a> Neg for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Neg for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<F> PartialEq for QArray<F>
where F: Float + PartialEq,

Source§

fn eq(&self, other: &QArray<F>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Quaternion<f32> for QArray<f32>

Source§

fn of_rotation3<M>(rotation: &M) -> Self
where M: SqMatrix3<f32>,

Find the quaternion of a Matrix3 assuming it is purely a rotation

Source§

fn as_rijk(&self) -> (f32, f32, f32, f32)

Break out into r, i, j, k
Source§

fn of_rijk(r: f32, i: f32, j: f32, k: f32) -> Self

Create from r, i, j, k
Source§

fn set_rotation3<M>(&self, matrix3: &mut M)
where M: SqMatrix3<f32>,

Set a Matrix3 to be the rotation matrix corresponding to the unit quaternion
Source§

fn set_rotation4<M>(&self, matrix: &mut M)
where M: SqMatrix4<f32>,

Set a Matrix4 to be the rotation matrix corresponding to the unit quaternion
Source§

fn conjugate(self) -> Self

Create the conjugate of a quaternion
Source§

fn of_axis_angle(axis: &[F; 3], angle: F) -> Self

Create a unit quaternion for a rotation of an angle about an axis
Source§

fn rotate_x(self, angle: F) -> Self

Apply a rotation about the X-axis to this quaternion
Source§

fn rotate_y(self, angle: F) -> Self

Apply a rotation about the Y-axis to this quaternion
Source§

fn rotate_z(self, angle: F) -> Self

Apply a rotation about the Z-axis to this quaternion
Source§

fn look_at(dirn: &[F; 3], up: &[F; 3]) -> Self

Create a quaternion that maps a unit V3 of dirn to (0,0,-1) and a unit V3 of up (if perpendicular to dirn) to (0,1,0)
Source§

fn rotation_of_vec_to_vec(a: &[F; 3], b: &[F; 3]) -> Self

Get a quaternion that is a rotation of one vector to another Read more
Source§

fn weighted_average_pair(&self, w_a: F, qb: &Self, w_b: F) -> Self

Calculate the weighted average of two unit quaternions Read more
Source§

fn weighted_average_many<A: Into<[F; 4]>, I: Iterator<Item = (F, A)>>( value_iter: I, ) -> Self

Calculate the weighted average of many unit quaternions Read more
Source§

fn as_axis_angle<V: From<[F; 3]>>(&self) -> (V, F)

Find the axis and angle of rotation for a (non-unit) quaternion
Source§

fn set_zero(&mut self)

Set the quaternion to be all zeros
Source§

fn mix(self, other: &[F; 4], t: F) -> Self

Create a linear combination of this Quaternion and another using parameter t from zero to one
Source§

fn dot(self, other: &Self) -> F

Return the dot product of two quaternions; basically used for length
Source§

fn length_sq(&self) -> F

Return the square of the length of the quaternion
Source§

fn length(&self) -> F

Return the length of the quaternion
Source§

fn distance_sq(&self, other: &Self) -> F

Return the square of the distance between this quaternion and another
Source§

fn distance(&self, other: &Self) -> F

Return the distance between this quaternion and another
Source§

fn normalize(self) -> Self

Normalize the quaternion; if its length is close to zero, then set it to be zero
Source§

fn apply3<T>(&self, other: &T) -> T
where T: Deref<Target = [F; 3]> + From<[F; 3]>,

Apply the quaternion to a V3 Read more
Source§

fn apply4<T>(&self, other: &T) -> T
where T: Deref<Target = [F; 4]> + From<[F; 4]>,

Apply the quaternion to a V4
Source§

impl Quaternion<f64> for QArray<f64>

Source§

fn of_rotation3<M>(rotation: &M) -> Self
where M: SqMatrix3<f64>,

Find the quaternion of a Matrix3 assuming it is purely a rotation

Source§

fn as_rijk(&self) -> (f64, f64, f64, f64)

Break out into r, i, j, k
Source§

fn of_rijk(r: f64, i: f64, j: f64, k: f64) -> Self

Create from r, i, j, k
Source§

fn set_rotation3<M>(&self, matrix3: &mut M)
where M: SqMatrix3<f64>,

Set a Matrix3 to be the rotation matrix corresponding to the unit quaternion
Source§

fn set_rotation4<M>(&self, matrix: &mut M)
where M: SqMatrix4<f64>,

Set a Matrix4 to be the rotation matrix corresponding to the unit quaternion
Source§

fn conjugate(self) -> Self

Create the conjugate of a quaternion
Source§

fn of_axis_angle(axis: &[F; 3], angle: F) -> Self

Create a unit quaternion for a rotation of an angle about an axis
Source§

fn rotate_x(self, angle: F) -> Self

Apply a rotation about the X-axis to this quaternion
Source§

fn rotate_y(self, angle: F) -> Self

Apply a rotation about the Y-axis to this quaternion
Source§

fn rotate_z(self, angle: F) -> Self

Apply a rotation about the Z-axis to this quaternion
Source§

fn look_at(dirn: &[F; 3], up: &[F; 3]) -> Self

Create a quaternion that maps a unit V3 of dirn to (0,0,-1) and a unit V3 of up (if perpendicular to dirn) to (0,1,0)
Source§

fn rotation_of_vec_to_vec(a: &[F; 3], b: &[F; 3]) -> Self

Get a quaternion that is a rotation of one vector to another Read more
Source§

fn weighted_average_pair(&self, w_a: F, qb: &Self, w_b: F) -> Self

Calculate the weighted average of two unit quaternions Read more
Source§

fn weighted_average_many<A: Into<[F; 4]>, I: Iterator<Item = (F, A)>>( value_iter: I, ) -> Self

Calculate the weighted average of many unit quaternions Read more
Source§

fn as_axis_angle<V: From<[F; 3]>>(&self) -> (V, F)

Find the axis and angle of rotation for a (non-unit) quaternion
Source§

fn set_zero(&mut self)

Set the quaternion to be all zeros
Source§

fn mix(self, other: &[F; 4], t: F) -> Self

Create a linear combination of this Quaternion and another using parameter t from zero to one
Source§

fn dot(self, other: &Self) -> F

Return the dot product of two quaternions; basically used for length
Source§

fn length_sq(&self) -> F

Return the square of the length of the quaternion
Source§

fn length(&self) -> F

Return the length of the quaternion
Source§

fn distance_sq(&self, other: &Self) -> F

Return the square of the distance between this quaternion and another
Source§

fn distance(&self, other: &Self) -> F

Return the distance between this quaternion and another
Source§

fn normalize(self) -> Self

Normalize the quaternion; if its length is close to zero, then set it to be zero
Source§

fn apply3<T>(&self, other: &T) -> T
where T: Deref<Target = [F; 3]> + From<[F; 3]>,

Apply the quaternion to a V3 Read more
Source§

fn apply4<T>(&self, other: &T) -> T
where T: Deref<Target = [F; 4]> + From<[F; 4]>,

Apply the quaternion to a V4
Source§

impl Serialize for QArray<f32>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Serialize for QArray<f64>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> Sub<&'a QArray<f32>> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the - operation. Read more
Source§

impl<'a> Sub<&'a QArray<f64>> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the - operation. Read more
Source§

impl<'a, D: Deref<Target = [f32; 4]>> Sub<D> for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: D) -> QArray<f32>

Performs the - operation. Read more
Source§

impl<'a, D: Deref<Target = [f64; 4]>> Sub<D> for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: D) -> QArray<f64>

Performs the - operation. Read more
Source§

impl<D: Deref<Target = [f32; 4]>> Sub<D> for QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: D) -> QArray<f32>

Performs the - operation. Read more
Source§

impl<D: Deref<Target = [f64; 4]>> Sub<D> for QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: D) -> QArray<f64>

Performs the - operation. Read more
Source§

impl<'a> Sub for &'a QArray<f32>

Source§

type Output = QArray<f32>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a QArray<f32>) -> QArray<f32>

Performs the - operation. Read more
Source§

impl<'a> Sub for &'a QArray<f64>

Source§

type Output = QArray<f64>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a QArray<f64>) -> QArray<f64>

Performs the - operation. Read more
Source§

impl<'a> SubAssign<&'a QArray<f32>> for &mut QArray<f32>

Source§

fn sub_assign(&mut self, other: &'a QArray<f32>)

Performs the -= operation. Read more
Source§

impl<'a> SubAssign<&'a QArray<f32>> for QArray<f32>

Source§

fn sub_assign(&mut self, other: &'a QArray<f32>)

Performs the -= operation. Read more
Source§

impl<'a> SubAssign<&'a QArray<f64>> for &mut QArray<f64>

Source§

fn sub_assign(&mut self, other: &'a QArray<f64>)

Performs the -= operation. Read more
Source§

impl<'a> SubAssign<&'a QArray<f64>> for QArray<f64>

Source§

fn sub_assign(&mut self, other: &'a QArray<f64>)

Performs the -= operation. Read more
Source§

impl<D: Deref<Target = [f32; 4]>> SubAssign<D> for &mut QArray<f32>

Source§

fn sub_assign(&mut self, other: D)

Performs the -= operation. Read more
Source§

impl<D: Deref<Target = [f64; 4]>> SubAssign<D> for &mut QArray<f64>

Source§

fn sub_assign(&mut self, other: D)

Performs the -= operation. Read more
Source§

impl<D: Deref<Target = [f32; 4]>> SubAssign<D> for QArray<f32>

Source§

fn sub_assign(&mut self, other: D)

Performs the -= operation. Read more
Source§

impl<D: Deref<Target = [f64; 4]>> SubAssign<D> for QArray<f64>

Source§

fn sub_assign(&mut self, other: D)

Performs the -= operation. Read more
Source§

impl Transform<f32, FArray<f32, 3>, QArray<f32>> for FQArrayTrans<f32>

Source§

fn of_trs(t: FArray<f32, 3>, r: QArray<f32>, s: f32) -> Self

Create an FQArrayTrans from a Vector3 translation, Quat rotation and Float scaling

Source§

fn scale(&self) -> f32

Get the scaling of the transformation

Source§

fn translation(&self) -> FArray<f32, 3>

Get the translation of the transformation

Source§

fn rotation(&self) -> QArray<f32>

Get the rotation of the transformation

Source§

fn inverse(&self) -> Self

Get a transformation that is the inverse of this

Source§

fn invert(&mut self)

Invert this transformation

Source§

fn as_mat<M: SqMatrix4<f32>>(&self) -> M

Return the matrix

Source§

impl Transform<f64, FArray<f64, 3>, QArray<f64>> for FQArrayTrans<f64>

Source§

fn of_trs(t: FArray<f64, 3>, r: QArray<f64>, s: f64) -> Self

Create an FQArrayTrans from a Vector3 translation, Quat rotation and Float scaling

Source§

fn scale(&self) -> f64

Get the scaling of the transformation

Source§

fn translation(&self) -> FArray<f64, 3>

Get the translation of the transformation

Source§

fn rotation(&self) -> QArray<f64>

Get the rotation of the transformation

Source§

fn inverse(&self) -> Self

Get a transformation that is the inverse of this

Source§

fn invert(&mut self)

Invert this transformation

Source§

fn as_mat<M: SqMatrix4<f64>>(&self) -> M

Return the matrix

Source§

impl<'a> TryFrom<&'a [f32]> for QArray<f32>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from(data: &'a [f32]) -> Result<QArray<f32>, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a [f64]> for QArray<f64>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from(data: &'a [f64]) -> Result<QArray<f64>, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Vec<f32>> for QArray<f32>

Source§

type Error = Vec<f32>

The type returned in the event of a conversion error.
Source§

fn try_from(data: Vec<f32>) -> Result<QArray<f32>, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<Vec<f64>> for QArray<f64>

Source§

type Error = Vec<f64>

The type returned in the event of a conversion error.
Source§

fn try_from(data: Vec<f64>) -> Result<QArray<f64>, Self::Error>

Performs the conversion.
Source§

impl<F> Copy for QArray<F>
where F: Float + Copy,

Source§

impl<F> StructuralPartialEq for QArray<F>
where F: Float,

Auto Trait Implementations§

§

impl<F> Freeze for QArray<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for QArray<F>
where F: RefUnwindSafe,

§

impl<F> Send for QArray<F>
where F: Send,

§

impl<F> Sync for QArray<F>
where F: Sync,

§

impl<F> Unpin for QArray<F>
where F: Unpin,

§

impl<F> UnwindSafe for QArray<F>
where F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,