Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am new at game development want to know that how can I implement bullet physics in libgdx. I searched lot of things on Internet but nothing found worthy.

share|improve this question
1  
This question is a bit overbroad for our format. –  Cameron Fredman Mar 9 '13 at 5:44
    
After studying the links given by Mr. Cameron Fredman I understand the basics of bullet physics but still in dilemma that how can i implement bullet physics in 2d game built in libgdx platform. I need some kind of sample code or tutorial which help me. –  Nishant Anindya Apr 2 '13 at 7:40

1 Answer 1

up vote 2 down vote accepted

As I mentioned in my comment above, this question is a bit overbroad, but here's the source code for the JNI bullet engine in libgdx. And here's the wiki. The Bullet User Manual is a pdf file located in the root of the Bullet Physics SDK, which might make a good place to start.

You'll need to add gdx-bullet.jar and gdx-bullet-natives.jar to your desktop project, and gdx-bullet.jar to your Android project. You’ll also need to copy the libgdx-bullet.so files from the extensions/gdx-bullet/armeabi and armeabi-v7a folders to your Android project’s libs/armeabi and armeabi-v7a folders of course.

And there's this from the google codebase:

Setting up Bullet with libgdx To use bullet physics in your project, you’ll need to add gdx-bullet.jar to your main project. Alternatively you can add the gdx-bullet project to the projects of the build path of your main project.

For your desktop project you’ll need to add the gdx-bullet-natives.jar to the libraries.

For your android project you’ll need to copy the armeabi/libgdx-bullet.so and armeabi-v7a/libgdx-bullet.so files to the libs folder in your android project.

Bullet isn’t supported for GWT at the moment.

Initializing Bullet Before you can use Bullet, you’ll need to load the libraries. This can be done by adding the following line in your create method:

Bullet.init();

There's a good deal more information at the links provided above.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.