B2d_shape_edge - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Description
Sets the given shape to an edge 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 zig zag terrain comprised of several points
b2d_shape_add_point(myshape, 0, 10);
b2d_shape_add_point(myshape, 10, 0);
b2d_shape_add_point(myshape, 20, 10);
b2d_shape_add_point(myshape, 30, 0);
b2d_shape_add_point(myshape, 40, 10);
b2d_shape_add_point(myshape, 50, 0);
b2d_shape_add_point(myshape, 60, 10);
b2d_shape_add_point(myshape, 70, 0);
b2d_shape_edge(myshape);
NOTOC