From 119f3466dca8c263abcb1634be2b288f751c9ea3 Mon Sep 17 00:00:00 2001 From: "Diego F. Goberna" Date: Sat, 1 Dec 2018 01:24:23 +0100 Subject: [PATCH] fixed twister rotations --- src/components/twister.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/twister.js b/src/components/twister.js index ff055e5..00a1f23 100644 --- a/src/components/twister.js +++ b/src/components/twister.js @@ -81,12 +81,14 @@ AFRAME.registerComponent('twister', { var rotation; var x, y; var sin, cos; + var diff; delta *= 0.001; - // TODO: FIX ROTATIONS!! (before they where absolute, now relative) - this.currentTwist += (this.data.twist - this.currentTwist) * delta; - rotation = 0.01; + diff = (this.data.twist - this.currentTwist) * delta; + + this.currentTwist += diff; + rotation = diff * 3.0; for (var s = 0; s < this.data.count; s++) { for (var i = 0; i < NUM_VALUES_PER_SEGMENT; i += 3) {