physics_fixture_set_polygon_shape(id)
Jump to navigation
Jump to search
Description
Sets the shape of the given fixture 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 fixture |
Return Values
void: This function does not return anything.
Example Call
// demonstrates setting the shape of a fixture to a triangle making a horizontal slope going from left bottom to top right
physics_fixture_add_point(myfixture, width, -height);
physics_fixture_add_point(myfixture, width, height);
physics_fixture_add_point(myfixture, -width, height);
physics_fixture_set_polygon_shape(myfixture);