O'Reilly logo

LibGDX Game Development Essentials by Juwal Bose

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using bullet physics

The Bullet class is a 3D collision detection and physics library that is similar to Box2D (http://bulletphysics.org/mediawiki-1.5.8/index.php/Main_Page). LibGDX has a wrapper for Bullet, but it has a steep learning curve due to the JavaCPP bridge. Please check out the official Bullet manual at https://github.com/erwincoumans/bullet2/blob/master/Bullet_User_Manual.pdf?raw=true. The Bullet package is an extension and needs to be added manually. Follow the same process that you followed for Box2D with the following details, and refresh the Gradle dependencies.

Core dependency:

compile "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"

Desktop dependency:

compile "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-desktop" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required