Skip to content

Physics_fixture_set_edge_shape

hugh greene edited this page Jun 20, 2022 · 1 revision

Description

Sets the shape of the given fixture 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 fixture
adjstart whether or not a ghost adjacent vertice was added at the beginning
adjend whether or not a ghost adjacent vertice was added at the end

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_edge_shape(myfixture);

NOTOC

Clone this wiki locally