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
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