Managing Collisions in JBullet?

Yet another JBullet question for you experts out there:

I’m trying to figure out how best to manage collisions with game objects now. I thought I had it, but it looks like JBullet doesn’t support GhostObjects yet. I’m now trying to use Callbacks to properly flag my game objects as having “collided” with one another. Unfortunately, I haven’t been able to find any sample code that shows how to do this. Could someone please steer me in the right direction?

Are callbacks the best to use? Can I use callbacks to flag my game objects somehow? (Currently I store a reference to the RigidBody in each object)

Or should I loop through the manifold points each frame and try to figure out which point is related to each game objects? (yikes!)

For an update:

In order to prevent constant looping through my objects in order to find what collision belongs to what with a ContactProcessedCallback, I now create a hashMap to link all RigidBody objects to all Entity objects (my custom game objects). I then have the ContactProcessedCallback report back to the entity manager to query the HashMap and flag my game object as “colliding.”

Is there a more efficient way to do all this? Or have I gotten it?

Ummm… I think I found where all of my “issues” with JBullet are coming from. Looks like Character Controllers don’t exist in the port yet. I’ve been trying to move a character around on the screen, but without controllers, it just makes everything go haywire. I see vehicle controllers listed in the javadoc, any plan on getting character controllers in there?

I’ve just ported it. I have a little cleanup to do and I’ll send the code to jezek2. Have a look at the sticky JBullet thread: http://www.java-gaming.org/index.php/topic,18035.msg168653.html#msg168653.

Hopefully the code will be accepted.

Awesome! Thank you!