rapier.js icon indicating copy to clipboard operation
rapier.js copied to clipboard

Support for compound shapes

Open BlueNebulaDev opened this issue 4 years ago • 4 comments

I need to create a 2d body made by a circle and a rectangle. According to the documentation on the website I should use a compound collider for this, correct?

I've been looking into how to use a compound shape with rapier2d, but couldn't find much: the "Compound = 8" definition in the typescript source is commented out and there's no constructor or function to handle them.

Would it be possible to port support to compound shapes?

Otherwise what's the recommended way to create my shape?

BlueNebulaDev avatar Sep 05 '21 09:09 BlueNebulaDev

Hi! You are correct, the bindings don’t expose the compound shapes yet. As an alternative, you can attach two colliders to your rigid-body: one collider with a circle shape, and another collider with a rectangle shape. It will behave the same way as with a single collider with a compound shape.

sebcrozet avatar Sep 05 '21 10:09 sebcrozet