Can I use physics editor's plist file with box2d?

I using box2d in cocos2d-x 3.16
but only using box2d, can make body shape circle, box, etc.
but i want corrently same body size of sprite.
in physics can using that with physics editor.
but box2d can’t using that?

Hi. We are using physicsEditor and bare Box2D in our project. You need to write some wrapper to convert plist file from physicsEditor to create box2d body.

How can I use that?
Do you have any page or code can refer to?

B2Component.cpp (7.2 KB)
B2Component.h (1.5 KB)

1 Like

This is our wrapper class but there are some other stuff in it. you should convert plist to valueMap and from ValueMap you can create BodyDef like in our wrapper.

thank you for your help.
i’ll try with this.