Looking-Glass / HoloPlayJS_Issues

A repository for feature requests and bug reports for the HoloPlay.js library. This repository doesn't contain source code. You can download the HoloPlay.js library at http://look.glass/threejs
0 stars 0 forks source link

Unreachable to load default config if LGK is not found. #8

Closed blkcatman closed 5 years ago

blkcatman commented 5 years ago

Unreachable to load default config if LGK is not found in PC.

fixed codes in holoplay.js from release 0.2.1

--- a/holoplay.js
+++ b/holoplay.js
@@ -212,7 +212,7 @@ function HoloPlay(scene, camera, renderer, focalPointVector, constantCenter, hiR

        function applyCalibration (calibration_obj)
        {
-        if(calibration_obj === undefined || calibration_obj === ""){
+        if(!calibration_obj){
             jsonObj = defaultCalibration;
             alert("No Looking Glass display connected; using default calibration data. Please ensure your Looking Glass is connected to your computer via USB and reload the page.")
         } else {
@@ -247,6 +247,8 @@ function HoloPlay(scene, camera, renderer, focalPointVector, constantCenter, hiR
                        } else { 
                                alert(errstr);
                        }
+                       applyCalibration(null);
+                       initialized = true;
                        finished();
                }, 800);
                ws.onmessage = function(event) {
alxdncn commented 5 years ago

Thanks for posting this! I don't quite understand where the issue is and I can't replicate it. What happens when you don't have LKG accessible?

blkcatman commented 5 years ago

What happens when you don't have LKG accessible?

I'm sorry, my comment is wrong. holoplay.js don't load a default calibration config if it cannot find a local WebSocket server. If it do not want to load the default config when the server is not found, it's correct. But if you don't assume that, it needs to be fixed as above.

alxdncn commented 5 years ago

I see, that makes sense. I'll look into this and try to patch it for 0.2.2!

alxdncn commented 5 years ago

Fixed on 0.2.2, now live