Chain link chandelier never comes to rest

Discuss issues specific to the Flash/AS3 port of Box2D
kamcknig
Posts: 6
Joined: Fri Sep 14, 2012 10:37 am

Chain link chandelier never comes to rest

Postby kamcknig » Fri Sep 14, 2012 10:43 am

I am making a chandelier that consists of "chain links" and then a base that hangs from the bottom. I created the chain using rectangular bodies connected together via revolute joints. The base then is also rectangular and is connected to the last chain via another revolute joint.

I had to play with the nubmers to get it to hang correctly and I'm sure my numbers are wrong.

Each chain link I had to give a density of 20 and then the base gets a density of 1. If I have them be the same density then the base becomes to "heavy" and pulls the chain apart and thigns get super wonky. The links and base also have a friction of .2. So the only way I could figure out how to get it to stay together and solid was to increase the mass of the links. Which is probably not the best way to do it. Anyone know how to fix that? Or is that actually ok?

I also have a second problem, which might also just be because of my fudged numbers above. If I apply a horizontal force to the base, then it will move correctly and the links will hold it up liek they are supposed to. The problem then is that the whole thing never comes to rest. It just swings back and forth indefinintely and I can't figure out how to get it to come to rest on it's own.

Kyle

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Chain link chandelier never comes to rest

Postby irresistible force » Fri Sep 14, 2012 4:44 pm

One way to overcome the stretching problem when the link segments are light, would be to connect the main body of the chandelier to the ceiling with a rope joint - not sure if the Flash port has it yet though...

It will never come to rest unless there is some friction to reduce the amount of energy in each swing. You can set a small value for linear/angular damping for the bodies, would be the easiest way to make them gradually slow down.

kamcknig
Posts: 6
Joined: Fri Sep 14, 2012 10:37 am

Re: Chain link chandelier never comes to rest

Postby kamcknig » Fri Sep 14, 2012 7:28 pm

Thank you for the answer! I'm not at the computer to be able to test it but I'll be back to post the results

Kyle

kamcknig
Posts: 6
Joined: Fri Sep 14, 2012 10:37 am

Re: Chain link chandelier never comes to rest

Postby kamcknig » Sat Sep 15, 2012 10:03 am

That worked great! thanks so much for the suggestions!


Return to “Flash”



Who is online

Users browsing this forum: No registered users and 4 guests