box2d-optimized icon indicating copy to clipboard operation
box2d-optimized copied to clipboard

Box2D Testbed is not compatible with Box2D-optimized

Open aismann opened this issue 4 years ago • 2 comments

I got some compiler errors...

Once be: b2ChainShape unknown

I thought In can use Box2D-optimized without any changes on my Box2D app. Only switching from Box2D to Box2D-optimized and can use my original sources whitout any changes.

aismann avatar Aug 13 '21 11:08 aismann

Hi @aismann !

Unfortunately there are some breaking changes and incompatibilities with the original box2D, but only where it was necessary to provide superior performance. The chain shape is one such case. It is no longer a single shape, so you have to add the edge shapes in your body.

I have created helper functions specifically for this case, in b2_geometry. Can you check out https://github.com/mtsamis/box2d-optimized/blob/master/src/common/b2_geometry.cpp and see if these can be used as a replacement? These function are used in the testbed examples so you can find an example there. They were made to provide a similar alternative to working with chain shapes.

Let me know if this helps

Thanks!

mtsamis avatar Aug 29 '21 07:08 mtsamis

Thanks for this hint. I will use/test it later some weeks. Currently on another project.

aismann avatar Sep 01 '21 13:09 aismann