How to model a pinball paddle?.

I am trying to model a pinball paddle in Box2D and have not found a good solution.

I am using a revolute joint with limits. I apply a large torque on button press and a reverse force on release but then an object can easily move the paddle most of the time. If I apply a large force all the time, object will really bounce off the paddle because the reaction force is so large. Then I changed things to use a small maintaining force if the button is held and a small reverse force if the button is not held and things were better. Then I looked at the compute time and the paddles were consuming over 100% of the CPU even though nothing was happening. I think the paddles are bouncing on the limits causing many iterations on each cycle. I never see the paddle sleeping (blue).

I would prefer a model where a body changes from being a wall (i.e. fixed with only restitution) to moving, then becoming a wall again. This would also be useful to implement doors that may do something when opened but after that pretty much walls again. I hacked this model by changing some internal body variables and it works well, but it is still a hack.

Any suggestions would be appreciated.

Robert
Try making the paddle/door heavy relative to the stuff that hits it. You can use a joint motor instead of a raw torque. You can see a case where something with limits goes to sleep in the MotorsAndLimits test.
Thanks. This originally modeled a paddle with a motor as you suggested, but had some other issues. Going back now that I understand more of what is going on, it does work better.

Robert
I am trying this but with no success. My paddle just hangs down limply. I cant get the paddle to turn whatsoever using a motor.
I think it may have to do with me using a user defined image for the flipper.
Do I have to do anything special in the update routine to update the flipper image beside what I am doing already (see below)?
Do I have to do anything in the update routine to update joints?

bd = new b2BodyDef();
def = new b2BoxDef();
def.density = 1.0;
def.extents.Set(73/2, 12/2);
bd.userData = new FlipperIMG();
bd.userData.width = 73;
bd.userData.height = 12;
bd.AddShape(def);
bd.position.Set(314,544);
bd.rotation = 45 / (180/Math.PI);
body=m_world.CreateBody(bd);
body.m_mass=def.density;
addChild(bd.userData);

jd = new b2RevoluteJointDef();
jd.anchorPoint.Set(314,544);
jd.body1 = body;
jd.body2 = ground;
jd.enableMotor=true;
jd.motorSpeed = -1.0 * Math.PI;
jd.motorTorque = 500000000.0;

LeftPaddleJoint=m_world.CreateJoint(jd);


My update routine:

m_world.Step(m_timeStep, m_iterations);

// Go through body list and update sprite positions/rotations
for (var bb:b2Body = m_world.m_bodyList; bb!=null; bb = bb.m_next)
{
if (bb.m_userData is Sprite)
{
bb.m_userData.x = bb.m_position.x;
bb.m_userData.y = bb.m_position.y;
bb.m_userData.rotation = bb.m_rotation * (180/Math.PI);
}
}

Please help!
thanks.
jfabris's question is duplicated here:
viewtopic.php?f=8&t=909
See if this helps:

http://www.box2d.org/wiki/index.php?title=General_FAQ#Ensuring_Movement
jfabris seems to be using box2dFlash 1.4.3, so point 1 in the Ensuring Movement section doesn't apply, but point 3, waking up the body, is definitely a good idea.

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