janusweb 1.5.42 → 1.5.44
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 +23 -0
- package/css/janusweb.css +7 -2
- package/media/assets/webui/apps/buttons/buttons.js +17 -3
- package/media/assets/webui/apps/comms/comms.css +1 -1
- package/media/assets/webui/apps/comms/comms.js +1 -1
- package/media/assets/webui/apps/comms/voip.css +12 -3
- package/media/assets/webui/apps/comms/voip.js +16 -6
- package/media/assets/webui/apps/editor/editor.css +1 -0
- package/media/assets/webui/apps/editor/editor.js +19 -12
- package/media/assets/webui/apps/locomotion/teleporter.js +11 -4
- package/media/assets/webui/apps/xrmenu/images/audio-settings.png +0 -0
- package/media/assets/webui/apps/xrmenu/xrmenu-assets.json +2 -1
- package/media/assets/webui/apps/xrmenu/xrmenu.js +142 -40
- package/media/assets/webui/themes/default.css +42 -0
- package/package.json +2 -2
- package/scripts/client.js +12 -1
- package/scripts/config.js +1 -1
- package/scripts/elements/outliner.js +7 -1
- package/scripts/external/JanusClientConnection.js +14 -8
- package/scripts/image.js +1 -1
- package/scripts/janusbase.js +49 -27
- package/scripts/janusghost.js +14 -10
- package/scripts/januslight.js +46 -4
- package/scripts/janusparticle.js +116 -13
- package/scripts/janusplayer.js +97 -22
- package/scripts/janusweb.js +18 -5
- package/scripts/janusxrplayer.js +117 -17
- package/scripts/object.js +75 -31
- package/scripts/parts.js +1 -1
- package/scripts/portal.js +21 -10
- package/scripts/remoteplayer.js +3 -2
- package/scripts/room.js +159 -49
- package/scripts/text.js +7 -4
- package/scripts/websurface.js +3 -3
package/scripts/object.js
CHANGED
|
@@ -51,6 +51,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
51
51
|
shadow: { type: 'boolean', default: true, set: this.updateMaterial },
|
|
52
52
|
shadow_receive: { type: 'boolean', default: true, set: this.updateMaterial, comment: 'Receive shadows from self and other objects' },
|
|
53
53
|
shadow_cast: { type: 'boolean', default: true, set: this.updateMaterial, comment: 'Cast shadows onto self and other objects' },
|
|
54
|
+
shadow_side: { type: 'string', default: '', set: this.updateMaterial, comment: 'Cast shadows onto front, back, both, or auto (empty)' },
|
|
54
55
|
wireframe: { type: 'boolean', default: false, set: this.updateMaterial, comment: 'Wireframe rendering' },
|
|
55
56
|
fog: { type: 'boolean', default: true, set: this.updateMaterial, comment: 'Object is affected by fog' },
|
|
56
57
|
lights: { type: 'boolean', default: false, comment: 'Load lights from model' },
|
|
@@ -58,7 +59,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
58
59
|
cull_face: { type: 'string', default: 'back', set: this.updateMaterial, comment: 'Hide face sides (back, front, or none)' },
|
|
59
60
|
blend_src: { type: 'string', set: this.updateMaterial, comment: 'Blend mode (source)' },
|
|
60
61
|
blend_dest: { type: 'string', set: this.updateMaterial, comment: 'Blend mode (destination)' },
|
|
61
|
-
blend_mode: { type: 'string', default:
|
|
62
|
+
blend_mode: { type: 'string', default: null, set: this.updateMaterial, comment: 'Blend mode' },
|
|
62
63
|
depth_write: { type: 'boolean', default: null, set: this.updateMaterial },
|
|
63
64
|
depth_test: { type: 'boolean', default: null, set: this.updateMaterial },
|
|
64
65
|
depth_offset: { type: 'float', default: null, set: this.updateMaterial },
|
|
@@ -81,6 +82,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
81
82
|
emissive_intensity: { type: 'float', default: 1, set: this.updateMaterial, comment: 'Intensity of material emissive color' },
|
|
82
83
|
roughness: { type: 'float', default: null, min: 0, max: 1, set: this.updateMaterial, comment: 'Material roughness value' },
|
|
83
84
|
metalness: { type: 'float', default: null, set: this.updateMaterial, comment: 'Material metalness value' },
|
|
85
|
+
transmission: { type: 'float', default: 0, set: this.updateMaterial, comment: 'Material transmission value' },
|
|
84
86
|
usevertexcolors: { type: 'boolean', default: true, set: this.updateMaterial },
|
|
85
87
|
gain: { type: 'float', default: 1.0, set: this.updateAudioNodes },
|
|
86
88
|
onloadstart: { type: 'callback' },
|
|
@@ -113,19 +115,23 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
113
115
|
if (asset.loaded) {
|
|
114
116
|
setTimeout(elation.bind(this, this.handleLoad), 0);
|
|
115
117
|
} else {
|
|
118
|
+
//this.loadingindicator = this.createObject('object', {});
|
|
119
|
+
/*
|
|
116
120
|
this.loadingindicator = this.createObject('particle', {
|
|
117
121
|
col: 'green',
|
|
118
122
|
scale: V(.025),
|
|
119
123
|
vel: V(-1, 0, -1),
|
|
120
124
|
accel: V(0, -5, 0),
|
|
121
125
|
rand_vel: V(2, 2, 2),
|
|
122
|
-
count:
|
|
123
|
-
rate:
|
|
126
|
+
count: 25,
|
|
127
|
+
rate: 50,
|
|
124
128
|
duration: .5,
|
|
125
129
|
collidable: false,
|
|
126
130
|
collision_trigger: true,
|
|
127
131
|
loop: true,
|
|
128
132
|
});
|
|
133
|
+
*/
|
|
134
|
+
//elation.events.add(asset, 'asset_load_queued,asset_load_start,asset_load_progress,asset_load_processing,asset_load_complete', ev => { console.log(ev.type, this, ev); });
|
|
129
135
|
elation.events.add(asset, 'asset_load_complete', elation.bind(this, this.handleLoad));
|
|
130
136
|
elation.events.add(asset, 'asset_load_progress', (ev) => { this.dispatchEvent({type: 'loadprogress', data: ev.data}); });
|
|
131
137
|
}
|
|
@@ -189,7 +195,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
189
195
|
if (this.modelasset) {
|
|
190
196
|
this.initAnimations(this.modelasset.animations);
|
|
191
197
|
if (this.animations && this.anim_id && this.animations[this.anim_id]) {
|
|
192
|
-
console.log('start animation', this);
|
|
198
|
+
//console.log('start animation', this);
|
|
193
199
|
this.animations[this.anim_id].play();
|
|
194
200
|
this.activeanimation = this.animations[this.anim_id];
|
|
195
201
|
}
|
|
@@ -204,12 +210,14 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
204
210
|
}
|
|
205
211
|
this.updateVideo = function() {
|
|
206
212
|
if (!this.modelasset) return;
|
|
213
|
+
if (this.videotexture) {
|
|
214
|
+
if (this.videotexture.image) {
|
|
215
|
+
this.videotexture.image.pause();
|
|
216
|
+
}
|
|
217
|
+
}
|
|
207
218
|
if (!this.videoasset || this.videoasset.name != this.video_id) {
|
|
208
219
|
if (this.video_id && this.video_id != '' && !this.image_id) {
|
|
209
220
|
this.loadVideo(this.video_id);
|
|
210
|
-
if (this.modelasset && texture) {
|
|
211
|
-
this.assignTextureParameters(texture, this.modelasset, this.videoasset);
|
|
212
|
-
}
|
|
213
221
|
} else {
|
|
214
222
|
this.videotexture = null;
|
|
215
223
|
}
|
|
@@ -246,9 +254,11 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
246
254
|
// Refresh this object whenever the video has a new frame for us to display
|
|
247
255
|
texture.onUpdate = (e) => this.refresh();
|
|
248
256
|
|
|
249
|
-
if (videoasset.auto_play) {
|
|
257
|
+
if (videoasset.auto_play && texture.image) {
|
|
250
258
|
texture.image.addEventListener('canplaythrough', function() {
|
|
251
|
-
texture.image
|
|
259
|
+
if (texture.image) {
|
|
260
|
+
texture.image.play();
|
|
261
|
+
}
|
|
252
262
|
});
|
|
253
263
|
}
|
|
254
264
|
|
|
@@ -260,6 +270,9 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
260
270
|
|
|
261
271
|
elation.events.add(this, 'click', elation.bind(this, this.handleVideoClick));
|
|
262
272
|
this.room.videos[videoid] = this;
|
|
273
|
+
if (this.modelasset && texture) {
|
|
274
|
+
this.assignTextureParameters(texture, this.modelasset, videoasset);
|
|
275
|
+
}
|
|
263
276
|
}
|
|
264
277
|
}
|
|
265
278
|
this.updateWebsurface = function() {
|
|
@@ -296,6 +309,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
296
309
|
this.websurface = this.spawn('januswebsurface', null, {janus: this.janus, room: this.room, websurface_id: this.websurface_id});
|
|
297
310
|
elation.events.add(this, 'mouseover', elation.bind(this.websurface, this.websurface.hover));
|
|
298
311
|
elation.events.add(this, 'mouseout', elation.bind(this.websurface, this.websurface.unhover));
|
|
312
|
+
elation.events.add(this, 'click', elation.bind(this.websurface, this.websurface.click));
|
|
299
313
|
this.replaceWebsurfaceMaterial();
|
|
300
314
|
this.websurface.start();
|
|
301
315
|
}
|
|
@@ -357,6 +371,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
357
371
|
blend_src = false,
|
|
358
372
|
blend_dest = false,
|
|
359
373
|
side = this.sidemap[this.properties.cull_face],
|
|
374
|
+
shadowside = this.sidemap[this.properties.shadow_side || this.properties.cull_face],
|
|
360
375
|
textureasset,
|
|
361
376
|
lightmaptextureasset,
|
|
362
377
|
emissivetextureasset,
|
|
@@ -416,7 +431,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
416
431
|
|
|
417
432
|
//texture.offset.copy(this.texture_offset);
|
|
418
433
|
//texture.repeat.copy(this.texture_repeat);
|
|
419
|
-
//texture.rotation = this.texture_rotation * THREE.
|
|
434
|
+
//texture.rotation = this.texture_rotation * THREE.MathUtils.DEG2RAD;
|
|
420
435
|
|
|
421
436
|
if (texture) {
|
|
422
437
|
this.assignTextureParameters(texture, modelasset, textureasset);
|
|
@@ -434,7 +449,10 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
434
449
|
}
|
|
435
450
|
}
|
|
436
451
|
if (normal_image_id) {
|
|
437
|
-
let normaltextureasset = this.getAsset('image', normal_image_id,
|
|
452
|
+
let normaltextureasset = this.getAsset('image', normal_image_id, false);
|
|
453
|
+
if (!normaltextureasset) { // no image found, try video
|
|
454
|
+
normaltextureasset = this.getAsset('video', normal_image_id);
|
|
455
|
+
}
|
|
438
456
|
if (normaltextureasset) {
|
|
439
457
|
textureNormal = normaltextureasset.getInstance();
|
|
440
458
|
if (!this.assetloadhandlers[textureNormal.uuid]) {
|
|
@@ -632,6 +650,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
632
650
|
shadermaterial = shader.getInstance();
|
|
633
651
|
shadermaterial.uniforms = this.room.parseShaderUniforms(shader.uniforms);
|
|
634
652
|
shadermaterial.side = this.sidemap[this.properties.cull_face];
|
|
653
|
+
shadermaterial.shadowSide = shadowside
|
|
635
654
|
shadermaterial.receiveShadow = this.shadow && this.shadow_receive;
|
|
636
655
|
shadermaterial.castShadow = this.shadow && this.shadow_cast;
|
|
637
656
|
shadermaterial.renderOrder = this.renderorder;
|
|
@@ -765,9 +784,8 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
765
784
|
}
|
|
766
785
|
if (m.normalMap) {
|
|
767
786
|
var imagesrc = m.normalMap.sourceFile;
|
|
768
|
-
var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false});
|
|
787
|
+
var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false, srgb: false});
|
|
769
788
|
if (asset) {
|
|
770
|
-
m.normalMap = asset.getInstance();
|
|
771
789
|
m.normalMap = asset.getInstance();
|
|
772
790
|
if (!this.assetloadhandlers[m.normalMap.uuid]) {
|
|
773
791
|
this.assetloadhandlers[m.normalMap.uuid] = true;
|
|
@@ -783,9 +801,8 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
783
801
|
m.bumpScale = this.bumpmap_scale;
|
|
784
802
|
} else if (m.bumpMap) {
|
|
785
803
|
var imagesrc = m.bumpMap.sourceFile;
|
|
786
|
-
var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false});
|
|
804
|
+
var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false, srgb: false});
|
|
787
805
|
if (asset) {
|
|
788
|
-
m.normalMap = asset.getInstance();
|
|
789
806
|
m.normalMap = asset.getInstance();
|
|
790
807
|
if (!this.assetloadhandlers[m.normalMap.uuid]) {
|
|
791
808
|
this.assetloadhandlers[m.normalMap.uuid] = true;
|
|
@@ -793,7 +810,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
793
810
|
m.normalMap = ev.data; this.refresh();
|
|
794
811
|
m.normalMap.offset.copy(this.texture_offset);
|
|
795
812
|
m.normalMap.repeat.copy(this.texture_repeat);
|
|
796
|
-
m.normalMap.rotation = this.texture_rotation * THREE.
|
|
813
|
+
m.normalMap.rotation = this.texture_rotation * THREE.MathUtils.DEG2RAD;
|
|
797
814
|
}));
|
|
798
815
|
elation.events.add(asset, 'asset_load', elation.bind(this, function(ev) { m.normalMap = ev.data; this.refresh(); }));
|
|
799
816
|
}
|
|
@@ -803,7 +820,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
803
820
|
m.normalMap = textureNormal;
|
|
804
821
|
} else if (m.normalMap) {
|
|
805
822
|
var imagesrc = m.normalMap.sourceFile;
|
|
806
|
-
var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false});
|
|
823
|
+
var asset = this.getAsset('image', imagesrc, {id: imagesrc, src: imagesrc, hasalpha: false, srgb: false});
|
|
807
824
|
if (asset) {
|
|
808
825
|
m.normalMap = asset.getInstance();
|
|
809
826
|
if (!this.assetloadhandlers[m.normalMap.uuid]) {
|
|
@@ -817,11 +834,10 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
817
834
|
if (textureLightmap && textureLightmap.image) {
|
|
818
835
|
if (lightmaptextureasset.loaded) {
|
|
819
836
|
m.lightMap = textureLightmap;
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
elation.events.add(textureLightmap, 'asset_update', elation.bind(m, function(ev) { m.lightMap = ev.data; this.refresh(); }));
|
|
837
|
+
if (!this.assetloadhandlers[m.lightMap.uuid]) {
|
|
838
|
+
this.assetloadhandlers[m.lightMap.uuid] = true;
|
|
839
|
+
elation.events.add(textureLightmap, 'asset_update', elation.bind(m, function(ev) { m.lightMap = ev.data; this.refresh(); }));
|
|
840
|
+
}
|
|
825
841
|
}
|
|
826
842
|
} else if (m.lightMap) {
|
|
827
843
|
var imagesrc = m.lightMap.sourceFile;
|
|
@@ -844,11 +860,19 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
844
860
|
m.emissiveMap = textureEmissive;
|
|
845
861
|
textureEmissive.encoding = THREE.sRGBEncoding;
|
|
846
862
|
m.emissive = new THREE.Color(0xffffff);
|
|
863
|
+
} else if (m.emissiveMap) {
|
|
864
|
+
m.emissiveMap.encoding = THREE.sRGBEncoding;
|
|
847
865
|
} else if (this.emissive) {
|
|
848
866
|
//m.emissive = this.emissive.clone();
|
|
849
867
|
m.emissive.copy(this.emissive)
|
|
850
868
|
}
|
|
851
869
|
m.emissiveIntensity = this.emissive_intensity;
|
|
870
|
+
} else {
|
|
871
|
+
if (textureEmissive) {
|
|
872
|
+
m.map = textureEmissive;
|
|
873
|
+
textureEmissive.encoding = THREE.sRGBEncoding;
|
|
874
|
+
m.color = new THREE.Color(0xffffff);
|
|
875
|
+
}
|
|
852
876
|
}
|
|
853
877
|
if (textureAlpha) {
|
|
854
878
|
m.alphaMap = textureAlpha;
|
|
@@ -864,13 +888,18 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
864
888
|
} else if (this.metalness !== null) {
|
|
865
889
|
m.metalness = this.metalness;
|
|
866
890
|
}
|
|
891
|
+
if (this.transmission !== null) {
|
|
892
|
+
m.transmission = this.transmission;
|
|
893
|
+
}
|
|
867
894
|
|
|
868
895
|
if (this.isUsingPBR() && !this.isUsingToonShader()) {
|
|
869
896
|
m.envMap = this.getEnvmap();
|
|
897
|
+
m.envMapIntensity = room.skybox_intensity;
|
|
870
898
|
}
|
|
871
899
|
|
|
872
900
|
//m.roughness = 0.75;
|
|
873
901
|
m.side = side;
|
|
902
|
+
m.shadowSide = shadowside;
|
|
874
903
|
|
|
875
904
|
if (blend_src || blend_dest) {
|
|
876
905
|
if (blend_src) m.blendSrc = blend_src;
|
|
@@ -882,8 +911,8 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
882
911
|
if (!(this.blend_src == 'src_alpha' && this.blend_dest == 'one_minus_src_alpha')) {
|
|
883
912
|
m.transparent = true;
|
|
884
913
|
}
|
|
885
|
-
} else {
|
|
886
|
-
|
|
914
|
+
} else if (this.blend_mode) {
|
|
915
|
+
m.blending = this.blendModeMap[this.blend_mode];
|
|
887
916
|
}
|
|
888
917
|
if (this.depth_write !== null) {
|
|
889
918
|
m.depthWrite = this.depth_write;
|
|
@@ -926,9 +955,9 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
926
955
|
//m.needsUpdate = true;
|
|
927
956
|
m.skinning = useSkinning;
|
|
928
957
|
if (useVertexColors) {
|
|
929
|
-
m.vertexColors =
|
|
958
|
+
m.vertexColors = true;
|
|
930
959
|
} else {
|
|
931
|
-
m.vertexColors =
|
|
960
|
+
m.vertexColors = false
|
|
932
961
|
}
|
|
933
962
|
m.fog = this.fog;
|
|
934
963
|
m.wireframe = this.wireframe;
|
|
@@ -1004,6 +1033,12 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1004
1033
|
m.emissive.copy(this.emissive);
|
|
1005
1034
|
}
|
|
1006
1035
|
}
|
|
1036
|
+
if (oldmat.emissiveIntensity !== undefined) m.emissiveIntensity = oldmat.emissiveIntensity;
|
|
1037
|
+
} else {
|
|
1038
|
+
if (oldmat.emissiveMap && !oldmat.map) {
|
|
1039
|
+
m.map = oldmat.emissiveMap;
|
|
1040
|
+
oldmat.color.setRGB(1,1,1);
|
|
1041
|
+
}
|
|
1007
1042
|
}
|
|
1008
1043
|
|
|
1009
1044
|
m.lightMap = oldmat.lightMap;
|
|
@@ -1031,6 +1066,8 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1031
1066
|
if (oldmat.attenuationDistance !== undefined) m.attenuationDistance = oldmat.attenuationDistance;
|
|
1032
1067
|
if (oldmat.thickness !== undefined) m.thickness = oldmat.thickness;
|
|
1033
1068
|
if (oldmat.thicknessMap !== undefined) m.thicknessMap = oldmat.thicknessMap;
|
|
1069
|
+
if (oldmat.transmission !== undefined) m.transmission = oldmat.transmission;
|
|
1070
|
+
if (oldmat.transmissionMap !== undefined) m.transmissionMap = oldmat.transmissionMap;
|
|
1034
1071
|
|
|
1035
1072
|
//m.reflectivity = (oldmat.reflectivity !== undefined ? oldmat.reflectivity : .5);
|
|
1036
1073
|
|
|
@@ -1064,7 +1101,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1064
1101
|
shader.vertexShader = shader.vertexShader.replace('#include <' + oldchunkname + '>', '#include <' + newchunkname + '>');
|
|
1065
1102
|
shader.fragmentShader = shader.fragmentShader.replace('#include <' + oldchunkname + '>', '#include <' + newchunkname + '>');
|
|
1066
1103
|
}
|
|
1067
|
-
}
|
|
1104
|
+
};
|
|
1068
1105
|
}
|
|
1069
1106
|
}
|
|
1070
1107
|
return m;
|
|
@@ -1076,6 +1113,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1076
1113
|
let materials = (elation.utils.isArray(n.material) ? n.material : [n.material]);
|
|
1077
1114
|
materials.forEach(m => {
|
|
1078
1115
|
m.envMap = envMap;
|
|
1116
|
+
m.envMapIntensity = room.skybox_intensity;
|
|
1079
1117
|
});
|
|
1080
1118
|
}
|
|
1081
1119
|
});
|
|
@@ -1145,7 +1183,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1145
1183
|
texture.generateMipmaps = linear && !(texture instanceof THREE.VideoTexture || texture instanceof THREE.SBSVideoTexture) && (textureasset && textureasset.detectImageType() != 'basis');
|
|
1146
1184
|
texture.offset.copy(this.texture_offset);
|
|
1147
1185
|
texture.repeat.copy(this.texture_repeat);
|
|
1148
|
-
texture.rotation = this.texture_rotation * THREE.
|
|
1186
|
+
texture.rotation = this.texture_rotation * THREE.MathUtils.DEG2RAD;
|
|
1149
1187
|
if (texture.repeat.x > 1 || texture.repeat.y > 1) {
|
|
1150
1188
|
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
|
|
1151
1189
|
}
|
|
@@ -1163,12 +1201,12 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1163
1201
|
if (m.map) {
|
|
1164
1202
|
m.map.offset.copy(this.texture_offset);
|
|
1165
1203
|
m.map.repeat.copy(this.texture_repeat);
|
|
1166
|
-
m.map.rotation = this.texture_rotation * THREE.
|
|
1204
|
+
m.map.rotation = this.texture_rotation * THREE.MathUtils.DEG2RAD;
|
|
1167
1205
|
}
|
|
1168
1206
|
if (m.normalMap) {
|
|
1169
1207
|
m.normalMap.offset.copy(this.texture_offset);
|
|
1170
1208
|
m.normalMap.repeat.copy(this.texture_repeat);
|
|
1171
|
-
m.normalMap.rotation = this.texture_rotation * THREE.
|
|
1209
|
+
m.normalMap.rotation = this.texture_rotation * THREE.MathUtils.DEG2RAD;
|
|
1172
1210
|
}
|
|
1173
1211
|
// TODO - all maps which use uv layer 0 should be changed here
|
|
1174
1212
|
});
|
|
@@ -1263,6 +1301,8 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1263
1301
|
if (strerr.indexOf('NotSupportedError') == 0 && this.hls !== false) {
|
|
1264
1302
|
console.log('Attempting to init hls', this.videoasset)
|
|
1265
1303
|
this.videoasset.initHLS();
|
|
1304
|
+
} else {
|
|
1305
|
+
console.error(e);
|
|
1266
1306
|
}
|
|
1267
1307
|
});
|
|
1268
1308
|
}
|
|
@@ -1368,7 +1408,9 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1368
1408
|
}
|
|
1369
1409
|
this.setupOnBeforeRenderListener = function(type, args, arg2, arg3) {
|
|
1370
1410
|
if (this.onbeforerender) {
|
|
1371
|
-
this
|
|
1411
|
+
elation.events.add(this, 'load', ev => {
|
|
1412
|
+
this.objects['3d'].onBeforeRenderx = this.onbeforerender;
|
|
1413
|
+
});
|
|
1372
1414
|
}
|
|
1373
1415
|
}
|
|
1374
1416
|
this.updateAudioNodes = function() {
|
|
@@ -1443,6 +1485,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1443
1485
|
shadow: [ 'property', 'shadow' ],
|
|
1444
1486
|
shadow_receive: [ 'property', 'shadow_receive' ],
|
|
1445
1487
|
shadow_cast: [ 'property', 'shadow_cast' ],
|
|
1488
|
+
shadow_side: [ 'property', 'shadow_side' ],
|
|
1446
1489
|
cull_face: [ 'property', 'cull_face' ],
|
|
1447
1490
|
blend_src: [ 'property', 'blend_src' ],
|
|
1448
1491
|
blend_dest: [ 'property', 'blend_dest' ],
|
|
@@ -1460,6 +1503,7 @@ elation.require(['janusweb.janusbase', 'janusweb.websurface'], function() {
|
|
|
1460
1503
|
emissive_intensity: [ 'property', 'emissive_intensity'],
|
|
1461
1504
|
roughness: [ 'property', 'roughness'],
|
|
1462
1505
|
metalness: [ 'property', 'metalness'],
|
|
1506
|
+
transmission: [ 'property', 'transmission'],
|
|
1463
1507
|
usevertexcolors: [ 'property', 'usevertexcolors'],
|
|
1464
1508
|
|
|
1465
1509
|
texture_offset: [ 'property', 'texture_offset'],
|
package/scripts/parts.js
CHANGED
|
@@ -35,7 +35,7 @@ elation.require([], function() {
|
|
|
35
35
|
engine: this._object.engine,
|
|
36
36
|
properties: {
|
|
37
37
|
object: object,
|
|
38
|
-
rotation: [object.rotation.x * THREE.
|
|
38
|
+
rotation: [object.rotation.x * THREE.MathUtils.RAD2DEG, object.rotation.y * THREE.MathUtils.RAD2DEG, object.rotation.z * THREE.MathUtils.RAD2DEG],
|
|
39
39
|
room: rootobject.room
|
|
40
40
|
}
|
|
41
41
|
});
|
package/scripts/portal.js
CHANGED
|
@@ -21,6 +21,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
21
21
|
'mirror_recursion': { type: 'integer', default: 2, set: this.updateGeometry },
|
|
22
22
|
'mirror_texturesize': { type: 'integer', default: 1024, set: this.updateGeometry },
|
|
23
23
|
'external': { type: 'boolean', default: false },
|
|
24
|
+
'preload': { type: 'boolean', default: false },
|
|
24
25
|
'target': { type: 'string', default: '' },
|
|
25
26
|
'round': { type: 'boolean', default: false },
|
|
26
27
|
'cooldown': { type: 'float', default: 1000 },
|
|
@@ -289,7 +290,12 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
289
290
|
this.closePortal();
|
|
290
291
|
}
|
|
291
292
|
} else if (this.url) {
|
|
292
|
-
|
|
293
|
+
if (this.preload) {
|
|
294
|
+
let newroom = this.properties.janus.preload(this.url);
|
|
295
|
+
elation.events.add(newroom, 'room_load_complete', ev => this.properties.janus.setActiveRoom(newroom));
|
|
296
|
+
} else {
|
|
297
|
+
this.properties.janus.setActiveRoom(this.url, room.url);
|
|
298
|
+
}
|
|
293
299
|
}
|
|
294
300
|
}
|
|
295
301
|
var gamepads = this.engine.systems.controls.gamepads;
|
|
@@ -320,6 +326,7 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
320
326
|
shader_id: ['property', 'shader_id'],
|
|
321
327
|
size: ['property', 'size'],
|
|
322
328
|
round: ['property', 'round'],
|
|
329
|
+
preload: ['property', 'preload'],
|
|
323
330
|
};
|
|
324
331
|
}
|
|
325
332
|
return this._proxyobject;
|
|
@@ -501,11 +508,11 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
501
508
|
var offset = ((thickness / 2) / this.properties.scale.z) * 2;
|
|
502
509
|
var box;
|
|
503
510
|
if (this.round) {
|
|
504
|
-
box = new THREE.
|
|
511
|
+
box = new THREE.CircleGeometry(.5, 64);
|
|
505
512
|
box.applyMatrix4(new THREE.Matrix4().makeScale(this.size.x, this.size.y, thickness));
|
|
506
513
|
box.applyMatrix4(new THREE.Matrix4().makeTranslation(0, this.size.y/2, .02));
|
|
507
514
|
} else {
|
|
508
|
-
box = new THREE.
|
|
515
|
+
box = new THREE.BoxGeometry(this.size.x, this.size.y, thickness);
|
|
509
516
|
box.applyMatrix4(new THREE.Matrix4().makeTranslation(0, this.size.y/2, thickness + .02));
|
|
510
517
|
}
|
|
511
518
|
|
|
@@ -536,27 +543,31 @@ elation.require(['janusweb.janusbase'], function() {
|
|
|
536
543
|
var group = new THREE.Mesh(box, mat);
|
|
537
544
|
group.renderOrder = 10;
|
|
538
545
|
group.castShadow = true;
|
|
546
|
+
let framegeo;
|
|
539
547
|
|
|
540
548
|
if (this.draw_glow) {
|
|
541
549
|
var framewidth = .05,
|
|
542
550
|
frameheight = .05,
|
|
543
551
|
framedepth = .01 / this.properties.size.z;
|
|
544
|
-
var framegeo = new THREE.BufferGeometry();
|
|
545
|
-
var framepart = new THREE.
|
|
552
|
+
//var framegeo = new THREE.BufferGeometry();
|
|
553
|
+
var framepart = new THREE.BoxGeometry(this.size.x,frameheight,framedepth);
|
|
546
554
|
var framemat4 = new THREE.Matrix4();
|
|
547
555
|
|
|
548
556
|
|
|
549
557
|
framemat4.makeTranslation(0,this.size.y - frameheight/2,framedepth + offset);
|
|
550
|
-
|
|
558
|
+
let framepart1 = framepart.clone().applyMatrix4(framemat4);
|
|
559
|
+
|
|
551
560
|
framemat4.makeTranslation(0,frameheight/2,framedepth + offset);
|
|
552
|
-
|
|
561
|
+
let framepart2 = framepart.clone().applyMatrix4(framemat4);
|
|
553
562
|
|
|
554
|
-
framepart = new THREE.
|
|
563
|
+
framepart = new THREE.BoxGeometry(framewidth,this.size.y,framedepth);
|
|
555
564
|
|
|
556
565
|
framemat4.makeTranslation(this.size.x / 2 - framewidth/2,this.size.y / 2,framedepth + offset);
|
|
557
|
-
|
|
566
|
+
let framepart3 = framepart.clone().applyMatrix4(framemat4);
|
|
558
567
|
framemat4.makeTranslation(-this.size.x / 2 + framewidth/2,this.size.y / 2,framedepth + offset);
|
|
559
|
-
|
|
568
|
+
let framepart4 = framepart.clone().applyMatrix4(framemat4);
|
|
569
|
+
|
|
570
|
+
framegeo = THREE.BufferGeometryUtils.mergeBufferGeometries([framepart1, framepart2, framepart3, framepart4]);
|
|
560
571
|
|
|
561
572
|
var framemat = new THREE.MeshPhongMaterial({color: 0x0000cc, emissive: 0x222222});
|
|
562
573
|
var frame = new THREE.Mesh(framegeo, framemat);
|
package/scripts/remoteplayer.js
CHANGED
|
@@ -113,8 +113,9 @@ elation.component.add('engine.things.remoteplayer', function() {
|
|
|
113
113
|
this.mouth = this.createObject('sound', {
|
|
114
114
|
pos: V(0, 0, 0),
|
|
115
115
|
distancemodel: 'exponential',
|
|
116
|
-
dist:
|
|
117
|
-
|
|
116
|
+
dist: 1,
|
|
117
|
+
gain: 2,
|
|
118
|
+
rolloff: .4,
|
|
118
119
|
});
|
|
119
120
|
this.head.add(this.mouth._target);
|
|
120
121
|
|