# [ODE] movement force conversion

Piotr Obrzut piotr_obrzut at o2.pl
Mon Apr 11 23:58:09 MST 2005

```Hi,

11 kwietnia 2005 (22:55:29) Jon wrote:

>> new_ang_vel = (new_angle - old_angle) / delta_time;

JW> Don't divide desired velocity by delta-time, because your
JW> desired velocity is not dependent on the time step size.
JW> You can instead multiply by a response constant K, which
JW> you can tune.

It is not the time step used for ODE, it is time connected with
animation (time from last animation update). I use this delta_time b/c
I want my model to be in animation time domain. However this couse
some problems with optimization mechanisms which turns off animation
when model isn't visible (physics isn't updated and I my model fall
over and generaly looks strange). I plan to resolve this with simple
AI which will be responsible for keeping my model in right position
(based on factors like "feet box" collider or pelvis position, it will
do some specified by special script things).

JW> Also, this way of getting angular velocity will favor the
JW> three cardinal axes, because it's a velocity "box" instead
JW> of a single ("sphere"-morphic) vector.

Perhaps I don't understand you, but anyway I'm geting angles just
from proper transform now (from old to desired position), now I know
that I shouldn't just substract euler angles :) (thanks to SJS).

>> torque = Inertia * (new_ang_vel - old_ang_vel) / delta_time;

JW> What's the value of Inertia? And if it's the inertia tensor,
JW> what reference frame is it in?

It is inertia given from body which I'm trying to control - it is
right (I think).

Generaly now everything is working fine when apropriate joints are
set, beside that now movement looks a bit robotic.

Oh and just curious:
when I don't use any joints then my model looks like possessed by the
demon, generaly you can see that it is trying to walk but its fingers,
and head goes in strange positions (it sometimes hits another model
which is pretty far away) - it is b/c of some numerical errors?
Or it should be like that?

BTW Is ODE FPU safe? I'm using MASM writen function which do a lot on
FPU and sometimes when I use it after body settings, outputs differ a
bit from C++ writen, similar function. It is certainly not bug in this
function, could it be b/c of ODE? It is not so important b/c the
diferences are very small but I just want to know.

Thanks for help!

--
greetings,
Piotr Obrzut

```