aframe-babia-components 1.2.9 → 1.3.0
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.
- package/components/filters/babia-selector.js +33 -21
- package/components/filters/babia-treebuilder.js +14 -13
- package/components/others/babia-navigator.js +94 -37
- package/components/others/babia-poster.js +369 -368
- package/components/others/babia-slider.js +63 -25
- package/components/others/common.js +60 -80
- package/components/visualizers/babia-html.js +95 -118
- package/components/visualizers/babia-map.js +796 -0
- package/dist/aframe-babia-components.js +7249 -6492
- package/dist/aframe-babia-components.min.js +1 -1
- package/dist/aframe-babia-components.min.js.LICENSE.txt +1 -1
- package/dist/aframe-babia-components.min.js.map +1 -1
- package/docs/APIs/OTHERS.md +4 -4
- package/docs/CONTRIBUTING.md +34 -25
- package/docs/RELEASE_NOTES.md +9 -2
- package/docs/Tutorials/HOW_TO_USE_BABIA_MAP.md +554 -0
- package/docs/Tutorials/ejemplo1.png +0 -0
- package/docs/Tutorials/ejemplo2.png +0 -0
- package/docs/Tutorials/ejemplo3.png +0 -0
- package/docs/Tutorials/pyramids.png +0 -0
- package/docs/Tutorials/singular.png +0 -0
- package/docs/Tutorials/terrain-vr-scenario.png +0 -0
- package/docs/Tutorials/terrain.png +0 -0
- package/examples/boats/boats2/data.json +206 -13
- package/examples/charts/pie/index.html +0 -5
- package/examples/demos/map-terrain/assets/360-panorama.jpg +0 -0
- package/examples/demos/map-terrain/assets/floor-texture.jpg +0 -0
- package/examples/demos/map-terrain/assets/mapTextures/512sample.webp +0 -0
- package/examples/demos/map-terrain/assets/mapTextures/defaultTexture.webp +0 -0
- package/examples/demos/map-terrain/assets/maps/defaultMap.png +0 -0
- package/examples/demos/map-terrain/assets/maps/example.png +0 -0
- package/examples/demos/map-terrain/assets/metalic-texture.jpg +0 -0
- package/examples/demos/map-terrain/dist/aframe-lounge-component.min.js +1 -0
- package/examples/demos/map-terrain/index.html +82 -0
- package/examples/demos/map-terrain/index_gallery.html +188 -0
- package/examples/demos/map-terrain/main_data.json +1 -0
- package/examples/demos/map-terrain/pyramids.html +130 -0
- package/examples/js/aframe-orbit-controls-component.js +1060 -0
- package/examples/ui/pie/index.html +0 -1
- package/index.html +15 -0
- package/index.js +1 -0
- package/package.json +5 -5
- package/tests/screenshots/other_snapshots.js/pyramids.png +0 -0
- package/tests/screenshots/other_snapshots.js/singular.png +0 -0
- package/tests/screenshots/other_snapshots.js/terrain-vr-scenario.png +0 -0
- package/tests/screenshots/other_snapshots.js/terrain.png +0 -0
- package/webpack.common.js +1 -1
- package/webpack.dev.js +17 -0
- package/examples/demos/citations/babiaxr.json +0 -1
- package/examples/demos/citations/citations.html +0 -72
- package/examples/demos/citations/music.mp3 +0 -0
- package/examples/demos/citations/stl.js +0 -28
|
@@ -1,48 +1,241 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"id": "/barrio",
|
|
4
|
+
"children": [
|
|
5
|
+
{
|
|
6
|
+
"id": "/barrio/block1",
|
|
7
|
+
"width": "3",
|
|
8
|
+
"height": "1",
|
|
9
|
+
"depth": "3"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "/barrio/subarrio",
|
|
13
|
+
"children": [
|
|
14
|
+
{
|
|
15
|
+
"id": "/barrio/subarrio/block1",
|
|
16
|
+
"width": "5",
|
|
17
|
+
"height": "2",
|
|
18
|
+
"depth": "5"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "/barrio/subarrio/block2",
|
|
22
|
+
"width": "3",
|
|
23
|
+
"height": "1",
|
|
24
|
+
"depth": "3"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"id": "/barrio2",
|
|
32
|
+
"children": [
|
|
33
|
+
{
|
|
34
|
+
"id": "/barrio2/block1",
|
|
35
|
+
"width": "3",
|
|
36
|
+
"height": "1",
|
|
37
|
+
"depth": "3"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "/barrio2/subarrio",
|
|
41
|
+
"children": [
|
|
42
|
+
{
|
|
43
|
+
"id": "/barrio2/subarrio/block1",
|
|
44
|
+
"width": "5",
|
|
45
|
+
"height": "2",
|
|
46
|
+
"depth": "5"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "/barrio2/subarrio/block2",
|
|
50
|
+
"width": "3",
|
|
51
|
+
"height": "1",
|
|
52
|
+
"depth": "3"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "/barrio2/subarrio/block3",
|
|
56
|
+
"width": "1",
|
|
57
|
+
"height": "5",
|
|
58
|
+
"depth": "1"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "/barrio2/block2",
|
|
64
|
+
"width": "2",
|
|
65
|
+
"height": "3",
|
|
66
|
+
"depth": "2"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "/barrio3",
|
|
72
|
+
"children": [
|
|
73
|
+
{
|
|
74
|
+
"id": "/barrio3/block1",
|
|
75
|
+
"width": "2",
|
|
76
|
+
"height": "1",
|
|
77
|
+
"depth": "2"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "/barrio2/block2",
|
|
81
|
+
"width": "2",
|
|
82
|
+
"height": "3",
|
|
83
|
+
"depth": "2"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "/barrio3/subarrio",
|
|
87
|
+
"children": [
|
|
88
|
+
{
|
|
89
|
+
"id": "/barrio3/subarrio/block2",
|
|
90
|
+
"width": "3",
|
|
91
|
+
"height": "1",
|
|
92
|
+
"depth": "3"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "/barrio3/subarrio/block3",
|
|
96
|
+
"width": "1",
|
|
97
|
+
"height": "5",
|
|
98
|
+
"depth": "1"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
2
104
|
{
|
|
3
105
|
"id": "001",
|
|
106
|
+
"width": "5",
|
|
4
107
|
"height": "1",
|
|
5
|
-
"
|
|
108
|
+
"depth": "5"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "003",
|
|
112
|
+
"width": "5",
|
|
113
|
+
"height": "1",
|
|
114
|
+
"depth": "5"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "004",
|
|
118
|
+
"width": "2",
|
|
119
|
+
"height": "1",
|
|
120
|
+
"depth": "2"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "005",
|
|
124
|
+
"width": "3",
|
|
125
|
+
"height": "1",
|
|
126
|
+
"depth": "3"
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
{
|
|
130
|
+
"id": "006",
|
|
131
|
+
"width": "3",
|
|
132
|
+
"height": "1",
|
|
133
|
+
"depth": "3"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "/barrio4",
|
|
137
|
+
"children": [
|
|
138
|
+
{
|
|
139
|
+
"id": "/barrio4/block1",
|
|
140
|
+
"width": "3",
|
|
141
|
+
"height": "1",
|
|
142
|
+
"depth": "3"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"id": "/barrio4/subarrio",
|
|
146
|
+
"children": [
|
|
147
|
+
{
|
|
148
|
+
"id": "/barrio4/subarrio/block1",
|
|
149
|
+
"width": "5",
|
|
150
|
+
"height": "2",
|
|
151
|
+
"depth": "5"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "/barrio4/subarrio/block2",
|
|
155
|
+
"width": "3",
|
|
156
|
+
"height": "1",
|
|
157
|
+
"depth": "3"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "001",
|
|
165
|
+
"width": "5",
|
|
166
|
+
"height": "1",
|
|
167
|
+
"depth": "5"
|
|
6
168
|
},
|
|
7
169
|
{
|
|
8
170
|
"id": "002",
|
|
171
|
+
"width": "3",
|
|
9
172
|
"height": "1",
|
|
10
|
-
"
|
|
173
|
+
"depth": "3"
|
|
11
174
|
},
|
|
12
175
|
{
|
|
13
176
|
"id": "003",
|
|
177
|
+
"width": "5",
|
|
14
178
|
"height": "1",
|
|
15
|
-
"
|
|
179
|
+
"depth": "5"
|
|
16
180
|
},
|
|
17
181
|
{
|
|
18
182
|
"id": "004",
|
|
183
|
+
"width": "5",
|
|
19
184
|
"height": "1",
|
|
20
|
-
"
|
|
185
|
+
"depth": "5"
|
|
21
186
|
},
|
|
22
|
-
|
|
23
187
|
{
|
|
24
188
|
"id": "005",
|
|
189
|
+
"width": "3",
|
|
25
190
|
"height": "1",
|
|
26
|
-
"
|
|
191
|
+
"depth": "3"
|
|
27
192
|
},
|
|
28
193
|
{
|
|
29
194
|
"id": "006",
|
|
195
|
+
"width": "3",
|
|
196
|
+
"height": "1",
|
|
197
|
+
"depth": "3"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "001",
|
|
201
|
+
"width": "5",
|
|
202
|
+
"height": "1",
|
|
203
|
+
"depth": "5"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"id": "002",
|
|
207
|
+
"width": "3",
|
|
208
|
+
"height": "1",
|
|
209
|
+
"depth": "3"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"id": "003",
|
|
213
|
+
"width": "5",
|
|
214
|
+
"height": "1",
|
|
215
|
+
"depth": "5"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"id": "004",
|
|
219
|
+
"width": "5",
|
|
30
220
|
"height": "1",
|
|
31
|
-
"
|
|
221
|
+
"depth": "5"
|
|
32
222
|
},
|
|
33
223
|
{
|
|
34
|
-
"id": "
|
|
224
|
+
"id": "005",
|
|
225
|
+
"width": "3",
|
|
35
226
|
"height": "1",
|
|
36
|
-
"
|
|
227
|
+
"depth": "3"
|
|
37
228
|
},
|
|
38
229
|
{
|
|
39
|
-
"id": "
|
|
230
|
+
"id": "006",
|
|
231
|
+
"width": "3",
|
|
40
232
|
"height": "1",
|
|
41
|
-
"
|
|
233
|
+
"depth": "3"
|
|
42
234
|
},
|
|
43
235
|
{
|
|
44
|
-
"id": "
|
|
236
|
+
"id": "001",
|
|
237
|
+
"width": "5",
|
|
45
238
|
"height": "1",
|
|
46
|
-
"
|
|
239
|
+
"depth": "5"
|
|
47
240
|
}
|
|
48
241
|
]
|
|
@@ -26,11 +26,6 @@
|
|
|
26
26
|
data: [{"key":"kbn_network","points":10},{"key":"Maria","points":5},{"key":"Dave","points":9},{"key":"Jhon","points":12},{"key":"Sara","points":16},{"key":"Lemar","points":2},{"key":"Dawn","points":1},{"key":"Jesus","points":8},{"key":"Bitergia","points":3},{"key":"URJC","points":6},{"key":"Alice","points":22},{"key":"Pete","points":2},{"key":"Seth","points":6},{"key":"Martin","points":9}]'
|
|
27
27
|
position="-3 5 15" rotation="90 0 0"></a-entity>
|
|
28
28
|
|
|
29
|
-
<a-entity babia-doughnut='size: points; legend: true; palette: blues; title: babia-pie; titleColor: #FFFFFF;
|
|
30
|
-
titleFont: #optimerBoldFont; titlePosition: 4 0.5 1.5; animation: true;
|
|
31
|
-
data: [{"key":"kbn_network","points":10},{"key":"Maria","points":5},{"key":"Dave","points":9},{"key":"Jhon","points":12},{"key":"Sara","points":16},{"key":"Lemar","points":2},{"key":"Dawn","points":1},{"key":"Jesus","points":8},{"key":"Bitergia","points":3},{"key":"URJC","points":6},{"key":"Alice","points":22},{"key":"Pete","points":2},{"key":"Seth","points":6},{"key":"Martin","points":9}]'
|
|
32
|
-
position="0 5 15" rotation="90 0 0"></a-entity>
|
|
33
|
-
|
|
34
29
|
<a-entity movement-controls="fly: true" position="-3 5 20">
|
|
35
30
|
<a-entity camera position="0 0 0" look-controls></a-entity>
|
|
36
31
|
<a-entity cursor="rayOrigin:mouse"></a-entity>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var o in i)("object"==typeof exports?exports:t)[o]=i[o]}}(this,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available.");AFRAME.registerComponent("lounge-collider",{schema:{interval:{type:"number",default:80},objects:{type:"selectorAll",default:""}},init:function(){this.boundingBox=new THREE.Box3,this.boxCenter=new THREE.Vector3,this.objectEls=[],this.intersectedEls=[],this.previousIntersectedEls=[],this.newIntersectedEls=[],this.clearedIntersectedEls=[],this.prevCheckTime=void 0,this.observer=new MutationObserver(this.setDirty),this.setDirty=this.setDirty.bind(this),this.boxMax=new THREE.Vector3,this.boxMin=new THREE.Vector3},play:function(){this.observer.observe(this.el.sceneEl,{childList:!0,attributes:!0,subtree:!0}),this.el.sceneEl.addEventListener("object3dset",this.setDirty),this.el.sceneEl.addEventListener("object3dremove",this.setDirty)},remove:function(){this.observer.disconnect(),this.el.sceneEl.removeEventListener("object3dset",this.setDirty),this.el.sceneEl.removeEventListener("object3dremove",this.setDirty)},tick:function(t){const e=this.boundingBox,o=this.el,n=this.objectEls,l=this.intersectedEls,r=this.previousIntersectedEls,s=this.newIntersectedEls,a=this.clearedIntersectedEls,h=this.prevCheckTime;if(!(h&&t-h<this.data.interval)){this.prevCheckTime=t,this.dirty&&this.refreshObjects(),e.setFromObject(o.object3D),this.boxMin.copy(e.min),this.boxMax.copy(e.max),e.getCenter(this.boxCenter),r.length=0;for(let t=0;t<l.length;t++)r[t]=l[t];for(l.length=0,i=0;i<n.length;i++)n[i]!==this.el&&this.isIntersecting(n[i])&&l.push(n[i]);for(s.length=0,i=0;i<l.length;i++)-1===r.indexOf(l[i])&&s.push(l[i]);for(a.length=0,i=0;i<r.length;i++)-1===l.indexOf(r[i])&&(r[i].emit("hitend"),a.push(r[i]));for(i=0;i<s.length;i++)s[i]!==this.el&&s[i].emit("hitstart")}},isIntersecting:function(t){let e;if(!t.object3D)return!1;t.object3D.aabbBox||(t.object3D.aabbBox=(new THREE.Box3).setFromObject(t.object3D),t.object3D.boundingBoxCenter=new THREE.Vector3,t.object3D.aabbBox.getCenter(t.object3D.boundingBoxCenter)),e=t.object3D.aabbBox;const i=e.min,o=e.max;return this.boxMin.x<=o.x&&this.boxMax.x>=i.x&&this.boxMin.y<=o.y&&this.boxMax.y>=i.y&&this.boxMin.z<=o.z&&this.boxMax.z>=i.z},setDirty:function(){this.dirty=!0},refreshObjects:function(){const t=this.data;t.objects?this.objectEls=this.el.sceneEl.querySelectorAll(t.objects):this.objectEls=this.el.sceneEl.children,this.dirty=!1}}),AFRAME.registerComponent("lounge-plinth",{schema:{width:{type:"number",default:1},depth:{type:"number",default:1},height:{type:"number",default:.5},color:{type:"color",default:"#404040"}},multiple:!1,init:function(){let t=this.el,e=this.data;console.log("lounge-plinth (init)"),this.el.setAttribute("geometry",{primitive:"box",width:this.data.width,depth:this.data.depth,height:this.data.height}),this.el.setAttribute("material",{color:this.data.color}),this.el.addEventListener("staydown",(function(i){let o=t.object3D.worldToLocal(i.detail.worldPosition);t.object3D.position.y=o.y+e.height/2}))},update:function(t){},remove:function(){}}),AFRAME.registerComponent("lounge-staydown",{schema:{},multiple:!1,floor_level:function(t){localPosition=new THREE.Vector3(t.x,t.y,t.z),this.el.object3D.updateMatrixWorld(),this.el.emit("staydown",{worldPosition:this.el.object3D.localToWorld(localPosition)},!1)},init:function(){console.log("lounge-staydown component (init)");let t=this.floor_level.bind(this),e=this.el;for(;(e=e.parentNode)&&!("lounge"in e.attributes););let i=e;i.addEventListener("loaded",(function(){let e=i.querySelector("a-entity[lounge-floor]"),o=e.components["lounge-floor"];"data"in o?t(o.data.position):e.addEventListener("componentinitialized",(function(e){"lounge-floor"==e.detail.name&&t(o.data.position)}))}))},update:function(t){},remove:function(){}}),AFRAME.registerComponent("lounge-entry-point",{schema:{loungeId:{type:"string",default:"lounge"}},multiple:!1,init:function(){let t=this.el;console.log("lounge-entry-point component (init)");let e=document.getElementById(this.data.loungeId);null==e&&(e=document.querySelector("a-entity[lounge]")),e.addEventListener("componentinitialized",(function(i){if("lounge"==i.detail.name){let i=e.components.lounge.entry_point(),o=t.object3D.worldToLocal(i);t.object3D.position.copy(o)}}))},update:function(t){},remove:function(){}}),AFRAME.registerComponent("lounge-floor",{schema:{width:{type:"number",default:10},depth:{type:"number",default:7},color:{type:"color",default:""},texture:{type:"asset",default:""},position:{type:"vec3",default:{x:0,y:0,z:0}}},multiple:!1,init:function(){console.log("lounge-floor component (init)"),this.floor=document.createElement("a-plane"),this.floor.setAttribute("class","lounge-floor"),""==this.data.color&&""==this.data.texture&&(this.data.color="#808080"),this.floor.setAttribute("color",this.data.color),this.floor.setAttribute("src",this.data.texture),this.floor.setAttribute("width",this.data.width),this.floor.setAttribute("height",this.data.depth),this.floor.setAttribute("position",this.data.position),this.floor.setAttribute("rotation","270 0 0"),this.floor.setAttribute("side","double"),this.el.appendChild(this.floor)},update:function(t){},remove:function(){}}),AFRAME.registerComponent("lounge-ceiling",{schema:{width:{type:"number",default:10},depth:{type:"number",default:7},color:{type:"color",default:"#808080"},position:{type:"vec3",default:{x:0,y:0,z:0}}},multiple:!1,init:function(){console.log("lounge-ceiling component (init)"),this.floor=document.createElement("a-plane"),this.floor.setAttribute("class","lounge-ceiling"),this.floor.setAttribute("color",this.data.color),this.floor.setAttribute("width",this.data.width),this.floor.setAttribute("height",this.data.depth),this.floor.setAttribute("position",this.data.position),this.floor.setAttribute("rotation","90 0 0"),this.floor.setAttribute("side","double"),this.el.appendChild(this.floor)},update:function(t){},remove:function(){}}),AFRAME.registerComponent("lounge-wall",{schema:{width:{type:"number",default:10},height:{type:"number",default:4},depth:{type:"number",default:.3},color:{type:"color",default:"#aaa4a4"},position:{type:"vec3",default:{x:0,y:0,z:0}},opacity:{type:"number",default:1},wireframe:{type:"boolean",default:!1}},multiple:!0,init:function(){data=this.data,console.log("lounge-wall component (init)"),this.wall=document.createElement("a-box"),this.wall.setAttribute("class","lounge-wall"),"north"==this.id?this.wall.setAttribute("rotation","0 0 0"):"east"==this.id?this.wall.setAttribute("rotation","0 90 0"):"south"==this.id?this.wall.setAttribute("rotation","0 180 0"):"west"==this.id&&this.wall.setAttribute("rotation","0 270 0"),this.el.appendChild(this.wall)},update:function(t){data=this.data,console.log("lounge-wall component (update)"),this.wall.setAttribute("color",data.color),this.wall.setAttribute("width",data.width),this.wall.setAttribute("depth",data.depth),this.wall.setAttribute("height",data.height),this.wall.setAttribute("position",data.position),data.opacity<1&&this.wall.setAttribute("material",{transparent:!0,opacity:data.opacity}),this.wall.setAttribute("wireframe",data.wireframe)},remove:function(){}}),AFRAME.registerComponent("lounge",{schema:{width:{type:"number",default:10},height:{type:"number",default:4},depth:{type:"number",default:7},floorColor:{type:"color",default:""},floorTexture:{type:"asset",default:""},north:{type:"string",default:"wall"},east:{type:"string",default:"wall"},south:{type:"string",default:"wall"},west:{type:"string",default:"wall"},wallColor:{type:"color",default:"#aaa4a4"},glassOpacity:{type:"number",default:.4},barrierHeight:{type:"number",default:1.4},ceiling:{type:"boolean",default:!0},entryPoint:{type:"vec3",default:{}}},multiple:!1,init:function(){let t=this.data;console.log("lounge component (init)"),this.lounge=document.createElement("a-entity"),this.lounge.setAttribute("lounge-floor",{color:t.floorColor,texture:t.floorTexture,width:t.width,depth:t.depth,position:{x:0,y:-t.height/2,z:0}});let e={};const i={north:{x:0,z:-t.depth/2,width:t.width},east:{x:t.width/2,z:0,width:t.depth},south:{x:0,z:t.depth/2,width:t.width},west:{x:-t.width/2,z:0,width:t.depth}};for(direction in i)wall={},["wall","barrier","glass"].includes(t[direction])&&(wall.x=i[direction].x,wall.z=i[direction].z,wall.width=i[direction].width,["wall","glass"].includes(t[direction])?(wall.height=t.height,wall.y=0):"barrier"==t[direction]&&(wall.height=t.barrierHeight,wall.y=(wall.height-t.height)/2),["glass","barrier"].includes(t[direction])?wall.opacity=t.glassOpacity:wall.opacity=1,e[direction]=wall);for(const t in e){const i=e[t];this.lounge.setAttribute("lounge-wall__"+t,{color:this.data.wallColor,width:i.width,height:i.height,position:{x:i.x,y:i.y,z:i.z},opacity:i.opacity})}this.data.ceiling&&this.lounge.setAttribute("lounge-ceiling",{color:this.data.ceilingColor,width:this.data.width,depth:this.data.depth,position:{x:0,y:this.data.height/2,z:0}}),this.el.appendChild(this.lounge),console.log(this.lounge)},update:function(t){},remove:function(){},pause:function(){},play:function(){},events:{},entry_point(){var t;return t=0==Object.keys(this.data.entryPoint).length?new THREE.Vector3(0,-this.data.height/2,this.data.depth/4):new THREE.Vector3(this.data.entryPoint.x,this.data.entryPoint.y,this.data.entryPoint.z),this.el.object3D.updateMatrixWorld(),this.el.object3D.localToWorld(t)}})}])}));
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>A-Frame Babia Map Terrain</title>
|
|
7
|
+
<meta name="description" content="Babia Map example" />
|
|
8
|
+
<script src="https://aframe.io/releases/1.7.0/aframe.min.js"></script>
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v7.2.0/dist/aframe-extras.min.js"></script>
|
|
10
|
+
<script src="https://unpkg.com/aframe-environment-component@1.3.1/dist/aframe-environment-component.min.js"></script>
|
|
11
|
+
<script src="https://unpkg.com/aframe-text-geometry-component@0.5.1/dist/aframe-text-geometry-component.min.js"></script>
|
|
12
|
+
<script src="../../../dist/aframe-babia-components.js"></script>
|
|
13
|
+
<link rel="stylesheet" href="../../assets/gitlab-corner.css">
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<a-scene background="color: #A8F3FF" id="AframeScene">
|
|
18
|
+
<!-- <a-entity environment></a-entity> -->
|
|
19
|
+
<a-light type="directional" color="#ffffff" intensity="1.5" position="5 10 5"></a-light>
|
|
20
|
+
|
|
21
|
+
<a-assets>
|
|
22
|
+
<a-asset-item id="optimerBoldFont" src="https://rawgit.com/mrdoob/three.js/dev/examples/fonts/optimer_bold.typeface.json"></a-asset-item>
|
|
23
|
+
</a-assets>
|
|
24
|
+
|
|
25
|
+
<a-entity id="map-terrain" class="collidable" babia-map="zoom: 5; x: 15; y: 12;" position="0 -200 0"></a-entity>
|
|
26
|
+
|
|
27
|
+
<!-- RIG de usuario -->
|
|
28
|
+
<a-entity id="rig" movement-controls="fly: true; speed: 0.1" position="0 1.6 0">
|
|
29
|
+
<!-- Cámara con controles -->
|
|
30
|
+
<a-entity id="head" camera look-controls wasd-controls></a-entity>
|
|
31
|
+
|
|
32
|
+
<!-- Mano derecha -->
|
|
33
|
+
<a-entity id="rightHand" laser-controls="hand: right" raycaster="objects: .collidable" line="color: red" visible="false"></a-entity>
|
|
34
|
+
|
|
35
|
+
<!-- Mano izquierda -->
|
|
36
|
+
<a-entity id="leftHand" laser-controls="hand: left" raycaster="objects: .collidable" line="color: blue" visible="false"></a-entity>
|
|
37
|
+
|
|
38
|
+
<!-- Cursor para escritorio -->
|
|
39
|
+
<a-entity cursor="rayOrigin: mouse" raycaster="objects: .collidable"></a-entity>
|
|
40
|
+
</a-scene>
|
|
41
|
+
|
|
42
|
+
<!-- TOKEN FORM-->
|
|
43
|
+
<form id="token-form" style="position: absolute; top: 20px; left: 30px; z-index: 999;">
|
|
44
|
+
<input type="text" id="token-input" placeholder="Introduce tu token de Mapbox" style="width: 200px;" />
|
|
45
|
+
<button type="submit">Guardar</button>
|
|
46
|
+
</form>
|
|
47
|
+
|
|
48
|
+
<!-- GITLAB CORNER-->
|
|
49
|
+
<div class="gitlab-corner-wrapper"><a href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples/demos/map-terrain/index.html" class="gitlab-corner"
|
|
50
|
+
aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art" xmlns="http://www.w3.org/2000/svg"
|
|
51
|
+
viewBox="0 0 586 559">
|
|
52
|
+
<g id="g44">
|
|
53
|
+
<path id="path46" class="cls-1"
|
|
54
|
+
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" />
|
|
55
|
+
</g>
|
|
56
|
+
<g id="g48">
|
|
57
|
+
<path id="path50" class="cls-2" d="M293,434.91h0l62.16-191.28H230.87L293,434.91Z" />
|
|
58
|
+
</g>
|
|
59
|
+
<g id="g56">
|
|
60
|
+
<path id="path58" class="cls-1" d="M293,434.91,230.82,243.63h-87L293,434.91Z" />
|
|
61
|
+
</g>
|
|
62
|
+
<g id="g64">
|
|
63
|
+
<path id="path66" class="cls-3"
|
|
64
|
+
d="M143.75,243.69h0l-18.91,58.12a12.88,12.88,0,0,0,4.66,14.39L293,435,143.75,243.69Z" />
|
|
65
|
+
</g>
|
|
66
|
+
<g id="g72">
|
|
67
|
+
<path id="path74" class="cls-2" d="M143.78,243.69h87.11L193.4,128.49a6.47,6.47,0,0,0-12.27,0l-37.35,115.2Z" />
|
|
68
|
+
</g>
|
|
69
|
+
<g id="g76">
|
|
70
|
+
<path id="path78" class="cls-1" d="M293,434.91l62.16-191.28H442.3L293,434.91Z" />
|
|
71
|
+
</g>
|
|
72
|
+
<g id="g80">
|
|
73
|
+
<path id="path82" class="cls-3"
|
|
74
|
+
d="M442.24,243.69h0l18.91,58.12a12.85,12.85,0,0,1-4.66,14.39L293,434.91l149.2-191.22Z" />
|
|
75
|
+
</g>
|
|
76
|
+
<g id="g84">
|
|
77
|
+
<path id="path86" class="cls-2" d="M442.28,243.69h-87.1l37.42-115.2a6.46,6.46,0,0,1,12.26,0l37.42,115.2Z" />
|
|
78
|
+
</g>
|
|
79
|
+
</svg></a></div>
|
|
80
|
+
|
|
81
|
+
</body>
|
|
82
|
+
</html>
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>BabiaXR Demo - Map Terrains </title>
|
|
7
|
+
<meta name="description" content="BabiaXR Map Terrain Gallery">
|
|
8
|
+
</meta>
|
|
9
|
+
<script src="https://aframe.io/releases/1.7.0/aframe.min.js"></script>
|
|
10
|
+
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/aframe-extras@v7.2.0/dist/aframe-extras.min.js"></script>
|
|
11
|
+
<script
|
|
12
|
+
src="https://unpkg.com/aframe-environment-component@1.3.3/dist/aframe-environment-component.min.js"></script>
|
|
13
|
+
<script
|
|
14
|
+
src="https://unpkg.com/aframe-text-geometry-component@0.5.2/dist/aframe-text-geometry-component.min.js"></script>
|
|
15
|
+
<script
|
|
16
|
+
src="https://unpkg.com/aframe-geometry-merger-component/dist/aframe-geometry-merger-component.min.js"></script>
|
|
17
|
+
<script src="https://rawgit.com/zcanter/aframe-gradient-sky/master/dist/gradientsky.min.js"></script>
|
|
18
|
+
<script src="https://supereggbert.github.io/aframe-htmlembed-component/dist/build.js"></script>
|
|
19
|
+
<script src="dist/aframe-lounge-component.min.js"></script>
|
|
20
|
+
<script src="../../../dist/aframe-babia-components.js"></script>
|
|
21
|
+
<link rel="stylesheet" href="../../assets/gitlab-corner.css">
|
|
22
|
+
<style>
|
|
23
|
+
h1 {
|
|
24
|
+
color: #AAAAAA;
|
|
25
|
+
font-family: 'Archivo', sans-serif;
|
|
26
|
+
font-size: 45px;
|
|
27
|
+
text-align: center;
|
|
28
|
+
text-shadow: black 0.1em 0.1em 0.2em
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
p {
|
|
32
|
+
color: #444444;
|
|
33
|
+
font-family: 'Archivo', sans-serif;
|
|
34
|
+
font-size: 26px;
|
|
35
|
+
text-align: justify;
|
|
36
|
+
text-shadow: #AAAAAA 0.1em 0.1em 0.2em
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
</head>
|
|
40
|
+
|
|
41
|
+
<body>
|
|
42
|
+
<a-scene id="scene" light="defaultLightsEnabled: false" xr-mode-ui="XRMode: xr">
|
|
43
|
+
|
|
44
|
+
<!-- Assets -->
|
|
45
|
+
<a-assets>
|
|
46
|
+
<img id="sky" src="assets/360-panorama.jpg">
|
|
47
|
+
<img id="floor" src="assets/floor-texture.jpg">
|
|
48
|
+
<img id="metalic" src="assets/metalic-texture.jpg">
|
|
49
|
+
</a-assets>
|
|
50
|
+
|
|
51
|
+
<!-- Enviroment -->
|
|
52
|
+
<a-sky src="#sky" hide-on-enter-ar></a-sky>
|
|
53
|
+
|
|
54
|
+
<!-- Aframe Lounge -->
|
|
55
|
+
<a-entity id="lounge" position="2 3.5 0" hide-on-enter-ar lounge="width: 40; depth: 50; height: 10;
|
|
56
|
+
north: barrier;
|
|
57
|
+
floorTexture: assets/floor-texture.jpg">
|
|
58
|
+
<!-- 3D Components -->
|
|
59
|
+
<a-entity class="collidable" babia-map="height: 8; width: 8; bumpScale: 1; zoom: 1; textureType: Satellite; handsUi: false;
|
|
60
|
+
entityRightButton: {"position":"0.6 4 3", "rotation":"30 0 0"};
|
|
61
|
+
entityLeftButton: {"position":"-0.6 4 3", "rotation":"30 0 0"};
|
|
62
|
+
|
|
63
|
+
rightButtons: [
|
|
64
|
+
{"height":"0.5", "width":"1", "label":"Zoom In", "color":"blue", "position":"0 0.75 -0.3", "rotation":"0 0 0", "textSize":3, "className":"zoomInBtn"},
|
|
65
|
+
{"height":"0.5", "width":"1", "label":"Zoom Out", "color":"purple", "position":"0 0 -0.3", "rotation":"0 0 0", "textSize":3, "className":"zoomOutBtn"}
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
crossEntity: {"position":"1 0.375 0", "rotation":"0 0 0"};
|
|
69
|
+
crossButtons: [
|
|
70
|
+
{"height":"0.2", "width":"0.2", "label":"^", "color":"darkgray", "position":"0 0.2 0", "textSize":3, "className":"dpadUp"},
|
|
71
|
+
{"height":"0.2", "width":"0.2", "label":"v", "color":"darkgray", "position":"0 -0.2 0", "textSize":3, "className":"dpadDown"},
|
|
72
|
+
{"height":"0.2", "width":"0.2", "label":"<", "color":"darkgray", "position":"-0.3 0 0", "textSize":3, "className":"dpadLeft"},
|
|
73
|
+
{"height":"0.2", "width":"0.2", "label":">", "color":"darkgray", "position":"0.3 0 0", "textSize":3, "className":"dpadRight"}
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
leftButtons: [
|
|
77
|
+
{"height":"0.5", "width":"1", "label":"Next Layer", "color":"green", "position":"0 0.75 -0.3", "rotation":"0 0 0", "textSize":3, "className":"layerUpBtn"},
|
|
78
|
+
{"height":"0.5", "width":"1", "label":"Previous Layer", "color":"orange", "position":"0 0 -0.3", "rotation":"0 0 0", "textSize":3, "className":"layerDownBtn"}
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
coordinatesText: {"label":"Coordinates: ","color":"black","position":"-0.5 1.2 -0.4","rotation":"0 0 0","textSize":3};
|
|
82
|
+
" position="-6 -5 -6">
|
|
83
|
+
</a-entity>
|
|
84
|
+
|
|
85
|
+
<a-entity class="collidable" babia-map="height: 8; width: 8; bumpScale: 1; zoom: 1; x: 1; handsUi: false;
|
|
86
|
+
entityRightButton: {"position":"4.5 2 3", "rotation":"-90 0 0"};
|
|
87
|
+
entityLeftButton: {"position":"4.5 2 1.5", "rotation":"-90 0 0"};
|
|
88
|
+
|
|
89
|
+
rightButtons: [
|
|
90
|
+
{"height":"0.5", "width":"1", "label":"Zoom In", "color":"blue", "position":"0 0.75 -0.3", "rotation":"0 0 0", "textSize":3, "className":"zoomInBtn"},
|
|
91
|
+
{"height":"0.5", "width":"1", "label":"Zoom Out", "color":"purple", "position":"0 0 -0.3", "rotation":"0 0 0", "textSize":3, "className":"zoomOutBtn"}
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
crossEntity: {"position":"1 0.375 0", "rotation":"0 0 0"};
|
|
95
|
+
crossButtons: [
|
|
96
|
+
{"height":"0.2", "width":"0.2", "label":"^", "color":"darkgray", "position":"0 0.2 0", "textSize":3, "className":"dpadUp"},
|
|
97
|
+
{"height":"0.2", "width":"0.2", "label":"v", "color":"darkgray", "position":"0 -0.2 0", "textSize":3, "className":"dpadDown"},
|
|
98
|
+
{"height":"0.2", "width":"0.2", "label":"<", "color":"darkgray", "position":"-0.3 0 0", "textSize":3, "className":"dpadLeft"},
|
|
99
|
+
{"height":"0.2", "width":"0.2", "label":">", "color":"darkgray", "position":"0.3 0 0", "textSize":3, "className":"dpadRight"}
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
leftButtons: [
|
|
103
|
+
{"height":"0.5", "width":"1", "label":"Next Layer", "color":"green", "position":"0 0.75 -0.3", "rotation":"0 0 0", "textSize":3, "className":"layerUpBtn"},
|
|
104
|
+
{"height":"0.5", "width":"1", "label":"Previous Layer", "color":"orange", "position":"0 0 -0.3", "rotation":"0 0 0", "textSize":3, "className":"layerDownBtn"}
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
coordinatesText: {"label":"Coordinates: ","color":"black","position":"-0.5 1.2 -0.3","rotation":"0 0 0","textSize":3};
|
|
108
|
+
" position="3 -1 -6" rotation="90 0 0">
|
|
109
|
+
</a-entity>
|
|
110
|
+
</a-entity>
|
|
111
|
+
|
|
112
|
+
<!-- Component's Descriptions -->
|
|
113
|
+
|
|
114
|
+
<a-entity id="mapsdescription" position="-8 -0.6 -1" rotation="-30 30 0">
|
|
115
|
+
<a-box src="#floor" height="2" width="2" depth="0.1" position="0 0 0"></a-box>
|
|
116
|
+
<a-box src="#metalic" height="1.8" width="1.8" depth="0.05" position="0 0 0.05"></a-box>
|
|
117
|
+
<a-entity htmlembed position="0 0.1 0.1" style="width: 380px; height: 400px;">
|
|
118
|
+
<h1>babia-map Component</h1>
|
|
119
|
+
<p>This component shows a map generated by OpenStreetMap.
|
|
120
|
+
<p>Raycaster: </br>Get coordinates of a point after clicking with the left hand.</p>
|
|
121
|
+
</p>
|
|
122
|
+
</a-entity>
|
|
123
|
+
</a-entity>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<!-- Lights -->
|
|
127
|
+
<a-entity light="color: #fff ; type: ambient; intensity: 0.85"></a-entity>
|
|
128
|
+
|
|
129
|
+
<!-- Controls and Camera -->
|
|
130
|
+
<a-entity lounge-entry-point>
|
|
131
|
+
<a-entity movement-controls="fly: false" position="0 0 0">
|
|
132
|
+
<a-entity camera position="0 0 0" look-controls></a-entity>
|
|
133
|
+
</a-entity>
|
|
134
|
+
<a-entity id="rightHand" laser-controls="hand: right" oculus-touch-controls="hand: right" raycaster="objects: .babiaxraycasterclass, .collidable">
|
|
135
|
+
</a-entity>
|
|
136
|
+
<a-entity id="leftHand" laser-controls="hand: left" oculus-touch-controls="hand: left" raycaster="objects: .collidable">
|
|
137
|
+
</a-entity>
|
|
138
|
+
<a-entity cursor="rayOrigin:mouse" raycaster="objects: .babiaxraycasterclass, .collidable"></a-entity>
|
|
139
|
+
</a-entity>
|
|
140
|
+
</a-entity>
|
|
141
|
+
|
|
142
|
+
</a-scene>
|
|
143
|
+
|
|
144
|
+
<!-- TOKEN FORM-->
|
|
145
|
+
<form id="token-form" style="position: absolute; top: 20px; left: 30px; z-index: 999;">
|
|
146
|
+
<input type="text" id="token-input" placeholder="Introduce tu token de Mapbox" style="width: 200px;" />
|
|
147
|
+
<button type="submit">Guardar</button>
|
|
148
|
+
</form>
|
|
149
|
+
|
|
150
|
+
<div class="gitlab-corner-wrapper"><a
|
|
151
|
+
href="https://gitlab.com/babiaxr/aframe-babia-components/-/blob/master/examples/demos/map-terrain/index_gallery.html"
|
|
152
|
+
class="gitlab-corner" aria-label="View source on GitLab"><svg id="logo_art" data-name="logo art"
|
|
153
|
+
xmlns="http://www.w3.org/2000/svg" viewBox="0 0 586 559">
|
|
154
|
+
<g id="g44">
|
|
155
|
+
<path id="path46" class="cls-1"
|
|
156
|
+
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" />
|
|
157
|
+
</g>
|
|
158
|
+
<g id="g48">
|
|
159
|
+
<path id="path50" class="cls-2"
|
|
160
|
+
d="M293,434.91h0l62.16-191.28H230.87L293,434.91Z" />
|
|
161
|
+
</g>
|
|
162
|
+
<g id="g56">
|
|
163
|
+
<path id="path58" class="cls-1" d="M293,434.91,230.82,243.63h-87L293,434.91Z" />
|
|
164
|
+
</g>
|
|
165
|
+
<g id="g64">
|
|
166
|
+
<path id="path66" class="cls-3"
|
|
167
|
+
d="M143.75,243.69h0l-18.91,58.12a12.88,12.88,0,0,0,4.66,14.39L293,435,143.75,243.69Z" />
|
|
168
|
+
</g>
|
|
169
|
+
<g id="g72">
|
|
170
|
+
<path id="path74" class="cls-2"
|
|
171
|
+
d="M143.78,243.69h87.11L193.4,128.49a6.47,6.47,0,0,0-12.27,0l-37.35,115.2Z" />
|
|
172
|
+
</g>
|
|
173
|
+
<g id="g76">
|
|
174
|
+
<path id="path78" class="cls-1"
|
|
175
|
+
d="M293,434.91l62.16-191.28H442.3L293,434.91Z" />
|
|
176
|
+
</g>
|
|
177
|
+
<g id="g80">
|
|
178
|
+
<path id="path82" class="cls-3"
|
|
179
|
+
d="M442.24,243.69h0l18.91,58.12a12.85,12.85,0,0,1-4.66,14.39L293,434.91l149.2-191.22Z" />
|
|
180
|
+
</g>
|
|
181
|
+
<g id="g84">
|
|
182
|
+
<path id="path86" class="cls-2"
|
|
183
|
+
d="M442.28,243.69h-87.1l37.42-115.2a6.46,6.46,0,0,1,12.26,0l37.42,115.2Z" />
|
|
184
|
+
</g>
|
|
185
|
+
</svg></a></div>
|
|
186
|
+
</body>
|
|
187
|
+
|
|
188
|
+
</html>
|