Skip to main content

ForceSource

Trait ForceSource 

Source
pub trait ForceSource {
    // Required method
    fn force_at(
        &self,
        transform: &Transform,
        velocity: [Real; 3],
        mass: Real,
    ) -> ([Real; 3], [Real; 3]);
}
Expand description

Trait for objects that apply forces to bodies (gravity fields, springs, etc.).

Required Methods§

Source

fn force_at( &self, transform: &Transform, velocity: [Real; 3], mass: Real, ) -> ([Real; 3], [Real; 3])

Compute the force (and optionally torque) acting on a body at the given transform with the given velocity.

Returns (force, torque) both as [f64; 3] in world space.

Implementors§