瀏覽代碼

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

customisations
alemart 8 月之前
父節點
當前提交
0bbc0e4ee3
共有 2 個檔案被更改,包括 14 行新增1 行删除
  1. 4
    0
      docs/api/plugin-aframe.md
  2. 10
    1
      plugins/aframe-with-encantar.js

+ 4
- 0
docs/api/plugin-aframe.md 查看文件

306
 
306
 
307
 *Since:* 0.4.0
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
 **Example**
313
 **Example**
310
 
314
 
311
 ```html
315
 ```html

+ 10
- 1
plugins/aframe-with-encantar.js 查看文件

993
 AFRAME.registerComponent('ar-pointer-tracker', ARComponent({
993
 AFRAME.registerComponent('ar-pointer-tracker', ARComponent({
994
 
994
 
995
     schema: {
995
     schema: {
996
+
997
+        /** the space in which pointers will be located */
998
+        'space': { type: 'string', default: 'normalized' },
999
+
996
     },
1000
     },
997
 
1001
 
998
     validate()
1002
     validate()
1003
 
1007
 
1004
     tracker()
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
 AFRAME.registerPrimitive('ar-pointer-tracker', {
1017
 AFRAME.registerPrimitive('ar-pointer-tracker', {
1012
     defaultComponents: {
1018
     defaultComponents: {
1013
         'ar-pointer-tracker': {}
1019
         'ar-pointer-tracker': {}
1020
+    },
1021
+    mappings: {
1022
+        'space': 'ar-pointer-tracker.space'
1014
     }
1023
     }
1015
 });
1024
 });
1016
 
1025
 

Loading…
取消
儲存