viral-viewer-2 4.4.0 → 4.4.2
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/dist/components/worker/viral-viewer-4.worker.js +17 -15
- package/dist/components/worker/viral-viewer-4.worker.js.map +1 -1
- package/dist/components/worker-script/load-model-worker-3.script.js +13 -25
- package/dist/components/worker-script/load-model-worker-3.script.js.map +1 -1
- package/package.json +1 -1
|
@@ -39,22 +39,24 @@ class ViralViewerWorker4 {
|
|
|
39
39
|
}
|
|
40
40
|
loadElement(elements, callbackOnSuccess = () => { }) {
|
|
41
41
|
this.workerPool.Enqueue(elements, (data) => {
|
|
42
|
-
var _a, _b;
|
|
43
42
|
let dummyMesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
console.log(dummyMesh);
|
|
44
|
+
// for (let j = 0; j < dummyMesh.children.length; j++) {
|
|
45
|
+
// const element = dummyMesh.children[j];
|
|
46
|
+
// for (let index = 0; index < element.children.length; index++) {
|
|
47
|
+
// const object = element.children[index] as Mesh;
|
|
48
|
+
// object.material = this.viralViewerApi.viralScene.materials.get(
|
|
49
|
+
// object.userData.MaterialId
|
|
50
|
+
// )!;
|
|
51
|
+
// if (element.userData?.IsInstancedMesh) {
|
|
52
|
+
// object.userData.type = "Revit Element";
|
|
53
|
+
// }
|
|
54
|
+
// this.viralViewerApi.viralBVH.applyThreeMeshBVH(object.geometry);
|
|
55
|
+
// }
|
|
56
|
+
// if (!element.userData?.IsInstancedMesh) {
|
|
57
|
+
// element.userData.type = "Revit Element";
|
|
58
|
+
// }
|
|
59
|
+
// }
|
|
58
60
|
if (this.mainModel)
|
|
59
61
|
this.mainModel.add(dummyMesh);
|
|
60
62
|
this.viralViewerApi.viralRenderer.render();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-viewer-4.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-4.worker.ts"],"names":[],"mappings":";;;AASA,iCAQe;AACf,4FAAyE;AACzE,oDAAsD;AACtD,iDAAwD;AAExD,MAAa,kBAAkB;IAI7B,YACS,cAA8B,EACrC,YAAoB,gDAAgD;QAD7D,mBAAc,GAAd,cAAc,CAAgB;QAHhC,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAKnC,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,uCAAU,KAAK,CAAC,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,oCAAoC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAgB,CACpC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,cAAc,EAC1C,UAAU,CACX,CAAC;IACJ,CAAC;IACM,OAAO,CAAC,SAA2B;QACxC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,SAAS,GAAG,IAAI,YAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACrD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;YAClC,IAAI,WAAW,GAAG,IAAA,2BAAiB,EACjC,QAAQ,CAAC,GAAG,EACZ,QAAQ,CAAC,KAAK,EACd,QAAQ,CAAC,IAAI,CACd,CAAC;YAEF,IAAI,cAAc,GAAG,IAAI,yBAAiB,CAAC;gBACzC,KAAK,EAAE,WAAW;gBAClB,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,WAAW,EAAE,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;gBACjD,WAAW,EAAE,IAAI;gBACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;gBACnB,aAAa,EAAE,IAAI;gBACnB,mBAAmB,EAAE,CAAC;gBACtB,kBAAkB,EAAE,GAAG;aACxB,CAAC,CAAC;YACH,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;SACrE;IACH,CAAC;IACM,WAAW,CAChB,QAA6B,EAC7B,iBAAiB,GAAG,GAAG,EAAE,GAAE,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,OAAO,CAA2B,QAAQ,EAAE,CAAC,IAAS,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"viral-viewer-4.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-4.worker.ts"],"names":[],"mappings":";;;AASA,iCAQe;AACf,4FAAyE;AACzE,oDAAsD;AACtD,iDAAwD;AAExD,MAAa,kBAAkB;IAI7B,YACS,cAA8B,EACrC,YAAoB,gDAAgD;QAD7D,mBAAc,GAAd,cAAc,CAAgB;QAHhC,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAKnC,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,uCAAU,KAAK,CAAC,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,oCAAoC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAgB,CACpC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,cAAc,EAC1C,U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,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC9D,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;YACtB,wDAAwD;YACxD,2CAA2C;YAC3C,oEAAoE;YACpE,sDAAsD;YACtD,sEAAsE;YACtE,mCAAmC;YACnC,UAAU;YACV,+CAA+C;YAC/C,gDAAgD;YAChD,QAAQ;YACR,uEAAuE;YACvE,MAAM;YACN,8CAA8C;YAC9C,+CAA+C;YAC/C,MAAM;YACN,IAAI;YACN,IAAI,IAAI,CAAC,SAAS;gBAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YAC3C,iBAAiB,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAzED,gDAyEC"}
|
|
@@ -13536,10 +13536,8 @@ function workerFunction() {
|
|
|
13536
13536
|
instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
|
|
13537
13537
|
supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
|
|
13538
13538
|
outputColorSpace: currentRenderTarget === null ?
|
|
13539
|
-
renderer.outputColorSpace :
|
|
13540
|
-
currentRenderTarget.
|
|
13541
|
-
currentRenderTarget.texture.colorSpace :
|
|
13542
|
-
LinearSRGBColorSpace,
|
|
13539
|
+
renderer.outputColorSpace : currentRenderTarget.isXRRenderTarget === true ?
|
|
13540
|
+
currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace,
|
|
13543
13541
|
map: HAS_MAP,
|
|
13544
13542
|
matcap: HAS_MATCAP,
|
|
13545
13543
|
envMap: HAS_ENVMAP,
|
|
@@ -14647,9 +14645,7 @@ function workerFunction() {
|
|
|
14647
14645
|
}
|
|
14648
14646
|
}
|
|
14649
14647
|
if (shadow.map === null || toVSM === true || fromVSM === true) {
|
|
14650
|
-
const pars = this.type !== VSMShadowMap ?
|
|
14651
|
-
{ minFilter: NearestFilter, magFilter: NearestFilter } :
|
|
14652
|
-
{};
|
|
14648
|
+
const pars = this.type !== VSMShadowMap ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};
|
|
14653
14649
|
if (shadow.map !== null) {
|
|
14654
14650
|
shadow.map.dispose();
|
|
14655
14651
|
}
|
|
@@ -16517,8 +16513,7 @@ function workerFunction() {
|
|
|
16517
16513
|
}
|
|
16518
16514
|
else {
|
|
16519
16515
|
const textures = renderTarget.isWebGLMultipleRenderTargets === true ?
|
|
16520
|
-
renderTarget.texture :
|
|
16521
|
-
[renderTarget.texture];
|
|
16516
|
+
renderTarget.texture : [renderTarget.texture];
|
|
16522
16517
|
for (let i = 0; i < textures.length; i++) {
|
|
16523
16518
|
const texture = textures[i];
|
|
16524
16519
|
const glFormat = utils.convert(texture.format, texture.colorSpace);
|
|
@@ -16741,8 +16736,7 @@ function workerFunction() {
|
|
|
16741
16736
|
function updateRenderTargetMipmap(renderTarget) {
|
|
16742
16737
|
const supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2;
|
|
16743
16738
|
const textures = renderTarget.isWebGLMultipleRenderTargets === true ?
|
|
16744
|
-
renderTarget.texture :
|
|
16745
|
-
[renderTarget.texture];
|
|
16739
|
+
renderTarget.texture : [renderTarget.texture];
|
|
16746
16740
|
for (let i = 0, il = textures.length; i < il; i++) {
|
|
16747
16741
|
const texture = textures[i];
|
|
16748
16742
|
if (textureNeedsGenerateMipmaps(texture, supportsMips)) {
|
|
@@ -16761,8 +16755,7 @@ function workerFunction() {
|
|
|
16761
16755
|
renderTarget.samples > 0 &&
|
|
16762
16756
|
useMultisampledRTT(renderTarget) === false) {
|
|
16763
16757
|
const textures = renderTarget.isWebGLMultipleRenderTargets ?
|
|
16764
|
-
renderTarget.texture :
|
|
16765
|
-
[renderTarget.texture];
|
|
16758
|
+
renderTarget.texture : [renderTarget.texture];
|
|
16766
16759
|
const width = renderTarget.width;
|
|
16767
16760
|
const height = renderTarget.height;
|
|
16768
16761
|
let mask = _gl.COLOR_BUFFER_BIT;
|
|
@@ -17571,8 +17564,7 @@ function workerFunction() {
|
|
|
17571
17564
|
renderer.capabilities.isWebGL2 === false) {
|
|
17572
17565
|
const layerInit = {
|
|
17573
17566
|
antialias: session.renderState.layers === undefined ?
|
|
17574
|
-
attributes.antialias :
|
|
17575
|
-
true,
|
|
17567
|
+
attributes.antialias : true,
|
|
17576
17568
|
alpha: true,
|
|
17577
17569
|
depth: attributes.depth,
|
|
17578
17570
|
stencil: attributes.stencil,
|
|
@@ -18303,8 +18295,7 @@ function workerFunction() {
|
|
|
18303
18295
|
if (hasUniformChanged(uniform, i, cache) === true) {
|
|
18304
18296
|
const offset = uniform.__offset;
|
|
18305
18297
|
const values = Array.isArray(uniform.value) ?
|
|
18306
|
-
uniform.value :
|
|
18307
|
-
[uniform.value];
|
|
18298
|
+
uniform.value : [uniform.value];
|
|
18308
18299
|
let arrayOffset = 0;
|
|
18309
18300
|
for (let i = 0; i < values.length; i++) {
|
|
18310
18301
|
const value = values[i];
|
|
@@ -18365,8 +18356,7 @@ function workerFunction() {
|
|
|
18365
18356
|
}
|
|
18366
18357
|
else {
|
|
18367
18358
|
const cachedObjects = Array.isArray(cache[index]) ?
|
|
18368
|
-
cache[index] :
|
|
18369
|
-
[cache[index]];
|
|
18359
|
+
cache[index] : [cache[index]];
|
|
18370
18360
|
const values = Array.isArray(value) ? value : [value];
|
|
18371
18361
|
for (let i = 0; i < cachedObjects.length; i++) {
|
|
18372
18362
|
const cachedObject = cachedObjects[i];
|
|
@@ -18393,8 +18383,7 @@ function workerFunction() {
|
|
|
18393
18383
|
storage: 0, // bytes
|
|
18394
18384
|
};
|
|
18395
18385
|
const values = Array.isArray(uniform.value) ?
|
|
18396
|
-
uniform.value :
|
|
18397
|
-
[uniform.value];
|
|
18386
|
+
uniform.value : [uniform.value];
|
|
18398
18387
|
for (let j = 0, jl = values.length; j < jl; j++) {
|
|
18399
18388
|
const value = values[j];
|
|
18400
18389
|
const info = getUniformSize(value);
|
|
@@ -19230,8 +19219,7 @@ function workerFunction() {
|
|
|
19230
19219
|
_transmissionRenderTarget = new WebGLRenderTarget(1024, 1024, {
|
|
19231
19220
|
generateMipmaps: true,
|
|
19232
19221
|
type: extensions.has("EXT_color_buffer_half_float") ?
|
|
19233
|
-
HalfFloatType :
|
|
19234
|
-
UnsignedByteType,
|
|
19222
|
+
HalfFloatType : UnsignedByteType,
|
|
19235
19223
|
minFilter: LinearMipmapLinearFilter,
|
|
19236
19224
|
samples: isWebGL2 && antialias === true ? 4 : 0,
|
|
19237
19225
|
});
|
|
@@ -34073,8 +34061,8 @@ which can be placed in CurveUtils.
|
|
|
34073
34061
|
}
|
|
34074
34062
|
self.addEventListener("message", (event) => {
|
|
34075
34063
|
let mainMesh = new Mesh();
|
|
34076
|
-
for (let
|
|
34077
|
-
const data = event.data[
|
|
34064
|
+
for (let k = 0; k < event.data.length; k++) {
|
|
34065
|
+
const data = event.data[k];
|
|
34078
34066
|
//1 element may have multiple solids
|
|
34079
34067
|
const solids = progressGeometries(data);
|
|
34080
34068
|
if (data.Instances && data.Instances.length > 0) {
|