janusweb 1.5.31 → 1.5.35
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/media/assets/webui/apps/avatar/avatar.js +2 -1
- package/media/assets/webui/apps/buttons/buttons.html +2 -2
- package/media/assets/webui/apps/buttons/buttons.js +2 -2
- package/media/assets/webui/apps/comms/voip.js +2 -4
- 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 +407 -9
- package/media/assets/webui/apps/editor/editor.json +6 -3
- package/media/assets/webui/apps/inventory/inventory.js +2 -2
- package/media/assets/webui/apps/locomotion/teleporter.js +8 -7
- package/media/assets/webui/apps/navigation/navigation.js +12 -12
- 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/default.json +2 -1
- package/media/assets/webui/themes/default.css +29 -2
- 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 +65 -45
- package/scripts/config.js +2 -0
- package/scripts/elements/linesegments.js +5 -2
- package/scripts/image.js +7 -1
- package/scripts/janusbase.js +28 -11
- package/scripts/janusghost.js +4 -3
- package/scripts/janusparagraph.js +5 -3
- package/scripts/janusparticle.js +25 -14
- package/scripts/janusplayer.js +25 -10
- package/scripts/janusweb.js +22 -3
- package/scripts/janusxrplayer.js +4 -1
- package/scripts/multiplayermanager.js +3 -3
- package/scripts/object.js +172 -82
- package/scripts/portal.js +12 -10
- package/scripts/room.js +113 -54
- package/scripts/sound.js +0 -1
- package/scripts/text.js +10 -2
- package/scripts/translators/janusvfs.js +20 -0
- package/scripts/video.js +1 -1
- package/scripts/websurface.js +11 -2
- package/utils/build.sh +3 -0
- package/utils/init.sh +1 -1
package/scripts/janusplayer.js
CHANGED
|
@@ -116,7 +116,7 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
116
116
|
elation.events.add(this.engine.client.container, 'mousedown', elation.bind(this, this.updateMouseStatus));
|
|
117
117
|
elation.events.add(this.engine.client.container, 'mouseup', elation.bind(this, this.updateMouseStatus));
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
this.updateCursorStyle = elation.bind(this, this.updateCursorStyle);
|
|
120
120
|
|
|
121
121
|
this.touchcache = {
|
|
122
122
|
positions: []
|
|
@@ -368,10 +368,10 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
368
368
|
if (typeof playerpos.z == 'undefined' || isNaN(playerpos.z)) playerpos.z = 0;
|
|
369
369
|
this.objects['3d'].updateMatrix();
|
|
370
370
|
this.objects['3d'].updateMatrixWorld();
|
|
371
|
-
this.objects['3d'].matrixWorld.extractBasis(v.xdir, v.ydir, v.zdir)
|
|
371
|
+
this.objects['3d'].matrixWorld.extractBasis(v.xdir, v.ydir, v.zdir);
|
|
372
372
|
}
|
|
373
373
|
if (this.head) {
|
|
374
|
-
this.head.objects['3d'].matrixWorld.extractBasis(v.view_xdir, v.view_ydir, v.view_zdir)
|
|
374
|
+
this.head.objects['3d'].matrixWorld.extractBasis(v.view_xdir, v.view_ydir, v.view_zdir);
|
|
375
375
|
v.head_pos.setFromMatrixPosition(this.head.objects['3d'].matrixWorld);
|
|
376
376
|
v.view_zdir.negate();
|
|
377
377
|
}
|
|
@@ -446,10 +446,14 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
446
446
|
}
|
|
447
447
|
this.setRoom = function(newroom) {
|
|
448
448
|
if (this.room) {
|
|
449
|
+
let oldroomproxy = this.room.getProxyObject();
|
|
450
|
+
oldroomproxy.removeEventListener('mouseover', this.updateCursorStyle);
|
|
451
|
+
oldroomproxy.removeEventListener('mouseout', this.updateCursorStyle);
|
|
449
452
|
this.room.part();
|
|
450
453
|
}
|
|
451
454
|
this.room = newroom;
|
|
452
455
|
this.room.join();
|
|
456
|
+
|
|
453
457
|
/*
|
|
454
458
|
if (!this.gazecaster) {
|
|
455
459
|
this.gazecaster = newroom.createObject('raycaster', {persist: false});
|
|
@@ -462,6 +466,10 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
462
466
|
this.gazecaster.setRoom(newroom);
|
|
463
467
|
}
|
|
464
468
|
*/
|
|
469
|
+
let newroomproxy = newroom.getProxyObject();
|
|
470
|
+
newroomproxy.addEventListener('mouseover', this.updateCursorStyle);
|
|
471
|
+
newroomproxy.addEventListener('mouseout', this.updateCursorStyle);
|
|
472
|
+
|
|
465
473
|
if (!this.cursors) {
|
|
466
474
|
this.cursors = {
|
|
467
475
|
'default': janus.getAsset('image', 'cursor_crosshair'),
|
|
@@ -483,7 +491,8 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
483
491
|
avatar_src: 'data:text/plain,' + encodeURIComponent(avatar),
|
|
484
492
|
showlabel: false,
|
|
485
493
|
//pos: V(0, -this.fatness, 0),
|
|
486
|
-
rotation: V(0, 180, 0),
|
|
494
|
+
//rotation: V(0, 180, 0),
|
|
495
|
+
renderorder: 101,
|
|
487
496
|
});
|
|
488
497
|
this.ghost.orientation.set(0,1,0,0);
|
|
489
498
|
}
|
|
@@ -645,8 +654,9 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
645
654
|
ghost_id: this.getUsername(),
|
|
646
655
|
avatar_src: 'data:text/plain,' + encodeURIComponent(avatar),
|
|
647
656
|
showlabel: false,
|
|
648
|
-
pos: V(0, -this.fatness, 0),
|
|
649
|
-
rotation: V(0, 180, 0),
|
|
657
|
+
//pos: V(0, -this.fatness, 0),
|
|
658
|
+
//rotation: V(0, 180, 0),
|
|
659
|
+
renderorder: 101,
|
|
650
660
|
});
|
|
651
661
|
|
|
652
662
|
return setting;
|
|
@@ -776,10 +786,9 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
776
786
|
}
|
|
777
787
|
this.updateCursorStyle = function(ev) {
|
|
778
788
|
var vrdisplay = this.engine.systems.render.views.main.vrdisplay;
|
|
779
|
-
var obj = ev.
|
|
789
|
+
var obj = ev.element;
|
|
780
790
|
var proxyobj = (obj.getProxyObject ? obj.getProxyObject() : obj);
|
|
781
791
|
|
|
782
|
-
|
|
783
792
|
if (obj && proxyobj && (ev.type == 'mouseover' || ev.type == 'mousemove') && (
|
|
784
793
|
obj.onclick ||
|
|
785
794
|
elation.events.hasEventListener(obj, 'click') ||
|
|
@@ -832,10 +841,16 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
|
|
|
832
841
|
this.updateCollider = function() {
|
|
833
842
|
if (this.objects['dynamics']) {
|
|
834
843
|
if (this.collision_radius > 0) {
|
|
844
|
+
/*
|
|
835
845
|
this.setCollider('sphere', {
|
|
836
846
|
radius: this.collision_radius,
|
|
837
|
-
|
|
838
|
-
|
|
847
|
+
});
|
|
848
|
+
*/
|
|
849
|
+
this.pickable = false;
|
|
850
|
+
this.setCollider('capsule', {
|
|
851
|
+
radius: this.collision_radius,
|
|
852
|
+
length: 1,
|
|
853
|
+
offset: V(0, this.collision_radius, 0)
|
|
839
854
|
});
|
|
840
855
|
} else {
|
|
841
856
|
this.removeCollider();
|
package/scripts/janusweb.js
CHANGED
|
@@ -101,7 +101,7 @@ elation.require([
|
|
|
101
101
|
if (this.urltemplate) {
|
|
102
102
|
dust.filters.stripunsafe = function(s) {
|
|
103
103
|
return s.replace(/:\//g, '');
|
|
104
|
-
}
|
|
104
|
+
};
|
|
105
105
|
elation.template.add('janusweb.url', this.urltemplate);
|
|
106
106
|
}
|
|
107
107
|
this.initScripting();
|
|
@@ -157,6 +157,7 @@ elation.require([
|
|
|
157
157
|
userid: ['property', 'userId'],
|
|
158
158
|
avatarlighting: ['property', 'settings.avatarlighting'],
|
|
159
159
|
ui: ['property', 'engine.client.ui'],
|
|
160
|
+
currentroom: ['property', 'currentroom'],
|
|
160
161
|
|
|
161
162
|
hmd: ['accessor', 'isVRActive'],
|
|
162
163
|
|
|
@@ -172,6 +173,7 @@ elation.require([
|
|
|
172
173
|
load: ['function', 'navigateTo'],
|
|
173
174
|
setActiveRoom: ['function', 'setActiveRoom'],
|
|
174
175
|
preload: ['function', 'preload'],
|
|
176
|
+
createRoom: ['function', 'createRoom'],
|
|
175
177
|
navhome: ['function', 'navigateHome'],
|
|
176
178
|
chatsend: ['function', 'sendChatMessage'],
|
|
177
179
|
sync: ['function', 'currentroom.sync'],
|
|
@@ -410,7 +412,24 @@ elation.require([
|
|
|
410
412
|
}
|
|
411
413
|
}
|
|
412
414
|
this.preload = function(url, stripreferrer) {
|
|
413
|
-
this.load(url, false, null, stripreferrer);
|
|
415
|
+
return this.load(url, false, null, stripreferrer);
|
|
416
|
+
}
|
|
417
|
+
this.createRoom = function(url, makeactive=true) {
|
|
418
|
+
let newroom = this.spawn('janusroom', url, {
|
|
419
|
+
url: url,
|
|
420
|
+
janus: this,
|
|
421
|
+
corsproxy: this.corsproxy,
|
|
422
|
+
deferload: true
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
this.rooms[newroom.roomid] = newroom;
|
|
426
|
+
//console.log('made new room', url, room);
|
|
427
|
+
this.loading = false;
|
|
428
|
+
if (newroom && makeactive) {
|
|
429
|
+
this.setActiveRoom(newroom);
|
|
430
|
+
}
|
|
431
|
+
this.initScripting();
|
|
432
|
+
return newroom.getProxyObject();
|
|
414
433
|
}
|
|
415
434
|
this.getFixedURL = function(url) {
|
|
416
435
|
// Our 'clean' client URLs don't contain a : because many services have problems parsing them
|
|
@@ -511,7 +530,7 @@ elation.require([
|
|
|
511
530
|
}
|
|
512
531
|
this.handleRoomEditOther = function(data) {
|
|
513
532
|
var roomId = data.roomId,
|
|
514
|
-
movedata = data.position
|
|
533
|
+
movedata = data.position,
|
|
515
534
|
edit = movedata.room_edit,
|
|
516
535
|
del = movedata.room_delete;
|
|
517
536
|
|
package/scripts/janusxrplayer.js
CHANGED
|
@@ -562,6 +562,7 @@ elation.require(['engine.things.generic', 'janusweb.external.webxr-input-profile
|
|
|
562
562
|
lighting: false,
|
|
563
563
|
opacity: .5,
|
|
564
564
|
cull_face: 'none',
|
|
565
|
+
billboard: 'y',
|
|
565
566
|
});
|
|
566
567
|
this.raycaster = this.createObject('raycaster', {});
|
|
567
568
|
this.raycaster.addEventListener('raycastenter', (ev) => this.handleRaycastEnter(ev));
|
|
@@ -572,8 +573,10 @@ elation.require(['engine.things.generic', 'janusweb.external.webxr-input-profile
|
|
|
572
573
|
this.worldToLocal(this.laser.positions[1].copy(endpoint));
|
|
573
574
|
this.laser.updateLine();
|
|
574
575
|
this.cursor.pos.copy(endpoint);
|
|
576
|
+
let cursorscale = player.head.distanceTo(endpoint) / 12;
|
|
577
|
+
this.cursor.scale.set(cursorscale, cursorscale, cursorscale);
|
|
575
578
|
//this.cursor.zdir = normal;
|
|
576
|
-
if (this.cursor.room !== room) room.appendChild(this.cursor);
|
|
579
|
+
if (this.cursor.room !== room._target) room.appendChild(this.cursor);
|
|
577
580
|
//this.cursor.zdir.copy(player.view_dir).multiplyScalar(-1);
|
|
578
581
|
//this.cursor.zdir = normal;
|
|
579
582
|
this.cursor.visible = true;
|
|
@@ -180,7 +180,7 @@ console.log('[MultiplayerManager] set active room:', room, this.activeroom);
|
|
|
180
180
|
dir: (-tmpVecZ.x) + ' ' + (-tmpVecZ.y) + ' ' + (-tmpVecZ.z),
|
|
181
181
|
up_dir: '0 1 0',
|
|
182
182
|
//view_dir: this.tmpVecZ.toArray().join(' ')
|
|
183
|
-
}
|
|
183
|
+
};
|
|
184
184
|
if (head) {
|
|
185
185
|
//this.tmpMat.makeRotationFromQuaternion(head.properties.orientation);
|
|
186
186
|
tmpMat.copy(head.objects['3d'].matrixWorld);
|
|
@@ -230,8 +230,8 @@ console.log('[MultiplayerManager] set active room:', room, this.activeroom);
|
|
|
230
230
|
//console.log('[MultiplayerManager] player update', moveData);
|
|
231
231
|
if (this.avatarNeedsUpdate || player.avatarNeedsUpdate) {
|
|
232
232
|
moveData.avatar = player.getCurrentAvatarData().replace(/"/g, "^");
|
|
233
|
-
this.avatarNeedsUpdate = false
|
|
234
|
-
player.avatarNeedsUpdate = false
|
|
233
|
+
this.avatarNeedsUpdate = false;
|
|
234
|
+
player.avatarNeedsUpdate = false;
|
|
235
235
|
} else if (moveData.avatar) {
|
|
236
236
|
delete moveData.avatar;
|
|
237
237
|
}
|