瀏覽代碼

Rename A-Frame component to encantar

customisations
alemart 9 月之前
父節點
當前提交
ea3ae4a19e
共有 3 個文件被更改,包括 10 次插入9 次删除
  1. 1
    1
      demos/hello-aframe/index.html
  2. 1
    1
      demos/hello-aframe/video.html
  3. 8
    7
      plugins/aframe-with-encantar.js

+ 1
- 1
demos/hello-aframe/index.html 查看文件

@@ -14,7 +14,7 @@
14 14
     <body>
15 15
 
16 16
         <!-- The AR scene -->
17
-        <a-scene ar-session="stats: true; gizmos: true">
17
+        <a-scene encantar="stats: true; gizmos: true">
18 18
 
19 19
             <!--
20 20
             +============================+

+ 1
- 1
demos/hello-aframe/video.html 查看文件

@@ -14,7 +14,7 @@
14 14
     <body>
15 15
 
16 16
         <!-- The AR scene -->
17
-        <a-scene ar-session="stats: true; gizmos: true">
17
+        <a-scene encantar="stats: true; gizmos: true">
18 18
 
19 19
             <!--
20 20
             +============================+

+ 8
- 7
plugins/aframe-with-encantar.js 查看文件

@@ -177,9 +177,9 @@ AFRAME.registerSystem('ar', Object.assign(ARBaseSystem(), {
177 177
         const scene = this.el;
178 178
 
179 179
         // validate
180
-        if(!scene.getAttribute('ar-session')) {
181
-            scene.setAttribute('ar-session', {}); // use a default ar-session
182
-            //throw new Error('Missing ar-session in a-scene'); // other errors will appear
180
+        if(!scene.getAttribute('encantar')) {
181
+            scene.setAttribute('encantar', {}); // use a default encantar
182
+            //throw new Error('Missing encantar in a-scene'); // other errors will appear
183 183
         }
184 184
 
185 185
         // initial setup
@@ -400,10 +400,10 @@ AFRAME.registerSystem('ar', Object.assign(ARBaseSystem(), {
400 400
     _loadPreferences()
401 401
     {
402 402
         const scene = this.el;
403
-        const sessionComponent = scene.components['ar-session'];
403
+        const sessionComponent = scene.components['encantar'];
404 404
 
405 405
         if(sessionComponent === undefined)
406
-            throw new Error('Missing ar-session in a-scene');
406
+            throw new Error('Missing encantar in a-scene');
407 407
 
408 408
         return sessionComponent.preferences();
409 409
     },
@@ -461,9 +461,10 @@ const ARComponent = obj => Object.assign({}, obj, {
461 461
 });
462 462
 
463 463
 /**
464
- * AR Session
464
+ * The encantar component enchants an a-scene with AR
465
+ * Parameters of the AR scene are set in this component
465 466
  */
466
-AFRAME.registerComponent('ar-session', ARComponent({
467
+AFRAME.registerComponent('encantar', ARComponent({
467 468
 
468 469
     schema: {
469 470
 

Loading…
取消
儲存