This project has moved and is read-only. For the latest updates, please go here.

LinearSprings in FP3

Topics: Developer Forum, User Forum
Apr 22, 2010 at 7:25 AM

Where are they? If they're not there yet, how should I go about implementing them?

Apr 22, 2010 at 7:31 AM
I think you have the DistanceJoint, which should be pretty much the same that the LinearJoint. For adding softness to joints (and thus, behave like a spring) you have to define two constants: Frequency (lower than 30 says the Box2D manual) and Damping (between 0 and 1).
Apr 22, 2010 at 8:42 AM
Edited Apr 25, 2010 at 1:56 AM

I need a LinearSpring with RestLength 0... but the distance joint doesn't work with distance 0 :(

EDIT: ... at least, it *says* it doesn't, in the comments. In practice, it seems to work okay.


I just wish there was a way to set the spring constant directly.