c++cocos2d-xbox2drevolute-joints

Fire event when reach certain angle in revolute joint


I need to develop cannon game using box2d and cocos2dx. Cannon is divided into two parts

I have searching in SO and i found This Solution which calculates the angle each step, this can be used but it needs more calculations that i feel lazy to do.

Does the callback method for notifying motor speed or certain angle has been reached exists ?


Solution

  • Schedule a function to check your conditions on each frame. When you don't need the checks any more - unschedule the selector, then reschedule when needed again. As far as I know there are no callbacks for your exact task.