|
6 | 6 | <meta name="description" content="Anime UI — A-Frame"> |
7 | 7 | <script src="../../../dist/aframe-master.js"></script> |
8 | 8 | <script src="https://unpkg.com/aframe-event-set-component@4.2.1/dist/aframe-event-set-component.min.js"></script> |
9 | | - <script> |
10 | | - AFRAME.registerComponent('hide-in-ar-mode', { |
11 | | - // Set this object invisible while in AR mode. |
12 | | - // TODO: could this be replaced with bind="visible: !ar-mode" |
13 | | - // with https://www.npmjs.com/package/aframe-state-component ? |
14 | | - init: function () { |
15 | | - this.el.sceneEl.addEventListener('enter-vr', (ev) => { |
16 | | - if (this.el.sceneEl.is('ar-mode')) { |
17 | | - this.el.setAttribute('visible', false); |
18 | | - } |
19 | | - }); |
20 | | - this.el.sceneEl.addEventListener('exit-vr', (ev) => { |
21 | | - this.el.setAttribute('visible', true); |
22 | | - }); |
23 | | - } |
24 | | - }) |
25 | | - </script> |
26 | 9 | </head> |
27 | 10 | <body> |
28 | | - <a-scene renderer="colorManagement: true;"> |
| 11 | + <a-scene renderer="colorManagement: true;" vr-mode-ui="enterAREnabled: true"> |
29 | 12 | <a-assets> |
30 | 13 | <a-asset-item id="engine" src="models/engine.glb"></a-asset-item> |
31 | 14 | <a-mixin id="image" geometry="height: 2; width: 2"></a-mixin> |
|
53 | 36 | <a-camera position="0 0 0" near="0.1"></a-camera> |
54 | 37 | </a-entity> |
55 | 38 |
|
56 | | - <a-entity position="0 0 -3" hide-in-ar-mode> |
| 39 | + <a-entity position="0 0 -3" hide-on-enter-ar> |
57 | 40 | <a-gltf-model src="#engine" rotation="90 0 0" scale="18 18 18"></a-gltf-model> |
58 | 41 | </a-entity> |
59 | 42 |
|
60 | | - <a-entity id="wall-lights" position="-7.25 1.5 2.9" rotation="0 90 0" scale="1.25 1.25 1.25"> |
| 43 | + <a-entity id="wall-lights" position="-7.25 1.5 2.9" rotation="0 90 0" scale="1.25 1.25 1.25" hide-on-enter-ar> |
61 | 44 | <a-entity position="0 0 0" scale="0.05 0.05 0.05"> |
62 | 45 | <a-plane mixin="delayVisible" width="1" height="4" shader="flat" color="#B4E2F8" event-set__loaded="_delay: 350"></a-plane> |
63 | 46 | <a-plane width="6" height="4" color="#586266" opacity="0.6" position="0 0 -.01"></a-plane> |
|
0 commit comments