Struct skspringrs::DampedSpringController [−][src]
pub struct DampedSpringController<F> { /* fields omitted */ }
Caches coefficients so that multiple springs with the same parameters may be used without re-running trigonometry calls.
Methods
impl<F> DampedSpringController<F> where
F: Float + FromPrimitive,
[src]
impl<F> DampedSpringController<F> where
F: Float + FromPrimitive,
pub fn with_coefficients(
delta_time: F,
desired_angular_frequency: F,
desired_damping_ratio: F
) -> DampedSpringController<F>
[src]
pub fn with_coefficients(
delta_time: F,
desired_angular_frequency: F,
desired_damping_ratio: F
) -> DampedSpringController<F>
Performs (somewhat nontrivial) calculations to prepare the
motion of a damped spring. Once initialized, you may update
any spring with identical properties with update
using the
same object.
pub fn update(&self, position: &mut F, velocity: &mut F, target: F)
[src]
pub fn update(&self, position: &mut F, velocity: &mut F, target: F)
Updates the position and velocity of a spring using this controller's physical properties.
Auto Trait Implementations
impl<F> Send for DampedSpringController<F> where
F: Send,
impl<F> Send for DampedSpringController<F> where
F: Send,
impl<F> Sync for DampedSpringController<F> where
F: Sync,
impl<F> Sync for DampedSpringController<F> where
F: Sync,