How to simulate spring in newton

fredmouse

14-11-2008 21:19:09

Is there any one familiar with simulating a situation where two sphere connected by a spring in newton? I vaguely guess that it is related to a slider joint but I am not sure. Wish someone could help me with this. Thank you.

ForgottenMaster

18-12-2008 13:02:31

I also would like to know the answer to this. If anybody has a spring joint class or even can just explain what would go into the submitConstraint function, I would be very grateful.

Basically, what I need is a joint that can rotate with the two bodies it joins, but when compressed or stretched bounces back into its' resting state. I know there is the setRowSpringDamper method which allows you to make the joint behave like a spring. I just can't get my head around using the linear row method in practice.

So please, if anybody has come up with a spring joint, could they share their wisdom?

Thanks in advance

P.S. I am going to use the spring joint in a spherical shape as shown on this page

http://cowboyprogramming.com/2007/01/05/blob-physics/

under "a better blob"....i'm going to simply extend this idea to 3-dimensions which shouldn't be hard at all...I just have trouble working out how the spring joint should be implemented in OgreNewt

ForgottenMaster

23-12-2008 00:14:19

Actually, I have thought that I don't need to use custom joints at all. I am going to implement spring class that tracks two rigid bodies and when one body moves, just use the spring force formula to move the other appropriately. This will be much simpler than trying to understand custom joints I think :)