Birch-san / box2d-wasm

Box2D physics engine compiled to WebAssembly. Supports TypeScript and ES modules.
263 stars 21 forks source link

Liquidfun ParticleGroup shapes array #72

Closed leha-games closed 4 months ago

leha-games commented 4 months ago

Hi. Thanks for amazing Box2D wasm port! I'm curious if it possible to iterate through b2ParticleGroupDef.shapes array? I think multiple shapes is important feature in Liquidfun when you need complex elastic shape for example.

I found this lines in Box2D.idl file : https://github.com/Birch-san/box2d-wasm/blob/01b4d5d77efb5267c672be79ad3ac7c77789f96a/box2d-wasm/Box2D.idl#L1141-L1142

For example we have b2PolygonShape#get_m_vertices(index?: number) and b2PolygonShape#set_m_vertices(index: number, m_vertices_elem: b2Vec2) to work with multiple polygon vertices.

leha-games commented 4 months ago

Nevermind, there is another way