Struct rhusics_core::Velocity
source · pub struct Velocity<L, A> { /* private fields */ }
Expand description
Velocity
Type parameters:
L
: Linear velocity, usuallyVector2
orVector3
A
: Angular velocity, usuallyScalar
orVector3
Implementations
sourceimpl<L, A> Velocity<L, A>where
L: Zero,
A: Clone + Zero,
impl<L, A> Velocity<L, A>where
L: Zero,
A: Clone + Zero,
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<B, P, R>(&self, pose: &B, dt: L::Scalar) -> Bwhere
P: EuclideanSpace<Scalar = L::Scalar, Diff = L>,
L: VectorSpace,
L::Scalar: BaseFloat,
R: ApplyAngular<L::Scalar, A> + Rotation<P>,
B: Pose<P, R>,
pub fn apply<B, P, R>(&self, pose: &B, dt: L::Scalar) -> Bwhere
P: EuclideanSpace<Scalar = L::Scalar, Diff = L>,
L: VectorSpace,
L::Scalar: BaseFloat,
R: ApplyAngular<L::Scalar, A> + Rotation<P>,
B: Pose<P, R>,
Apply velocity to pose.
Parameters:
pose
: Pose to apply the velocity todt
: Time step
Type parameters:
B
: Transform type (BodyPose3
or similar)P
: Positional quantity, usuallyPoint2
orPoint3
R
: Rotational quantity, usuallyBasis2
orQuaternion
sourcepub fn apply_linear<P>(&self, linear: P, dt: L::Scalar) -> Pwhere
P: EuclideanSpace<Scalar = L::Scalar, Diff = L>,
L::Scalar: BaseFloat,
L: VectorSpace,
pub fn apply_linear<P>(&self, linear: P, dt: L::Scalar) -> Pwhere
P: EuclideanSpace<Scalar = L::Scalar, Diff = L>,
L::Scalar: BaseFloat,
L: VectorSpace,
Apply linear velocity to a positional quantity
Parameters:
linear
: Positional valuedt
: Time step
Type parameters:
P
: Positional quantity, usuallyPoint2
orPoint3
sourcepub fn apply_angular<R>(&self, rotation: R, dt: L::Scalar) -> Rwhere
R: ApplyAngular<L::Scalar, A>,
L: VectorSpace,
L::Scalar: BaseFloat,
pub fn apply_angular<R>(&self, rotation: R, dt: L::Scalar) -> Rwhere
R: ApplyAngular<L::Scalar, A>,
L: VectorSpace,
L::Scalar: BaseFloat,
Apply angular velocity to a rotational quantity
Parameters:
rotation
: Rotational valuedt
: Time step
Type parameters:
R
: Rotational quantity, usuallyBasis2
orQuaternion
Trait Implementations
sourceimpl<L: PartialEq, A: PartialEq> PartialEq<Velocity<L, A>> for Velocity<L, A>
impl<L: PartialEq, A: PartialEq> PartialEq<Velocity<L, A>> for Velocity<L, A>
impl<L, A> StructuralPartialEq for Velocity<L, A>
Auto Trait Implementations
impl<L, A> RefUnwindSafe for Velocity<L, A>where
A: RefUnwindSafe,
L: RefUnwindSafe,
impl<L, A> Send for Velocity<L, A>where
A: Send,
L: Send,
impl<L, A> Sync for Velocity<L, A>where
A: Sync,
L: Sync,
impl<L, A> Unpin for Velocity<L, A>where
A: Unpin,
L: Unpin,
impl<L, A> UnwindSafe for Velocity<L, A>where
A: UnwindSafe,
L: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more