I am taking JS code from a previous project and re-coding it into Typescript for another I am starting.
In the JS of the previous, the code was:
const options = {
// when both AR & VR capable; AR wins for now
uiOptions: {sessionMode: isARCapable ? "immersive-ar" : "immersive-vr"},
useMultiview: true, // just guessing
timeToTeleport: 3500
};
BABYLON.WebXRDefaultExperience.CreateAsync(scene, options).then((defaultExperience) => { ... });
That in Typescript fails to compile in CreateAsync()
with sessionMode cannot be text
. Ok, so I wrote it this way to get around it:
const options = new BABYLON.WebXRDefaultExperienceOptions();
// when both AR & VR capable; AR wins for now
options.uiOptions.sessionMode = isARCapable ? "immersive-ar" : "immersive-vr";
options.timeToTeleport = 3500; // this does not compile
BABYLON.WebXRDefaultExperience.CreateAsync(scene, options).then((defaultExperience) => { ... });
A whole bunch of other properties are listed in the editor code completion dropdown, but not timeToTeleport
. Please advise.