Box2D lua bindings for the Defold Game Engine.
I tried to keep the lua api the same as the c++ api when possible.
If you like the extension you can support me on patreon. It will help me make more items for defold.
Try the demo: https://d954mas.github.io/defold-box2d/
1) Add defold-box2d in your own project as a Defold library dependency. Open your game.project file and in the dependencies field under project add: https://github.com/d954mas/defold-box2d/archive/refs/tags/1.0.0.zip
2) Remove Defold engine box2d. If it's not removed there will be a conflict between this box2d and engine box2d. Open your game.project file and in the App Manifest field under Native Extension add manifest.
- Use /box2d/manifest.appmanifest, OR
- You can generate a manifest yourself https://britzl.github.io/manifestation/
Supports emmylua. box2d_header.lua
If you need info about how Box2D works, read its documentation. https://box2d.org/documentation/
Box2d version: 2.4.1
1) No binding for b2Vec2. Use defold vector(vmath.vector3)
2) No binding for some b2World functions.
void SetContactFilter(b2ContactFilter* filter);
const b2ContactManager& GetContactManager() const;
3) No binding for some b2Joint functions.
virtual void Draw(b2Draw* draw) const;