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) -> Self
pub fn with_derivative(self, dm: DMat3) -> Self
Sets the time derivative of the rotation matrix.
Sourcepub fn with_angular_velocity(self, v: DVec3) -> Self
pub fn with_angular_velocity(self, v: DVec3) -> Self
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: Self) -> Self
pub fn compose(self, other: Self) -> Self
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 more