Skip to content

Instantly share code, notes, and snippets.

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