Skip to content
Discussion options

You must be logged in to vote

b2PolygonShape#get_m_count() and b2PolygonShape#get_m_vertices(index?: number).

https://github.com/Birch-san/box2d-wasm/blob/master/docs/iteration.md

const square = new b2PolygonShape();
square.SetAsBox(1, 1);
for (let vertexIx = 0; vertexIx < square.get_m_count(); vertexIx++) {
  const vertex = square.get_m_vertices(vertexIx);
}

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@SammyJoeOsborne
Comment options

@SammyJoeOsborne
Comment options

@Birch-san
Comment options

@SammyJoeOsborne
Comment options

Answer selected by SammyJoeOsborne
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants