ODEjava+Xith3D: how to begin

Hi William and All!
I’m rather strong in Xith3D and already have some commercial projects.
Then I want to add some phisics effects to some of my projects (walk, avatar object interacion etc.).
I did that:

  1. Download odejava-0.1.1-full.zip (Is this latest? It is on the /old folder :))
  2. Download ODE API documentation from http://www.odejava.org/javadoc/
  3. Closely read boxDemo and carDemo.

Unfortunately, this all are not useful to begin ODE integration with my projects, because of:

  1. API documentation and examples have not explanation how I must init ODE world:

world = new dWorld();
space = new dHashSpace(Ode.getPARENTSPACEID_ZERO());
contactGroup = new dJointGroup(0);
jointGroup = new dJointGroup(1);
world.setGravity(gravity.x, gravity.y, gravity.z);
// Setup callback function
Ode.setWorldID(world.id());
Ode.setContactGroupID(contactGroup.id());
Ode.setSurfaceMu(1f);
Ode.setSurfaceBounce(0.14f);
Ode.setSurfaceBounceVel(0.1f);
Ode.setSurfaceMode(Ode.dContactBounce | Ode.dContactApprox1);

Where I can read some little explanation about using ODE World, JointGroup, dHashSpace etc.?
Is tutorial anywhere?

  1. In API documentation I see classes: World, Body. But in examples: dWorld, dBody. How I must understand this?

  2. What difference between Body.addForce() and Boby.setForce() ?

And many more questions about many classes and method because of API documentation no explain how to use their.

Yeah. What you gotta remember about javaode is that its just a wrapper for ODE.
the documentation found in
www.ode.org
is essentail reading.
That will explain how to use the bodies.
Its then just a matter of working out what the wrapper class is. Its fairly obvious.
Things with a d prefix. are what the original names are of methods. And would be what you would use if you were writing C code. Javaode exposes all these methods directly as is. Thats called the low level API and is in the class Ode as static methods.
As these arn’t really very nice, the high level API is an abstraction of these method, in an attempt to OO the ODE API. Really you should not need to touch the low level API but sometimes if you need to do something obscure its helpful.
If I had to guess at the difference between set force and add force, I would say set force dictates the total force applied to a body for a time step. Add force which I use often just adds a force to be applied at a timestep. You average body may have lots of forces applied in different directions all at the same time.
Alot of these forces you won’t be even creating. Things like collisions and stuff will be adding forces to a body to make it react convincingly. Don’t use setForce.

Thanks for your answer! This is something useful…

Make sure you get the latest natives here: https://odejava.dev.java.net/servlets/ProjectDocumentList?folderID=1810&expandFolder=1810&folderID=0

And grab the rest from CVS and compile (just call ‘ant’).

Please don’t use the old version, there have been many non-backward compatible changes!

We should upload a more recent snapshot.

Will.

And where do I get this “ANT”-Tool? I hope it’s free?!?

ANT? Uh oh, where have you been.
ANT is an apache tool. Its reads an XML build file. The build.xml and then compiles things and stuff for you.
Its much better than Make files becuase its corossplatfrom blah blah.
Yes its free.
Look for apache ant.
Pretty much everyone uses it nowdays.

http://ant.apache.org/

compiled (no need for ant) snapshot here:

https://odejava.dev.java.net/servlets/ProjectDocumentList?folderID=1843&expandFolder=1843&folderID=1843

grab natives from here:
https://odejava.dev.java.net/servlets/ProjectDocumentList?folderID=1810&expandFolder=1810&folderID=1843

to use with that snapshot.

Will.