]> gitweb.ps.run Git - cloth_sim/blobdiff - Scripts/main.js
correct units, tweak parameters
[cloth_sim] / Scripts / main.js
index ececd6af5bda8d4546a29fc286c73f08a78f3a6f..8c61f82566a2653bc8f890435f7a41a30f098186 100644 (file)
@@ -1,6 +1,14 @@
 import { Face, Spring, Cloth } from './cloth.js';\r
 \r
 \r
 import { Face, Spring, Cloth } from './cloth.js';\r
 \r
 \r
+/**\r
+ * rendering\r
+ * Einheiten konsistent\r
+ * Wind\r
+ * evtl. an Stoff ziehen\r
+ */\r
+\r
+\r
 class Point {\r
   constructor(x, y) {\r
     this.x = x;\r
 class Point {\r
   constructor(x, y) {\r
     this.x = x;\r
@@ -87,10 +95,10 @@ function init() {
 \r
   /**\r
    * function called every frame\r
 \r
   /**\r
    * function called every frame\r
-   * @param {number} dt - time passed since last frame\r
+   * @param {number} dt - time passed since last frame in ms\r
    */\r
   function animate(dt) {\r
    */\r
   function animate(dt) {\r
-    cloth.simulate(dt);\r
+    cloth.simulate(dt/1000);\r
 \r
     setTimeout(() => {\r
       animate(frameTime);\r
 \r
     setTimeout(() => {\r
       animate(frameTime);\r