B2d_shape_loop - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Description
Sets the given shape to a loop comprised of its currently added points. The chain shape provides an efficient way to connect many edges together to construct your static game worlds. Chain shapes automatically eliminate ghost collisions and provide two sided collision. Note: Box2D requires the points to be added clockwise, and the shape to be convex
Parameters
Parameter | Description |
---|---|
id | index of the shape |
adjstart | whether or not the shape has an adjacent starting point |
adjend | whether or not the shape has an adjacent ending point |
Return Values
void: This function does not return anything.
Example Call
// demonstrates setting a loop shape with both adjacent vertices
b2d_shape_add_point(myshape, 0, 10);
b2d_shape_add_point(myshape, 10, 0);
b2d_shape_add_point(myshape, 5, -10);
b2d_shape_add_point(myshape, 0, 0);
b2d_shape_loop(myshape, true, true);
NOTOC