Skip to content
Jacob Austin edited this page May 23, 2019 · 5 revisions

Description

Springs connect masses together and exert forces on them according to Hooke's Law:

F = -k * delta_x

Properties

double _k;  // Spring constant [N/m]
double _rest; // Rest length [m] 

Methods

setLeft (Mass * left) // Sets left mass 
setRight(Mass * right) // sets right mass

setMasses(Mass * left, Mass * right) // sets left and right masses 

These methods set the left and right masses, respectively, and are required to handle reference counting.