Ellipse and Torus shows in AR

,

Hello BabylonJS team, I have an issue with the XR Feature since upgrading BabylonJS to 5.38.0

When I launch an AR view, I now have an ellipse and torus in addition to my model. I tried to reproduce it on the playground but had no clue.

Looking at the code of BabylonJS, I found that these two objects are linked with the teleportation feature. But this feature should only appear using sessionMode: 'immersive-vr'.
So do you have an idea why it shows up in my use case ?

Here is my code

The scene I create:

let scene = new Scene(this.system.engine);
scene.clearColor = new Color4(0, 0, 0, 0);
let camera = new ArcRotateCamera('camera1', -Math.PI / 2, Math.PI / 4, 3, new Vector3(0, 0, 0), scene);
camera.lowerRadiusLimit = 2;
camera.upperRadiusLimit = 10;
camera.wheelDeltaPercentage = 0.01;
camera.attachControl(this.system.canvas, true);

The helper initialization:

WebXRDefaultExperience.CreateAsync(scene, {
        uiOptions: {
            sessionMode: 'immersive-ar',
        }
    }).then((xrHelper) => {
        this.xrHelper = xrHelper;
        callback();
    });

And on pointer action:

this.xrHelper.baseExperience.enterXRAsync('immersive-ar', null)
    .then((helper) => {
        // SHOW MODEL
    })

I also tried with referenceSpaceType: "unbounded" but I have the same result.

Thanks a lot!

pinging @RaananW :wink:

Just to help @RaananW when he ll be back in Jan :frowning: could you check 37 and such to determine exactly in which version things started to fail ?

I continued to dig into the issue.

I saw that there is a new option (maybe not new but I didn’t know about it) that is disableTeleportation when creating the XR Default Experience. Setting it to true fixed the problem and Ellipse/Torus doesn’t appear anymore.

When using AR, I think you will never need teleportation so maybe it should be disabled by default with sessionMode: 'immersive-ar' ?
At the same, I didn’t have the issue in the playground so it can be linked to something else I was doing in my code.

I am sure @RaananW will have an explanation when he will be back :wink:

Oh, that should not happen. Teleportation in AR is a weird concept, I agree, but can still be used to move the scene. Anyhow - the elements should not be displayed, unless there is some exception thrown during initialization.

I will create an AR scene and check what changed.

1 Like

[XR] Hide teleportation mesh on creation by RaananW · Pull Request #13397 · BabylonJS/Babylon.js (github.com)
This will make sure it is not visible, even if an exception is thrown.

1 Like