Adding the Box2D physics engine to AndEngine is easy. Simply obtain a copy of the AndEnginePhysicsBox2DExtension
project (found at https://github.com/nicolasgramlich/AndEnginePhysicsBox2DExtension) and link it into your own project in the same way as you added the AndEngine project to your project before. Add the libandenginephysicsbox2dextension.so
library found in the /libs/armeabi/
folder of the extension project to the same folder of your own project if it's reported as missing during the running of your project. Normally, this copying is done automatically, but you may have to do it manually.
The first real challenge is making the Box2D physics engine work with the 3D models for which we integrated code in the previous chapter. To this end, we have to modify the following files:
MainActivity.java
Actor3D.java