abouttreesummaryrefslogcommitdiff
path: root/Scripts/main.js
diff options
context:
space:
mode:
authorPatrick Schönberger2021-02-06 12:48:25 +0100
committerPatrick Schönberger2021-02-06 12:48:25 +0100
commit999a549825d3de0b53e2922462ed1e120e176ec2 (patch)
treeb1ed24d49f362a5a35e96c9c61122355f85f7f64 /Scripts/main.js
parent19d9f67e228e9925958489574339448bb608c9db (diff)
downloadcloth_sim-999a549825d3de0b53e2922462ed1e120e176ec2.tar.gz
cloth_sim-999a549825d3de0b53e2922462ed1e120e176ec2.zip
simulate
Diffstat (limited to 'Scripts/main.js')
-rw-r--r--Scripts/main.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/Scripts/main.js b/Scripts/main.js
index d54aa9f..3353f4d 100644
--- a/Scripts/main.js
+++ b/Scripts/main.js
@@ -98,7 +98,9 @@ function init() {
* @param {number} dt - time passed since last frame in ms
*/
function animate(dt) {
- // simulate cloth
+ cloth.simulate(dt / 1000);
+
+ cloth.updateGeometry(clothGeometry);
raycaster.setFromCamera( new THREE.Vector2((mousePos.x / w) * 2 - 1, ((h - mousePos.y) / h) * 2 - 1), camera );