As I needed a 64bit version of the natives for jME Physics 2 stumbled over some 64 bit problems with odejava:
The collision callback uses an IntBuffer to pass native addresses to the java part. This obviously does not work as java int is 32 bit and native addresses are 64 bit.
To fix this I changed the following:
- Java part:
- all contact related IntBuffer vars to LongBuffer
- all geom and body ids from int to long
- Native part (odejava.cpp)
- all long to jlong (to have 64 bit buffers on 32 bit systems, too)
- Java_org_odejava_Odejava_getNativeAddr from
return **(jint**)&swigCPtr;
to
return void* id = (*(void* *)swigCPtr);
return (jlong) id;
Maybe someone want to apply this on the odejava sources to allow for runnig on 64bit systems.