Jump to content

move a body from positon A to B?


Recommended Posts

Posted

how can i do that? i think a way is to calculate the force and add to the body, but i don't know how to calculate it.

Posted

First of all, it can be useful: addForce() to BodyRigid instance

Second, I have similar task, but not succeed yet, cause I powerless in physics :rolleyes:

For example:

vec3 p0 = // destination position
vec3 p1 = // current body position

vec3 force = (p0 - p1) * 128.0f - body.getLinearVelocity() * 32.0f;

body.addForce(force * body.getMass());

×
×
  • Create New...