Box2D QML plugin
Switch branches/tags
Nothing to show
Clone or download
bjorn Merge pull request #123 from JBBgameich/debian-packaging
Update debian packaging to standards-version 4.1.3 and compat 11
Latest commit b7212d5 Apr 6, 2018
Permalink
Failed to load latest commit information.
Box2D Updated to Box2D 2.3.2 (trunk) Apr 12, 2014
debian debian: select qt5 Apr 5, 2018
examples Improved readme to help beginners. Added a few screenshots of example… Jan 5, 2018
.gitignore .gitignore was changed Mar 6, 2014
COPYING Updated the COPYING file with the new license Aug 23, 2012
README.md Rename README to README.md Jan 9, 2018
box2d-static.pri Add ability to compile qml_box2d with system Bod2D library May 27, 2015
box2d.pro Fixed 'make install' command issue on Android (#119) Dec 3, 2017
box2d.qbs qbs : export path in library to avoid including it in projects Jul 20, 2015
box2d_lib.pri Add ability to compile qml_box2d with system Bod2D library May 27, 2015
box2dbody.cpp Merge pull request #91 from folibis/transformorigin Mar 29, 2015
box2dbody.h Fix workaround with setting transformOrigin Mar 29, 2015
box2dcontact.cpp Removed unit conversion for forces, velocities and mass Apr 10, 2014
box2dcontact.h Added new class & events to access raw data of contacts Mar 16, 2014
box2ddebugdraw.cpp Allow to avoid setting Body.world if there is only one World Feb 21, 2015
box2ddebugdraw.h Replace QPainter with Scene graph render in DebugDraw item Jul 24, 2014
box2ddistancejoint.cpp Fixed up the DistanceJoint Apr 21, 2014
box2ddistancejoint.h Fixed up the DistanceJoint Apr 21, 2014
box2dfixture.cpp Update bodies after changing pixelsPerMeter Dec 23, 2014
box2dfixture.h Update bodies after changing pixelsPerMeter Dec 23, 2014
box2dfrictionjoint.cpp Corrected some filenames in header comments Jan 2, 2016
box2dfrictionjoint.h Corrected some filenames in header comments Jan 2, 2016
box2dgearjoint.cpp Corrected some filenames in header comments Jan 2, 2016
box2dgearjoint.h Updated GearJoint for consistency Apr 21, 2014
box2djoint.cpp Added missing include Jun 16, 2014
box2djoint.h Fixed crash when starting the 'mouse' example Apr 18, 2014
box2dmotorjoint.cpp Fixed up the MotorJoint Apr 27, 2014
box2dmotorjoint.h Fixed up the MotorJoint Apr 27, 2014
box2dmousejoint.cpp Fixed crash when starting the 'mouse' example Apr 18, 2014
box2dmousejoint.h Fixed crash when starting the 'mouse' example Apr 18, 2014
box2dplugin.cpp Allow using a different name for the static import Dec 23, 2014
box2dplugin.h add qbs project file for both box2d and box2d-lib Jul 17, 2015
box2dprismaticjoint.cpp Fixed up the RevoluteJoint Apr 27, 2014
box2dprismaticjoint.h Fixed up the PrismaticJoint Apr 27, 2014
box2dpulleyjoint.cpp Corrected some filenames in header comments Jan 2, 2016
box2dpulleyjoint.h Corrected some filenames in header comments Jan 2, 2016
box2draycast.cpp Fixed compile Apr 27, 2014
box2draycast.h Simplified raycast API Apr 21, 2014
box2drevolutejoint.cpp Fixed problem with setting revolute joint limits. Nov 8, 2015
box2drevolutejoint.h Fixed up the RevoluteJoint Apr 27, 2014
box2dropejoint.cpp Corrected some filenames in header comments Jan 2, 2016
box2dropejoint.h Fixed up the WeldJoint Apr 27, 2014
box2dweldjoint.cpp Fixed up the WeldJoint Apr 27, 2014
box2dweldjoint.h Corrected some filenames in header comments Jan 2, 2016
box2dwheeljoint.cpp Corrected some filenames in header comments Jan 2, 2016
box2dwheeljoint.h Corrected some filenames in header comments Jan 2, 2016
box2dworld.cpp Fixed crash when contact events are disabled. Nov 9, 2015
box2dworld.h Allow to avoid setting Body.world if there is only one World Feb 21, 2015
qmldir Added classname entry to qmldir file Aug 6, 2015

README.md

QML Box2D plugin

The goal of the qml-box2d plugin is to expose the functionality of Box2D (C++) as a QML plugin in order to make it easier to write physics based software in QML.

This plugin is meant to be installed to your Qt/imports directory, or shipped in a directory of which the parent is added as import path.

INSTALLING

qmake make make install (goes to Qt's import path, run with sudo if necessary)

The 'make install' step will copy the qml-box2d Box2D plugin into your Qt installation. Example: If you have a Qt installation of: /Users/user/Qt5.10/5.10.0 the plugin will be in: /Users/user/Qt5.10/5.10.0/clang_64/qml/Box2D.2.0 This example is a Mac path, on other platforms you will see different paths and compilers.

RUNNING THE EXAMPLES

You can run the examples launcher from a Terminal/Cmd prompt with: qmlscene examples/ui.qml

(You need to be in the root folder of qml-box2d.)

DEPLOYMENT

The standart plugin (dynamically linked) runs well on Mac, Window and Linux. The qml-box2d plugin can be linked statically to run on both iOS and Android.

USING QT CREATOR

For running you can use a "Custom Executable" configuration set to run "qmlscene" with the right parameters.

When you have write permissions to Qt's import path, it can be convenient to add a deployment step to your run settings:

  • Go to Projects -> box2d -> Run Settings
  • Choose Add Deploy Step -> Make
  • Enter "install" under "Make arguments"

This will make sure that before running, the version of the plugin is updated in Qt's import path.

EXAMPLE SCREENSHOTS:

(These screenshots have been done on an iPad Air)