dacatchman Posted September 30, 2019 Share Posted September 30, 2019 I made this. Tips welcome of course, was a quick hack, but wanted to help people always asking for physics https://github.com/dacatchman/pixi-planckjs-demo jonforum 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 30, 2019 Share Posted September 30, 2019 Added to https://github.com/pixijs/pixi.js/wiki/v5-Boilerplate > In this demo, you will see how to convert between box2d space and screen space. I usually leave it like that: pixi objects have to be in pixels, physics in units. There's a way to notify box2d part that pixi changed something: like , if "obj.transform_localID" was changed -> need to update transform from pixi side. But multiplication/division there is needed anyway Treat it like properties: if you change pixiObj.position, its in pixels, if you change pixiObj.body - its in units. Quote Link to comment Share on other sites More sharing options...
dacatchman Posted October 13, 2019 Author Share Posted October 13, 2019 Bumping because I updated this. Mainly, a new live demo can be found here: https://dacatchman.github.io/pixi-planckjs-demo/ Added toggles for bullet physics, interpolation, and the timestep tweaking. Also, added triangle shapes so you can see how to roll custom shapes for Box2d. Has more aggressive culling for timestep panic as well. Future updates may include custom shape file loading from PhysicsEditor, I wrote a custom json exporter for it that works nicely with planck (well any box2d really) and PIXI. Just depends how far along I keep pushing my personal projects. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.