cyclone-physics
cyclone-physics copied to clipboard
spring force
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.
Thanks a lot! Fixed the issue to which I couldn't find a solution. :)
Same problem here: https://github.com/idmillington/cyclone-physics/blob/c%2B%2B11/src/pfgen.cpp#L83