[ODE] dBodyAddForce

Mauro G. Todeschini mauro2006todeschini at itia.cnr.it
Thu Jul 13 09:01:16 MST 2006


Lubomir Kazasov wrote:
> hello
> 
> i want to apply a force to a trimesh. the force is different on every
> point. can somebody explain me, how
> dBodyAddForce works. I understand that the function takes a BodyID, a
> force-Vector3 and Vector of Positions.
> But what happens after that? I need the new positions of the points
> after applying the force on every point. Where are the new
> positions stored.
> 
> Now I'm making something like:
> 
> for (int k=0; k < TrimeshVertices.size(); k++)
>                 {
>                         dBodyAddForceAtPos(rigid_model.body, force[k].x,
> k.force[k].y, k.force[k].z,
>                                 TrimeshPoints[k*3],TrimeshPoints[k*3 +
> 1],TrimeshPoints[k*3 + 2]);
>                 }       
> After that i need the new positions of the points of the trimesh to copy
> them to another part of the code, that renders the scene.
> Are the new positions stored again in
> TrimeshPoints[k*3],TrimeshPoints[k*3 + 1],TrimeshPoints[k*3 + 2], or
> somewhere else?
I never used this function but I'm quite sure that trimesh points are
relative to the body frame (when you attach a trimesh geom to a body).
So they don't change when you apply a force (I mean that they don't
change in body coordinate system).
They change in world coordinate system and to get their coordinates in
this system you have to use body position, rotation, position of the
trimesh points in body coordinate system, and the function
dBodyGetRelPointPos .

Bye

P.S. I know It is a quick answer but It may help :)


More information about the ODE mailing list