1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
use ::world::{World};
use ::math::{Vec2};

pub trait DebugCollision {
    fn contact_points(&self) -> Vec<Vec2>;
}

impl DebugCollision for World {
    fn contact_points(&self) -> Vec<Vec2> {
        self.collision_pairs
            .values()
            .flat_map(
                |ref m|
                    m.contacts.iter()
                     .map(|ref c| c.point))
            .collect()
    }
}