Skip to main content

collide_polygons

Function collide_polygons 

Source
pub fn collide_polygons(
    polygon_a: &Polygon,
    polygon_b: &Polygon,
    xf: Transform,
) -> LocalManifold
Expand description

Compute the contact manifold between two polygons. (b2CollidePolygons)

Due to speculation, every polygon is rounded. Algorithm:

compute edge separation using the separating axis test (SAT) if (separation > speculation_distance) return find reference and incident edge if separation >= 0.1f * B2_LINEAR_SLOP compute closest points between reference and incident edge if vertices are closest single vertex-vertex contact else clip edges end else clip edges end