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 subeset 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> 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<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 concat(&self, other: &Basis3<S>) -> Basis3<S>
fn concat(&self, other: &Basis3<S>) -> Basis3<S>
Create a new rotation which combines both this rotation, and another.
source§fn concat_self(&mut self, other: &Basis3<S>)
fn concat_self(&mut self, other: &Basis3<S>)
Modify this rotation in-place by combining it with another.
source§fn invert(&self) -> Basis3<S>
fn invert(&self) -> Basis3<S>
Create a new rotation which “un-does” this rotation. That is,
r.concat(r.invert())
is the identity.source§fn invert_self(&mut self)
fn invert_self(&mut self)
Invert this rotation in-place.
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(axis: Vector3<S>, angle: Rad<S>) -> Basis3<S>
fn from_axis_angle(axis: Vector3<S>, angle: Rad<S>) -> Basis3<S>
Create a rotation using an angle around a given axis.
source§fn from_euler(x: Rad<S>, y: Rad<S>, z: Rad<S>) -> Basis3<S>
fn from_euler(x: Rad<S>, y: Rad<S>, z: Rad<S>) -> Basis3<S>
Create a rotation from a set of euler angles. Read more
source§fn from_angle_x(theta: Rad<S>) -> Basis3<S>
fn from_angle_x(theta: Rad<S>) -> Basis3<S>
Create a rotation from an angle around the
x
axis (pitch).source§fn from_angle_y(theta: Rad<S>) -> Basis3<S>
fn from_angle_y(theta: Rad<S>) -> Basis3<S>
Create a rotation from an angle around the
y
axis (yaw).source§fn from_angle_z(theta: Rad<S>) -> Basis3<S>
fn from_angle_z(theta: Rad<S>) -> Basis3<S>
Create a rotation from an angle around the
z
axis (roll).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