pub struct Velocity<L, A> { /* private fields */ }Expand description
Velocity
§Type parameters:
L: Linear velocity, usuallyVector2orVector3A: Angular velocity, usuallyScalarorVector3
Implementations§
Source§impl<L, A> Velocity<L, A>
impl<L, A> Velocity<L, A>
Sourcepub fn new(linear: L, angular: A) -> Self
pub fn new(linear: L, angular: A) -> Self
Create new velocity object, with both linear and angular velocity
Sourcepub fn from_linear(linear: L) -> Self
pub fn from_linear(linear: L) -> Self
Create new velocity object with only linear velocity
Sourcepub fn set_linear(&mut self, linear: L)
pub fn set_linear(&mut self, linear: L)
Set linear velocity
Sourcepub fn set_angular(&mut self, angular: A)
pub fn set_angular(&mut self, angular: A)
Set angular velocity
Sourcepub fn apply<P, R>(
&self,
pose: &BodyPose<P, R>,
dt: L::Scalar,
) -> BodyPose<P, R>where
P: EuclideanSpace<Scalar = L::Scalar, Diff = L>,
L: VectorSpace,
L::Scalar: BaseFloat,
R: ApplyAngular<L::Scalar, A> + Rotation<P>,
pub fn apply<P, R>(
&self,
pose: &BodyPose<P, R>,
dt: L::Scalar,
) -> BodyPose<P, R>where
P: EuclideanSpace<Scalar = L::Scalar, Diff = L>,
L: VectorSpace,
L::Scalar: BaseFloat,
R: ApplyAngular<L::Scalar, A> + Rotation<P>,
Sourcepub fn apply_linear<P>(&self, linear: &P, dt: L::Scalar) -> P
pub fn apply_linear<P>(&self, linear: &P, dt: L::Scalar) -> P
Sourcepub fn apply_angular<R>(&self, rotation: &R, dt: L::Scalar) -> R
pub fn apply_angular<R>(&self, rotation: &R, dt: L::Scalar) -> R
Trait Implementations§
impl<L, A> StructuralPartialEq for Velocity<L, A>
Auto Trait Implementations§
impl<L, A> Freeze for Velocity<L, A>
impl<L, A> RefUnwindSafe for Velocity<L, A>where
L: RefUnwindSafe,
A: RefUnwindSafe,
impl<L, A> Send for Velocity<L, A>
impl<L, A> Sync for Velocity<L, A>
impl<L, A> Unpin for Velocity<L, A>
impl<L, A> UnwindSafe for Velocity<L, A>where
L: UnwindSafe,
A: 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