I have a Box2d Body with a fixture attached, and I would like to move the Body by swiping on the screen. The Body should move according to the direction and “speed” of the swipe, with a faster/longer swipe applying a larger force on the Body.
How would you implement this in Libgdx? I’m stuck on the Input aspect (what to do with the InputProcessor).
Update: Well I’ve just tried MouseJoints and they’re not what I’m looking for. I’ve decided to try applying an impulse to the body on touchDragged, but now I need a way to limit the velocity of a Body so that it never goes above a maximum.
If I check whether the velocity exceeds the maximum before applying an impulse, after the applied impulse, the velocity can still go above the max.