Quellcode durchsuchen

Rename A-Frame component to encantar

customisations
alemart vor 9 Monaten
Ursprung
Commit
ea3ae4a19e
3 geänderte Dateien mit 10 neuen und 9 gelöschten Zeilen
  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 Datei anzeigen

14
     <body>
14
     <body>
15
 
15
 
16
         <!-- The AR scene -->
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 Datei anzeigen

14
     <body>
14
     <body>
15
 
15
 
16
         <!-- The AR scene -->
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 Datei anzeigen

177
         const scene = this.el;
177
         const scene = this.el;
178
 
178
 
179
         // validate
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
         // initial setup
185
         // initial setup
400
     _loadPreferences()
400
     _loadPreferences()
401
     {
401
     {
402
         const scene = this.el;
402
         const scene = this.el;
403
-        const sessionComponent = scene.components['ar-session'];
403
+        const sessionComponent = scene.components['encantar'];
404
 
404
 
405
         if(sessionComponent === undefined)
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
         return sessionComponent.preferences();
408
         return sessionComponent.preferences();
409
     },
409
     },
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
     schema: {
469
     schema: {
469
 
470
 

Laden…
Abbrechen
Speichern