B2d_shape_polygon - hpgDesigns/hpgdesigns-dev.io GitHub Wiki

Description

Sets the given shape to a polygon comprised of its currently added points. Note: Box2D requires the points to be added clockwise, and the shape to be convex

Parameters

Parameter Description
id index of the shape

Return Values

void: This function does not return anything.

Example Call

// demonstrates setting a shape to a triangle making a horizontal slope going from left bottom to top right
b2d_shape_add_point(myshape, width, -height);
b2d_shape_add_point(myshape, width, height);
b2d_shape_add_point(myshape, -width, height);
b2d_shape_polygon(myshape);

NOTOC