Commit 7ad32ef2 authored by amandaghassaei's avatar amandaghassaei
Browse files

small changes

parent d9f9ae2a
......@@ -712,7 +712,8 @@
</div>
<div id="virtualReality" class="hide indent smallTxt">
Status: &nbsp;<span id="VRstatus"></span><a class="about floatRight" href="#" id="aboutVR"><span class="fui-question-circle"></span></a>
<div id="VRoptions">
<div id="VRoptions"><br/>
<a href="#" id="enterVR" class="displayBlock btn btn-lg btn-inverse"></a>
</div><br/><br/>
</div><br/>
<div>
......
......@@ -56,14 +56,17 @@ function initViveInterface(globals){
var scale = 0.5;
function connect(){
WEBVR.getVRDisplay( function ( display ) {
if (!display) return;
$status.html("VR device detected.");
var button = WEBVR.getButton( display, globals.threeView.renderer.domElement );
$("#VRoptions").html(button);
var $link = $("#enterVR");
$link.html(button.textContent);
var callback = button.onclick;
button.onclick = function () {
globals.vrEnabled = !display.isPresenting;
$link.click(function(e){
e.preventDefault();
globals.vrEnabled = !display.isPresenting;
var y = 0;
if (globals.vrEnabled) y = yOffset;
globals.threeView.modelWrapper.scale.set(scale, scale, scale);
......@@ -76,7 +79,7 @@ function initViveInterface(globals){
});
setControllerEvents();
if (callback) callback();
};
});
} );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment