Created
February 24, 2019 13:46
-
-
Save flushpot1125/372319a5108093fd69dd8c9d0cdae583 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var vrHelper = scene.createDefaultVRExperience(); | |
vrHelper.enableInteractions(); | |
vrHelper.gazeTrackerMesh = BABYLON.Mesh.CreateSphere("sphere1", 4, 0.1, scene); | |
vrHelper.onControllerMeshLoaded.add((webVRController)=>{}); | |
sphere.actionManager = new BABYLON.ActionManager(scene); | |
sphere.actionManager.registerAction( | |
new BABYLON.ExecuteCodeAction({ | |
trigger: BABYLON.ActionManager.OnPickDownTrigger,}, | |
function () { | |
console.log("clicked the mesh"); | |
vrHelper.exitVR(); | |
scene.getEngine().exitFullscreen(); | |
// document.exitFullscreen(); // this does not works | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment