I am using box2d and attempting to create a chain shape.
In order to create a chain shape or polygon shape I must pass an array of vectors in order to specify the geometry.
I do not see any documentation to help me accomplish this, and the notes about bindings here don’t go into any detail about arrays.
How can I construct an array?
I have solved this problem by using these (as yet undocumented) emscripten features.
Note that I am accessing the functions and values (like
ALLOC_STACKandwrapPointer) out of the Box2D object simply because that is the scope where I have found them to be exposed. They are emscripten-specific values, so for a different project and/or build settings it would be different.