janusweb 1.5.30 → 1.5.34
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/CHANGELOG +39 -0
- package/LICENSE +1 -1
- package/media/assets/janus-avatar-animations.glb +0 -0
- package/media/assets/janus-avatar-base.glb +0 -0
- package/media/assets/webui/apps/avatar/avatar.css +6 -2
- package/media/assets/webui/apps/avatar/avatar.js +99 -11
- package/media/assets/webui/apps/buttons/buttons.html +2 -2
- package/media/assets/webui/apps/buttons/buttons.js +3 -3
- package/media/assets/webui/apps/comms/comms.js +7 -4
- package/media/assets/webui/apps/comms/voip.js +133 -57
- package/media/assets/webui/apps/editor/codemirror/addon/hint/javascript-hint.js +162 -0
- package/media/assets/webui/apps/editor/codemirror/addon/hint/show-hint.css +36 -0
- package/media/assets/webui/apps/editor/codemirror/addon/hint/show-hint.js +529 -0
- package/media/assets/webui/apps/editor/codemirror/addon/hint/xml-hint.js +140 -0
- package/media/assets/webui/apps/editor/codemirror/keymap/vim.js +5734 -0
- package/media/assets/webui/apps/editor/codemirror/lib/codemirror.css +350 -0
- package/media/assets/webui/apps/editor/codemirror/lib/codemirror.js +9800 -0
- package/media/assets/webui/apps/editor/codemirror/lib/jmldark.css +33 -0
- package/media/assets/webui/apps/editor/codemirror/mode/css/css.js +864 -0
- package/media/assets/webui/apps/editor/codemirror/mode/htmlmixed/htmlmixed.js +153 -0
- package/media/assets/webui/apps/editor/codemirror/mode/javascript/javascript.js +942 -0
- package/media/assets/webui/apps/editor/codemirror/mode/xml/xml.js +413 -0
- package/media/assets/webui/apps/editor/editor.css +3 -0
- package/media/assets/webui/apps/editor/editor.js +409 -9
- package/media/assets/webui/apps/editor/editor.json +6 -3
- package/media/assets/webui/apps/inventory/inventory.html +7 -4
- package/media/assets/webui/apps/inventory/inventory.js +2 -2
- package/media/assets/webui/apps/locomotion/teleporter.js +10 -9
- package/media/assets/webui/apps/navigation/navigation.js +12 -12
- package/media/assets/webui/apps/settings/settings.html +1 -1
- package/media/assets/webui/apps/vfs/browserfs/browserfs.js +8 -0
- package/media/assets/webui/apps/vfs/vfs.css +52 -0
- package/media/assets/webui/apps/vfs/vfs.js +452 -0
- package/media/assets/webui/apps/vfs/vfs.json +10 -0
- package/media/assets/webui/apps/virtualgamepad/virtualgamepad.js +9 -7
- package/media/assets/webui/apps/xrmenu/xrmenu.js +13 -4
- package/media/assets/webui/default.json +2 -1
- package/media/assets/webui/none.json +1 -0
- package/media/assets/webui/themes/default.css +29 -2
- package/media/assets.json +2 -1
- package/media/index.html +1 -1
- package/media/lib/draco/README.md +32 -0
- package/media/lib/draco/draco_decoder.js +52 -0
- package/media/lib/draco/draco_decoder.wasm +0 -0
- package/media/lib/draco/draco_encoder.js +33 -0
- package/media/lib/draco/draco_wasm_wrapper.js +104 -0
- package/media/lib/draco/gltf/draco_decoder.js +48 -0
- package/media/lib/draco/gltf/draco_decoder.wasm +0 -0
- package/media/lib/draco/gltf/draco_encoder.js +33 -0
- package/media/lib/draco/gltf/draco_wasm_wrapper.js +104 -0
- package/media/lib/physx/physx.release.js +21 -0
- package/media/lib/physx/physx.release.wasm +0 -0
- package/media/manifest.json +5 -5
- package/media/service-worker.js +7 -0
- package/package.json +2 -9
- package/scripts/client.js +67 -46
- package/scripts/config.js +2 -0
- package/scripts/elements/linesegments.js +10 -3
- package/scripts/external/JanusFireboxParser.js +1 -0
- package/scripts/image.js +7 -1
- package/scripts/janusbase.js +104 -43
- package/scripts/janusghost.js +314 -16
- package/scripts/januslight.js +11 -2
- package/scripts/janusparagraph.js +8 -6
- package/scripts/janusparticle.js +26 -16
- package/scripts/janusplayer.js +126 -37
- package/scripts/janusweb.js +26 -2
- package/scripts/janusxrplayer.js +5 -3
- package/scripts/multiplayermanager.js +6 -4
- package/scripts/object.js +246 -88
- package/scripts/portal.js +23 -14
- package/scripts/remoteplayer.js +1 -25
- package/scripts/room.js +199 -77
- package/scripts/sound.js +8 -6
- package/scripts/text.js +13 -5
- package/scripts/translators/janusvfs.js +20 -0
- package/scripts/video.js +1 -1
- package/scripts/websurface.js +17 -3
- package/utils/build.sh +3 -0
- package/utils/init.sh +2 -2
- package/scripts/chat.js +0 -80
- package/scripts/ui.js +0 -265
- package/scripts/urlbar.js +0 -93
- package/templates/janusweb.tpl +0 -3
package/scripts/client.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient', 'engine.things.light_directional', 'engine.things.light_point', 'janusweb.janusweb', 'janusweb.chat', 'janusweb.janusplayer', 'janusweb.janusxrplayer', 'janusweb.
|
|
2
|
-
|
|
1
|
+
elation.require(['elements.elements', 'elements', 'engine.engine', 'engine.assets', 'engine.things.light_ambient', 'engine.things.light_directional', 'engine.things.light_point', 'janusweb.janusweb', 'janusweb.chat', 'janusweb.janusplayer', 'janusweb.janusxrplayer', 'janusweb.external.document-register-element', 'janusweb.ui.main', 'elements.elements'], function() {
|
|
3
2
|
// If getCurrentScript returns non-null here, then it means we're in release mode
|
|
4
3
|
var clientScript = elation.utils.getCurrentScript();
|
|
5
4
|
|
|
@@ -12,10 +11,10 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
12
11
|
var homepage = elation.utils.any(args.homepage, elation.config.get('janusweb.homepage'), document.location.href);
|
|
13
12
|
var corsproxy = elation.utils.any(args.corsproxy, elation.config.get('engine.assets.corsproxy'), document.location.href);
|
|
14
13
|
var container = elation.utils.any(args.container, document.body);
|
|
15
|
-
var fullsize = (container == document.body);
|
|
14
|
+
var fullsize = elation.utils.any(args.fullsize, container == document.body);
|
|
16
15
|
|
|
17
16
|
if (elation.config.get('serviceworker.enabled') && 'serviceWorker' in navigator) {
|
|
18
|
-
var workerscript = elation.config.get('serviceworker.script', '
|
|
17
|
+
var workerscript = elation.config.get('serviceworker.script', 'service-worker.js');
|
|
19
18
|
navigator.serviceWorker.register(workerscript)
|
|
20
19
|
.then(function(reg) {
|
|
21
20
|
// registration worked
|
|
@@ -58,7 +57,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
58
57
|
document.head.appendChild(link);
|
|
59
58
|
elation.html.addclass(document.body, 'dark');
|
|
60
59
|
elation.html.addclass(document.body, 'janusweb');
|
|
61
|
-
var janusweb = elation.janusweb.client
|
|
60
|
+
var janusweb = elation.elements.create('janusweb.client', {
|
|
62
61
|
append: container,
|
|
63
62
|
homepage: homepage,
|
|
64
63
|
corsproxy: corsproxy,
|
|
@@ -67,6 +66,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
67
66
|
showchat: elation.utils.any(args.showchat, true),
|
|
68
67
|
usevoip: elation.utils.any(args.usevoip, false),
|
|
69
68
|
resolution: args.resolution,
|
|
69
|
+
fullsize: fullsize,
|
|
70
70
|
url: args.url,
|
|
71
71
|
networking: args.networking,
|
|
72
72
|
autoload: args.autoload,
|
|
@@ -82,13 +82,31 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
82
82
|
elation.events.add(janusweb.engine, 'engine_start', function() { resolve(janusweb); });
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
|
-
elation.
|
|
86
|
-
|
|
85
|
+
elation.elements.define('janusweb.client', class extends elation.elements.engine.client {
|
|
86
|
+
init() {
|
|
87
|
+
super.init();
|
|
88
|
+
this.defineAttributes({
|
|
89
|
+
corsproxy: { type: 'string' },
|
|
90
|
+
homepage: { type: 'string' },
|
|
91
|
+
url: { type: 'string' },
|
|
92
|
+
uiconfig: { type: 'string' },
|
|
93
|
+
shownavigation: { type: 'boolean', default: true },
|
|
94
|
+
showchat: { type: 'boolean', default: true },
|
|
95
|
+
networking: { type: 'boolean', default: true },
|
|
96
|
+
usevoip: { type: 'boolean', default: false },
|
|
97
|
+
autoload: { type: 'boolean', default: true },
|
|
98
|
+
urltemplate: { type: 'string' },
|
|
99
|
+
server: { type: 'string' },
|
|
100
|
+
avatarsrc: { type: 'string' },
|
|
101
|
+
muted: { type: 'boolean', default: false },
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
initEngine() {
|
|
87
105
|
this.initLoader();
|
|
88
106
|
|
|
89
107
|
var hashargs = elation.url();
|
|
90
108
|
|
|
91
|
-
this.enginecfg.stats = this.args.stats;
|
|
109
|
+
//this.enginecfg.stats = this.args.stats;
|
|
92
110
|
|
|
93
111
|
this.enginecfg.systems = [];
|
|
94
112
|
this.enginecfg.systems.push("controls");
|
|
@@ -96,13 +114,14 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
96
114
|
this.enginecfg.systems.push("ai");
|
|
97
115
|
this.enginecfg.systems.push("world");
|
|
98
116
|
//if (hashargs.admin == 1) {
|
|
99
|
-
this.enginecfg.systems.push("admin");
|
|
117
|
+
//this.enginecfg.systems.push("admin");
|
|
100
118
|
//}
|
|
101
119
|
this.enginecfg.systems.push("render");
|
|
102
120
|
this.enginecfg.systems.push("sound");
|
|
103
121
|
this.enginecfg.crosshair = false;
|
|
104
122
|
this.enginecfg.picking = true;
|
|
105
|
-
this.enginecfg.
|
|
123
|
+
this.enginecfg.fullsize = this.fullsize && this.fullsize != 'false'; // FIXME - type coersion should be doing this
|
|
124
|
+
//this.enginecfg.useWebVRPolyfill = elation.utils.any(this.args.useWebVRPolyfill, true);
|
|
106
125
|
|
|
107
126
|
if ('xr' in navigator) {
|
|
108
127
|
navigator.xr.addEventListener('sessiongranted', (ev) => {
|
|
@@ -110,7 +129,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
110
129
|
});
|
|
111
130
|
}
|
|
112
131
|
}
|
|
113
|
-
|
|
132
|
+
initButtons() {
|
|
114
133
|
this.sharebutton = elation.ui.button({classname: 'janusweb_sharing', label: 'Share'});
|
|
115
134
|
this.sharedialog = elation.engine.sharing({append: document.body, client: this, anchor: this.sharebutton});
|
|
116
135
|
elation.events.add(this.sharebutton, 'ui_button_click', elation.bind(this.sharedialog, this.sharedialog.showShareDialog));
|
|
@@ -126,21 +145,21 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
126
145
|
|
|
127
146
|
elation.events.add(document, 'pointerlockchange', elation.bind(this, function() { this.setUIActive(document.pointerLockElement === null); }));
|
|
128
147
|
}
|
|
129
|
-
|
|
148
|
+
initWorld() {
|
|
130
149
|
var things = this.world.load({
|
|
131
150
|
name: 'janusweb',
|
|
132
151
|
type: 'janusweb',
|
|
133
152
|
properties: {
|
|
134
|
-
corsproxy: elation.utils.any(this.
|
|
153
|
+
corsproxy: elation.utils.any(this.corsproxy, elation.config.get('engine.assets.corsproxy')),
|
|
135
154
|
datapath: elation.config.get('janusweb.datapath'),
|
|
136
|
-
homepage: this.
|
|
137
|
-
url: this.
|
|
138
|
-
showchat: this.
|
|
139
|
-
networking: this.
|
|
140
|
-
autoload: this.
|
|
141
|
-
urltemplate: this.
|
|
142
|
-
server: this.
|
|
143
|
-
muted: this.
|
|
155
|
+
homepage: this.homepage,
|
|
156
|
+
url: this.url,
|
|
157
|
+
showchat: this.showchat,
|
|
158
|
+
networking: this.networking,
|
|
159
|
+
autoload: this.autoload,
|
|
160
|
+
//urltemplate: this.urltemplate,
|
|
161
|
+
server: this.server,
|
|
162
|
+
muted: this.muted,
|
|
144
163
|
}
|
|
145
164
|
});
|
|
146
165
|
this.janusweb = things.children.janusweb;
|
|
@@ -151,38 +170,38 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
151
170
|
height: 1.8,
|
|
152
171
|
movespeed: 5000,
|
|
153
172
|
collidable: true,
|
|
154
|
-
usevoip: this.
|
|
155
|
-
avatarsrc: this.
|
|
173
|
+
usevoip: this.usevoip,
|
|
174
|
+
avatarsrc: this.avatarsrc,
|
|
156
175
|
staticfriction: 2,
|
|
157
176
|
dynamicfriction: 1.9,
|
|
158
177
|
});
|
|
159
178
|
elation.events.add(this.engine.systems.render, 'render_view_add', (ev) => this.handleRenderViewAdd(ev));
|
|
160
179
|
|
|
161
|
-
this.shownavigation = elation.utils.any(this.args.shownavigation, true);
|
|
162
180
|
var datapath = elation.config.get('janusweb.datapath', '/media/janusweb');
|
|
163
|
-
this.uiconfig = elation.utils.any(this.player.getSetting('uiconfig'), this.
|
|
181
|
+
this.uiconfig = elation.utils.any(this.player.getSetting('uiconfig'), this.uiconfig, datapath + (datapath[datapath.length-1] != '/' ? '/' : '') + 'assets/webui/default.json');
|
|
164
182
|
if (this.shownavigation) {
|
|
165
183
|
this.createUI();
|
|
166
184
|
}
|
|
167
185
|
this.view.pickingactive = true;
|
|
168
186
|
|
|
169
|
-
let overlay = this.
|
|
187
|
+
let overlay = this.parentNode.querySelector('janus-overlay');
|
|
170
188
|
if (overlay) {
|
|
171
189
|
this.overlay = overlay;
|
|
172
190
|
}
|
|
173
191
|
|
|
174
192
|
elation.engine.assets.initTextureLoaders(this.engine.systems.render, elation.config.get('janusweb.datapath') + 'lib/basis/');
|
|
193
|
+
elation.engine.assets.setDracoPath(elation.config.get('janusweb.datapath') + 'lib/draco/');
|
|
175
194
|
}
|
|
176
|
-
|
|
195
|
+
createUI() {
|
|
177
196
|
if (!this.ui) {
|
|
178
197
|
this.ui = elation.elements.create('janus.ui.main', {
|
|
179
|
-
append: this
|
|
198
|
+
append: this,
|
|
180
199
|
client: this,
|
|
181
200
|
config: this.uiconfig
|
|
182
201
|
});
|
|
183
202
|
}
|
|
184
203
|
}
|
|
185
|
-
|
|
204
|
+
initLoader() {
|
|
186
205
|
var loader = document.getElementsByClassName('engine_loading')[0];
|
|
187
206
|
if (loader) {
|
|
188
207
|
var logo = loader.getElementsByTagName('svg')[0];
|
|
@@ -196,12 +215,12 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
196
215
|
elation.events.add(this.engine, 'engine_start', elation.bind(this, this.handleEngineStart));
|
|
197
216
|
}
|
|
198
217
|
}
|
|
199
|
-
|
|
218
|
+
handleEngineStart(ev) {
|
|
200
219
|
if (this.loadingscreen) {
|
|
201
220
|
this.loadingscreen.container.parentNode.removeChild(this.loadingscreen.container);
|
|
202
221
|
}
|
|
203
222
|
}
|
|
204
|
-
|
|
223
|
+
handleEngineError(ev) {
|
|
205
224
|
console.log('omg error!', ev);
|
|
206
225
|
if (this.loadingscreen) {
|
|
207
226
|
this.loadingscreen.label.innerHTML = 'Error!';
|
|
@@ -212,9 +231,9 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
212
231
|
var errordiv = elation.html.create({tag: 'pre', append: this.loadingscreen.container, content: msg, classname: 'janusweb_error'});
|
|
213
232
|
}
|
|
214
233
|
}
|
|
215
|
-
|
|
234
|
+
showMenu() {
|
|
216
235
|
}
|
|
217
|
-
|
|
236
|
+
setUIActive(active) {
|
|
218
237
|
if (active) {
|
|
219
238
|
if (this.ui) this.ui.enable();
|
|
220
239
|
if (this.buttons) this.buttons.enable();
|
|
@@ -223,12 +242,12 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
223
242
|
if (this.buttons) this.buttons.disable();
|
|
224
243
|
}
|
|
225
244
|
}
|
|
226
|
-
|
|
245
|
+
showAbout() {
|
|
227
246
|
var aboutwin = elation.ui.window({append: document.body, center: true, title: 'About JanusWeb'});
|
|
228
247
|
var frame = elation.ui.iframe({src: 'http://github.com/jbaicoianu/janusweb/', classname: 'janusweb_about'});
|
|
229
248
|
aboutwin.setcontent(frame);
|
|
230
249
|
}
|
|
231
|
-
|
|
250
|
+
toggleFullscreen(ev, updateOnly) {
|
|
232
251
|
var view = this.view;
|
|
233
252
|
if (!updateOnly && view && (typeof ev == 'undefined' || ev.value == 1 || typeof ev.value == 'undefined')) {
|
|
234
253
|
view.toggleFullscreen();
|
|
@@ -243,7 +262,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
243
262
|
}
|
|
244
263
|
}
|
|
245
264
|
}
|
|
246
|
-
|
|
265
|
+
configureOptions() {
|
|
247
266
|
if (!this.configmenu) {
|
|
248
267
|
var configpanel = elation.janusweb.configuration({client: this});
|
|
249
268
|
this.configmenu = elation.ui.window({
|
|
@@ -260,10 +279,10 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
260
279
|
}
|
|
261
280
|
this.configmenu.show();
|
|
262
281
|
}
|
|
263
|
-
|
|
282
|
+
registerElement(tagname, classobj, extendclass) {
|
|
264
283
|
this.janusweb.registerElement(tagname, classobj, extendclass);
|
|
265
284
|
}
|
|
266
|
-
|
|
285
|
+
handleRenderViewAdd(ev) {
|
|
267
286
|
let view = ev.data;
|
|
268
287
|
if (view.xrsession && !this.xrplayer) {
|
|
269
288
|
this.xrplayer = this.player.createObject('xrplayer', {
|
|
@@ -272,14 +291,14 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
272
291
|
});
|
|
273
292
|
}
|
|
274
293
|
}
|
|
275
|
-
}
|
|
294
|
+
});
|
|
276
295
|
|
|
277
296
|
if (typeof customElements != 'undefined') {
|
|
278
297
|
elation.elements.define('janus.viewer', class extends elation.elements.base {
|
|
279
298
|
init() {
|
|
280
299
|
super.init();
|
|
281
300
|
this.defineAttributes({
|
|
282
|
-
|
|
301
|
+
fullsize: { type: 'boolean', default: true },
|
|
283
302
|
autostart: { type: 'boolean', default: true },
|
|
284
303
|
src: { type: 'string' },
|
|
285
304
|
corsproxy: { type: 'string' },
|
|
@@ -304,11 +323,12 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
304
323
|
}
|
|
305
324
|
document.body.addEventListener('click', start);
|
|
306
325
|
}
|
|
326
|
+
this.style.overflow = 'hidden';
|
|
307
327
|
}
|
|
308
328
|
getClientArgs() {
|
|
309
|
-
var
|
|
310
|
-
width = (this.
|
|
311
|
-
height = (this.
|
|
329
|
+
var fullsize = this.fullsize,
|
|
330
|
+
width = (this.fullsize ? window.innerWidth : this.width),
|
|
331
|
+
height = (this.fullsize ? window.innerHeight : this.height);
|
|
312
332
|
var args = {
|
|
313
333
|
url: this.getRoomURL(),
|
|
314
334
|
homepage: this.homepage || this.src,
|
|
@@ -320,6 +340,7 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
320
340
|
avatarsrc: this.avatarsrc,
|
|
321
341
|
uiconfig: this.uiconfig,
|
|
322
342
|
container: this,
|
|
343
|
+
fullsize: this.fullsize,
|
|
323
344
|
};
|
|
324
345
|
return args;
|
|
325
346
|
}
|
|
@@ -337,9 +358,9 @@ elation.require(['engine.engine', 'engine.assets', 'engine.things.light_ambient'
|
|
|
337
358
|
create() {
|
|
338
359
|
if (this.iframe) return;
|
|
339
360
|
var iframe = document.createElement('iframe');
|
|
340
|
-
var
|
|
341
|
-
iframe.width = (this.
|
|
342
|
-
iframe.height = (this.
|
|
361
|
+
var fullsize = this.fullsize;
|
|
362
|
+
iframe.width = (this.fullsize ? window.innerWidth : this.width);
|
|
363
|
+
iframe.height = (this.fullsize ? window.innerHeight : this.height);
|
|
343
364
|
iframe.setAttribute('allowvr', 'yes');
|
|
344
365
|
iframe.setAttribute('allowfullscreen', true);
|
|
345
366
|
iframe.setAttribute('allow', 'vr');
|
package/scripts/config.js
CHANGED
|
@@ -26,6 +26,8 @@ elation.config.set('share.targets.yahoo.clientid', '374523350201-p566ctvssq49sa4
|
|
|
26
26
|
elation.config.set('share.targets.facebook.clientid', '1197654320349894');
|
|
27
27
|
elation.config.set('share.targets.file.enabled', true);
|
|
28
28
|
|
|
29
|
+
elation.config.set('serviceworker.enabled', true);
|
|
30
|
+
|
|
29
31
|
// FIXME - hack for dev, we should support role-based config
|
|
30
32
|
if (typeof document != 'undefined' && document.location.origin == 'https://bai.dev.supcrit.com') {
|
|
31
33
|
elation.config.set('share.imagebase', null);
|
|
@@ -6,6 +6,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
6
6
|
linewidth: 1,
|
|
7
7
|
depth_write: true,
|
|
8
8
|
depth_test: true,
|
|
9
|
+
fog: true,
|
|
9
10
|
|
|
10
11
|
create() {
|
|
11
12
|
|
|
@@ -33,16 +34,18 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
33
34
|
let lineobj = new THREE.LineSegments(geo, new THREE.LineBasicMaterial({
|
|
34
35
|
vertexColors: THREE.VertexColors,
|
|
35
36
|
opacity: this.opacity,
|
|
36
|
-
transparent: (this.opacity < 1),
|
|
37
|
+
transparent: (this.transparent !== null ? this.transparent : this.opacity < 1),
|
|
37
38
|
depthWrite: this.depth_write,
|
|
38
39
|
depthTest: this.depth_test,
|
|
39
40
|
linewidth: this.linewidth,
|
|
41
|
+
fog: this.fog,
|
|
40
42
|
}));
|
|
43
|
+
lineobj.renderOrder = this.renderorder;
|
|
41
44
|
this.objects['3d'].add(lineobj);
|
|
42
45
|
if (this.pickable || this.collidable) {
|
|
43
46
|
//this.colliders.add(lineobj.clone());
|
|
44
47
|
}
|
|
45
|
-
lineobj.userData.thing = this;
|
|
48
|
+
lineobj.userData.thing = this._target || this;
|
|
46
49
|
this.geometry = geo;
|
|
47
50
|
this.lineobj = lineobj;
|
|
48
51
|
}
|
|
@@ -75,9 +78,13 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
75
78
|
this.geometry.computeBoundingSphere();
|
|
76
79
|
}
|
|
77
80
|
},
|
|
78
|
-
setLine(offset, start, end) {
|
|
81
|
+
setLine(offset, start, end, color) {
|
|
79
82
|
this.positions[offset * 2] = start;
|
|
80
83
|
this.positions[offset * 2 + 1] = end;
|
|
84
|
+
if (color) {
|
|
85
|
+
this.colors[offset * 2] = color;
|
|
86
|
+
this.colors[offset * 2 + 1] = color;
|
|
87
|
+
}
|
|
81
88
|
},
|
|
82
89
|
getLine(idx) {
|
|
83
90
|
let line = {
|
package/scripts/image.js
CHANGED
|
@@ -55,7 +55,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
55
55
|
color: this.properties.color,
|
|
56
56
|
transparent: (this.opacity < 1),
|
|
57
57
|
opacity: this.opacity,
|
|
58
|
-
alphaTest:
|
|
58
|
+
alphaTest: this.alphatest
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
this.asset = this.getAsset('image', this.image_id);
|
|
@@ -68,6 +68,9 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
68
68
|
elation.events.add(this.texture, 'update', elation.bind(this, this.refresh));
|
|
69
69
|
|
|
70
70
|
matargs.transparent = this.asset.hasalpha;
|
|
71
|
+
elation.events.add(this.asset, 'asset_load', ev => {
|
|
72
|
+
matargs.transparent = this.asset.hasalpha;
|
|
73
|
+
});
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
if (this.texture) {
|
|
@@ -156,6 +159,9 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
156
159
|
this.sidetex.image = this.texture.image;
|
|
157
160
|
this.sidetex.needsUpdate = true;
|
|
158
161
|
|
|
162
|
+
this.frontmaterial.transparent = this.asset.hasalpha;
|
|
163
|
+
this.sidematerial.transparent = this.asset.hasalpha;
|
|
164
|
+
|
|
159
165
|
if (this.properties.sbs3d || this.asset.sbs3d) {
|
|
160
166
|
// TODO - to really support 3d video, we need to set offset based on which eye is being rendered
|
|
161
167
|
var texture = new THREE.SBSTexture(this.texture.image);
|