I'm trying to get a pinwheel spinning that feels natural and accelerates correctly. I have a body and then a propeller attached to it with a revolute joint. When you touch it I use a mouse joint to let you spin the fan by swiping. However, since you want to make it go a fast as possible, I need to be prepared to handle another swipe on the same sprite in short order.
Using the frequency and damping ratio I'm getting pretty close (feels better on iPad than iPhone at this point):
local jointDef = b2.createMouseJointDef(groundBody, touchedBody, x, y, 100000, 1.5, 0.0); |
What I'm trying to is make sure that when you touch the sprite again and reconnect the mouse joint that it doesn't steal too much velocity from the fan so that the secondary swipe adds to the angular velocity.
Has anyone done this or know of any examples that might be helpful?
Comments
I just don't know your exact goal, but you could simply check the length and speed of a swipe and apply it as angular velocity in correct direction?
I haven't seen many examples that use the damping and frequency, so I've been experimenting with different values. On the iPad the settings above feel pretty natural, but on the iPhone it's not quite right.