libgdx/libgdx — pull request #1595 by xoppa (2014-03-30 23:11:18+00:00)
Title: Bullet: update to SWIG 3.0

Don't look at the diff, it's huge and might crash your browser, instead look at the individual commits.
This breaks existing API (although it only requires fixing imports).

A week or two ago [SWIG 3.0](http://sourceforge.net/p/swig/news/2014/03/swig-300-released/) is released. The (for the bullet wrapper) most important change is that nested classes are now supported. This is great, because bullet is full of nested classes and up until now we had to manually create a workaround for each nested class. This PR removes all previous workarounds and relies on SWIG to implement those, including all nested classes which where previously not included in the wrapper.

This means that some classes are now moved to be a subclass, meaning you might need to fix your imports. It would be possible to fall back to the previous behavior (`flatnested`), but that might cause naming conflicts and I think it's also cleaner this way.

There seems to be a problem though with directors (callback classes) where the method contains a nested class as an argument. It looks like a jni method signature problem (in `jenv->GetStaticMethodID`), I haven't found a solution for this and therefor "flattened" some director classes of btCollisionWorld (see `jni/swig/collision/btCollisionWorld.i` for details). In practice this means that you don't have to fix the import of these classes.

Someone decided that it would be a good idea to extend stl exceptions in swig. I don't think its worth it to workaround that (would get messy), instead we might as well deal with it and enable stl in the android build. For now, I simply modified `Application.mk`, but of-course that will overwritten when BulletBuild is run. It might be better to add e.g. an option to jnigen to enable stl. Note that actual required changes dont have to match my changes to application.mk (e.g. stl/gnu/static, stl might imply exceptions, etc). Compiling bullet for android takes ages, so I haven't compared each configuration.

Tested on windows and android.