I'm writing a physics engine that uses Verlet integration, and i can't get some constraints to work right. Some (like a bond/weld constraint) are extra "soggy" and aren't stiff enough, while others (like an area constraint) are extra bouncy and send atoms flying. The code for my update ethod in my physics simulator is like this:
ProcessRemovedItems();
ProcessAddedItems();
_colliderManager.Update(timestepSize);
foreach (Atom atom in _atomList)
{
atom.Update(timestepSize);
}
for (int i = 0; i < _iterations; i++)
{
foreach (IConstraint constraint in _constraintList)
{
constraint.Update();
}
}
I've tried all idfferent combinations of update orders and none help. I have a vague idea of something about using iterations but have no clue what else would help. Any suggestions?