Physics bodies don’t just have to drift around on their own. They can also be joined together in a variety of ways. Here, we’re going to change our RCWPlungerNode so that it joins the ball to the top of the plunger when the touch begins. That joint will hold the ball in place no matter how fast the plunger moves. When the action runs to snap the plunger back in place, we will break the joint and then launch the ball by manually applying a force to it, depending on how far the player pulled down the plunger.
First, we need to change our method declarations in RCWPlungerNode.h. The plunger needs to know more details to do its new job. We have to pass it the ball and the physics world.