pub struct AcceleratedPath {
pub start: DVec3,
pub velocity: DVec3,
pub acceleration: DVec3,
pub duration: f64,
}Expand description
A point moving under constant acceleration for a while: the path of a
capsule’s centre that
PhysicsWorld::sweep_capsule_arc
sweeps.
At time t in [0, duration] the point is at
start + velocity t + ½ acceleration t². Gravity and a steering
acceleration together are one constant acceleration; anything that
changes over the interval — a correction that ends, a drag — is the
caller’s to split the interval at.
Fields§
§start: DVec3Where the point is at time zero.
velocity: DVec3Its velocity at time zero.
acceleration: DVec3Its constant acceleration.
duration: f64How long it moves for: the end of the interval [0, duration].
Implementations§
Source§impl AcceleratedPath
impl AcceleratedPath
Sourcepub fn new(
start: DVec3,
velocity: DVec3,
acceleration: DVec3,
duration: f64,
) -> Self
pub fn new( start: DVec3, velocity: DVec3, acceleration: DVec3, duration: f64, ) -> Self
A path from start at velocity, accelerating at acceleration, for
duration.
§Panics
Panics in debug builds if duration is negative or not finite.
Sourcepub fn position_at(&self, time: f64) -> DVec3
pub fn position_at(&self, time: f64) -> DVec3
Where the point is at time.
Sourcepub fn velocity_at(&self, time: f64) -> DVec3
pub fn velocity_at(&self, time: f64) -> DVec3
The point’s velocity at time.
Trait Implementations§
Source§impl Clone for AcceleratedPath
impl Clone for AcceleratedPath
impl Copy for AcceleratedPath
Source§impl Debug for AcceleratedPath
impl Debug for AcceleratedPath
Source§impl PartialEq for AcceleratedPath
impl PartialEq for AcceleratedPath
impl StructuralPartialEq for AcceleratedPath
Auto Trait Implementations§
impl Forget for AcceleratedPath
impl Freeze for AcceleratedPath
impl Move for AcceleratedPath
impl RefUnwindSafe for AcceleratedPath
impl Send for AcceleratedPath
impl Sync for AcceleratedPath
impl Unpin for AcceleratedPath
impl UnsafeUnpin for AcceleratedPath
impl UnwindSafe for AcceleratedPath
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