aframe-babia-components 1.2.2 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/components/filters/babia-selector.js +256 -79
  2. package/components/filters/babia-treebuilder.js +1 -2
  3. package/components/geometries/babia-bar.js +13 -1
  4. package/components/geometries/babia-cyl.js +189 -0
  5. package/components/others/assets/tooltip.png +0 -0
  6. package/components/others/babia-camera.js +195 -0
  7. package/components/others/babia-controls.js +56 -31
  8. package/components/others/babia-navigator.js +55 -49
  9. package/components/others/babia-range-selector.js +218 -0
  10. package/components/others/babia-slider.js +36 -8
  11. package/components/others/babia-ui.js +246 -73
  12. package/components/others/common.js +91 -83
  13. package/components/queriers/babia-querycsv.js +96 -0
  14. package/components/queriers/babia-queryes.js +209 -131
  15. package/components/visualizers/babia-bars.js +15 -38
  16. package/components/visualizers/babia-barsmap.js +19 -34
  17. package/components/visualizers/babia-boats.js +221 -134
  18. package/components/visualizers/babia-bubbles.js +13 -26
  19. package/components/visualizers/babia-cyls.js +203 -201
  20. package/components/visualizers/babia-cylsmap.js +173 -241
  21. package/components/visualizers/babia-doughnut.js +6 -28
  22. package/components/visualizers/babia-network.js +191 -124
  23. package/components/visualizers/babia-pie.js +6 -30
  24. package/dist/aframe-babia-components.js +21913 -19571
  25. package/dist/aframe-babia-components.min.js +7 -1
  26. package/dist/aframe-babia-components.min.js.map +1 -1
  27. package/docs/APIs/CHARTS.md +33 -14
  28. package/docs/APIs/DATAMANAGEMENT.md +7 -0
  29. package/docs/APIs/OTHERS.md +42 -0
  30. package/docs/APIs/QUERIERS.md +18 -0
  31. package/docs/RELEASE_NOTES.md +58 -21
  32. package/docs/Tutorials/multiuser.md +47 -2
  33. package/examples/assets/door/New Bitmap Image.jpg +0 -0
  34. package/examples/assets/door/door.mtl +26 -0
  35. package/examples/assets/door/door.obj +6927 -0
  36. package/examples/assets/popups/0.png +0 -0
  37. package/examples/assets/popups/1.png +0 -0
  38. package/examples/assets/popups/10.png +0 -0
  39. package/examples/assets/popups/2.png +0 -0
  40. package/examples/assets/popups/3.png +0 -0
  41. package/examples/assets/popups/4.png +0 -0
  42. package/examples/assets/popups/5.png +0 -0
  43. package/examples/assets/popups/6.png +0 -0
  44. package/examples/assets/popups/7.png +0 -0
  45. package/examples/assets/popups/8.png +0 -0
  46. package/examples/assets/popups/9.png +0 -0
  47. package/examples/assets/popups/close.jpg +0 -0
  48. package/examples/assets/popups/info.jpg +0 -0
  49. package/examples/assets/textures/brownwall.png +0 -0
  50. package/examples/assets/textures/concrete.png +0 -0
  51. package/examples/assets/textures/white-wall-texture.jpg +0 -0
  52. package/examples/charts/cyls/index.html +13 -4
  53. package/examples/charts/cyls/primitive.html +76 -0
  54. package/examples/charts/cylsmap/index.html +14 -5
  55. package/examples/charts_querier/bars_querier/data.csv +10 -0
  56. package/examples/charts_querier/bars_querier/index_csv.html +80 -0
  57. package/examples/charts_querier/multichart_querier/manual_colors.html +81 -0
  58. package/examples/dashboard/chaoss-dashboards.html +259 -0
  59. package/examples/dashboard/chaoss-issues.html +248 -0
  60. package/examples/dashboard/chaoss-pr.html +248 -0
  61. package/examples/dashboard/index.html +247 -0
  62. package/examples/dashboard/issues_queries/80-percent-open-time.json +123 -0
  63. package/examples/dashboard/issues_queries/issues-by-organization.json +107 -0
  64. package/examples/dashboard/issues_queries/issues.json +117 -0
  65. package/examples/dashboard/issues_queries/median-open-time.json +123 -0
  66. package/examples/dashboard/issues_queries/organizations.json +130 -0
  67. package/examples/dashboard/issues_queries/projects.json +130 -0
  68. package/examples/dashboard/issues_queries/repositories.json +130 -0
  69. package/examples/dashboard/issues_queries/status.json +107 -0
  70. package/examples/dashboard/issues_queries/submitter.json +125 -0
  71. package/examples/dashboard/issues_queries/submitters.json +113 -0
  72. package/examples/dashboard/pullrequests_queries/80-percent-open-time.json +123 -0
  73. package/examples/dashboard/pullrequests_queries/median-open-time.json +123 -0
  74. package/examples/dashboard/pullrequests_queries/organizations.json +130 -0
  75. package/examples/dashboard/pullrequests_queries/projects.json +130 -0
  76. package/examples/dashboard/pullrequests_queries/pull-requests-by-organization.json +107 -0
  77. package/examples/dashboard/pullrequests_queries/pull-requests.json +117 -0
  78. package/examples/dashboard/pullrequests_queries/repositories.json +130 -0
  79. package/examples/dashboard/pullrequests_queries/status.json +107 -0
  80. package/examples/dashboard/pullrequests_queries/submitter.json +125 -0
  81. package/examples/dashboard/pullrequests_queries/submitters.json +113 -0
  82. package/examples/dashboard/range.html +88 -0
  83. package/examples/dashboard/template.html +136 -0
  84. package/examples/demos/1.0.11/index_multiuser_ui.html +1 -1
  85. package/examples/multi_bars/data.json +14 -0
  86. package/examples/multi_bars/data2.json +15 -0
  87. package/examples/multi_bars/data3.json +23 -0
  88. package/examples/multi_bars/easyrtc.js +11984 -0
  89. package/examples/multi_bars/index.html +97 -0
  90. package/examples/multi_bars/index1.html +111 -0
  91. package/examples/multi_bars/index2.html +102 -0
  92. package/examples/multi_bars/index3.html +104 -0
  93. package/examples/multi_boats/data3.json +174 -0
  94. package/examples/multi_boats/data4.json +192 -0
  95. package/examples/multi_boats/{index.html → index_multi_boats.html} +50 -55
  96. package/examples/multi_boats/jetuml.html +124 -115
  97. package/examples/multi_boats/jetuml_evolution_experiment.html +419 -0
  98. package/examples/multi_boats/only_queryjson.html +132 -0
  99. package/examples/multi_boats/only_queryjson2.html +167 -0
  100. package/examples/multi_boats/only_queryjson3.html +165 -0
  101. package/examples/multi_boats/queryjson_treebuilder.html +132 -0
  102. package/examples/multi_boats/with_selector.html +121 -111
  103. package/examples/multiuser/choose_avatar/index.html +18 -8
  104. package/examples/selector_boats/jetuml_from_3_2_to_1_0.json +62382 -0
  105. package/examples/ui/network/data.json +123 -0
  106. package/examples/ui/network/links.json +13 -0
  107. package/examples/ui/network/network.html +75 -0
  108. package/examples/ui/network/network_nodes_links.html +82 -0
  109. package/examples/ui/network/nodes.json +12 -0
  110. package/index.html +69 -3
  111. package/index.js +6 -1
  112. package/package.json +4 -3
  113. package/tests/screenshots/other_snapshots.js/chaoss-issues.png +0 -0
  114. package/tests/screenshots/other_snapshots.js/chaoss-pr.png +0 -0
  115. package/tests/screenshots/other_snapshots.js/template.png +0 -0
  116. package/tests/ui.js +7 -0
  117. package/webpack.common.js +1 -1
  118. package/webpack.devnossl.js +16 -0
  119. package/.idea/vcs.xml +0 -6
  120. package/.idea/workspace.xml +0 -79
@@ -0,0 +1,192 @@
1
+ [
2
+ {
3
+ "uid": "001",
4
+ "width": "5",
5
+ "height": "20",
6
+ "depth": "5"
7
+ },
8
+ {
9
+ "uid": "/barrio",
10
+ "children": [
11
+ {
12
+ "uid": "/barrio/002",
13
+ "width": "4",
14
+ "height": "3",
15
+ "depth": "4"
16
+ },
17
+ {
18
+ "uid": "/barrio/003",
19
+ "children": [
20
+ {
21
+ "uid": "barrio/003/block1",
22
+ "width": "10",
23
+ "height": "2",
24
+ "depth": "5"
25
+ },
26
+ {
27
+ "uid": "barrio/003/block2",
28
+ "width": "3",
29
+ "height": "1",
30
+ "depth": "3"
31
+ },
32
+ {
33
+ "uid": "barrio/003/block3",
34
+ "width": "1",
35
+ "height": "1",
36
+ "depth": "1"
37
+ }
38
+ ]
39
+ },
40
+ {
41
+ "uid": "/barrio/004",
42
+ "width": "1",
43
+ "height": "1",
44
+ "depth": "3"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "uid": "003",
50
+ "width": "3",
51
+ "height": "1",
52
+ "depth": "5"
53
+ },
54
+ {
55
+ "uid": "004",
56
+ "width": "1",
57
+ "height": "1",
58
+ "depth": "2"
59
+ },
60
+ {
61
+ "uid": "005",
62
+ "width": "5",
63
+ "height": "10",
64
+ "depth": "3"
65
+ },
66
+ {
67
+ "uid": "006",
68
+ "width": "3",
69
+ "height": "1",
70
+ "depth": "3"
71
+ },
72
+ {
73
+ "uid": "007",
74
+ "width": "6",
75
+ "height": "1",
76
+ "depth": "6"
77
+ },
78
+ {
79
+ "uid": "008",
80
+ "width": "3",
81
+ "height": "1",
82
+ "depth": "3"
83
+ },
84
+ {
85
+ "uid": "009",
86
+ "width": "5",
87
+ "height": "1",
88
+ "depth": "5"
89
+ },
90
+ {
91
+ "uid": "010",
92
+ "width": "5",
93
+ "height": "1",
94
+ "depth": "5"
95
+ },
96
+ {
97
+ "uid": "011",
98
+ "width": "3",
99
+ "height": "1",
100
+ "depth": "3"
101
+ },
102
+ {
103
+ "uid": "012",
104
+ "width": "3",
105
+ "height": "1",
106
+ "depth": "3"
107
+ },
108
+ {
109
+ "uid": "013",
110
+ "width": "1",
111
+ "height": "5",
112
+ "depth": "1"
113
+ },
114
+ {
115
+ "uid": "014",
116
+ "width": "3",
117
+ "height": "1",
118
+ "depth": "3"
119
+ },
120
+ {
121
+ "uid": "015",
122
+ "width": "4",
123
+ "height": "1",
124
+ "depth": "4"
125
+ },
126
+ {
127
+ "uid": "016",
128
+ "width": "5",
129
+ "height": "1",
130
+ "depth": "5"
131
+ },
132
+ {
133
+ "uid": "017",
134
+ "width": "3",
135
+ "height": "9",
136
+ "depth": "3"
137
+ },
138
+ {
139
+ "uid": "018",
140
+ "width": "3",
141
+ "height": "1",
142
+ "depth": "3"
143
+ },
144
+ {
145
+ "uid": "019",
146
+ "width": "5",
147
+ "height": "1",
148
+ "depth": "5"
149
+ },
150
+ {
151
+ "uid": "020",
152
+ "width": "3",
153
+ "height": "1",
154
+ "depth": "3"
155
+ },
156
+ {
157
+ "uid": "021",
158
+ "width": "5",
159
+ "height": "1",
160
+ "depth": "5"
161
+ },
162
+ {
163
+ "uid": "022",
164
+ "width": "7",
165
+ "height": "1",
166
+ "depth": "7"
167
+ },
168
+ {
169
+ "uid": "023",
170
+ "width": "3",
171
+ "height": "1",
172
+ "depth": "3"
173
+ },
174
+ {
175
+ "uid": "024",
176
+ "width": "6",
177
+ "height": "10",
178
+ "depth": "6"
179
+ },
180
+ {
181
+ "uid": "025",
182
+ "width": "5",
183
+ "height": "1",
184
+ "depth": "5"
185
+ },
186
+ {
187
+ "uid": "026",
188
+ "width": "2",
189
+ "height": "1",
190
+ "depth": "2"
191
+ }
192
+ ]
@@ -22,7 +22,7 @@
22
22
 
23
23
  <body>
24
24
  <a-scene id="AframeScene" networked-scene="
25
- room: demo_jetuml;
25
+ room: index_multi_boats;
26
26
  adapter: easyrtc;
27
27
  debug: true;
28
28
  audio: true;
@@ -47,39 +47,19 @@
47
47
  <a-text class="username-tag"></a-text>
48
48
  </template>
49
49
 
50
- <!-- Querier and treebuilder -->
51
- <template id="querier-template">
52
- <a-entity class="querier"></a-entity>
53
- </template>
54
- <template id="treebuilder-template">
55
- <a-entity class="treebuilder"></a-entity>
56
- </template>
57
-
58
- <!-- Boats -->
59
- <template id="boats-template">
60
- <a-entity class="boats"></a-entity>
61
- </template>
62
50
  </a-assets>
63
51
 
64
52
  <!-- Environment -->
65
- <a-entity environment="preset: yavapai" renderer="antialias: true">
66
-
53
+ <a-entity environment="preset: yavapai" renderer="antialias: true"></a-entity>
67
54
 
68
- <!-- Sync entities, persistent -->
69
55
  <!-- Querier -->
70
- <a-entity id="datajetuml" babia-queryjson="url: ./jetuml_code_data.json;"
71
- networked="template:#querier-template; networkId:querier; persistent: true; owner: scene"></a-entity>
56
+ <a-entity id="datajetuml" babia-queryjson="url: ./jetuml_code_data.json;"></a-entity>
72
57
  <!-- Treebuilder -->
73
- <a-entity id="treedata" babia-treebuilder="field: file_path; split_by: /; from: datajetuml"
74
- networked="template:#treebuilder-template; networkId:treebuilder; persistent: true; owner: scene">
75
- </a-entity>
76
-
58
+ <a-entity id="treedata" babia-treebuilder="field: file_path; split_by: /; from: datajetuml"></a-entity>
77
59
  <!-- Boats Visualizer -->
78
60
  <a-entity babia-boats="from: treedata; area: num_funs; height: loc_per_function; color: ccn"
79
- networked="template:#boats-template; networkId:boats; persistent: true; owner: scene" position="0 0.1 0"
80
- scale="0.03 0.03 0.03"></a-entity>
61
+ position="0 0.1 0"scale="0.03 0.03 0.03"></a-entity>
81
62
 
82
- <!--Sync entities, not persistent-->
83
63
  <!-- Camera -->
84
64
  <a-entity id="rig" position="2.25 1.6 3" rotation="0 0 0"
85
65
  networked="template:#rig-template; attachTemplateToLocal:false">
@@ -92,23 +72,31 @@
92
72
  position="-0.5 1.5 0" width="5" color="black" value="username"></a-text>
93
73
  </a-sphere>
94
74
  </a-entity>
95
- </a-entity>
96
- <!-- Hand Controls -->
75
+ <!-- Hand Controls -->
97
76
  <a-entity id="leftHand" oculus-touch-controls="hand: left"
98
- teleport-controls="cameraRig: #rig; teleportOrigin: #avatar; collisionEntities: #environmentGround;
99
- hitCylinderColor: #ff3468; curveHitColor: #ff3468; curveMissColor: #333333; curveLineWidth: 0.01; button: trigger"></a-entity>
77
+ teleport-controls="cameraRig: #rig; teleportOrigin: #avatar; collisionEntities: #environmentGround;
78
+ hitCylinderColor: #ff3468; curveHitColor: #ff3468; curveMissColor: #333333; curveLineWidth: 0.01; button: trigger"></a-entity>
100
79
  <a-entity id="rightHand" laser-controls="hand: right" oculus-touch-controls="hand: right"
101
80
  raycaster="objects: .babiaxraycasterclass, #audio_button"></a-entity>
102
81
  <a-entity id="cursor" cursor="rayOrigin:mouse" raycaster="objects: .babiaxraycasterclass, #audio_button">
103
82
  </a-entity>
104
83
  </a-entity>
84
+
85
+
86
+
87
+ <!-- Audio Button -->
88
+ <a-plane id="audio_button" position="7 2.5 0" rotation="0 0 0" height="0.5" width="1.5" color="#000" scale="0.5 0.5 0.5">
89
+ <a-text id="audio_label" value="Stop Audio" color="#fff" width="4" position="-0.5 0 0" rotation="0 0 0">
90
+ </a-text>
91
+ </a-plane>
105
92
 
106
93
  </a-scene>
107
94
 
108
95
  <script>
96
+ /* Avatar */
109
97
  let avatar = document.getElementById('avatar')
110
98
  let usernameTag = document.getElementById('username-tag')
111
-
99
+
112
100
  let color = getRandomColor();
113
101
  usernameTag.setAttribute('value', color)
114
102
  avatar.setAttribute('color', color)
@@ -122,6 +110,37 @@
122
110
  return color;
123
111
 
124
112
  }
113
+
114
+ /* Audio */
115
+ let audioButton = document.getElementById('audio_button');
116
+ let audioLabel = document.getElementById('audio_label');
117
+
118
+ audioButton.addEventListener('click', function (event) {
119
+ if (audioLabel.getAttribute('value') === 'Stop Audio') {
120
+ stopAudio();
121
+ } else {
122
+ turnOnAudio();
123
+ }
124
+ });
125
+ function turnOnAudio() {
126
+ NAF.connection.adapter.enableMicrophone(true);
127
+ audioButton.setAttribute('color', '#000');
128
+ audioLabel.setAttribute('color', '#fff');
129
+ audioLabel.setAttribute('value', 'Stop Audio');
130
+ }
131
+
132
+ function stopAudio() {
133
+ NAF.connection.adapter.enableMicrophone(false);
134
+ audioButton.setAttribute('color', '#fff');
135
+ audioLabel.setAttribute('color', '#000');
136
+ audioLabel.setAttribute('value', 'Turn on Audio');
137
+ }
138
+
139
+ /* Update avatar height in VR */
140
+
141
+ document.addEventListener('controllerconnected', (event) => {
142
+ rig.setAttribute('position', { x: 4, y: 1.6, z: 3 })
143
+ })
125
144
  </script>
126
145
  <script>
127
146
  // Schemas with components and attributes for syncronization
@@ -162,35 +181,11 @@
162
181
  ]
163
182
  });
164
183
 
165
- NAF.schemas.add({
166
- template: '#querier-template',
167
- components: [
168
- 'babia-queryjson'
169
- ]
170
- })
171
-
172
- NAF.schemas.add({
173
- template: '#treebuilder-template',
174
- components: [
175
- 'babia-treebuilder'
176
- ]
177
- })
178
-
179
- NAF.schemas.add({
180
- template: '#boats-template',
181
- components: [
182
- 'position',
183
- 'rotation',
184
- 'scale',
185
- 'babia-boats'
186
- ]
187
- });
188
-
189
184
  </script>
190
185
 
191
186
  <!-- GITLAB CORNER-->
192
187
  <div class="gitlab-corner-wrapper"><a
193
- href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples/multi_boats/index.html"
188
+ href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples/multi_boats/index_multi_boats.html"
194
189
  class="gitlab-corner" aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art"
195
190
  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586 559">
196
191
  <g id="g44">
@@ -3,8 +3,8 @@
3
3
 
4
4
  <head>
5
5
  <meta charset="utf-8">
6
- <title>A-Frame Boats Component - Animated (Front)</title>
7
- <meta name="description" content="Temporal Evolution for Boats component.">
6
+ <title>BabiaXR - Multiuser Babia-boats Demo</title>
7
+ <meta name="description" content="Babiaxr multiuser demo using babia-boats.">
8
8
  </meta>
9
9
  <!-- Aframe -->
10
10
  <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
@@ -22,18 +22,25 @@
22
22
 
23
23
  <body>
24
24
  <a-scene id="AframeScene" networked-scene="
25
- room: demo_jetuml;
25
+ room: multi_boats_jetuml;
26
26
  adapter: easyrtc;
27
27
  debug: true;
28
28
  audio: true;
29
- serverURL: https://f-l2108-pc02.aulas.etsit.urjc.es:49153/">
29
+ serverURL: https://f-l2108-pc02.aulas.etsit.urjc.es:49153/;
30
+ ">
30
31
 
31
32
  <a-assets>
32
33
  <!-- Dummy asset to make the scene sync (WIP)-->
33
34
  <img src="https://wallpapercave.com/wp/wp2345390.jpg?dummy=8484744">
34
35
 
35
36
  <!-- Templates -->
36
- <!-- Camara -->
37
+
38
+ <!-- Selector and navigator -->
39
+ <template id="selector-template">
40
+ <a-entity class="selector"></a-entity>
41
+ </template>
42
+
43
+ <!-- Camera -->
37
44
  <template id="rig-template">
38
45
  <a-entity class="rig"></a-entity>
39
46
  </template>
@@ -46,51 +53,30 @@
46
53
  <template id="username-tag-template">
47
54
  <a-text class="username-tag"></a-text>
48
55
  </template>
49
-
50
- <!-- Querier , Selector and treebuilder -->
51
- <template id="querier-template">
52
- <a-entity class="querier"></a-entity>
53
- </template>
54
- <template id="selector-template">
55
- <a-entity class="selector"></a-entity>
56
- </template>
57
- <template id="treebuilder-template">
58
- <a-entity class="treebuilder"></a-entity>
59
- </template>
60
-
61
- <!-- Boats -->
62
- <template id="boats-template">
63
- <a-entity class="boats"></a-entity>
64
- </template>
65
56
  </a-assets>
66
57
 
67
58
  <!-- Environment -->
68
- <a-entity environment="preset: yavapai" renderer="antialias: true">
59
+ <a-entity environment="preset: yavapai" renderer="antialias: true"></a-entity>
69
60
 
70
- <!-- No sync entities -->
71
61
  <!-- Slider -->
72
- <a-entity id="nav" babia-navigator position="6.5 1 1" rotation="0 0 0" scale="0.5 0.5 0.5"></a-entity>
62
+ <a-entity id="nav" babia-navigator position="6 1 1" rotation="0 0 0" scale="0.5 0.5 0.5"
63
+ ></a-entity>
73
64
 
74
- <!-- Sync entities, persistent -->
75
65
  <!-- Querier -->
76
- <a-entity id="datajetuml" babia-queryjson="url: ../selector_boats/jetuml_evol_data.json;"
77
- networked="template:#querier-template; networkId:querier; persistent: true; owner: scene"></a-entity>
78
- <!-- 3 Selector -->
79
- <a-entity id="selector" babia-selector="from: datajetuml; controller: nav"
80
- networked="template:#selector-template; networkId:selector; persistent: true; owner: scene"></a-entity>
66
+ <a-entity id="querier" babia-queryjson="url:../selector_boats/jetuml_evol_data.json;"></a-entity>
67
+ <!-- Selector -->
68
+ <a-entity id="selector" networked="template:#selector-template; networkId:selector; persistent: true; owner: scene"
69
+ babia-selector="from: querier; controller: nav"
70
+ ></a-entity>
81
71
  <!-- Treebuilder -->
82
- <a-entity id="treedata" babia-treebuilder="field: path; split_by: /; from: selector"
83
- networked="template:#treebuilder-template; networkId:treebuilder; persistent: true; owner: scene">
84
- </a-entity>
72
+ <a-entity id="treebuilder" babia-treebuilder="field: path; split_by: /; from: selector"></a-entity>
85
73
 
86
74
  <!-- Boats Visualizer -->
87
- <a-entity babia-boats="from: treedata; area: num_funs; height: loc_per_function; color: ccn"
88
- networked="template:#boats-template; networkId:boats; persistent: true; owner: scene" position="0 0.1 0"
89
- scale="0.03 0.03 0.03"></a-entity>
75
+ <a-entity id="boats" babia-boats="from: treebuilder; area: num_funs; height: loc_per_function; color: ccn"
76
+ position="1 0.1 0" scale="0.03 0.03 0.03"></a-entity>
90
77
 
91
- <!--Sync entities, not persistent-->
92
78
  <!-- Camera -->
93
- <a-entity id="rig" position="2.25 1.6 3" rotation="0 0 0"
79
+ <a-entity id="rig" position="4 1.6 3" rotation="0 0 0"
94
80
  networked="template:#rig-template; attachTemplateToLocal:false">
95
81
  <a-entity id="camera" camera look-controls wasd-controls="fly: false"
96
82
  networked="template:#camera-template;attachTemplateToLocal:false;">
@@ -101,23 +87,43 @@
101
87
  position="-0.5 1.5 0" width="5" color="black" value="username"></a-text>
102
88
  </a-sphere>
103
89
  </a-entity>
90
+ <!-- Hand Controls -->
91
+ <a-entity id="leftHand" interaction-hands aabb-collider="objects: .grabbable"
92
+ hand-controls="hand: left; handModelStyle: highPoly" mixin="touch"
93
+ teleport-controls="cameraRig: #cameraRig; teleportOrigin: #head; collisionEntities: .environmentGround;
94
+ hitCylinderColor: #ff3468; curveHitColor: #ff3468; curveMissColor: #333333; curveLineWidth: 0.01; button: grip">
95
+ <a-entity id="tooltip_trigger_L" class="tips" tooltip="text: Grab; width: 0.07; height: 0.03; targetPosition: 0.002 -0.02 -0.014; lineHorizontalAlign: right; rotation: -90 0 0; src:assets/tooltip.png"
96
+ position="-0.09 -0.04 -0.08"></a-entity>
97
+ <a-entity id="tooltip_grip_L" class="tips" tooltip="text: Teleport; width: 0.08; height: 0.04; targetPosition: 0.006 -0.008 0.033; rotation: -90 0 0; src:assets/tooltip.png"
98
+ position="0.085 -0.01 0.07"></a-entity>
99
+ </a-entity>
100
+ <a-entity id="rightHand" interaction-hands aabb-collider="objects: .grabbable"
101
+ hand-controls="hand: right; handModelStyle: highPoly" mixin="touch"
102
+ laser-controls="hand: right" raycaster="objects: .babiaxraycasterclass, #audio_button">
103
+ <a-entity id="tooltip_trigger_R" class="tips" tooltip="text: Click/Grab ; width: 0.07; height: 0.03; targetPosition: 0.005 -0.02 -0.014; lineHorizontalAlign: left; rotation: -90 0 0; src:assets/tooltip.png"
104
+ position="0.09 -0.04 -0.08"></a-entity>
105
+ <a-entity id="tooltip_grip_R" class="tips" tooltip="text: Open/Close \nTips; width: 0.08; height: 0.04; targetPosition: -0.006 -0.008 0.033; rotation: -90 0 0; lineHorizontalAlign: right; src:assets/tooltip.png"
106
+ position="-0.085 -0.01 0.07"></a-entity>
104
107
  </a-entity>
105
- <!-- Hand Controls -->
106
- <a-entity id="leftHand" oculus-touch-controls="hand: left"
107
- teleport-controls="cameraRig: #rig; teleportOrigin: #avatar; collisionEntities: #environmentGround;
108
- hitCylinderColor: #ff3468; curveHitColor: #ff3468; curveMissColor: #333333; curveLineWidth: 0.01; button: trigger"></a-entity>
109
- <a-entity id="rightHand" laser-controls="hand: right" oculus-touch-controls="hand: right"
110
- raycaster="objects: .babiaxraycasterclass, #audio_button"></a-entity>
111
108
  <a-entity id="cursor" cursor="rayOrigin:mouse" raycaster="objects: .babiaxraycasterclass, #audio_button">
112
109
  </a-entity>
113
110
  </a-entity>
114
111
 
112
+ <!-- Audio Button -->
113
+ <a-plane id="audio_button" position="7 2.5 0" rotation="0 0 0" height="0.5" width="1.5" color="#000" scale="0.5 0.5 0.5">
114
+ <a-text id="audio_label" value="Stop Audio" color="#fff" width="4" position="-0.5 0 0" rotation="0 0 0">
115
+ </a-text>
116
+ </a-plane>
117
+
118
+
115
119
  </a-scene>
116
120
 
117
121
  <script>
122
+ /* Camera */
123
+ let rig = document.getElementById('rig')
118
124
  let avatar = document.getElementById('avatar')
119
125
  let usernameTag = document.getElementById('username-tag')
120
-
126
+
121
127
  let color = getRandomColor();
122
128
  usernameTag.setAttribute('value', color)
123
129
  avatar.setAttribute('color', color)
@@ -129,11 +135,50 @@
129
135
  color += digits[Math.floor(Math.random() * 16)];
130
136
  }
131
137
  return color;
138
+ }
139
+
140
+ /* Audio */
141
+ let audioButton = document.getElementById('audio_button');
142
+ let audioLabel = document.getElementById('audio_label');
143
+
144
+ audioButton.addEventListener('click', function (event) {
145
+ if (audioLabel.getAttribute('value') === 'Stop Audio') {
146
+ stopAudio();
147
+ } else {
148
+ turnOnAudio();
149
+ }
150
+ });
151
+ function turnOnAudio() {
152
+ NAF.connection.adapter.enableMicrophone(true);
153
+ audioButton.setAttribute('color', '#000');
154
+ audioLabel.setAttribute('color', '#fff');
155
+ audioLabel.setAttribute('value', 'Stop Audio');
156
+ }
132
157
 
158
+ function stopAudio() {
159
+ NAF.connection.adapter.enableMicrophone(false);
160
+ audioButton.setAttribute('color', '#fff');
161
+ audioLabel.setAttribute('color', '#000');
162
+ audioLabel.setAttribute('value', 'Turn on Audio');
133
163
  }
164
+
165
+
166
+ /* Update avatar height in VR */
167
+
168
+ document.addEventListener('controllerconnected', (event) => {
169
+ rig.setAttribute('position', { x: 4, y: 1.6, z: 3 })
170
+ })
171
+
134
172
  </script>
135
173
  <script>
136
- // Schemas with components and attributes for syncronization
174
+ NAF.schemas.add({
175
+ template: '#selector-template',
176
+ components: [
177
+ 'babia-selector'
178
+ ]
179
+ })
180
+
181
+ // Avatar
137
182
  NAF.schemas.add({
138
183
  template: '#rig-template',
139
184
  components: [
@@ -170,78 +215,42 @@
170
215
  'rotation'
171
216
  ]
172
217
  });
173
-
174
-
175
- NAF.schemas.add({
176
- template: '#querier-template',
177
- components: [
178
- 'babia-queryjson'
179
- ]
180
- })
181
-
182
- NAF.schemas.add({
183
- template: '#selector-template',
184
- components: [
185
- 'babia-selector'
186
- ]
187
- })
188
-
189
- NAF.schemas.add({
190
- template: '#treebuilder-template',
191
- components: [
192
- 'babia-treebuilder'
193
- ]
194
- })
195
-
196
- NAF.schemas.add({
197
- template: '#boats-template',
198
- components: [
199
- 'position',
200
- 'rotation',
201
- 'scale',
202
- 'babia-boats'
203
- ]
204
- });
205
-
206
218
  </script>
207
219
 
208
-
209
-
210
220
  <!-- GITLAB CORNER-->
211
221
  <div class="gitlab-corner-wrapper"><a
212
- href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples/selector_boats/index.html"
213
- class="gitlab-corner" aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art"
214
- xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586 559">
215
- <g id="g44">
216
- <path id="path46" class="cls-1"
217
- d="M461.17,301.83l-18.91-58.12L404.84,128.43a6.47,6.47,0,0,0-12.27,0L355.15,243.64H230.82L193.4,128.43a6.46,6.46,0,0,0-12.26,0L143.78,243.64l-18.91,58.19a12.88,12.88,0,0,0,4.66,14.39L293,435,456.44,316.22a12.9,12.9,0,0,0,4.73-14.39" />
218
- </g>
219
- <g id="g48">
220
- <path id="path50" class="cls-2" d="M293,434.91h0l62.16-191.28H230.87L293,434.91Z" />
221
- </g>
222
- <g id="g56">
223
- <path id="path58" class="cls-1" d="M293,434.91,230.82,243.63h-87L293,434.91Z" />
224
- </g>
225
- <g id="g64">
226
- <path id="path66" class="cls-3"
227
- d="M143.75,243.69h0l-18.91,58.12a12.88,12.88,0,0,0,4.66,14.39L293,435,143.75,243.69Z" />
228
- </g>
229
- <g id="g72">
230
- <path id="path74" class="cls-2"
231
- d="M143.78,243.69h87.11L193.4,128.49a6.47,6.47,0,0,0-12.27,0l-37.35,115.2Z" />
232
- </g>
233
- <g id="g76">
234
- <path id="path78" class="cls-1" d="M293,434.91l62.16-191.28H442.3L293,434.91Z" />
235
- </g>
236
- <g id="g80">
237
- <path id="path82" class="cls-3"
238
- d="M442.24,243.69h0l18.91,58.12a12.85,12.85,0,0,1-4.66,14.39L293,434.91l149.2-191.22Z" />
239
- </g>
240
- <g id="g84">
241
- <path id="path86" class="cls-2"
242
- d="M442.28,243.69h-87.1l37.42-115.2a6.46,6.46,0,0,1,12.26,0l37.42,115.2Z" />
243
- </g>
244
- </svg></a></div>
222
+ href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples/multi_boats/jetuml.html"
223
+ class="gitlab-corner" aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art"
224
+ xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586 559">
225
+ <g id="g44">
226
+ <path id="path46" class="cls-1"
227
+ d="M461.17,301.83l-18.91-58.12L404.84,128.43a6.47,6.47,0,0,0-12.27,0L355.15,243.64H230.82L193.4,128.43a6.46,6.46,0,0,0-12.26,0L143.78,243.64l-18.91,58.19a12.88,12.88,0,0,0,4.66,14.39L293,435,456.44,316.22a12.9,12.9,0,0,0,4.73-14.39" />
228
+ </g>
229
+ <g id="g48">
230
+ <path id="path50" class="cls-2" d="M293,434.91h0l62.16-191.28H230.87L293,434.91Z" />
231
+ </g>
232
+ <g id="g56">
233
+ <path id="path58" class="cls-1" d="M293,434.91,230.82,243.63h-87L293,434.91Z" />
234
+ </g>
235
+ <g id="g64">
236
+ <path id="path66" class="cls-3"
237
+ d="M143.75,243.69h0l-18.91,58.12a12.88,12.88,0,0,0,4.66,14.39L293,435,143.75,243.69Z" />
238
+ </g>
239
+ <g id="g72">
240
+ <path id="path74" class="cls-2"
241
+ d="M143.78,243.69h87.11L193.4,128.49a6.47,6.47,0,0,0-12.27,0l-37.35,115.2Z" />
242
+ </g>
243
+ <g id="g76">
244
+ <path id="path78" class="cls-1" d="M293,434.91l62.16-191.28H442.3L293,434.91Z" />
245
+ </g>
246
+ <g id="g80">
247
+ <path id="path82" class="cls-3"
248
+ d="M442.24,243.69h0l18.91,58.12a12.85,12.85,0,0,1-4.66,14.39L293,434.91l149.2-191.22Z" />
249
+ </g>
250
+ <g id="g84">
251
+ <path id="path86" class="cls-2"
252
+ d="M442.28,243.69h-87.1l37.42-115.2a6.46,6.46,0,0,1,12.26,0l37.42,115.2Z" />
253
+ </g>
254
+ </svg></a></div>
245
255
  </body>
246
-
247
256
  </html>