Throw object after some interval

Hi,
I have a clutter-box2d application.
As we throw the object using mouse and it simulates the physics like collision and gravity.
Similary i want to throw an object after sometime of my launching the appllication as if it has been thrown by using mouse (As i dont want to use mouse for some specific reason).

Can i get such effect?

Thanks.
How about ApplyLinearImpulse?
Acutually i am using ClutterActor for creating the object and setting it to dynamic body...i didnot found any method that sets the impulse...

Any other way...i am using clutter-box2d api

Thanks
https://github.com/clutter-project/clut ... -box2d.cpp
Look at line 53.

looks like you call that to get the clutter_box2d_child class. Then look here at line 106:
https://github.com/clutter-project/clut ... 2d-child.h

looks like you pass your actor,child class, and vector to set velocity. Not seeing apply force anywhere but you might be able to fake it using get velocity.


Never used this library so I'm just sorta guessing. Good luck!
We can throw objects by programming without the use of mouse. It was achieved using mouse joint.
Follow the below steps to do the same:
1. Select some reference point for target for mouse joint with the body you want to throw.
2. Built up mouse joint.
3. Update the target point in iterations.
4. The body will move because of mouse joint with it.
5. Suddenly break this joint, the body will simulate like a natural (mouse) throw due to its momentum.

🙂

Regards,
Pankaj

Original thread: https://box2d.org/forum/viewtopic.php?t=8814