Shared library from bullet

Post Reply
KnisterPeter
Posts: 5
Joined: Tue Jul 29, 2008 6:45 am

Shared library from bullet

Post by KnisterPeter »

Hi there,

I'll need a shared library from bullet, because I'll try to create a java binding throught JNI.
The problem with this are the different c++ styles in java and bullet which would not compile in one shared library. Therefore I'll need one from bullet and one for my binding.
I'll tried to set the Jamfile rules but do not have success. As there is very little documentation on jam I'll thought I'll write here and maybe anyone could give a hint on how to do shared linking?
jezek2
Posts: 40
Joined: Fri Jan 11, 2008 8:33 am

Re: Shared library from bullet

Post by jezek2 »

Hi, have you seen JBullet? It's pure Java port of Bullet (not binding).

If yes and wish to have binding as well, I initially did a binding, but I didn't like to have to create multiple builds for all platforms (and testing them), wanted tighter integration with Java to use internal stuff and generally provide more Java-like library. I had no problems using JNI and Bullet in the same library (though I've tested it only on Linux). What are your problems exactly?
KnisterPeter
Posts: 5
Joined: Tue Jul 29, 2008 6:45 am

Re: Shared library from bullet

Post by KnisterPeter »

I have problem with linking in linux with either gcc or g++.
When choosing one then the bullet symbols are not found, if I choose the other the java symbols are not found.

I've seen JBullet and would like to use it, but I need collada support and as far as I have seen there is currently no support for it in JBullet, is it? Maybe I could contribute something to the port if you accept patches.
jezek2
Posts: 40
Joined: Fri Jan 11, 2008 8:33 am

Re: Shared library from bullet

Post by jezek2 »

KnisterPeter wrote:I have problem with linking in linux with either gcc or g++.
When choosing one then the bullet symbols are not found, if I choose the other the java symbols are not found.
Did you use extern "C" for JNI functions?
KnisterPeter wrote: I've seen JBullet and would like to use it, but I need collada support and as far as I have seen there is currently no support for it in JBullet, is it? Maybe I could contribute something to the port if you accept patches.
Currently no support for COLLADA has been made. Would be nice if you port it, I can help you if you encounter any problems. Personally I would look at XPP3 library (which is supposedly one of the fastest and effective XML libs out there) to see if it's applicable for the task. Looking into Bullet code I see generated classes from COLLADA schema to access COLLADA's DOM, so maybe JAXB is better choice.
KnisterPeter
Posts: 5
Joined: Tue Jul 29, 2008 6:45 am

Re: Shared library from bullet

Post by KnisterPeter »

Did you use extern "C" for JNI functions
Yes, maybe that's the problem?
Currently no support for COLLADA has been made.
I'll try to port it appropriatelly. But first I have to learn bullet. :)


For XML parsing I would either choose JAXP since it is a std. interface, implement some sort of interface to implement for the xml parser of user choice with a default implementation (either xpp3 or jaxp).
jezek2
Posts: 40
Joined: Fri Jan 11, 2008 8:33 am

Re: Shared library from bullet

Post by jezek2 »

KnisterPeter wrote:
Did you use extern "C" for JNI functions
Yes, maybe that's the problem?
No, that's how it should be. Try posting error messages you are getting.
KnisterPeter wrote: For XML parsing I would either choose JAXP since it is a std. interface, implement some sort of interface to implement for the xml parser of user choice with a default implementation (either xpp3 or jaxp).
Sounds good for me, though I'm not using XML much, so I can hardly compare. From very quick overview I can't find if it provides also XMLPULL interface (or something similar) which is both good for performance and is programmer friendly (EDIT: looks like it provides it with javax.xml.stream). It doesn't matter much if you take DOM route though.

Anyway, choose what you think is best for it, I've just gave some hints :)
KnisterPeter
Posts: 5
Joined: Tue Jul 29, 2008 6:45 am

Re: Shared library from bullet

Post by KnisterPeter »

jezek2 wrote:
KnisterPeter wrote:
Did you use extern "C" for JNI functions
Yes, maybe that's the problem?
No, that's how it should be. Try posting error messages you are getting.
I'll try with JBullet first. If all work well I'll don't need my binding. :)
jezek2 wrote:Anyway, choose what you think is best for it, I've just gave some hints :)
If I have something to show I'll post it here, but it will need some time.
KnisterPeter
Posts: 5
Joined: Tue Jul 29, 2008 6:45 am

Re: Shared library from bullet

Post by KnisterPeter »

Hi,

I've decided to create an interface to the 3d engine i'm using. It's way to much work to create a colada parser.
Post Reply