[Odejava] Ode.spaceCollide ?

Hi,

I’m trying to design a new simulation with OdeJava’s low level access. I’ve been looking through the example in “LowLevelApi.java,” but can’t figure out how to do space collisions.

In the code, under the “step()” method, is has a commented call:

		// Call collision methods for given space
		//Ode.spaceCollide(spaceId);

What should go here instead to make the collisions work?

Thanks for any help! :slight_smile:

I’ve managed to get a lot of it done, but have hit a snag: when I try to use getContactIntBuf(), declared like this:

protected native ByteBuffer getContactIntBuf();

I receive the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: getContactIntBuf
...

but odejava.dll is in my system32 directory! Neither the release or the debug version will work.

It means that your odejava natives do not match the java part. Have a look into JavaCollision for the correct calls.

As an update, I ended up using a DLL export viewer on the odejava dll to discover that the exports for “spaceCollide” are bound to the “JavaCollision” code in the OdeJava package. Therefore, even if I had copied the script directly from JavaCollision, it would not work, because it would not be part of the correct package with the correct name! These exports really should be modified to allow any code to use them. I managed to create a JavaCollision replacement script that overwrote the real JavaCollision in order to provide me access to the functions that I needed. However, since this is really just one big hack, I ended up using the high level API in the end. Thanks anyway!

glad that it works :slight_smile:

They already are, in the newest cvs version - have a look into the odejava-jni module.