Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created February 24, 2019 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/372319a5108093fd69dd8c9d0cdae583 to your computer and use it in GitHub Desktop.
Save flushpot1125/372319a5108093fd69dd8c9d0cdae583 to your computer and use it in GitHub Desktop.
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