So basically I'm writing a game where main component resembles a balance scale and I'm not really sure what is the best way to design it with Box2D.
I am a new Box2D user.
What I have come up with is something like this:
http://i.imgur.com/OAS6HRy.png
I am using kinematic body as the center of the scale which is connected to the top platform with RevoluteJoint.
I did this so the top platform ignore gravity and I am using setLinearVelocity to move the scale left and right. Also I set the angle limits to .5.
I have made 2 smaller platforms, on which I would put other box2d objects to simulate balance scale. I used Distance Joints. (edit: Rope joints work slightly better)
The problem with those is they fly around too much when I move the whole thing. I want them to be perpendicular to the ground all the time. Which joint type am I looking for? Or is there some other way to ignore Velocity?
edit: I fixed that by setting the velocity of lower platforms to the same of top platform 🙂 it almost does the job
Am I thinking the right way or is there some major flaw?
Thanks for help!
I am a new Box2D user.
What I have come up with is something like this:
http://i.imgur.com/OAS6HRy.png
I am using kinematic body as the center of the scale which is connected to the top platform with RevoluteJoint.
I did this so the top platform ignore gravity and I am using setLinearVelocity to move the scale left and right. Also I set the angle limits to .5.
I have made 2 smaller platforms, on which I would put other box2d objects to simulate balance scale. I used Distance Joints. (edit: Rope joints work slightly better)
The problem with those is they fly around too much when I move the whole thing. I want them to be perpendicular to the ground all the time. Which joint type am I looking for? Or is there some other way to ignore Velocity?
edit: I fixed that by setting the velocity of lower platforms to the same of top platform 🙂 it almost does the job
Am I thinking the right way or is there some major flaw?
Thanks for help!