+ let indexX = vertexIndex % numPointsX;\r
+ let indexY = Math.floor(vertexIndex / numPointsX);\r
+\r
+ let springs = [];\r
+\r
+ // 0 oben\r
+ // 1 links\r
+ // 2 oben links -> unten rechts diagonal\r
+ // 3 oben rechts -> unten links diagonal\r
+ // 4 rechts\r
+ // 5 unten\r
+\r
+ let ul = indexX > 0 && indexY < numPointsY - 1;\r
+ let ur = indexX < numPointsX - 1 && indexY < numPointsY - 1;\r
+ let ol = indexX > 0 && indexY > 0;\r
+ let or = indexX < numPointsX - 1 && indexY > 0;\r
+\r
+ if (ul) {\r
+ let faceUL = this.faces[getFaceIndex(indexX - 1, indexY)];\r
+ springs.push(faceUL.springs[3]);\r
+ if (!ol)\r
+ springs.push(faceUL.springs[0]);\r
+ springs.push(faceUL.springs[4]);\r
+ }\r
+ if (ur) {\r
+ let faceUR = this.faces[getFaceIndex(indexX, indexY)];\r
+ springs.push(faceUR.springs[2]);\r
+ if (!or)\r
+ springs.push(faceUR.springs[0]);\r
+ if (!ul)\r
+ springs.push(faceUR.springs[1]);\r
+ }\r
+ if (ol) {\r
+ let faceOL = this.faces[getFaceIndex(indexX - 1, indexY - 1)];\r
+ springs.push(faceOL.springs[2]);\r
+ springs.push(faceOL.springs[4]);\r
+ springs.push(faceOL.springs[5]);\r
+ }\r
+ if (or) {\r
+ let faceOR = this.faces[getFaceIndex(indexX , indexY - 1)];\r
+ springs.push(faceOR.springs[3]);\r
+ if (!ol)\r
+ springs.push(faceOR.springs[1]);\r
+ springs.push(faceOR.springs[5]);\r
+ }\r