[ODE] Suitability to my application

Nate W coding at natew.com
Mon Aug 26 11:18:01 2002


On Sat, 24 Aug 2002, [iso-8859-1] David Wills wrote:

> [...] I would have thought that applying a force directly through an
> object's centre of mass should result in pure translation, but what
> often happens is the object falls over and seems to begin rolling
> uncontrollably [....] Now this may well be the correct response (maybe
> it has something to do with the collision contacts the object is
> making with the ground mesh), but it's not much use when I am trying
> to get a simple translation..

If the object is resting on the ground, applying a force through it's
center make cause it to translate, but may cause it to tip over, depending
on the friction between the object and the ground.  With a lot of
friction, for example, you might get better results by applying the force
to a point somewhere between the contact and the center of mass.

What do you mean by "rolling uncontrollably?"

If you want to constrain an object's motion to a simple translation, try
adding a slider joint between the object in question and the 'static
environment.'

> I guess what I am saying is, although I want real
> physics in that the character can interact (eg roll
> boxes realistically etc), I also need to be able to
> restrict the physics of some objects fairly heavily so
> that it is easy for a player to control etc..

It sounds to me like what you're looking for is not-quite-realistic
physics... but ODE, by default, provides as-realistic-as-possible physics.  
But, I'd wager that you can get what you want by doing some
not-quite-realistic things at the application level, for example adding
sliders or other joints to constrain motion to keep things easier to
control.

> It is very easy to make the integrator go unstable and
> assert if I change variables manually (obviously), but
> is there simple ways to constrain things like the
> rotation objects can undergo on certain axes but still
> be able to rotate on other axes and move freely
> otherwise??

It sounds to me like what you're looking for can be achieved with a joint,
where one 'end' of the joint is attached to a body, and the other 'end' is
attached to the static environment.  Or, depending on what kinds of motion
you want to constrain, perhaps a chain of joints with an intermediate body
or two.  (Coincidentally, it's not unusual for joints to be referred to as
'constraints' in the literature.)

> Sorry if that's a bit long winded, I'll try and
> explain a bit better if it's not clear what I mean..

I think you can get ODE to do what you want by doing some extra work at
the application level (I mean, without changing ODE itself).  The only
catch is that if it requires many joints to get the results you want, you
might end up hurting performance.  Only trial-and-error will tell you if
that's actually going to be a problem or not.  Depending how non-realistic
you want things to be, you might end up with a situation where you'd be
better off writing some non-realistic physics code from scratch with
non-realistic motion in mind from the start.  

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com