Simple port of a cloth sim to JS