[ODE] math question

Anselm Hook anselm at hook.org
Wed Jul 16 14:09:02 2003


have to agree with Brian Bell here - some of these questions are probably
best for say #ode irc.freenode.net ... or some kind of 'lighter' forum...

 - a

On Wed, 16 Jul 2003, Roel van Dijk wrote:

> I don't really understand your question. Do you want to know where a body will
> be the next simulation step? In that case you simply add the body's velocity
> vector to it's position vector. You have to scale the velocity vector by the
> step time ofcourse.
>
> dBodyID body;
> ...
> dVector3 pos = dBodyGetPosition(body);
> dVector3 vel = dBodyGetLinearVel(body);
> // you have to guess the time step
> for (int i=0; i<3; i++) vel[i] *= timeStep;
> dVector3 nextPos;
> for (int i=0; i<3; i++) nextPos[i] = pos[i] + vel[i];
>
> // a vector form the current position to the next position
> dVector3 curToNext;
> for (int i=0; i<3; i++) curToNext;i] = nextPos[i] - pos[i];
>
> You could do the same for the rotation of an object.
>
> Roel
>
> On Wednesday 30 July 2003 20:00, Alex Hetu wrote:
> > Hi guys,
> >
> > I'd like to find a way to know exactly how far a body could move from its
> > current position during the next simulation step. Assuming that there would
> > be no contacts at all, I would need either the next position or a simple
> > vector that would describe the translation from the current position to the
> > next. Anyone with a solution? :)
> >
> > thx,
> > Alex
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>