physics2d 0.6.0

Yet another 2D physics engine, but with Iron power.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use world::Body;

pub trait Constraint {
    /// Initialize position-dependent variables to be used in the constraint velocity solver.
    fn initialize_velocity(&mut self, a: &Body, b: &Body, dt: f32);
    
    /// Apply accumulated velocity impulses, if any.
    fn warm_start_velocity(&mut self, a: &mut Body, b: &mut Body, dt: f32);
    
    /// Apply accumulated position impulses, if any.
    fn warm_start_position(&mut self, a: &mut Body, b: &mut Body, dt: f32);
    
    /// Solve the velocity constraint.
    fn solve_velocity(&mut self, a: &mut Body, b: &mut Body, dt: f32);
    
    /// Solve the position constraint.
    fn solve_position(&mut self, a: &mut Body, b: &mut Body, dt: f32);
}