Pārlūkot izejas kodu

A-Frame plugin: add ar-pointer-tracker.space

customisations
alemart 7 mēnešus atpakaļ
vecāks
revīzija
0bbc0e4ee3
2 mainītis faili ar 14 papildinājumiem un 1 dzēšanām
  1. 4
    0
      docs/api/plugin-aframe.md
  2. 10
    1
      plugins/aframe-with-encantar.js

+ 4
- 0
docs/api/plugin-aframe.md Parādīt failu

@@ -306,6 +306,10 @@ The `<ar-trackers>` primitive is used to specify the [trackers](./tracker.md) th
306 306
 
307 307
 *Since:* 0.4.0
308 308
 
309
+**Properties**
310
+
311
+* `space: string`. The [space](./pointer-tracker.md#space) in which pointers will be located. *Since:* 0.4.1
312
+
309 313
 **Example**
310 314
 
311 315
 ```html

+ 10
- 1
plugins/aframe-with-encantar.js Parādīt failu

@@ -993,6 +993,10 @@ AFRAME.registerPrimitive('ar-reference-image', {
993 993
 AFRAME.registerComponent('ar-pointer-tracker', ARComponent({
994 994
 
995 995
     schema: {
996
+
997
+        /** the space in which pointers will be located */
998
+        'space': { type: 'string', default: 'normalized' },
999
+
996 1000
     },
997 1001
 
998 1002
     validate()
@@ -1003,7 +1007,9 @@ AFRAME.registerComponent('ar-pointer-tracker', ARComponent({
1003 1007
 
1004 1008
     tracker()
1005 1009
     {
1006
-        return AR.Tracker.Pointer();
1010
+        return AR.Tracker.Pointer({
1011
+            space: this.data.space
1012
+        });
1007 1013
     },
1008 1014
 
1009 1015
 }));
@@ -1011,6 +1017,9 @@ AFRAME.registerComponent('ar-pointer-tracker', ARComponent({
1011 1017
 AFRAME.registerPrimitive('ar-pointer-tracker', {
1012 1018
     defaultComponents: {
1013 1019
         'ar-pointer-tracker': {}
1020
+    },
1021
+    mappings: {
1022
+        'space': 'ar-pointer-tracker.space'
1014 1023
     }
1015 1024
 });
1016 1025
 

Notiek ielāde…
Atcelt
Saglabāt