pub struct Basis3<S> { /* private fields */ }
Expand description
A three-dimensional rotation matrix.
The matrix is guaranteed to be orthogonal, so some operations, specifically
inversion, can be implemented more efficiently than the implementations for
math::Matrix3
. To ensure orthogonality is maintained, the operations have
been restricted to a subset of those implemented on Matrix3
.
Implementations§
source§impl<S: BaseFloat> Basis3<S>
impl<S: BaseFloat> Basis3<S>
sourcepub fn from_quaternion(quaternion: &Quaternion<S>) -> Basis3<S>
pub fn from_quaternion(quaternion: &Quaternion<S>) -> Basis3<S>
Create a new rotation matrix from a quaternion.
Trait Implementations§
source§impl<S: BaseFloat> ApproxEq for Basis3<S>
impl<S: BaseFloat> ApproxEq for Basis3<S>
source§fn default_epsilon() -> S::Epsilon
fn default_epsilon() -> S::Epsilon
The default tolerance to use when testing values that are close together. Read more
source§fn default_max_relative() -> S::Epsilon
fn default_max_relative() -> S::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
source§fn relative_eq(
&self,
other: &Self,
epsilon: S::Epsilon,
max_relative: S::Epsilon
) -> bool
fn relative_eq( &self, other: &Self, epsilon: S::Epsilon, max_relative: S::Epsilon ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
source§fn ulps_eq(&self, other: &Self, epsilon: S::Epsilon, max_ulps: u32) -> bool
fn ulps_eq(&self, other: &Self, epsilon: S::Epsilon, max_ulps: u32) -> bool
A test for equality that uses units in the last place (ULP) if the values are far apart.
source§impl<S: BaseFloat> From<Basis3<S>> for Quaternion<S>
impl<S: BaseFloat> From<Basis3<S>> for Quaternion<S>
source§fn from(b: Basis3<S>) -> Quaternion<S>
fn from(b: Basis3<S>) -> Quaternion<S>
Converts to this type from the input type.
source§impl<A> From<Euler<A>> for Basis3<A::Unitless>where
A: Into<Rad<<A as Angle>::Unitless>> + Angle,
impl<A> From<Euler<A>> for Basis3<A::Unitless>where A: Into<Rad<<A as Angle>::Unitless>> + Angle,
source§impl<S: BaseFloat> From<Quaternion<S>> for Basis3<S>
impl<S: BaseFloat> From<Quaternion<S>> for Basis3<S>
source§fn from(quat: Quaternion<S>) -> Basis3<S>
fn from(quat: Quaternion<S>) -> Basis3<S>
Converts to this type from the input type.
source§impl<S: PartialEq> PartialEq<Basis3<S>> for Basis3<S>
impl<S: PartialEq> PartialEq<Basis3<S>> for Basis3<S>
source§impl<S: BaseFloat> Rotation<Point3<S>> for Basis3<S>
impl<S: BaseFloat> Rotation<Point3<S>> for Basis3<S>
source§fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Basis3<S>
fn look_at(dir: Vector3<S>, up: Vector3<S>) -> Basis3<S>
Create a rotation to a given direction with an ‘up’ vector.
source§fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Basis3<S>
fn between_vectors(a: Vector3<S>, b: Vector3<S>) -> Basis3<S>
Create a shortest rotation to transform vector ‘a’ into ‘b’.
Both given vectors are assumed to have unit length.
source§fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>
fn rotate_vector(&self, vec: Vector3<S>) -> Vector3<S>
Rotate a vector using this rotation.
source§fn invert(&self) -> Basis3<S>
fn invert(&self) -> Basis3<S>
Create a new rotation which “un-does” this rotation. That is,
r * r.invert()
is the identity.source§fn rotate_point(&self, point: P) -> P
fn rotate_point(&self, point: P) -> P
Rotate a point using this rotation, by converting it to its
representation as a vector.
source§impl<S: BaseFloat> Rotation3<S> for Basis3<S>
impl<S: BaseFloat> Rotation3<S> for Basis3<S>
source§fn from_axis_angle<A: Into<Rad<S>>>(axis: Vector3<S>, angle: A) -> Basis3<S>
fn from_axis_angle<A: Into<Rad<S>>>(axis: Vector3<S>, angle: A) -> Basis3<S>
Create a rotation using an angle around a given axis. Read more
source§fn from_angle_x<A: Into<Rad<S>>>(theta: A) -> Basis3<S>
fn from_angle_x<A: Into<Rad<S>>>(theta: A) -> Basis3<S>
Create a rotation from an angle around the
x
axis (pitch).impl<S: Copy> Copy for Basis3<S>
impl<S> StructuralPartialEq for Basis3<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for Basis3<S>where S: RefUnwindSafe,
impl<S> Send for Basis3<S>where S: Send,
impl<S> Sync for Basis3<S>where S: Sync,
impl<S> Unpin for Basis3<S>where S: Unpin,
impl<S> UnwindSafe for Basis3<S>where S: UnwindSafe,
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