Flipper mechnic

Jul 11, 2010 at 6:53 PM


Is there a simple way to make a flipper (Like in a pinball machine) using the farseer engine?


Haven been messing around with ApplyAngularImpulse but the ball makes the flipper move, i want the flipper to be static but still apply rotation to produce the flipper action.



Jul 12, 2010 at 3:32 AM
In FP3 you can make your Body into a Kinematic body, which doesn't get affected by other dynamic bodies, it just moves based on your inputs. FP2.x doesn't have this, so you would need to be more clever if you use that version.
Jul 15, 2010 at 3:12 PM
I uploaded a patch that has this functionality. It's a straightforward port from Box2D r115 and uses FP3. You might get something out of it. http://farseerphysics.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=131147
Jul 15, 2010 at 7:52 PM
Actually I would recommend keeping the flipper as a dynamic body. If you look at a real pinball machine, you'll notice that pressing the flipper button is actually applying a constant torque on the flipper, not an impulse. Also, the ball still has an effect on the flipper, but because the torque is constant and high relative to the inertia of the ball (is that the right way to say it?), the effect of the ball on the flipper is small compared to the effect of the flipper on the ball.
Jul 17, 2010 at 4:35 PM
I did this just a few weeks ago and this is the approach that I used. To create the flipper, I added 2 joints, FixedRevoluteJoint to hold it in place and FixedAngleJoint to set the angles. If the player activates the flipper, set the FixedAngleJoint.TargetAngle to the flipped angle, otherwise it is set to the resting angle. Don't forget to turn down the FixedAngleJoint.MaxImpulse to something realistic. Cheers!