You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when entering the XR, the object is placed right under the camera, forcing us to point the device down to look at it. Ideally it'd be placed in directly in front, on a detected plane. Code that could be adjusted to do this:
let positionSet = false;
if (scene.app.xr.isAvailable(XRTYPE_AR)) {
scene.app.xr.on("start", () => {
console.log("Immersive AR session has started");
if (scene.app.xr.hitTest.supported) {
console.log("start hittest");
// place the mesh when a plane is detected
scene.app.xr.hitTest.start({
entityTypes: [XRTRACKABLE_POINT, XRTRACKABLE_PLANE],
callback: (err, hitTestSource) => {
if (err) {
console.log("Failed to start AR hit test");
return;
}
hitTestSource.on('result', function (position, rotation) {
if (!positionSet) {
positionSet = true;
entity.setPosition(position);
}
});
}
});
}
});
We might need to back up the original position, and restore it when the XR session ends.
The text was updated successfully, but these errors were encountered:
Currently when entering the XR, the object is placed right under the camera, forcing us to point the device down to look at it. Ideally it'd be placed in directly in front, on a detected plane. Code that could be adjusted to do this:
We might need to back up the original position, and restore it when the XR session ends.
The text was updated successfully, but these errors were encountered: