From cf4c581009ad6da3b0f4cbe9f36d9d502cffb6b6 Mon Sep 17 00:00:00 2001
From: amandaghassaei <amandaghassaei@gmail.com>
Date: Wed, 10 May 2017 14:21:21 -0400
Subject: [PATCH] vive

---
 index.html                  | 7 ++++---
 js/ViveInterface.js         | 2 ++
 js/dynamic/dynamicSolver.js | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/index.html b/index.html
index 64b8014..bc53472 100644
--- a/index.html
+++ b/index.html
@@ -301,14 +301,15 @@
             float theta = atan(y, x);
 
             float diff = theta-lastTheta[0];
+            float origDiff = diff;
             if (diff < -5.0) {
                 diff += TWO_PI;
-                theta = lastTheta[0] + diff;
             } else if (diff > 5.0) {
                 diff  -= TWO_PI;
-                theta = lastTheta[0] + diff;
             }
-            gl_FragColor = vec4(theta, theta, lastTheta[2], lastTheta[3]);//[theta, w, normal1Index, normal2Index]
+            //if (abs(diff)>0.01) diff = 0.0;
+            theta = lastTheta[0] + diff;
+            gl_FragColor = vec4(theta, origDiff, lastTheta[2], lastTheta[3]);//[theta, w, normal1Index, normal2Index]
         }
     </script>
 
diff --git a/js/ViveInterface.js b/js/ViveInterface.js
index 96e57b4..e2f8dc4 100644
--- a/js/ViveInterface.js
+++ b/js/ViveInterface.js
@@ -12,6 +12,8 @@ function initViveInterface(globals){
         $("#VRoptions").hide();
         return;
     }
+    $status.html("No device connected.");
+    $("#VRoptions").show();
 
     var controls, controller1, controller2, effect;
 
diff --git a/js/dynamic/dynamicSolver.js b/js/dynamic/dynamicSolver.js
index 6f8c2e4..2d62332 100644
--- a/js/dynamic/dynamicSolver.js
+++ b/js/dynamic/dynamicSolver.js
@@ -174,7 +174,7 @@ function initDynamicSolver(globals){
         //     globals.gpuMath.readPixels(0, 0, textureDimCreases * vectorLength, height, pixels);
         //     var parsedPixels = new Float32Array(pixels.buffer);
         //     for (var i=0;i<parsedPixels.length;i+=2){
-        //         if (Math.abs(parsedPixels[i+1])>3.0) console.log(parsedPixels[i+1]);
+        //         if (Math.abs(parsedPixels[i+1])>0.1) console.log(parsedPixels[i+1]);
         //     }
         // } else {
         //     console.log("here");
-- 
GitLab