X-Git-Url: https://gitweb.ps.run/cloth_sim/blobdiff_plain/590349d576668595128e2d15bbd72e9391a97fc1..79bcaf1ac3d8bc90b697c444ff5dfb694acb6962:/Scripts/cloth.js diff --git a/Scripts/cloth.js b/Scripts/cloth.js index 266af16..e39b95b 100644 --- a/Scripts/cloth.js +++ b/Scripts/cloth.js @@ -112,6 +112,9 @@ export class Cloth { let vertices = []; let faces = []; + this.numPointsWidth = numPointsWidth; + this.numPointsHeight = numPointsHeight; + /** * distance between two vertices horizontally/vertically * divide by the number of points minus one @@ -403,8 +406,8 @@ getAcceleration(vertexIndex, dt) { // Get the bounding springs and add them to the needed springs // TODO: optimize - const numPointsX = 10; - const numPointsY = 10; + const numPointsX = this.numPointsWidth; + const numPointsY = this.numPointsHeight; const numFacesX = numPointsX - 1; const numFacesY = numPointsY - 1;