janusweb 1.5.49 → 1.5.50
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/media/assets/webui/apps/comms/comms.js +2 -2
- package/package.json +2 -1
- package/scripts/client.js +6 -6
- package/scripts/janusbase.js +1 -0
- package/scripts/janusghost.js +41 -20
- package/scripts/object.js +1 -1
- package/scripts/room.js +9 -7
- package/utils/clean-build.sh +4 -0
|
@@ -99,7 +99,7 @@ elation.elements.define('janus-comms-userlist', class extends elation.elements.u
|
|
|
99
99
|
this.userlist_friends = this.elements.userlist_friends;
|
|
100
100
|
this.usermarkers = {};
|
|
101
101
|
|
|
102
|
-
elation.events.add(this.janusweb, 'room_load_start', (ev) => { this.updateRoom(ev.data); });
|
|
102
|
+
elation.events.add(this.janusweb, 'room_load_start', (ev) => { this.updateRoom(ev.data || ev.element); });
|
|
103
103
|
elation.events.add(this.janusweb.network, 'janusweb_user_joined,janusweb_user_left,janusweb_user_disconnected', (ev) => this.updateUsers());
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
//this.updateUsers();
|
|
@@ -209,7 +209,7 @@ elation.elements.define('janus-comms-chat', class extends elation.elements.base
|
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
elation.events.add(janus._target, 'clientprint', (ev) => this.handleClientPrint(ev.data));
|
|
212
|
-
elation.events.add(this.janusweb, 'room_load_start', (ev) => { this.updateRoom(ev.
|
|
212
|
+
elation.events.add(this.janusweb, 'room_load_start', (ev) => { this.updateRoom(ev.element); });
|
|
213
213
|
// FIXME - first element with the current design is a <detail> element, but this is fragile if that changes
|
|
214
214
|
this.elements[0].addEventListener('toggle', (ev) => this.elements.chatinput.focus());
|
|
215
215
|
this.updateRoom(room);
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "janusweb",
|
|
3
3
|
"description": "Web client for JanusVR worlds",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.50",
|
|
5
5
|
"main": "scripts/janusweb.js",
|
|
6
6
|
"author": "James Baicoianu",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"postinstall": "./utils/init.sh",
|
|
10
|
+
"clean": "./utils/clean-build.sh",
|
|
10
11
|
"build": "./utils/build.sh",
|
|
11
12
|
"postversion": "git push origin v`npm view janusweb version`",
|
|
12
13
|
"test": "./utils/activate.sh && ./node_modules/.bin/karma start tests/karma.conf.js --single-run",
|
package/scripts/client.js
CHANGED
|
@@ -9,9 +9,9 @@ elation.require(['elements.elements', 'elements', 'engine.engine', 'engine.asset
|
|
|
9
9
|
var rootdir = elation.utils.any(args.rootdir, elation.config.get('dependencies.rootdir'), document.location.pathname);
|
|
10
10
|
var path = elation.utils.any(args.path, elation.config.get('dependencies.path'), '/');
|
|
11
11
|
var homepage = elation.utils.any(args.homepage, elation.config.get('janusweb.homepage'), document.location.href);
|
|
12
|
-
var corsproxy = elation.utils.any(args.corsproxy, elation.config.get('engine.assets.corsproxy'), document.location.href);
|
|
12
|
+
var corsproxy = elation.utils.any(args.corsproxy && args.corsproxy != 'false', elation.config.get('engine.assets.corsproxy'), document.location.href);
|
|
13
13
|
var container = elation.utils.any(args.container, document.body);
|
|
14
|
-
var fullsize = elation.utils.any(args.fullsize, container == document.body);
|
|
14
|
+
var fullsize = elation.utils.any(args.fullsize && args.fullsize != 'false', container == document.body);
|
|
15
15
|
|
|
16
16
|
if (elation.config.get('serviceworker.enabled') && 'serviceWorker' in navigator) {
|
|
17
17
|
var workerscript = elation.config.get('serviceworker.script', 'service-worker.js');
|
|
@@ -65,11 +65,11 @@ elation.require(['elements.elements', 'elements', 'engine.engine', 'engine.asset
|
|
|
65
65
|
append: container,
|
|
66
66
|
homepage: homepage,
|
|
67
67
|
corsproxy: corsproxy,
|
|
68
|
-
showui: (args.showui && args.showui != "false"),
|
|
69
|
-
shownavigation: (args.shownavigation && args.shownavigation != "false"),
|
|
68
|
+
showui: elation.utils.any(args.showui && args.showui != "false", true),
|
|
69
|
+
shownavigation: elation.utils.any(args.shownavigation && args.shownavigation != "false", true),
|
|
70
70
|
uiconfig: args.uiconfig,
|
|
71
|
-
showchat: elation.utils.any(args.showchat, true),
|
|
72
|
-
usevoip: elation.utils.any(args.usevoip, false),
|
|
71
|
+
showchat: elation.utils.any(args.showchat && args.showchat != 'false', true),
|
|
72
|
+
usevoip: elation.utils.any(args.usevoip && args.usevoip != 'false', false),
|
|
73
73
|
resolution: args.resolution,
|
|
74
74
|
fullsize: fullsize,
|
|
75
75
|
url: args.url,
|
package/scripts/janusbase.js
CHANGED
|
@@ -52,6 +52,7 @@ elation.require(['engine.things.generic', 'utils.template', 'janusweb.parts'], f
|
|
|
52
52
|
hasposition: { type: 'boolean', default: true },
|
|
53
53
|
gazetime: { type: 'float' },
|
|
54
54
|
static: { type: 'boolean', default: false },
|
|
55
|
+
isinternal: { type: 'boolean', default: false },
|
|
55
56
|
ongazeenter: { type: 'callback' },
|
|
56
57
|
ongazeleave: { type: 'callback' },
|
|
57
58
|
ongazeprogress: { type: 'callback' },
|
package/scripts/janusghost.js
CHANGED
|
@@ -38,6 +38,9 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
|
|
|
38
38
|
if (dist < maxdist) {
|
|
39
39
|
diffuseColor.a = clamp(((dist - mindist) / (maxdist - mindist)), 0., 1.);
|
|
40
40
|
}
|
|
41
|
+
if (diffuseColor.a <= 1e-4) {
|
|
42
|
+
discard;
|
|
43
|
+
}
|
|
41
44
|
`;
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -124,6 +127,7 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
|
|
|
124
127
|
this.shoulders = this.createObject('object', {
|
|
125
128
|
'js_id': this.properties.player_id + '_shoulders',
|
|
126
129
|
'pos': V(0, 1.0, 0),
|
|
130
|
+
'isinternal': true,
|
|
127
131
|
});
|
|
128
132
|
}
|
|
129
133
|
this.setGhostAssets = function(assets) {
|
|
@@ -234,23 +238,13 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
|
|
|
234
238
|
//pos: headpos.clone().negate(),
|
|
235
239
|
//orientation: new THREE.Quaternion().setFromEuler(new THREE.Euler(0, Math.PI, 0)),
|
|
236
240
|
//rotation: V(0, 180, 0),
|
|
237
|
-
lighting: this.lighting,
|
|
238
|
-
//cull_face: 'none'
|
|
239
|
-
opacity: 0.9999,
|
|
240
|
-
renderorder: this.renderorder || 100,
|
|
241
|
-
shader_chunk_replace: (this.lighting ? {
|
|
242
|
-
'color_fragment': 'color_fragment_discard_close',
|
|
243
|
-
} : {}),
|
|
244
241
|
});
|
|
242
|
+
this.applyAvatarMaterial(this.face, 1);
|
|
245
243
|
this.face.start();
|
|
246
244
|
} else {
|
|
247
245
|
this.face = headid;
|
|
248
246
|
this.face.lighting = this.lighting;
|
|
249
|
-
this.face
|
|
250
|
-
this.face.renderorder = this.renderorder || 100;
|
|
251
|
-
this.face.shader_chunk_replace = (this.lighting ? {
|
|
252
|
-
'color_fragment': 'color_fragment_discard_close',
|
|
253
|
-
} : {});
|
|
247
|
+
this.applyAvatarMaterial(this.face, 1);
|
|
254
248
|
this.head.appendChild(headid);
|
|
255
249
|
this.face.start();
|
|
256
250
|
}
|
|
@@ -289,12 +283,9 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
|
|
|
289
283
|
rotation: V(0, 180, 0),
|
|
290
284
|
lighting: this.lighting,
|
|
291
285
|
//cull_face: 'none'
|
|
292
|
-
|
|
293
|
-
renderorder: this.renderorder || 100,
|
|
294
|
-
shader_chunk_replace: (this.lighting ? {
|
|
295
|
-
'color_fragment': 'color_fragment_discard_close',
|
|
296
|
-
} : {}),
|
|
286
|
+
isinternal: true,
|
|
297
287
|
});
|
|
288
|
+
this.applyAvatarMaterial(this.body, 0);
|
|
298
289
|
} else {
|
|
299
290
|
this.body = bodyid;
|
|
300
291
|
this.appendChild(bodyid);
|
|
@@ -448,7 +439,11 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
|
|
|
448
439
|
} else {
|
|
449
440
|
let armature = sourcecontainer.getObjectByName('Armature') || sourcecontainer;
|
|
450
441
|
newclip.tracks.forEach(track => {
|
|
451
|
-
track.name = track.name.replace('mixamorig', '');
|
|
442
|
+
//track.name = track.name.replace('mixamorig:', '');
|
|
443
|
+
let idx = track.name.indexOf(':');
|
|
444
|
+
if (idx > -1) {
|
|
445
|
+
track.name = track.name.substr(idx + 1);
|
|
446
|
+
}
|
|
452
447
|
let p = track.name.split('.');
|
|
453
448
|
if (p[1] == 'position') {
|
|
454
449
|
for (let i = 0; i < track.values.length / 3; i++) {
|
|
@@ -701,19 +696,36 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
|
|
|
701
696
|
this.setBody(false);
|
|
702
697
|
}
|
|
703
698
|
if (ghostdef._children) {
|
|
699
|
+
let potentialAttachments = [];
|
|
704
700
|
for (var type in ghostdef._children) {
|
|
705
701
|
for (var i = 0; i < ghostdef._children[type].length; i++) {
|
|
706
702
|
let js_id = ghostdef._children[type][i].js_id;
|
|
707
|
-
delete ghostdef._children[type][i].js_id;
|
|
703
|
+
//delete ghostdef._children[type][i].js_id;
|
|
704
|
+
ghostdef._children[type][i].isinternal = true;
|
|
708
705
|
let childobj = this.createObject(type, ghostdef._children[type][i]);
|
|
709
706
|
this.ghostchildren.push(childobj);
|
|
710
707
|
if (js_id == 'head') {
|
|
711
708
|
this.setHead(childobj, headpos, ghostdef.scale);
|
|
712
709
|
} else if (js_id == 'body') {
|
|
713
710
|
this.setBody(childobj, ghostdef.scale, ghostdef.pos);
|
|
711
|
+
} else {
|
|
712
|
+
potentialAttachments.push(childobj);
|
|
713
|
+
this.applyAvatarMaterial(childobj, 2);
|
|
714
|
+
childobj.traverse(obj => {
|
|
715
|
+
this.applyAvatarMaterial(obj, 3);
|
|
716
|
+
});
|
|
714
717
|
}
|
|
715
718
|
}
|
|
716
719
|
}
|
|
720
|
+
this.body.addEventListener('load', ev => {
|
|
721
|
+
for (let i = 0; i < potentialAttachments.length; i++) {
|
|
722
|
+
let obj = potentialAttachments[i];
|
|
723
|
+
if (obj.js_id in this.body.parts) {
|
|
724
|
+
this.body.parts[obj.js_id].add(obj);
|
|
725
|
+
this.applyAvatarMaterial(obj, 3);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
});
|
|
717
729
|
}
|
|
718
730
|
}
|
|
719
731
|
}
|
|
@@ -723,7 +735,8 @@ elation.require(['janusweb.janusbase', 'engine.things.leapmotion'], function() {
|
|
|
723
735
|
'position': [0,1.0,0],
|
|
724
736
|
'parent': this,
|
|
725
737
|
'janus': this.janus,
|
|
726
|
-
'room': this.room
|
|
738
|
+
'room': this.room,
|
|
739
|
+
'isinternal': true,
|
|
727
740
|
});
|
|
728
741
|
}
|
|
729
742
|
if (!this.hands) {
|
|
@@ -894,5 +907,13 @@ return;
|
|
|
894
907
|
}
|
|
895
908
|
return this._proxyobject;
|
|
896
909
|
}
|
|
910
|
+
this.applyAvatarMaterial = function(obj, renderorderOffset=0) {
|
|
911
|
+
if (this.lighting && obj.lighting) {
|
|
912
|
+
obj.transparent = true;
|
|
913
|
+
if (obj.opacity == 1) obj.opacity = 0.9999;
|
|
914
|
+
if (!obj.renderorder) obj.renderorder = this.renderorder + renderorderOffset;
|
|
915
|
+
obj.shader_chunk_replace = { 'color_fragment': 'color_fragment_discard_close' };
|
|
916
|
+
}
|
|
917
|
+
}
|
|
897
918
|
}, elation.engine.things.janusbase);
|
|
898
919
|
});
|
package/scripts/object.js
CHANGED
|
@@ -44,7 +44,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
44
44
|
lmap_id: { type: 'string', set: this.updateMaterial, comment: 'Lightmap texture ID' },
|
|
45
45
|
video_id: { type: 'string', set: this.updateVideo, comment: 'Video texture ID' },
|
|
46
46
|
shader_id: { type: 'string', set: this.updateMaterial, comment: 'Shader ID' },
|
|
47
|
-
shader_chunk_replace: { type: 'object' },
|
|
47
|
+
shader_chunk_replace: { type: 'object', set: this.updateMaterial },
|
|
48
48
|
url: { type: 'string', set: this.updateWebsurfaceURL },
|
|
49
49
|
loop: { type: 'boolean' },
|
|
50
50
|
websurface_id: { type: 'string', set: this.updateWebsurface, comment: 'WebSurface ID' },
|
package/scripts/room.js
CHANGED
|
@@ -840,7 +840,7 @@ elation.require([
|
|
|
840
840
|
}
|
|
841
841
|
this.createLights();
|
|
842
842
|
}
|
|
843
|
-
this.createRoomObjects = function(roomdata, parent) {
|
|
843
|
+
this.createRoomObjects = function(roomdata, parent, isinternal) {
|
|
844
844
|
var room = roomdata.room,
|
|
845
845
|
assets = roomdata.assets || [];
|
|
846
846
|
|
|
@@ -853,6 +853,7 @@ elation.require([
|
|
|
853
853
|
if (exclude.indexOf(k) == -1) {
|
|
854
854
|
roomdata[k].forEach(elation.bind(this, function(n) {
|
|
855
855
|
n.persist = true;
|
|
856
|
+
n.isinternal = isinternal;
|
|
856
857
|
this.createObject(k, n, parent);
|
|
857
858
|
}));
|
|
858
859
|
}
|
|
@@ -1373,16 +1374,17 @@ elation.require([
|
|
|
1373
1374
|
if (this.jsobjects[objectargs.js_id]) {
|
|
1374
1375
|
objectargs.js_id = objectargs.js_id + '_' + window.uniqueId();
|
|
1375
1376
|
}
|
|
1376
|
-
var object = parentobj.spawn(realtype, this.roomid + '_' + objectargs.js_id, objectargs)
|
|
1377
|
-
|
|
1378
|
-
|
|
1377
|
+
var object = parentobj.spawn(realtype, this.roomid + '_' + objectargs.js_id, objectargs),
|
|
1378
|
+
proxyobj = object.getProxyObject(customElement);
|
|
1379
|
+
if (proxyobj && objectargs.js_id && !objectargs.isinternal && (parentobj == this || 'js_id' in args)) {
|
|
1380
|
+
this.jsobjects[objectargs.js_id] = proxyobj;
|
|
1379
1381
|
}
|
|
1380
1382
|
|
|
1381
1383
|
if (realtype == 'janussound') {
|
|
1382
1384
|
this.sounds[objectargs.sound_id] = object;
|
|
1383
1385
|
this.sounds[objectargs.js_id] = object;
|
|
1384
1386
|
|
|
1385
|
-
|
|
1387
|
+
proxyobj.addEventListener('sound_delayed', (ev) => this.handleDelayedSound(ev));
|
|
1386
1388
|
}
|
|
1387
1389
|
if (realtype == 'janusvideo') {
|
|
1388
1390
|
this.videos[objectargs.video_id] = object;
|
|
@@ -1408,14 +1410,14 @@ elation.require([
|
|
|
1408
1410
|
}
|
|
1409
1411
|
children[k] = objs;
|
|
1410
1412
|
}
|
|
1411
|
-
this.createRoomObjects(children,
|
|
1413
|
+
this.createRoomObjects(children, proxyobj, objectargs.isinternal);
|
|
1412
1414
|
}
|
|
1413
1415
|
|
|
1414
1416
|
if (this.enabled && !skipstart) {
|
|
1415
1417
|
object.start();
|
|
1416
1418
|
}
|
|
1417
1419
|
|
|
1418
|
-
return
|
|
1420
|
+
return proxyobj;
|
|
1419
1421
|
}
|
|
1420
1422
|
this.appendChild = function(obj) {
|
|
1421
1423
|
var proxyobj = obj
|