B2d_shape_add_point - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
Description
Adds the given point to the given shape, only works with polygon or edge shapes. Note: Box2D requires the points to be added clockwise, and the shape to be convex
Parameters
Parameter | Description |
---|---|
id | index of the shape |
x | x coordinate representing the point |
y | y coordinate |
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