{"version":"1.0","type":"rich","title":"Optimized Cloth with Verlet","description":"Verlet integration is used to simulate cloth. \r\nSome optimizations:\r\n\r\n1. Mutable Vector Operations (biggest impact)\r\nThe original code created new arrays for every add3(), sub3(), scale3() call\r\nNow using pre-allocated tempVec1, tempVec2, tempVec3 that get reused\r\n\r\n2. Squared Distance Comparisons\r\nSorting triangles by distance no longer calls sqrt() - uses squared distances instead\r\n\r\nhttps:\/\/en.wikipedia.org\/wiki\/Verlet_integration\r\n\r\n#physics #cloth","author_name":"douglasgoodwin","author_url":"https:\/\/turtletoy.net\/user\/douglasgoodwin","provider_name":"Turtletoy","provider_url":"https:\/\/turtletoy.net\/","license":{"fullName":"Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International","shortName":"CC BY-NC-SA 4.0","url":"https:\/\/creativecommons.org\/licenses\/by-nc-sa\/4.0\/"},"thumbnail_url":"https:\/\/turtletoy.net\/thumbnail\/7a015572d3.jpg","thumbnail_width":512,"thumbnail_height":512,"html":"<iframe src=\"https:\/\/turtletoy.net\/embed\/7a015572d3\" width=\"1025px\" height=\"554px\" style=\"max-width: 100%; border: 0\" sandbox=\"allow-scripts allow-top-navigation allow-top-navigation-by-user-activation allow-forms allow-popups allow-same-origin\"><\/iframe>","width":1025,"height":554}