diff options
Diffstat (limited to 'Scripts/cloth.js')
| -rw-r--r-- | Scripts/cloth.js | 7 |
1 files changed, 5 insertions, 2 deletions
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;
|
