Struct nannou::math::Quaternion [−][src]
#[repr(C)]pub struct Quaternion<S> { pub s: S, pub v: Vector3<S>, }
A quaternion in scalar/vector form.
This type is marked as #[repr(C)]
.
Fields
s: S
The scalar part of the quaternion.
v: Vector3<S>
The vector part of the quaternion.
Methods
impl<S> Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Quaternion<S> where
S: BaseFloat,
pub fn new(w: S, xi: S, yj: S, zk: S) -> Quaternion<S>
[src]
pub fn new(w: S, xi: S, yj: S, zk: S) -> Quaternion<S>
Construct a new quaternion from one scalar component and three imaginary components.
pub fn from_sv(s: S, v: Vector3<S>) -> Quaternion<S>
[src]
pub fn from_sv(s: S, v: Vector3<S>) -> Quaternion<S>
Construct a new quaternion from a scalar and a vector.
pub fn from_arc(
src: Vector3<S>,
dst: Vector3<S>,
fallback: Option<Vector3<S>>
) -> Quaternion<S>
[src]
pub fn from_arc(
src: Vector3<S>,
dst: Vector3<S>,
fallback: Option<Vector3<S>>
) -> Quaternion<S>
Construct a new quaternion as a closest arc between two vectors
Return the closest rotation that turns src
vector into dst
.
- [Related StackOverflow question] (http://stackoverflow.com/questions/1171849/finding-quaternion-representing-the-rotation-from-one-vector-to-another)
- [Ogre implementation for normalized vectors] (https://bitbucket.org/sinbad/ogre/src/9db75e3ba05c/OgreMain/include/OgreVector3.h?fileviewer=file-view-default#cl-651)
pub fn conjugate(self) -> Quaternion<S>
[src]
pub fn conjugate(self) -> Quaternion<S>
The conjugate of the quaternion.
pub fn nlerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
[src]
pub fn nlerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
Do a normalized linear interpolation with other
, by amount
.
pub fn slerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
[src]
pub fn slerp(self, other: Quaternion<S>, amount: S) -> Quaternion<S>
Spherical Linear Interpolation
Return the spherical linear interpolation between the quaternion and
other
. Both quaternions should be normalized first.
Performance notes
The acos
operation used in slerp
is an expensive operation, so
unless your quaternions are far away from each other it's generally
more advisable to use nlerp
when you know your rotations are going
to be small.
- [Understanding Slerp, Then Not Using It] (http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/)
- [Arcsynthesis OpenGL tutorial] (http://www.arcsynthesis.org/gltut/Positioning/Tut08%20Interpolation.html)
impl<S> Quaternion<S> where
S: Copy + NumCast,
[src]
impl<S> Quaternion<S> where
S: Copy + NumCast,
pub fn cast<T>(&self) -> Option<Quaternion<T>> where
T: BaseFloat,
[src]
pub fn cast<T>(&self) -> Option<Quaternion<T>> where
T: BaseFloat,
Component-wise casting to another type.
Trait Implementations
impl<S> IndexMut<RangeTo<usize>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> IndexMut<RangeTo<usize>> for Quaternion<S> where
S: BaseFloat,
fn index_mut(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]
[src]
fn index_mut(&'a mut self, i: RangeTo<usize>) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<usize> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> IndexMut<usize> for Quaternion<S> where
S: BaseFloat,
ⓘImportant traits for &'a mut Rfn index_mut(&'a mut self, i: usize) -> &'a mut S
[src]
fn index_mut(&'a mut self, i: usize) -> &'a mut S
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<RangeFull> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> IndexMut<RangeFull> for Quaternion<S> where
S: BaseFloat,
fn index_mut(&'a mut self, i: RangeFull) -> &'a mut [S]
[src]
fn index_mut(&'a mut self, i: RangeFull) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<Range<usize>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> IndexMut<Range<usize>> for Quaternion<S> where
S: BaseFloat,
fn index_mut(&'a mut self, i: Range<usize>) -> &'a mut [S]
[src]
fn index_mut(&'a mut self, i: Range<usize>) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> IndexMut<RangeFrom<usize>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> IndexMut<RangeFrom<usize>> for Quaternion<S> where
S: BaseFloat,
fn index_mut(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]
[src]
fn index_mut(&'a mut self, i: RangeFrom<usize>) -> &'a mut [S]
Performs the mutable indexing (container[index]
) operation.
impl<S> Zero for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Zero for Quaternion<S> where
S: BaseFloat,
fn zero() -> Quaternion<S>
[src]
fn zero() -> Quaternion<S>
Returns the additive identity element of Self
, 0
. Read more
fn is_zero(&self) -> bool
[src]
fn is_zero(&self) -> bool
Returns true
if self
is equal to the additive identity.
impl<S> Rand for Quaternion<S> where
S: BaseFloat + Rand,
[src]
impl<S> Rand for Quaternion<S> where
S: BaseFloat + Rand,
fn rand<R>(rng: &mut R) -> Quaternion<S> where
R: Rng,
[src]
fn rand<R>(rng: &mut R) -> Quaternion<S> where
R: Rng,
Generates a random instance of this type using the specified source of randomness. Read more
impl<S> InnerSpace for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> InnerSpace for Quaternion<S> where
S: BaseFloat,
fn dot(self, other: Quaternion<S>) -> S
[src]
fn dot(self, other: Quaternion<S>) -> S
Vector dot (or inner) product.
fn is_perpendicular(self, other: Self) -> bool
[src]
fn is_perpendicular(self, other: Self) -> bool
Returns true
if the vector is perpendicular (at right angles) to the other vector. Read more
fn magnitude2(self) -> Self::Scalar
[src]
fn magnitude2(self) -> Self::Scalar
Returns the squared magnitude. Read more
fn magnitude(self) -> Self::Scalar
[src]
fn magnitude(self) -> Self::Scalar
The distance from the tail to the tip of the vector.
fn angle(self, other: Self) -> Rad<Self::Scalar>
[src]
fn angle(self, other: Self) -> Rad<Self::Scalar>
Returns the angle between two vectors in radians.
fn normalize(self) -> Self
[src]
fn normalize(self) -> Self
Returns a vector with the same direction, but with a magnitude of 1
.
fn normalize_to(self, magnitude: Self::Scalar) -> Self
[src]
fn normalize_to(self, magnitude: Self::Scalar) -> Self
Returns a vector with the same direction and a given magnitude.
fn lerp(self, other: Self, amount: Self::Scalar) -> Self
[src]
fn lerp(self, other: Self, amount: Self::Scalar) -> Self
Returns the result of linearly interpolating the magnitude of the vector towards the magnitude of other
by the specified amount. Read more
fn project_on(self, other: Self) -> Self
[src]
fn project_on(self, other: Self) -> Self
Returns the vector projection of the current inner space projected onto the supplied argument. Read more
impl<'a, 'b, S> Sub<&'a Quaternion<S>> for &'b Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, 'b, S> Sub<&'a Quaternion<S>> for &'b Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
[src]
fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
Performs the -
operation.
impl<'a, S> Sub<Quaternion<S>> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Sub<Quaternion<S>> for &'a Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the -
operator.
fn sub(self, other: Quaternion<S>) -> Quaternion<S>
[src]
fn sub(self, other: Quaternion<S>) -> Quaternion<S>
Performs the -
operation.
impl<S> Sub<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Sub<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the -
operator.
fn sub(self, other: Quaternion<S>) -> Quaternion<S>
[src]
fn sub(self, other: Quaternion<S>) -> Quaternion<S>
Performs the -
operation.
impl<'a, S> Sub<&'a Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Sub<&'a Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the -
operator.
fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
[src]
fn sub(self, other: &'a Quaternion<S>) -> Quaternion<S>
Performs the -
operation.
impl<S> Clone for Quaternion<S> where
S: Clone,
[src]
impl<S> Clone for Quaternion<S> where
S: Clone,
fn clone(&self) -> Quaternion<S>
[src]
fn clone(&self) -> Quaternion<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<S> Rotation3<S> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Rotation3<S> for Quaternion<S> where
S: BaseFloat,
fn from_axis_angle<A>(axis: Vector3<S>, angle: A) -> Quaternion<S> where
A: Into<Rad<S>>,
[src]
fn from_axis_angle<A>(axis: Vector3<S>, angle: A) -> Quaternion<S> where
A: Into<Rad<S>>,
Create a rotation using an angle around a given axis. Read more
fn from_angle_x<A>(theta: A) -> Self where
A: Into<Rad<S>>,
[src]
fn from_angle_x<A>(theta: A) -> Self where
A: Into<Rad<S>>,
Create a rotation from an angle around the x
axis (pitch).
fn from_angle_y<A>(theta: A) -> Self where
A: Into<Rad<S>>,
[src]
fn from_angle_y<A>(theta: A) -> Self where
A: Into<Rad<S>>,
Create a rotation from an angle around the y
axis (yaw).
fn from_angle_z<A>(theta: A) -> Self where
A: Into<Rad<S>>,
[src]
fn from_angle_z<A>(theta: A) -> Self where
A: Into<Rad<S>>,
Create a rotation from an angle around the z
axis (roll).
impl<S> VectorSpace for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> VectorSpace for Quaternion<S> where
S: BaseFloat,
type Scalar = S
The associated scalar.
impl<S> MulAssign<S> for Quaternion<S> where
S: BaseFloat + MulAssign<S>,
[src]
impl<S> MulAssign<S> for Quaternion<S> where
S: BaseFloat + MulAssign<S>,
fn mul_assign(&mut self, scalar: S)
[src]
fn mul_assign(&mut self, scalar: S)
Performs the *=
operation.
impl<S> Debug for Quaternion<S> where
S: Debug,
[src]
impl<S> Debug for Quaternion<S> where
S: Debug,
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<'a, S> Sum<&'a Quaternion<S>> for Quaternion<S> where
S: 'a + BaseFloat,
[src]
impl<'a, S> Sum<&'a Quaternion<S>> for Quaternion<S> where
S: 'a + BaseFloat,
fn sum<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = &'a Quaternion<S>>,
[src]
fn sum<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = &'a Quaternion<S>>,
Method which takes an iterator and generates Self
from the elements by "summing up" the items. Read more
impl<S> Sum<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Sum<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
fn sum<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = Quaternion<S>>,
[src]
fn sum<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = Quaternion<S>>,
Method which takes an iterator and generates Self
from the elements by "summing up" the items. Read more
impl<S> RemAssign<S> for Quaternion<S> where
S: BaseFloat + RemAssign<S>,
[src]
impl<S> RemAssign<S> for Quaternion<S> where
S: BaseFloat + RemAssign<S>,
fn rem_assign(&mut self, scalar: S)
[src]
fn rem_assign(&mut self, scalar: S)
Performs the %=
operation.
impl<'a> Mul<&'a Quaternion<f64>> for f64
[src]
impl<'a> Mul<&'a Quaternion<f64>> for f64
type Output = Quaternion<f64>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
[src]
fn mul(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
Performs the *
operation.
impl<S> Mul<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Mul<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the *
operator.
fn mul(self, other: Quaternion<S>) -> Quaternion<S>
[src]
fn mul(self, other: Quaternion<S>) -> Quaternion<S>
Performs the *
operation.
impl<'a> Mul<&'a Quaternion<f32>> for f32
[src]
impl<'a> Mul<&'a Quaternion<f32>> for f32
type Output = Quaternion<f32>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
[src]
fn mul(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
Performs the *
operation.
impl<S> Mul<S> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Mul<S> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the *
operator.
fn mul(self, other: S) -> Quaternion<S>
[src]
fn mul(self, other: S) -> Quaternion<S>
Performs the *
operation.
impl<S> Mul<Vector3<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Mul<Vector3<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Vector3<S>
The resulting type after applying the *
operator.
fn mul(self, other: Vector3<S>) -> Vector3<S>
[src]
fn mul(self, other: Vector3<S>) -> Vector3<S>
Performs the *
operation.
impl<'a, S> Mul<Quaternion<S>> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Mul<Quaternion<S>> for &'a Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the *
operator.
fn mul(self, other: Quaternion<S>) -> Quaternion<S>
[src]
fn mul(self, other: Quaternion<S>) -> Quaternion<S>
Performs the *
operation.
impl<'a, S> Mul<S> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Mul<S> for &'a Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the *
operator.
fn mul(self, other: S) -> Quaternion<S>
[src]
fn mul(self, other: S) -> Quaternion<S>
Performs the *
operation.
impl Mul<Quaternion<f32>> for f32
[src]
impl Mul<Quaternion<f32>> for f32
type Output = Quaternion<f32>
The resulting type after applying the *
operator.
fn mul(self, other: Quaternion<f32>) -> Quaternion<f32>
[src]
fn mul(self, other: Quaternion<f32>) -> Quaternion<f32>
Performs the *
operation.
impl<'a, S> Mul<&'a Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Mul<&'a Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
[src]
fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
Performs the *
operation.
impl<'a, S> Mul<Vector3<S>> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Mul<Vector3<S>> for &'a Quaternion<S> where
S: BaseFloat,
type Output = Vector3<S>
The resulting type after applying the *
operator.
fn mul(self, other: Vector3<S>) -> Vector3<S>
[src]
fn mul(self, other: Vector3<S>) -> Vector3<S>
Performs the *
operation.
impl<'a, 'b, S> Mul<&'a Vector3<S>> for &'b Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, 'b, S> Mul<&'a Vector3<S>> for &'b Quaternion<S> where
S: BaseFloat,
type Output = Vector3<S>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Vector3<S>) -> Vector3<S>
[src]
fn mul(self, other: &'a Vector3<S>) -> Vector3<S>
Performs the *
operation.
impl<'a, S> Mul<&'a Vector3<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Mul<&'a Vector3<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Vector3<S>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Vector3<S>) -> Vector3<S>
[src]
fn mul(self, other: &'a Vector3<S>) -> Vector3<S>
Performs the *
operation.
impl Mul<Quaternion<f64>> for f64
[src]
impl Mul<Quaternion<f64>> for f64
type Output = Quaternion<f64>
The resulting type after applying the *
operator.
fn mul(self, other: Quaternion<f64>) -> Quaternion<f64>
[src]
fn mul(self, other: Quaternion<f64>) -> Quaternion<f64>
Performs the *
operation.
impl<'a, 'b, S> Mul<&'a Quaternion<S>> for &'b Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, 'b, S> Mul<&'a Quaternion<S>> for &'b Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the *
operator.
fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
[src]
fn mul(self, other: &'a Quaternion<S>) -> Quaternion<S>
Performs the *
operation.
impl<S> One for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> One for Quaternion<S> where
S: BaseFloat,
fn one() -> Quaternion<S>
[src]
fn one() -> Quaternion<S>
Returns the multiplicative identity element of Self
, 1
. Read more
fn is_one(&self) -> bool where
Self: PartialEq<Self>,
[src]
fn is_one(&self) -> bool where
Self: PartialEq<Self>,
Returns true
if self
is equal to the multiplicative identity. Read more
impl<S> Serialize for Quaternion<S> where
S: Serialize,
[src]
impl<S> Serialize for Quaternion<S> where
S: Serialize,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'a, S> Neg for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Neg for &'a Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the -
operator.
fn neg(self) -> Quaternion<S>
[src]
fn neg(self) -> Quaternion<S>
Performs the unary -
operation.
impl<S> Neg for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Neg for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the -
operator.
fn neg(self) -> Quaternion<S>
[src]
fn neg(self) -> Quaternion<S>
Performs the unary -
operation.
impl<S> AsRef<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> AsRef<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
impl<S> AsRef<[S; 4]> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> AsRef<[S; 4]> for Quaternion<S> where
S: BaseFloat,
impl<'de, S> Deserialize<'de> for Quaternion<S> where
S: Deserialize<'de>,
[src]
impl<'de, S> Deserialize<'de> for Quaternion<S> where
S: Deserialize<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Quaternion<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<Quaternion<S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<S> From<Quaternion<S>> for Matrix3<S> where
S: BaseFloat,
[src]
impl<S> From<Quaternion<S>> for Matrix3<S> where
S: BaseFloat,
fn from(quat: Quaternion<S>) -> Matrix3<S>
[src]
fn from(quat: Quaternion<S>) -> Matrix3<S>
Convert the quaternion to a 3 x 3 rotation matrix.
impl<S> From<Quaternion<S>> for Basis3<S> where
S: BaseFloat,
[src]
impl<S> From<Quaternion<S>> for Basis3<S> where
S: BaseFloat,
fn from(quat: Quaternion<S>) -> Basis3<S>
[src]
fn from(quat: Quaternion<S>) -> Basis3<S>
Performs the conversion.
impl<S> From<Quaternion<S>> for Euler<Rad<S>> where
S: BaseFloat,
[src]
impl<S> From<Quaternion<S>> for Euler<Rad<S>> where
S: BaseFloat,
fn from(src: Quaternion<S>) -> Euler<Rad<S>>
[src]
fn from(src: Quaternion<S>) -> Euler<Rad<S>>
Performs the conversion.
impl<'a, S> From<&'a [S; 4]> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> From<&'a [S; 4]> for &'a Quaternion<S> where
S: BaseFloat,
fn from(v: &'a [S; 4]) -> &'a Quaternion<S>
[src]
fn from(v: &'a [S; 4]) -> &'a Quaternion<S>
Performs the conversion.
impl<'a, S> From<&'a (S, S, S, S)> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> From<&'a (S, S, S, S)> for &'a Quaternion<S> where
S: BaseFloat,
fn from(v: &'a (S, S, S, S)) -> &'a Quaternion<S>
[src]
fn from(v: &'a (S, S, S, S)) -> &'a Quaternion<S>
Performs the conversion.
impl<S> From<Quaternion<S>> for Matrix4<S> where
S: BaseFloat,
[src]
impl<S> From<Quaternion<S>> for Matrix4<S> where
S: BaseFloat,
fn from(quat: Quaternion<S>) -> Matrix4<S>
[src]
fn from(quat: Quaternion<S>) -> Matrix4<S>
Convert the quaternion to a 4 x 4 rotation matrix.
impl<'a, S> From<&'a mut [S; 4]> for &'a mut Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> From<&'a mut [S; 4]> for &'a mut Quaternion<S> where
S: BaseFloat,
fn from(v: &'a mut [S; 4]) -> &'a mut Quaternion<S>
[src]
fn from(v: &'a mut [S; 4]) -> &'a mut Quaternion<S>
Performs the conversion.
impl<S> From<Basis3<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> From<Basis3<S>> for Quaternion<S> where
S: BaseFloat,
fn from(b: Basis3<S>) -> Quaternion<S>
[src]
fn from(b: Basis3<S>) -> Quaternion<S>
Performs the conversion.
impl<A> From<Euler<A>> for Quaternion<<A as Angle>::Unitless> where
A: Angle + Into<Rad<<A as Angle>::Unitless>>,
[src]
impl<A> From<Euler<A>> for Quaternion<<A as Angle>::Unitless> where
A: Angle + Into<Rad<<A as Angle>::Unitless>>,
impl<S> From<[S; 4]> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> From<[S; 4]> for Quaternion<S> where
S: BaseFloat,
fn from(v: [S; 4]) -> Quaternion<S>
[src]
fn from(v: [S; 4]) -> Quaternion<S>
Performs the conversion.
impl<'a, S> From<&'a mut (S, S, S, S)> for &'a mut Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> From<&'a mut (S, S, S, S)> for &'a mut Quaternion<S> where
S: BaseFloat,
fn from(v: &'a mut (S, S, S, S)) -> &'a mut Quaternion<S>
[src]
fn from(v: &'a mut (S, S, S, S)) -> &'a mut Quaternion<S>
Performs the conversion.
impl<S> From<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> From<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
fn from(v: (S, S, S, S)) -> Quaternion<S>
[src]
fn from(v: (S, S, S, S)) -> Quaternion<S>
Performs the conversion.
impl<S> From<Matrix3<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> From<Matrix3<S>> for Quaternion<S> where
S: BaseFloat,
fn from(mat: Matrix3<S>) -> Quaternion<S>
[src]
fn from(mat: Matrix3<S>) -> Quaternion<S>
Convert the matrix to a quaternion
impl<S> AddAssign<Quaternion<S>> for Quaternion<S> where
S: BaseFloat + AddAssign<S>,
[src]
impl<S> AddAssign<Quaternion<S>> for Quaternion<S> where
S: BaseFloat + AddAssign<S>,
fn add_assign(&mut self, other: Quaternion<S>)
[src]
fn add_assign(&mut self, other: Quaternion<S>)
Performs the +=
operation.
impl<S> ApproxEq for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> ApproxEq for Quaternion<S> where
S: BaseFloat,
type Epsilon = <S as ApproxEq>::Epsilon
Used for specifying relative comparisons.
fn default_epsilon() -> <S as ApproxEq>::Epsilon
[src]
fn default_epsilon() -> <S as ApproxEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
fn default_max_relative() -> <S as ApproxEq>::Epsilon
[src]
fn default_max_relative() -> <S as ApproxEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
fn default_max_ulps() -> u32
[src]
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
fn relative_eq(
&self,
other: &Quaternion<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_relative: <S as ApproxEq>::Epsilon
) -> bool
[src]
fn relative_eq(
&self,
other: &Quaternion<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_relative: <S as ApproxEq>::Epsilon
) -> bool
A test for equality that uses a relative comparison if the values are far apart.
fn ulps_eq(
&self,
other: &Quaternion<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
[src]
fn ulps_eq(
&self,
other: &Quaternion<S>,
epsilon: <S as ApproxEq>::Epsilon,
max_ulps: u32
) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
[src]
fn relative_ne(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
The inverse of ApproxEq::relative_eq
.
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
[src]
fn ulps_ne(&self, other: &Self, epsilon: Self::Epsilon, max_ulps: u32) -> bool
The inverse of ApproxEq::ulps_eq
.
impl<S> Into<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Into<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
impl<S> Into<[S; 4]> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Into<[S; 4]> for Quaternion<S> where
S: BaseFloat,
impl<S> MetricSpace for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> MetricSpace for Quaternion<S> where
S: BaseFloat,
type Metric = S
The metric to be returned by the distance
function.
fn distance2(self, other: Quaternion<S>) -> S
[src]
fn distance2(self, other: Quaternion<S>) -> S
Returns the squared distance. Read more
fn distance(self, other: Self) -> Self::Metric
[src]
fn distance(self, other: Self) -> Self::Metric
The distance between two values.
impl<S> Index<RangeFull> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Index<RangeFull> for Quaternion<S> where
S: BaseFloat,
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeFull) -> &'a [S]
[src]
fn index(&'a self, i: RangeFull) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<S> Index<RangeFrom<usize>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Index<RangeFrom<usize>> for Quaternion<S> where
S: BaseFloat,
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeFrom<usize>) -> &'a [S]
[src]
fn index(&'a self, i: RangeFrom<usize>) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<S> Index<RangeTo<usize>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Index<RangeTo<usize>> for Quaternion<S> where
S: BaseFloat,
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: RangeTo<usize>) -> &'a [S]
[src]
fn index(&'a self, i: RangeTo<usize>) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<S> Index<usize> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Index<usize> for Quaternion<S> where
S: BaseFloat,
type Output = S
The returned type after indexing.
ⓘImportant traits for &'a mut Rfn index(&'a self, i: usize) -> &'a S
[src]
fn index(&'a self, i: usize) -> &'a S
Performs the indexing (container[index]
) operation.
impl<S> Index<Range<usize>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Index<Range<usize>> for Quaternion<S> where
S: BaseFloat,
type Output = [S]
The returned type after indexing.
fn index(&'a self, i: Range<usize>) -> &'a [S]
[src]
fn index(&'a self, i: Range<usize>) -> &'a [S]
Performs the indexing (container[index]
) operation.
impl<'a, 'b, S> Add<&'a Quaternion<S>> for &'b Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, 'b, S> Add<&'a Quaternion<S>> for &'b Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the +
operator.
fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
[src]
fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
Performs the +
operation.
impl<'a, S> Add<&'a Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Add<&'a Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the +
operator.
fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
[src]
fn add(self, other: &'a Quaternion<S>) -> Quaternion<S>
Performs the +
operation.
impl<S> Add<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Add<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the +
operator.
fn add(self, other: Quaternion<S>) -> Quaternion<S>
[src]
fn add(self, other: Quaternion<S>) -> Quaternion<S>
Performs the +
operation.
impl<'a, S> Add<Quaternion<S>> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Add<Quaternion<S>> for &'a Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the +
operator.
fn add(self, other: Quaternion<S>) -> Quaternion<S>
[src]
fn add(self, other: Quaternion<S>) -> Quaternion<S>
Performs the +
operation.
impl<'a, S> Product<&'a Quaternion<S>> for Quaternion<S> where
S: 'a + BaseFloat,
[src]
impl<'a, S> Product<&'a Quaternion<S>> for Quaternion<S> where
S: 'a + BaseFloat,
fn product<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = &'a Quaternion<S>>,
[src]
fn product<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = &'a Quaternion<S>>,
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
impl<S> Product<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Product<Quaternion<S>> for Quaternion<S> where
S: BaseFloat,
fn product<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = Quaternion<S>>,
[src]
fn product<I>(iter: I) -> Quaternion<S> where
I: Iterator<Item = Quaternion<S>>,
Method which takes an iterator and generates Self
from the elements by multiplying the items. Read more
impl<'a, S> Rem<S> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Rem<S> for &'a Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the %
operator.
fn rem(self, other: S) -> Quaternion<S>
[src]
fn rem(self, other: S) -> Quaternion<S>
Performs the %
operation.
impl<S> Rem<S> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Rem<S> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the %
operator.
fn rem(self, other: S) -> Quaternion<S>
[src]
fn rem(self, other: S) -> Quaternion<S>
Performs the %
operation.
impl<S> SubAssign<Quaternion<S>> for Quaternion<S> where
S: BaseFloat + SubAssign<S>,
[src]
impl<S> SubAssign<Quaternion<S>> for Quaternion<S> where
S: BaseFloat + SubAssign<S>,
fn sub_assign(&mut self, other: Quaternion<S>)
[src]
fn sub_assign(&mut self, other: Quaternion<S>)
Performs the -=
operation.
impl<S> AsMut<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> AsMut<(S, S, S, S)> for Quaternion<S> where
S: BaseFloat,
impl<S> AsMut<[S; 4]> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> AsMut<[S; 4]> for Quaternion<S> where
S: BaseFloat,
impl<S> Copy for Quaternion<S> where
S: Copy,
[src]
impl<S> Copy for Quaternion<S> where
S: Copy,
impl<S> DivAssign<S> for Quaternion<S> where
S: BaseFloat + DivAssign<S>,
[src]
impl<S> DivAssign<S> for Quaternion<S> where
S: BaseFloat + DivAssign<S>,
fn div_assign(&mut self, scalar: S)
[src]
fn div_assign(&mut self, scalar: S)
Performs the /=
operation.
impl<S> PartialEq<Quaternion<S>> for Quaternion<S> where
S: PartialEq<S>,
[src]
impl<S> PartialEq<Quaternion<S>> for Quaternion<S> where
S: PartialEq<S>,
fn eq(&self, other: &Quaternion<S>) -> bool
[src]
fn eq(&self, other: &Quaternion<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Quaternion<S>) -> bool
[src]
fn ne(&self, other: &Quaternion<S>) -> bool
This method tests for !=
.
impl Div<Quaternion<f64>> for f64
[src]
impl Div<Quaternion<f64>> for f64
type Output = Quaternion<f64>
The resulting type after applying the /
operator.
fn div(self, other: Quaternion<f64>) -> Quaternion<f64>
[src]
fn div(self, other: Quaternion<f64>) -> Quaternion<f64>
Performs the /
operation.
impl<'a> Div<&'a Quaternion<f64>> for f64
[src]
impl<'a> Div<&'a Quaternion<f64>> for f64
type Output = Quaternion<f64>
The resulting type after applying the /
operator.
fn div(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
[src]
fn div(self, other: &'a Quaternion<f64>) -> Quaternion<f64>
Performs the /
operation.
impl<'a> Div<&'a Quaternion<f32>> for f32
[src]
impl<'a> Div<&'a Quaternion<f32>> for f32
type Output = Quaternion<f32>
The resulting type after applying the /
operator.
fn div(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
[src]
fn div(self, other: &'a Quaternion<f32>) -> Quaternion<f32>
Performs the /
operation.
impl<S> Div<S> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Div<S> for Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the /
operator.
fn div(self, other: S) -> Quaternion<S>
[src]
fn div(self, other: S) -> Quaternion<S>
Performs the /
operation.
impl<'a, S> Div<S> for &'a Quaternion<S> where
S: BaseFloat,
[src]
impl<'a, S> Div<S> for &'a Quaternion<S> where
S: BaseFloat,
type Output = Quaternion<S>
The resulting type after applying the /
operator.
fn div(self, other: S) -> Quaternion<S>
[src]
fn div(self, other: S) -> Quaternion<S>
Performs the /
operation.
impl Div<Quaternion<f32>> for f32
[src]
impl Div<Quaternion<f32>> for f32
type Output = Quaternion<f32>
The resulting type after applying the /
operator.
fn div(self, other: Quaternion<f32>) -> Quaternion<f32>
[src]
fn div(self, other: Quaternion<f32>) -> Quaternion<f32>
Performs the /
operation.
impl<S> Rotation<Point3<S>> for Quaternion<S> where
S: BaseFloat,
[src]
impl<S> Rotation<Point3<S>> for Quaternion<S> where
S: BaseFloat,
fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Quaternion<S>
[src]
fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Quaternion<S>
Create a rotation to a given direction with an 'up' vector.
fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Quaternion<S>
[src]
fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Quaternion<S>
Create a shortest rotation to transform vector 'a' into 'b'. Both given vectors are assumed to have unit length. Read more
fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>
[src]
fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>
Rotate a vector using this rotation.
fn invert(&self) -> Quaternion<S>
[src]
fn invert(&self) -> Quaternion<S>
Create a new rotation which "un-does" this rotation. That is, r * r.invert()
is the identity. Read more
fn rotate_point(&self, point: P) -> P
[src]
fn rotate_point(&self, point: P) -> P
Rotate a point using this rotation, by converting it to its representation as a vector. Read more
Auto Trait Implementations
impl<S> Send for Quaternion<S> where
S: Send,
impl<S> Send for Quaternion<S> where
S: Send,
impl<S> Sync for Quaternion<S> where
S: Sync,
impl<S> Sync for Quaternion<S> where
S: Sync,