pub struct Rotation {
pub m: DMat3,
pub dm: DMat3,
}Expand description
A rotation matrix with its time derivative, for transforming position and velocity vectors.
Fields§
§m: DMat3Rotation matrix.
dm: DMat3Time derivative of the rotation matrix.
Implementations§
Source§impl Rotation
impl Rotation
Sourcepub fn with_derivative(self, dm: DMat3) -> Rotation
pub fn with_derivative(self, dm: DMat3) -> Rotation
Sets the time derivative of the rotation matrix.
Sourcepub fn with_angular_velocity(self, v: DVec3) -> Rotation
pub fn with_angular_velocity(self, v: DVec3) -> Rotation
Sets the time derivative from an angular velocity vector.
Sourcepub fn position_matrix(&self) -> DMat3
pub fn position_matrix(&self) -> DMat3
Returns the position rotation matrix.
Sourcepub fn velocity_matrix(&self) -> DMat3
pub fn velocity_matrix(&self) -> DMat3
Returns the velocity rotation matrix (time derivative).
Sourcepub fn compose(self, other: Rotation) -> Rotation
pub fn compose(self, other: Rotation) -> Rotation
Composes this rotation with another (self then other).
Sourcepub fn rotate_position(&self, pos: DVec3) -> DVec3
pub fn rotate_position(&self, pos: DVec3) -> DVec3
Rotates a position vector.
Sourcepub fn rotate_velocity(&self, pos: DVec3, vel: DVec3) -> DVec3
pub fn rotate_velocity(&self, pos: DVec3, vel: DVec3) -> DVec3
Rotates a velocity vector (accounting for the rotation rate).
Trait Implementations§
impl Copy for Rotation
impl StructuralPartialEq for Rotation
Auto Trait Implementations§
impl Freeze for Rotation
impl RefUnwindSafe for Rotation
impl Send for Rotation
impl Sync for Rotation
impl Unpin for Rotation
impl UnsafeUnpin for Rotation
impl UnwindSafe for Rotation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.