Home | Tutorials | Wiki | Issues
Ask Your Question
0

Apply force to object through plugin

asked 2019-09-13 05:50:13 -0600

lolistic gravatar image

Hi,

is there a way to apply a force to objects/models.

There is "SetLinearAccel", but I can't find any command for applying a force.

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-09-23 02:51:07 -0600

lolistic gravatar image

From my own experience, it seems like the answer is that one can't apply force to a model/object, only a link. This can be solved by getting the desired link from the model, where the names of the links can be changed in the .world file:

this->model->GetLink("body")->SetForce(ignition::math::Vector3d(1.0, 0.0, 0.0);

The same goes for applying torque:

this->model->GetLink("body")->SetTorque(1.0, ignition::math::Vector3d(1.0, 0.0, 0.0);

Hope this helps someone else.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-09-13 05:50:13 -0600

Seen: 63 times

Last updated: Sep 23