b2w_addPolygonShape function
Attach a convex polygon. verts: count points as x0, y0, x1, y1, …; Box2D takes their convex hull. More than 8 points (Box2D's limit) are cut into a fan of pieces that share the first point, so the body keeps the whole shape. Fewer than 3 attach nothing.
Implementation
@ffi.Native<
ffi.Void Function(
ffi.Int64,
ffi.Pointer<ffi.Float>,
ffi.Int32,
ffi.Float,
ffi.Float,
ffi.Float,
)
>()
external void b2w_addPolygonShape(
int bodyHandle,
ffi.Pointer<ffi.Float> verts,
int count,
double density,
double friction,
double restitution,
);