Home | Tutorials | Wiki | Issues
Ask Your Question
0

How does Link::SetLinearVel(const math::Vector3 &_vel) achieve the link velocity?

asked 2019-09-27 07:57:31 -0500

kumpakri gravatar image

I thought that it would set non-physically real velocity to the link. But if I connect two objects -- A and B, and assign a velocity to object A using this method, the velocity inside the simulation seems to change with physical properties of the object B. For example mass, friction or the spring stiffness of the connection. Is there a way how to achieve a perfect velocity match?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-02 04:47:47 -0500

kumpakri gravatar image

updated 2019-10-02 04:48:56 -0500

So the velocity is directly assign as the object variable lvel, but on every step the ODE physics engine computes the movement of the object by not only taking this velocity, but also considering the forces acting on the object

rhscurr[RHS__L_MIN + j] = -(b->facc[dV3E__AXES_MIN + j] * body_invMass + b->lvel[dV3E__AXES_MIN + j] * stepsizeRecip);

where b is the body (object), b->facc is the accumulated forces and b->lvel is the assigned linear velocity. That's why the object does not maintain the assigned velocity if there is another massive body being pulled by it.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-09-27 07:57:31 -0500

Seen: 13 times

Last updated: Oct 02