Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created February 24, 2019 13:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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