-
Notifications
You must be signed in to change notification settings - Fork 0
B2d_shape_loop
hpgDesigns edited this page Aug 8, 2021
·
1 revision
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
| 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 |
void: This function does not return anything.
// 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
This is number 1