I’m half-working on a game where you flick coins across a green felt table and they knock into others, kind of like billiards would be in Flatland.
There’s no “game” implemented yet but the mechanics all work, except I’m not mathed enough to figure out what kind of angular velocity to apply to the coins so they would realistically spin (slightly) as they ricochet off of the sides and other coins.
Any thoughts on what the equation could be to implement this? I’ve played with the code and can get the physics body to spin (manually) and match that same rotation on the coin sprite that is covering the body, but that’s all done manually. I’m lost mathematically as to how to make it happy organically.
In principle, you should measure the finger speed vector V when he leaves the coin after pushing it.
Then project it on the tangent to the circle at that contact point, to get tangential speed Vt.
Then the rotation speed is w = Len(Vt) / radius / deltaTime, in Radian per second.
Radius is the coin radius.
But you could use a simpler way to get the good result: make a circle physics body about your finger tip size (5 mm diameter?), Disable its rotation, and and force its position to the touch position => the physics engine will automatically manage rotationnal effects (on the objects they are set to on) when the finger collides with the coins.
Thanks @Jmv38, that’s a nice little hack that should yield a “good enough” result for the minor icing I’m trying to put on this cake. The physics will take care of collisions but I was stuck on how to get that finger flick rotation. Thanks!