Ode for Jme

Hi Jani,

Like to use Ode with Jme and have a few questions which you might be able to help.

How does the collision detection in Ode interacts with the one in Jme.

A while back you were looking (I think) to do a Jme toolkit for the engine. Is this done.

How can I use Ode in Jme? ( say do a bouncing ball or simulate some planks of falling on collision).



Since I began thinking of physics in jme i looked into ode some days ago, too.

As far as I understand, if you use ode, you no longer use collision detection in jme itself. You create all objects in ode (plus the appropriate TriMeshes and the likes in jme), place the ode objects in spaces and the likes, add them to the world, add your joints, do all calculations in ode and after having performed a world simulation step, you read the current translations/rotations from the ode objects and set them for your jme objects, which are only for display.

I would be interested in this issue, too. Currently I’ve written my only cheap physics simulation for my current purposes, but I would like to delve into ode deeper. I only feel my knowledge of jme currently is not good enough.

Correct, ode will take care of the collisions using OPCODE. Which is not bad, because it’s much more accurate than ours right now anways.

As you guys work with ode and jME, feel free to let me know ways you see that we could integrate the two (or allow for easy integration) in the future. That is, providing interfaces so the user can just implement it and it works. etc.

Ok, did Jani write an example we can use? I dont mind looking through an example to base my work from. Any ideas if there is one around?


There was one he wrote very early in odejava’s life. The falling blocks. It used to be in the source directory (there was a jme, xith, openmind directory). I don’t know if it’s still available.


I looked around and cant find it. Do you know where it is?


I was working with this examples (the falling blocks) but there is a new version (0.2.2) and now I´ve been worked to build some like the Xith3D examples.

There is a very fine example (CarTerrainExample). The mrs. Jani Laakso developed a scene with a car and a terrain builded by a ASE file.

I think we need to work in this way…

Let me know if someone working to developer classes as JmeToOde and OdeToJme…

I built ODE a couple of weeks ago & their were no jme examples :frowning: only Xith.

Just to say I’m interested in using it at sometime in the future with JME.

Well if you read through odejavas doc, you find the following:

To use a graphics package with Odejava - all that is needed is to implement the DisplayTransformable interface with regards to the chosen display library. All that interface specifies is a way for setting the translation and rotational components of the display object so it can be synched to the ODE one.

In addition to implementing DisplayTransformable, display libraries can have a utility class which is given Odejava GeomS and BodyS and can automatially generate appropriate representations of them in the display library using the Geometry properties.

I interpret this in a way that you basically have to implement this single interface and from there on you should have a basic binding between the two libs.

Thats correct as ODE consider itself as a mathematical library with no display classes. It might be useful to check out the xith code for ode to find out how its done and then try to do it with jme.


"tomcat" wrote:
Thats correct as ODE consider itself as a mathematical library with no display classes. It might be useful to check out the xith code for ode to find out how its done and then try to do it with jme.

Here's a "forward" from a personal mail that I like to share with other jME users also.

Please read this thread, this has the right information you need:

Especially this class is what you should exploit when you want to plug in jME and Odejava together:

Basically you just create one 3D object for each Odejava object.

E.g. for Car you do the following

1. create following Odejava (physical) objects:
-1 box (chassis)
-4 spheres (wheels)
-4 2-way hinges

2. create following jME 3D (visual) objects:
-1 box
-4 cylinders (wheels)
Note: in here you do not render suspension 'hinges'.

Now do the followin in your game loop:

1. step Odejava simulation ahead

2. update jME 3D objects based on Odejava objects position and orientation

3. render jME scenegraph


Actually the display package on Odejava helps you to bind physical objects into visual objects.

Hope this helps..


I really should spent half a day with jME again using latest Odejava but I'm very tight up with other work..

Next todo list with Odejava related projects is to integrate latest ODE into Odejava, it has some extra features and especially good performance boost for game oriented simulations.