Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
box2d swinging chain links never come to rest - Gideros Forum

box2d swinging chain links never come to rest

kamcknigkamcknig Member
edited September 2012 in General questions
Hi, I'm very new to Gideros, and pretty new to box2d too, though I am not new to programming.

I have an app running that has 7 chain links connected to each other with revolute joints, the chain is "attached" to the ceiling and at the bottom is larger square shape that is a chandelier connected to the end of the chain. I had to really play with numbers to get it to act how I wanted and I'm sure these numbers are probably not really what I want.

My first problem with setting up the fixtures/bodies:
Each of the links has a density of 20 and friction of .2 while the chandelier has a density of 1 and friction of .2. I had to play with those numbers because if I gave the default values then the chain link was stretchy. If I give the chandelier too much density it pulls on the links and eventually they just break apart.

My second problem:
I set it up so that on mouse_down a force is applied to the chandelier based on the angle to the mouse and how long you hold it down, this works fine, but when I let up the mouse the force stops being applied. This works and the chandelier is pushed away from the mouse when it's down but when you lift it the chandelier comes back down, but the problem is that the chandelier NEVER comes to rest. It continues swinging like a pendulum and never slows down. I'm sure it's most likely related to my first problem, but I just don't know :/

Anyone have any help?

Likes: larf

Tagged:
+1 -1 (+1 / -0 ) Share on Facebook
Sign In or Register to comment.