Skip to content

cf_poly_to_b2

Category: physics
GitHub: cute_physics.h


Converts a CF_Poly to a b2Polygon.

b2Polygon cf_poly_to_b2(const CF_Poly* poly, float radius);
Parameters Description
poly The polygon, with valid verts, norms and count (see cf_make_poly).
radius An optional rounding radius for the resulting polygon, usually 0.

Remarks

A real conversion, not a cast: b2Polygon additionally carries a centroid and rounding radius, which are computed/assigned here.

CF_Poly
cf_make_poly
cf_circle_to_b2
cf_capsule_to_b2