Skip to main content

Damped

Trait Damped 

Source
pub trait Damped {
    // Required methods
    fn linear_damping(&self) -> Real;
    fn angular_damping(&self) -> Real;

    // Provided method
    fn damp_velocity(&self, velocity: Real, dt: Real, is_angular: bool) -> Real { ... }
}
Expand description

Trait for objects that model energy dissipation.

Required Methods§

Source

fn linear_damping(&self) -> Real

Return the linear damping coefficient.

Source

fn angular_damping(&self) -> Real

Return the angular damping coefficient.

Provided Methods§

Source

fn damp_velocity(&self, velocity: Real, dt: Real, is_angular: bool) -> Real

Compute damped velocity components from current velocity over dt.

Implementors§