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/portal.js
CHANGED
|
@@ -2,13 +2,12 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
2
2
|
elation.component.add('engine.things.janusportal', function() {
|
|
3
3
|
this.postinit = function() {
|
|
4
4
|
this.defineProperties({
|
|
5
|
-
'url': { type: 'string' },
|
|
5
|
+
'url': { type: 'string', set: this.updateTitle },
|
|
6
6
|
'title': { type: 'string' },
|
|
7
7
|
'janus': { type: 'object' },
|
|
8
8
|
'room': { type: 'object' },
|
|
9
9
|
//'color': { type: 'color', default: new THREE.Color(0xffffff), set: this.updateMaterial },
|
|
10
10
|
'size': { type: 'vector3', default: new THREE.Vector3(1.4,2.2,1), set: this.updateGeometry },
|
|
11
|
-
'url': { type: 'string', set: this.updateTitle },
|
|
12
11
|
'open': { type: 'boolean', default: false },
|
|
13
12
|
'collision_id': { type: 'string', default: 'cube', set: this.updateCollider },
|
|
14
13
|
'collision_scale': { type: 'vector3', set: this.updateCollider },
|
|
@@ -26,6 +25,8 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
26
25
|
'target': { type: 'string', default: '' },
|
|
27
26
|
'round': { type: 'boolean', default: false },
|
|
28
27
|
'cooldown': { type: 'float', default: 1000 },
|
|
28
|
+
'font': { type: 'string', default: 'impact' },
|
|
29
|
+
'font_weight': { type: 'string', default: 'bold' },
|
|
29
30
|
});
|
|
30
31
|
this.addTag('usable');
|
|
31
32
|
elation.engine.things.janusportal.extendclass.postinit.call(this);
|
|
@@ -53,7 +54,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
53
54
|
this.updateTitle = function() {
|
|
54
55
|
if (this.draw_text) {
|
|
55
56
|
var title = this.title;
|
|
56
|
-
if (!title) {
|
|
57
|
+
if (!title && this.url) {
|
|
57
58
|
title = this.url.replace(/^https?:\/\//i, '');
|
|
58
59
|
if (title.match(/^[^\/]+\/$/)) {
|
|
59
60
|
title = title.substr(0, title.length - 1);
|
|
@@ -75,8 +76,8 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
75
76
|
collidable: false,
|
|
76
77
|
pickable: false,
|
|
77
78
|
background: 'rgba(255,255,255,.4)',
|
|
78
|
-
font:
|
|
79
|
-
fontWeight:
|
|
79
|
+
font: this.font,
|
|
80
|
+
fontWeight: this.font_weight,
|
|
80
81
|
textShadowBlur: 5,
|
|
81
82
|
textShadowColor: 'black',
|
|
82
83
|
height: .1,
|
|
@@ -90,10 +91,12 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
90
91
|
this.createChildren = function() {
|
|
91
92
|
//elation.events.add(this.label, 'mouseover,mousemove,mouseout,click', this);
|
|
92
93
|
this.updateCollider();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
if (this.url) {
|
|
95
|
+
elation.events.add(this, 'click', elation.bind(this, this.activate));
|
|
96
|
+
elation.events.add(this, 'mouseover', elation.bind(this, this.hover));
|
|
97
|
+
elation.events.add(this, 'mouseout', elation.bind(this, this.unhover));
|
|
98
|
+
elation.events.add(this, 'collide', (ev) => this.handleCollide(ev));
|
|
99
|
+
}
|
|
97
100
|
}
|
|
98
101
|
this.createMaterial = function() {
|
|
99
102
|
var matargs = {
|
|
@@ -106,7 +109,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
106
109
|
//console.log('shader', this.shader_id, shader);
|
|
107
110
|
if (shader) {
|
|
108
111
|
let shadermaterial = shader.getInstance();
|
|
109
|
-
shadermaterial.uniforms = this.room.parseShaderUniforms(shader.uniforms);
|
|
112
|
+
//shadermaterial.uniforms = this.room.parseShaderUniforms(shader.uniforms);
|
|
110
113
|
mat = shadermaterial;
|
|
111
114
|
mat.transparent = true;
|
|
112
115
|
mat.side = THREE.DoubleSide;
|
|
@@ -329,7 +332,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
329
332
|
console.log('load that room', this.portalroom);
|
|
330
333
|
|
|
331
334
|
var scene = new THREE.Scene();
|
|
332
|
-
scene.background = this.portalroom.skyboxtexture
|
|
335
|
+
scene.background = this.portalroom.skyboxtexture;
|
|
333
336
|
scene.add(this.portalroom.objects['3d']);
|
|
334
337
|
this.scene = scene;
|
|
335
338
|
this.scene.updateMatrixWorld(true);
|
|
@@ -521,6 +524,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
521
524
|
textureWidth: this.mirror_texturesize,
|
|
522
525
|
textureHeight: this.mirror_texturesize,
|
|
523
526
|
});
|
|
527
|
+
group.castShadow = true;
|
|
524
528
|
this.group = group;
|
|
525
529
|
if (this.objects['3d']) {
|
|
526
530
|
this.objects['3d'].add(group);
|
|
@@ -532,6 +536,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
532
536
|
//var group = new THREE.Object3D();
|
|
533
537
|
var group = new THREE.Mesh(box, mat);
|
|
534
538
|
group.renderOrder = 10;
|
|
539
|
+
group.castShadow = true;
|
|
535
540
|
|
|
536
541
|
if (this.draw_glow) {
|
|
537
542
|
var framewidth = .05,
|
|
@@ -557,6 +562,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
557
562
|
var framemat = new THREE.MeshPhongMaterial({color: 0x0000cc, emissive: 0x222222});
|
|
558
563
|
var frame = new THREE.Mesh(framegeo, framemat);
|
|
559
564
|
this.frame = frame;
|
|
565
|
+
frame.castShadow = true;
|
|
560
566
|
group.add(frame);
|
|
561
567
|
}
|
|
562
568
|
this.material = mat;
|
|
@@ -565,6 +571,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
565
571
|
|
|
566
572
|
var framemat = new THREE.MeshPhongMaterial({color: 0x0000cc, emissive: 0x222222});
|
|
567
573
|
var frame = new THREE.Mesh(framegeo, framemat);
|
|
574
|
+
frame.castShadow = true;
|
|
568
575
|
this.frame = frame;
|
|
569
576
|
group.add(frame);
|
|
570
577
|
|
|
@@ -609,21 +616,23 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
609
616
|
}
|
|
610
617
|
this.handleFrameUpdates = function(ev) {
|
|
611
618
|
elation.engine.things.janusportal.extendclass.handleFrameUpdates.call(this, ev);
|
|
612
|
-
if (this.shader) {
|
|
619
|
+
if (this.shader && this.shader.uniforms) {
|
|
613
620
|
if (this.shader.uniforms.time) {
|
|
614
621
|
this.shader.uniforms.time.value = performance.now() / 1000;
|
|
615
622
|
this.refresh();
|
|
616
623
|
}
|
|
617
624
|
}
|
|
618
625
|
}
|
|
619
|
-
this.handleCollide = function() {
|
|
626
|
+
this.handleCollide = function(ev) {
|
|
627
|
+
// TODO - we could potentially handle sending other physical objects through portals here, but for now we only care about the player
|
|
628
|
+
if (ev.data.other !== player._target) return;
|
|
620
629
|
// Only activate portal if the player is walking towards it
|
|
621
630
|
let fwd = this.localToWorld(V(0,0,1)).sub(this.localToWorld(V(0,0,0)));
|
|
622
631
|
let dot = fwd.dot(normalized(player.vel));
|
|
623
632
|
if (dot < 0) {
|
|
624
633
|
this.activate();
|
|
625
634
|
// FIXME - we should be transforming the user's velocity into the new room's coordinate space, but right now a portal isn't aware of what's on the other side
|
|
626
|
-
|
|
635
|
+
player.vel = V(0,0,0);
|
|
627
636
|
}
|
|
628
637
|
}
|
|
629
638
|
}, elation.engine.things.janusbase);
|
package/scripts/remoteplayer.js
CHANGED
|
@@ -72,30 +72,6 @@ elation.component.add('engine.things.remoteplayer', function() {
|
|
|
72
72
|
billboard: 'y'
|
|
73
73
|
});
|
|
74
74
|
*/
|
|
75
|
-
if (this.engine.client.player.usevoip && this.engine.systems.sound.canPlaySound) {
|
|
76
|
-
this.mouth = this.head.spawn('sound', this.properties.player_name + '_voice', {
|
|
77
|
-
//loop: true
|
|
78
|
-
});
|
|
79
|
-
/*
|
|
80
|
-
this.mouth.createAudio();
|
|
81
|
-
var context = this.mouth.audio.context;
|
|
82
|
-
this.voip = new JanusVOIPPlayer();
|
|
83
|
-
this.voip.start(context);
|
|
84
|
-
this.audiobuffer = {readyCallbacks: []};//new THREE.AudioBuffer(this.mouth.audio.context);
|
|
85
|
-
this.audiobuffer.buffer = this.voip.rawbuffer;
|
|
86
|
-
|
|
87
|
-
//elation.events.add(this.voip, 'voip_player_data', elation.bind(this, this.handleVoipData));
|
|
88
|
-
this.audiobuffer.ready = true;
|
|
89
|
-
for ( var i = 0; i < this.audiobuffer.readyCallbacks.length; i ++ ) {
|
|
90
|
-
|
|
91
|
-
this.audiobuffer.readyCallbacks[ i ]( this.voip.rawbuffer );
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
*/
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
//this.mouth.audio.setBuffer(this.audiobuffer);
|
|
98
|
-
elation.events.add(this, 'thing_change', elation.bind(this, this.updateTransparency));
|
|
99
75
|
};
|
|
100
76
|
this.speak = function(noise) {
|
|
101
77
|
this.voip.speak(noise);
|
|
@@ -136,7 +112,7 @@ elation.component.add('engine.things.remoteplayer', function() {
|
|
|
136
112
|
this.addVoice = async function(stream) {
|
|
137
113
|
this.mouth = this.createObject('sound', {
|
|
138
114
|
pos: V(0, 0, 0),
|
|
139
|
-
|
|
115
|
+
distancemodel: 'exponential',
|
|
140
116
|
dist: 8,
|
|
141
117
|
rolloff: 0.75,
|
|
142
118
|
});
|