Recast awesomeness for JME3

Continuing the discussion from Navmesh with Blender:

I’ve found a recast’s java port. Would it be “better” to use a port or directly use it as c++ with jni?. Would there be a huge performance difference?. Are there too many parts to use to be a jni interface feasible?.

I’ve never used it and I would like the opinion of people that is familiarized with the recast&detour library.

4 years ago I hacked my way into and around Recast. Was a nightmare. Don’t remember much. Version probably outdated too.

I suggest, try both - I think there’s a way to get automatic JNI from C code via something called “JNA” : Java Native Access - Wikipedia - never used that though.

The problem I see with the Java port: You won’t get the latest code changes made to the original C++ code. So you are stuck on a fork which may quickly fall behind in version number. Maybe I’m missing something here.

If the headers are not c compatible (that is, they use c++ features) you might look at GitHub - bytedeco/javacpp: The missing bridge between Java and native C++. It’s supposed to be capable of automatically generating a pure JNI binding to a c++ API. I’m currently messing about with applying it to assimp for another project I work on, and so far, it seems to do what it says on the tin, just assimp’s API is rather sprawling for a first attempt at something like this. I keep needing to pull in more header files :slight_smile:

@sailsman63, I already start/create a javacpp layer over assimp, as part of assimp for xbuf. It packaged as a independent sub-project.

assimp_xbuf/assimp4java at master · xbuf/assimp_xbuf · GitHub

Thanks for pointing this out, @david_bernard_31.

Looks like you have a subset so far. I’m a little confused… Are the mapping files hand written in your case, or are they the results of the parser? If the second, why are they checked in to source control rather then the presets file?

For the project I’m working on, I’ll need to create pretty much a full API mapping, as I’d like to make assimp the primary import/export processor for a modeling and animation suite.

@sailsman63, hand written (cleaner imho). I add binding, when I needed for my loader and when I understand it.
Fell free to reuse and to complete. (contribution welcome, I could extract the sub-project as a standalone project, if you plan to contribute). we can discuss on another thread, or PM or github issue).

@NemesisMate, If you need help with javacpp (my favorite vs swig, jna,…), you can ping me. I start to have some xp (assimp, raknet).

1 Like