I am writing a physics engine that uses Verlet integration, and I cannot get some restrictions for it to work properly. Some (for example, bond / weld limitation) are additional raw and not rigid enough, while others (for example, area limitation) are additional elastic and send atoms. The code for my update in my physical simulator is as follows:
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 tried all the same combinations of update orders, and none of them helped. I have a vague idea of ββusing iterations, but I donβt know what else will help. Any suggestions?