cyclone-physics icon indicating copy to clipboard operation
cyclone-physics copied to clipboard

spring force

Open mdipierro opened this issue 13 years ago • 2 comments

This line https://github.com/idmillington/cyclone-physics/blob/master/src/fgen.cpp#L106

magnitude = real_abs(magnitude - restLength);

should be

magnitude = magnitude - restLength;

The force should become repulsive when magnitude is less than restLength. Consistently with the book.

mdipierro avatar Oct 04 '11 04:10 mdipierro

Thanks a lot! Fixed the issue to which I couldn't find a solution. :)

EricPolman avatar Mar 03 '12 00:03 EricPolman

Same problem here: https://github.com/idmillington/cyclone-physics/blob/c%2B%2B11/src/pfgen.cpp#L83

Determinant avatar Jul 02 '13 09:07 Determinant