Guard enableVR with xrAvailable
This commit is contained in:
parent
6b18bcec55
commit
5534d54f8b
|
@ -106,10 +106,12 @@ export async function startEngine(
|
|||
});
|
||||
|
||||
const enableVR = () => {
|
||||
xr.baseExperience.enterXRAsync('immersive-vr', 'local').then(() => {
|
||||
xr.baseExperience.camera.position = initialPos;
|
||||
xr.baseExperience.camera.rotation = initialRotation;
|
||||
});
|
||||
if (xrAvailable) {
|
||||
xr.baseExperience.enterXRAsync('immersive-vr', 'local').then(() => {
|
||||
xr.baseExperience.camera.position = initialPos;
|
||||
xr.baseExperience.camera.rotation = initialRotation;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
document.body.onclick = enableVR;
|
||||
|
|
Loading…
Reference in New Issue