viral-viewer-2 3.3.9 → 3.4.0
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/LICENSE +57 -57
- package/dist/components/animation/viral-animation.d.ts +1 -0
- package/dist/components/animation/viral-animation.js +26 -2
- package/dist/components/animation/viral-animation.js.map +1 -1
- package/dist/components/camera/viral-camera.d.ts +13 -3
- package/dist/components/camera/viral-camera.js +57 -7
- package/dist/components/camera/viral-camera.js.map +1 -1
- package/dist/components/centralized-event-handler/viral-centralized-event-handler.js.map +1 -1
- package/dist/components/compress/{compress.processor.d.ts → viral-compress.processor.d.ts} +1 -1
- package/dist/components/compress/{compress.processor.js → viral-compress.processor.js} +4 -4
- package/dist/components/compress/viral-compress.processor.js.map +1 -0
- package/dist/components/context-menu/viral-context-menu.js +9 -8
- package/dist/components/context-menu/viral-context-menu.js.map +1 -1
- package/dist/components/keyboard/viral-keyboard.d.ts +11 -1
- package/dist/components/keyboard/viral-keyboard.js +33 -0
- package/dist/components/keyboard/viral-keyboard.js.map +1 -1
- package/dist/components/loader/{viral-viewer-point-cloud.loader.d.ts → viral-point-cloud.loader.d.ts} +1 -1
- package/dist/components/loader/{viral-viewer-point-cloud.loader.js → viral-point-cloud.loader.js} +4 -4
- package/dist/components/loader/viral-point-cloud.loader.js.map +1 -0
- package/dist/components/loader/{viral-viewer-revit.loader.d.ts → viral-revit.loader.d.ts} +1 -3
- package/dist/components/loader/{viral-viewer-revit.loader.js → viral-revit.loader.js} +8 -13
- package/dist/components/loader/viral-revit.loader.js.map +1 -0
- package/dist/components/loader/viral-three.loader.d.ts +11 -0
- package/dist/components/loader/viral-three.loader.js +20 -0
- package/dist/components/loader/viral-three.loader.js.map +1 -0
- package/dist/components/loader/viral.loader.d.ts +11 -0
- package/dist/components/loader/viral.loader.js +16 -0
- package/dist/components/loader/viral.loader.js.map +1 -0
- package/dist/components/mouse/viral-mouse.js +0 -1
- package/dist/components/mouse/viral-mouse.js.map +1 -1
- package/dist/components/scene/viral-scene.d.ts +8 -3
- package/dist/components/scene/viral-scene.js +28 -15
- package/dist/components/scene/viral-scene.js.map +1 -1
- package/dist/components/spinner/viral-spinner.js +159 -159
- package/dist/components/stats/viral-stats.d.ts +7 -0
- package/dist/components/stats/viral-stats.js +16 -0
- package/dist/components/stats/viral-stats.js.map +1 -0
- package/dist/components/worker/viral-viewer-2.worker.d.ts +1 -4
- package/dist/components/worker/viral-viewer-2.worker.js +3 -10
- package/dist/components/worker/viral-viewer-2.worker.js.map +1 -1
- package/dist/components/worker/viral-viewer-3.worker.d.ts +1 -7
- package/dist/components/worker/viral-viewer-3.worker.js +7 -18
- package/dist/components/worker/viral-viewer-3.worker.js.map +1 -1
- package/dist/components/worker-script/threejs.types.js +185 -185
- package/dist/const/colors.d.ts +1 -0
- package/dist/const/colors.js +1 -0
- package/dist/const/colors.js.map +1 -1
- package/dist/models/dictionary.model.d.ts +0 -10
- package/dist/models/dictionary.model.js +0 -41
- package/dist/models/dictionary.model.js.map +1 -1
- package/dist/threejs-addon/gltf-loader.d.ts +17 -0
- package/dist/threejs-addon/gltf-loader.js +2796 -0
- package/dist/threejs-addon/gltf-loader.js.map +1 -0
- package/dist/threejs-addon/transform-control.d.ts +74 -0
- package/dist/threejs-addon/transform-control.js +1033 -0
- package/dist/threejs-addon/transform-control.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.js +48 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/threejs.d.ts +2 -0
- package/dist/utils/threejs.js +10 -1
- package/dist/utils/threejs.js.map +1 -1
- package/dist/viral-viewer-api.d.ts +7 -11
- package/dist/viral-viewer-api.js +10 -14
- package/dist/viral-viewer-api.js.map +1 -1
- package/package.json +30 -29
- package/dist/components/compress/compress.processor.js.map +0 -1
- package/dist/components/loader/viral-viewer-point-cloud.loader.js.map +0 -1
- package/dist/components/loader/viral-viewer-revit.loader.js.map +0 -1
- package/dist/components/worker/test-worker.worker.d.ts +0 -6
- package/dist/components/worker/test-worker.worker.js +0 -21
- package/dist/components/worker/test-worker.worker.js.map +0 -1
- package/dist/components/worker/viral-viewer.worker-pool.d.ts +0 -0
- package/dist/components/worker/viral-viewer.worker-pool.js +0 -61
- package/dist/components/worker/viral-viewer.worker-pool.js.map +0 -1
- package/dist/components/worker/worker-pool.d.ts +0 -21
- package/dist/components/worker/worker-pool.js +0 -47
- package/dist/components/worker/worker-pool.js.map +0 -1
- package/dist/components/worker/worker-thread.d.ts +0 -9
- package/dist/components/worker/worker-thread.js +0 -30
- package/dist/components/worker/worker-thread.js.map +0 -1
- package/dist/components/worker-script/threejs.script.d.ts +0 -1
- package/dist/components/worker-script/threejs.script.js +0 -16
- package/dist/components/worker-script/threejs.script.js.map +0 -1
|
@@ -4,15 +4,15 @@ exports.ViralViewerWorker2 = void 0;
|
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
const three_1 = require("three");
|
|
6
6
|
const load_model_worker_2_script_1 = require("../worker-script/load-model-worker-2.script");
|
|
7
|
-
const dictionary_model_1 = require("../../models/dictionary.model");
|
|
8
7
|
const worker_pool_1 = require("./base/worker-pool");
|
|
9
8
|
const simplify_modifier_1 = require("../../threejs-addon/simplify-modifier");
|
|
9
|
+
const threejs_1 = require("../../utils/threejs");
|
|
10
10
|
class ViralViewerWorker2 {
|
|
11
11
|
constructor(viralViewerApi, scriptUrl = "../worker-script/load-model-worker-2.script.js") {
|
|
12
12
|
this.viralViewerApi = viralViewerApi;
|
|
13
13
|
this.materials = [];
|
|
14
14
|
this.mainModel = null;
|
|
15
|
-
this.threejsMaterials = new
|
|
15
|
+
this.threejsMaterials = new types_1.Dictionary();
|
|
16
16
|
this.maxPolygonPerObject = 1000;
|
|
17
17
|
this.maxPolygonForEdge = 1000;
|
|
18
18
|
// Create a new Blob containing the worker code
|
|
@@ -28,7 +28,7 @@ class ViralViewerWorker2 {
|
|
|
28
28
|
this.viralViewerApi.viralScene.addObject(this.mainModel);
|
|
29
29
|
for (let index = 0; index < materials.length; index++) {
|
|
30
30
|
const material = materials[index];
|
|
31
|
-
let colorString =
|
|
31
|
+
let colorString = (0, threejs_1.rgbToThreejsColor)(material.Red, material.Green, material.Blue);
|
|
32
32
|
let renderMaterial = new three_1.MeshPhongMaterial({
|
|
33
33
|
color: colorString,
|
|
34
34
|
opacity: material.Opacity,
|
|
@@ -122,13 +122,6 @@ class ViralViewerWorker2 {
|
|
|
122
122
|
callbackOnSuccess();
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
rgbToHex(r, g, b) {
|
|
126
|
-
return "#" + this.componentToHex(r) + this.componentToHex(g) + this.componentToHex(b);
|
|
127
|
-
}
|
|
128
|
-
componentToHex(c) {
|
|
129
|
-
var hex = c.toString(16);
|
|
130
|
-
return hex.length == 1 ? "0" + hex : hex;
|
|
131
|
-
}
|
|
132
125
|
}
|
|
133
126
|
exports.ViralViewerWorker2 = ViralViewerWorker2;
|
|
134
127
|
//# sourceMappingURL=viral-viewer-2.worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-viewer-2.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-2.worker.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"viral-viewer-2.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-2.worker.ts"],"names":[],"mappings":";;;AACA,uCAAwL;AACxL,iCAAsN;AACtN,4FAAyE;AACzE,oDAAsD;AACtD,6EAAyE;AACzE,iDAAwD;AAExD,MAAa,kBAAkB;IAO3B,YAAmB,cAA8B,EAAE,YAAoB,gDAAgD;QAApG,mBAAc,GAAd,cAAc,CAAgB;QAL1C,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAC9B,qBAAgB,GAA0C,IAAI,kBAAU,EAA6B,CAAC;QAC5F,wBAAmB,GAAG,IAAI,CAAC;QAC3B,sBAAiB,GAAG,IAAI,CAAC;QAGtC,+CAA+C;QAC/C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,CAAC,KAAK,GAAG,IAAI,CAAC,iBAAiB,EAAE;oBAC7D,MAAM,KAAK,GAAG,IAAI,qBAAa,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBAC9C,MAAM,IAAI,GAAG,IAAI,oBAAY,CACzB,KAAK,EACL,IAAI,yBAAiB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAC3D,CAAC;oBACF,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;oBAC3B,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;iBACvB;aAGJ;YACD,IAAI,IAAI,CAAC,SAAS,EAAE;gBAChB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;aACjC;YACD,iBAAiB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAA;IACN,CAAC;CAEJ;AAnID,gDAmIC"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { ViralViewerApi } from "../../viral-viewer-api";
|
|
2
2
|
import { RenderMaterial, ViralViewerRevitNoneStructuralGeometry, ViralViewerRevitStructuralGeometry } from "../../types";
|
|
3
|
-
import { Mesh
|
|
4
|
-
import { Dictionary } from "../../models/dictionary.model";
|
|
3
|
+
import { Mesh } from "three";
|
|
5
4
|
import { WorkerThreadPool } from "./base/worker-pool";
|
|
6
5
|
export declare class ViralViewerWorker3 {
|
|
7
6
|
viralViewerApi: ViralViewerApi;
|
|
8
7
|
workerPool: WorkerThreadPool;
|
|
9
8
|
materials: RenderMaterial[];
|
|
10
9
|
mainModel: Mesh | null;
|
|
11
|
-
threejsMaterials: Dictionary<number, MeshPhongMaterial>;
|
|
12
|
-
private readonly maxPolygonPerObject;
|
|
13
|
-
private readonly maxPolygonForEdge;
|
|
14
10
|
private threejsLoader;
|
|
15
11
|
constructor(viralViewerApi: ViralViewerApi, scriptUrl?: string);
|
|
16
12
|
initial(materials: RenderMaterial[]): void;
|
|
17
13
|
loadStructuralGeometry(model: ViralViewerRevitStructuralGeometry, callbackOnSuccess?: () => void): void;
|
|
18
14
|
loadNoneStructuralGeometry(model: ViralViewerRevitNoneStructuralGeometry, callbackOnSuccess?: () => void): void;
|
|
19
|
-
rgbToHex(r: number, g: number, b: number): string;
|
|
20
|
-
componentToHex(c: number): string;
|
|
21
15
|
}
|
|
@@ -3,18 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ViralViewerWorker3 = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
const three_1 = require("three");
|
|
6
|
-
// import { workerCode } from "../worker-script/load-model-worker-2.script";
|
|
7
6
|
const threejs_types_1 = require("../worker-script/threejs.types");
|
|
8
|
-
const dictionary_model_1 = require("../../models/dictionary.model");
|
|
9
7
|
const worker_pool_1 = require("./base/worker-pool");
|
|
8
|
+
const threejs_1 = require("../../utils/threejs");
|
|
10
9
|
class ViralViewerWorker3 {
|
|
11
10
|
constructor(viralViewerApi, scriptUrl = "../worker-script/load-model-worker-2.script.js") {
|
|
12
11
|
this.viralViewerApi = viralViewerApi;
|
|
13
12
|
this.materials = [];
|
|
14
13
|
this.mainModel = null;
|
|
15
|
-
this.threejsMaterials = new dictionary_model_1.Dictionary();
|
|
16
|
-
this.maxPolygonPerObject = 1000;
|
|
17
|
-
this.maxPolygonForEdge = 1000;
|
|
18
14
|
this.threejsLoader = new three_1.ObjectLoader();
|
|
19
15
|
// Create a new Blob containing the worker code
|
|
20
16
|
const blob = new Blob([`(${threejs_types_1.workerCode})()`]);
|
|
@@ -29,7 +25,7 @@ class ViralViewerWorker3 {
|
|
|
29
25
|
this.viralViewerApi.viralScene.addModel(this.mainModel);
|
|
30
26
|
for (let index = 0; index < materials.length; index++) {
|
|
31
27
|
const material = materials[index];
|
|
32
|
-
let colorString =
|
|
28
|
+
let colorString = (0, threejs_1.rgbToThreejsColor)(material.Red, material.Green, material.Blue);
|
|
33
29
|
let renderMaterial = new three_1.MeshPhongMaterial({
|
|
34
30
|
color: colorString,
|
|
35
31
|
opacity: material.Opacity,
|
|
@@ -37,7 +33,7 @@ class ViralViewerWorker3 {
|
|
|
37
33
|
// flatShading: true,
|
|
38
34
|
name: material.Name
|
|
39
35
|
});
|
|
40
|
-
this.
|
|
36
|
+
this.viralViewerApi.viralScene.materials.add(index, renderMaterial);
|
|
41
37
|
}
|
|
42
38
|
}
|
|
43
39
|
loadStructuralGeometry(model, callbackOnSuccess = () => { }) {
|
|
@@ -45,8 +41,8 @@ class ViralViewerWorker3 {
|
|
|
45
41
|
inputData.Indices = model.Indices;
|
|
46
42
|
inputData.Vertices = model.Vertices;
|
|
47
43
|
this.workerPool.Enqueue(inputData, (data) => {
|
|
48
|
-
let mesh = this.
|
|
49
|
-
mesh.material = this.
|
|
44
|
+
let mesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data);
|
|
45
|
+
mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex);
|
|
50
46
|
mesh.userData.type = "Revit Element";
|
|
51
47
|
if (this.mainModel)
|
|
52
48
|
this.mainModel.add(mesh);
|
|
@@ -56,8 +52,8 @@ class ViralViewerWorker3 {
|
|
|
56
52
|
}
|
|
57
53
|
loadNoneStructuralGeometry(model, callbackOnSuccess = () => { }) {
|
|
58
54
|
this.workerPool.Enqueue(model, (data) => {
|
|
59
|
-
let mesh = this.
|
|
60
|
-
mesh.material = this.
|
|
55
|
+
let mesh = this.viralViewerApi.viralLoader.threeLoader.parseObject(data);
|
|
56
|
+
mesh.material = this.viralViewerApi.viralScene.materials.get(model.MaterialIndex);
|
|
61
57
|
mesh.userData.type = "Revit Element";
|
|
62
58
|
if (this.mainModel)
|
|
63
59
|
this.mainModel.add(mesh);
|
|
@@ -65,13 +61,6 @@ class ViralViewerWorker3 {
|
|
|
65
61
|
callbackOnSuccess();
|
|
66
62
|
});
|
|
67
63
|
}
|
|
68
|
-
rgbToHex(r, g, b) {
|
|
69
|
-
return "#" + this.componentToHex(r) + this.componentToHex(g) + this.componentToHex(b);
|
|
70
|
-
}
|
|
71
|
-
componentToHex(c) {
|
|
72
|
-
var hex = c.toString(16);
|
|
73
|
-
return hex.length == 1 ? "0" + hex : hex;
|
|
74
|
-
}
|
|
75
64
|
}
|
|
76
65
|
exports.ViralViewerWorker3 = ViralViewerWorker3;
|
|
77
66
|
//# sourceMappingURL=viral-viewer-3.worker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viral-viewer-3.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-3.worker.ts"],"names":[],"mappings":";;;AACA,uCAA4K;AAC5K,iCAAsN;AACtN,
|
|
1
|
+
{"version":3,"file":"viral-viewer-3.worker.js","sourceRoot":"","sources":["../../../src/components/worker/viral-viewer-3.worker.ts"],"names":[],"mappings":";;;AACA,uCAA4K;AAC5K,iCAAsN;AACtN,kEAA4D;AAC5D,oDAAsD;AACtD,iDAAwD;AAExD,MAAa,kBAAkB;IAK3B,YAAmB,cAA8B,EAAE,YAAoB,gDAAgD;QAApG,mBAAc,GAAd,cAAc,CAAgB;QAH1C,cAAS,GAAqB,EAAE,CAAC;QACjC,cAAS,GAAgB,IAAI,CAAC;QAC7B,kBAAa,GAAG,IAAI,oBAAY,EAAE,CAAC;QAGvC,+CAA+C;QAC/C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,0BAAU,KAAK,CAAC,CAAC,CAAC;QAC7C,MAAM,UAAU,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7C,oCAAoC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAgB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;IACM,OAAO,CAAC,SAA2B;QACtC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,SAAS,GAAG,IAAI,YAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,a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CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAE,CAAC;YACnF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,eAAe,CAAC;YACrC,IAAI,IAAI,CAAC,SAAS;gBACd,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YAC3C,iBAAiB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAA;IACN,CAAC;IACM,0BAA0B,CAAC,KAA6C,EAAE,iBAAiB,GAAG,GAAG,EAAE,GAAG,CAAC;QAC1G,IAAI,CAAC,UAAU,CAAC,OAAO,CAA8C,KAAK,EAAE,CAAC,IAAS,EAAE,EAAE;YACtF,IAAI,IAAI,GAAkB,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAkB,CAAC;YACzG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAE,CAAC;YACnF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,eAAe,CAAC;YACrC,IAAI,IAAI,CAAC,SAAS;gBACd,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YAC3C,iBAAiB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAA;IACN,CAAC;CACJ;AA1DD,gDA0DC"}
|
|
@@ -8485,42 +8485,42 @@ function workerFunction() {
|
|
|
8485
8485
|
uniforms: {
|
|
8486
8486
|
tEquirect: { value: null },
|
|
8487
8487
|
},
|
|
8488
|
-
vertexShader: /* glsl */ `
|
|
8489
|
-
|
|
8490
|
-
varying vec3 vWorldDirection;
|
|
8491
|
-
|
|
8492
|
-
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
|
8493
|
-
|
|
8494
|
-
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
|
8495
|
-
|
|
8496
|
-
}
|
|
8497
|
-
|
|
8498
|
-
void main() {
|
|
8499
|
-
|
|
8500
|
-
vWorldDirection = transformDirection( position, modelMatrix );
|
|
8501
|
-
|
|
8502
|
-
#include <begin_vertex>
|
|
8503
|
-
#include <project_vertex>
|
|
8504
|
-
|
|
8505
|
-
}
|
|
8488
|
+
vertexShader: /* glsl */ `
|
|
8489
|
+
|
|
8490
|
+
varying vec3 vWorldDirection;
|
|
8491
|
+
|
|
8492
|
+
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
|
|
8493
|
+
|
|
8494
|
+
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
|
|
8495
|
+
|
|
8496
|
+
}
|
|
8497
|
+
|
|
8498
|
+
void main() {
|
|
8499
|
+
|
|
8500
|
+
vWorldDirection = transformDirection( position, modelMatrix );
|
|
8501
|
+
|
|
8502
|
+
#include <begin_vertex>
|
|
8503
|
+
#include <project_vertex>
|
|
8504
|
+
|
|
8505
|
+
}
|
|
8506
8506
|
`,
|
|
8507
|
-
fragmentShader: /* glsl */ `
|
|
8508
|
-
|
|
8509
|
-
uniform sampler2D tEquirect;
|
|
8510
|
-
|
|
8511
|
-
varying vec3 vWorldDirection;
|
|
8512
|
-
|
|
8513
|
-
#include <common>
|
|
8514
|
-
|
|
8515
|
-
void main() {
|
|
8516
|
-
|
|
8517
|
-
vec3 direction = normalize( vWorldDirection );
|
|
8518
|
-
|
|
8519
|
-
vec2 sampleUV = equirectUv( direction );
|
|
8520
|
-
|
|
8521
|
-
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
8522
|
-
|
|
8523
|
-
}
|
|
8507
|
+
fragmentShader: /* glsl */ `
|
|
8508
|
+
|
|
8509
|
+
uniform sampler2D tEquirect;
|
|
8510
|
+
|
|
8511
|
+
varying vec3 vWorldDirection;
|
|
8512
|
+
|
|
8513
|
+
#include <common>
|
|
8514
|
+
|
|
8515
|
+
void main() {
|
|
8516
|
+
|
|
8517
|
+
vec3 direction = normalize( vWorldDirection );
|
|
8518
|
+
|
|
8519
|
+
vec2 sampleUV = equirectUv( direction );
|
|
8520
|
+
|
|
8521
|
+
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
8522
|
+
|
|
8523
|
+
}
|
|
8524
8524
|
`,
|
|
8525
8525
|
};
|
|
8526
8526
|
const geometry = new BoxGeometry(5, 5, 5);
|
|
@@ -11055,66 +11055,66 @@ function workerFunction() {
|
|
|
11055
11055
|
poleAxis: { value: poleAxis },
|
|
11056
11056
|
},
|
|
11057
11057
|
vertexShader: _getCommonVertexShader(),
|
|
11058
|
-
fragmentShader: /* glsl */ `
|
|
11059
|
-
|
|
11060
|
-
precision mediump float;
|
|
11061
|
-
precision mediump int;
|
|
11062
|
-
|
|
11063
|
-
varying vec3 vOutputDirection;
|
|
11064
|
-
|
|
11065
|
-
uniform sampler2D envMap;
|
|
11066
|
-
uniform int samples;
|
|
11067
|
-
uniform float weights[ n ];
|
|
11068
|
-
uniform bool latitudinal;
|
|
11069
|
-
uniform float dTheta;
|
|
11070
|
-
uniform float mipInt;
|
|
11071
|
-
uniform vec3 poleAxis;
|
|
11072
|
-
|
|
11073
|
-
#define ENVMAP_TYPE_CUBE_UV
|
|
11074
|
-
#include <cube_uv_reflection_fragment>
|
|
11075
|
-
|
|
11076
|
-
vec3 getSample( float theta, vec3 axis ) {
|
|
11077
|
-
|
|
11078
|
-
float cosTheta = cos( theta );
|
|
11079
|
-
// Rodrigues' axis-angle rotation
|
|
11080
|
-
vec3 sampleDirection = vOutputDirection * cosTheta
|
|
11081
|
-
+ cross( axis, vOutputDirection ) * sin( theta )
|
|
11082
|
-
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
|
|
11083
|
-
|
|
11084
|
-
return bilinearCubeUV( envMap, sampleDirection, mipInt );
|
|
11085
|
-
|
|
11086
|
-
}
|
|
11087
|
-
|
|
11088
|
-
void main() {
|
|
11089
|
-
|
|
11090
|
-
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
|
|
11091
|
-
|
|
11092
|
-
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
|
|
11093
|
-
|
|
11094
|
-
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
|
|
11095
|
-
|
|
11096
|
-
}
|
|
11097
|
-
|
|
11098
|
-
axis = normalize( axis );
|
|
11099
|
-
|
|
11100
|
-
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
11101
|
-
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
|
|
11102
|
-
|
|
11103
|
-
for ( int i = 1; i < n; i++ ) {
|
|
11104
|
-
|
|
11105
|
-
if ( i >= samples ) {
|
|
11106
|
-
|
|
11107
|
-
break;
|
|
11108
|
-
|
|
11109
|
-
}
|
|
11110
|
-
|
|
11111
|
-
float theta = dTheta * float( i );
|
|
11112
|
-
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
|
|
11113
|
-
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
|
|
11114
|
-
|
|
11115
|
-
}
|
|
11116
|
-
|
|
11117
|
-
}
|
|
11058
|
+
fragmentShader: /* glsl */ `
|
|
11059
|
+
|
|
11060
|
+
precision mediump float;
|
|
11061
|
+
precision mediump int;
|
|
11062
|
+
|
|
11063
|
+
varying vec3 vOutputDirection;
|
|
11064
|
+
|
|
11065
|
+
uniform sampler2D envMap;
|
|
11066
|
+
uniform int samples;
|
|
11067
|
+
uniform float weights[ n ];
|
|
11068
|
+
uniform bool latitudinal;
|
|
11069
|
+
uniform float dTheta;
|
|
11070
|
+
uniform float mipInt;
|
|
11071
|
+
uniform vec3 poleAxis;
|
|
11072
|
+
|
|
11073
|
+
#define ENVMAP_TYPE_CUBE_UV
|
|
11074
|
+
#include <cube_uv_reflection_fragment>
|
|
11075
|
+
|
|
11076
|
+
vec3 getSample( float theta, vec3 axis ) {
|
|
11077
|
+
|
|
11078
|
+
float cosTheta = cos( theta );
|
|
11079
|
+
// Rodrigues' axis-angle rotation
|
|
11080
|
+
vec3 sampleDirection = vOutputDirection * cosTheta
|
|
11081
|
+
+ cross( axis, vOutputDirection ) * sin( theta )
|
|
11082
|
+
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
|
|
11083
|
+
|
|
11084
|
+
return bilinearCubeUV( envMap, sampleDirection, mipInt );
|
|
11085
|
+
|
|
11086
|
+
}
|
|
11087
|
+
|
|
11088
|
+
void main() {
|
|
11089
|
+
|
|
11090
|
+
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
|
|
11091
|
+
|
|
11092
|
+
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
|
|
11093
|
+
|
|
11094
|
+
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
|
|
11095
|
+
|
|
11096
|
+
}
|
|
11097
|
+
|
|
11098
|
+
axis = normalize( axis );
|
|
11099
|
+
|
|
11100
|
+
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
|
|
11101
|
+
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
|
|
11102
|
+
|
|
11103
|
+
for ( int i = 1; i < n; i++ ) {
|
|
11104
|
+
|
|
11105
|
+
if ( i >= samples ) {
|
|
11106
|
+
|
|
11107
|
+
break;
|
|
11108
|
+
|
|
11109
|
+
}
|
|
11110
|
+
|
|
11111
|
+
float theta = dTheta * float( i );
|
|
11112
|
+
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
|
|
11113
|
+
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
|
|
11114
|
+
|
|
11115
|
+
}
|
|
11116
|
+
|
|
11117
|
+
}
|
|
11118
11118
|
`,
|
|
11119
11119
|
blending: NoBlending,
|
|
11120
11120
|
depthTest: false,
|
|
@@ -11129,25 +11129,25 @@ function workerFunction() {
|
|
|
11129
11129
|
envMap: { value: null },
|
|
11130
11130
|
},
|
|
11131
11131
|
vertexShader: _getCommonVertexShader(),
|
|
11132
|
-
fragmentShader: /* glsl */ `
|
|
11133
|
-
|
|
11134
|
-
precision mediump float;
|
|
11135
|
-
precision mediump int;
|
|
11136
|
-
|
|
11137
|
-
varying vec3 vOutputDirection;
|
|
11138
|
-
|
|
11139
|
-
uniform sampler2D envMap;
|
|
11140
|
-
|
|
11141
|
-
#include <common>
|
|
11142
|
-
|
|
11143
|
-
void main() {
|
|
11144
|
-
|
|
11145
|
-
vec3 outputDirection = normalize( vOutputDirection );
|
|
11146
|
-
vec2 uv = equirectUv( outputDirection );
|
|
11147
|
-
|
|
11148
|
-
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
|
11149
|
-
|
|
11150
|
-
}
|
|
11132
|
+
fragmentShader: /* glsl */ `
|
|
11133
|
+
|
|
11134
|
+
precision mediump float;
|
|
11135
|
+
precision mediump int;
|
|
11136
|
+
|
|
11137
|
+
varying vec3 vOutputDirection;
|
|
11138
|
+
|
|
11139
|
+
uniform sampler2D envMap;
|
|
11140
|
+
|
|
11141
|
+
#include <common>
|
|
11142
|
+
|
|
11143
|
+
void main() {
|
|
11144
|
+
|
|
11145
|
+
vec3 outputDirection = normalize( vOutputDirection );
|
|
11146
|
+
vec2 uv = equirectUv( outputDirection );
|
|
11147
|
+
|
|
11148
|
+
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
|
11149
|
+
|
|
11150
|
+
}
|
|
11151
11151
|
`,
|
|
11152
11152
|
blending: NoBlending,
|
|
11153
11153
|
depthTest: false,
|
|
@@ -11162,22 +11162,22 @@ function workerFunction() {
|
|
|
11162
11162
|
flipEnvMap: { value: -1 },
|
|
11163
11163
|
},
|
|
11164
11164
|
vertexShader: _getCommonVertexShader(),
|
|
11165
|
-
fragmentShader: /* glsl */ `
|
|
11166
|
-
|
|
11167
|
-
precision mediump float;
|
|
11168
|
-
precision mediump int;
|
|
11169
|
-
|
|
11170
|
-
uniform float flipEnvMap;
|
|
11171
|
-
|
|
11172
|
-
varying vec3 vOutputDirection;
|
|
11173
|
-
|
|
11174
|
-
uniform samplerCube envMap;
|
|
11175
|
-
|
|
11176
|
-
void main() {
|
|
11177
|
-
|
|
11178
|
-
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
|
|
11179
|
-
|
|
11180
|
-
}
|
|
11165
|
+
fragmentShader: /* glsl */ `
|
|
11166
|
+
|
|
11167
|
+
precision mediump float;
|
|
11168
|
+
precision mediump int;
|
|
11169
|
+
|
|
11170
|
+
uniform float flipEnvMap;
|
|
11171
|
+
|
|
11172
|
+
varying vec3 vOutputDirection;
|
|
11173
|
+
|
|
11174
|
+
uniform samplerCube envMap;
|
|
11175
|
+
|
|
11176
|
+
void main() {
|
|
11177
|
+
|
|
11178
|
+
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
|
|
11179
|
+
|
|
11180
|
+
}
|
|
11181
11181
|
`,
|
|
11182
11182
|
blending: NoBlending,
|
|
11183
11183
|
depthTest: false,
|
|
@@ -11185,61 +11185,61 @@ function workerFunction() {
|
|
|
11185
11185
|
});
|
|
11186
11186
|
}
|
|
11187
11187
|
function _getCommonVertexShader() {
|
|
11188
|
-
return /* glsl */ `
|
|
11189
|
-
|
|
11190
|
-
precision mediump float;
|
|
11191
|
-
precision mediump int;
|
|
11192
|
-
|
|
11193
|
-
attribute float faceIndex;
|
|
11194
|
-
|
|
11195
|
-
varying vec3 vOutputDirection;
|
|
11196
|
-
|
|
11197
|
-
// RH coordinate system; PMREM face-indexing convention
|
|
11198
|
-
vec3 getDirection( vec2 uv, float face ) {
|
|
11199
|
-
|
|
11200
|
-
uv = 2.0 * uv - 1.0;
|
|
11201
|
-
|
|
11202
|
-
vec3 direction = vec3( uv, 1.0 );
|
|
11203
|
-
|
|
11204
|
-
if ( face == 0.0 ) {
|
|
11205
|
-
|
|
11206
|
-
direction = direction.zyx; // ( 1, v, u ) pos x
|
|
11207
|
-
|
|
11208
|
-
} else if ( face == 1.0 ) {
|
|
11209
|
-
|
|
11210
|
-
direction = direction.xzy;
|
|
11211
|
-
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
|
|
11212
|
-
|
|
11213
|
-
} else if ( face == 2.0 ) {
|
|
11214
|
-
|
|
11215
|
-
direction.x *= -1.0; // ( -u, v, 1 ) pos z
|
|
11216
|
-
|
|
11217
|
-
} else if ( face == 3.0 ) {
|
|
11218
|
-
|
|
11219
|
-
direction = direction.zyx;
|
|
11220
|
-
direction.xz *= -1.0; // ( -1, v, -u ) neg x
|
|
11221
|
-
|
|
11222
|
-
} else if ( face == 4.0 ) {
|
|
11223
|
-
|
|
11224
|
-
direction = direction.xzy;
|
|
11225
|
-
direction.xy *= -1.0; // ( -u, -1, v ) neg y
|
|
11226
|
-
|
|
11227
|
-
} else if ( face == 5.0 ) {
|
|
11228
|
-
|
|
11229
|
-
direction.z *= -1.0; // ( u, v, -1 ) neg z
|
|
11230
|
-
|
|
11231
|
-
}
|
|
11232
|
-
|
|
11233
|
-
return direction;
|
|
11234
|
-
|
|
11235
|
-
}
|
|
11236
|
-
|
|
11237
|
-
void main() {
|
|
11238
|
-
|
|
11239
|
-
vOutputDirection = getDirection( uv, faceIndex );
|
|
11240
|
-
gl_Position = vec4( position, 1.0 );
|
|
11241
|
-
|
|
11242
|
-
}
|
|
11188
|
+
return /* glsl */ `
|
|
11189
|
+
|
|
11190
|
+
precision mediump float;
|
|
11191
|
+
precision mediump int;
|
|
11192
|
+
|
|
11193
|
+
attribute float faceIndex;
|
|
11194
|
+
|
|
11195
|
+
varying vec3 vOutputDirection;
|
|
11196
|
+
|
|
11197
|
+
// RH coordinate system; PMREM face-indexing convention
|
|
11198
|
+
vec3 getDirection( vec2 uv, float face ) {
|
|
11199
|
+
|
|
11200
|
+
uv = 2.0 * uv - 1.0;
|
|
11201
|
+
|
|
11202
|
+
vec3 direction = vec3( uv, 1.0 );
|
|
11203
|
+
|
|
11204
|
+
if ( face == 0.0 ) {
|
|
11205
|
+
|
|
11206
|
+
direction = direction.zyx; // ( 1, v, u ) pos x
|
|
11207
|
+
|
|
11208
|
+
} else if ( face == 1.0 ) {
|
|
11209
|
+
|
|
11210
|
+
direction = direction.xzy;
|
|
11211
|
+
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
|
|
11212
|
+
|
|
11213
|
+
} else if ( face == 2.0 ) {
|
|
11214
|
+
|
|
11215
|
+
direction.x *= -1.0; // ( -u, v, 1 ) pos z
|
|
11216
|
+
|
|
11217
|
+
} else if ( face == 3.0 ) {
|
|
11218
|
+
|
|
11219
|
+
direction = direction.zyx;
|
|
11220
|
+
direction.xz *= -1.0; // ( -1, v, -u ) neg x
|
|
11221
|
+
|
|
11222
|
+
} else if ( face == 4.0 ) {
|
|
11223
|
+
|
|
11224
|
+
direction = direction.xzy;
|
|
11225
|
+
direction.xy *= -1.0; // ( -u, -1, v ) neg y
|
|
11226
|
+
|
|
11227
|
+
} else if ( face == 5.0 ) {
|
|
11228
|
+
|
|
11229
|
+
direction.z *= -1.0; // ( u, v, -1 ) neg z
|
|
11230
|
+
|
|
11231
|
+
}
|
|
11232
|
+
|
|
11233
|
+
return direction;
|
|
11234
|
+
|
|
11235
|
+
}
|
|
11236
|
+
|
|
11237
|
+
void main() {
|
|
11238
|
+
|
|
11239
|
+
vOutputDirection = getDirection( uv, faceIndex );
|
|
11240
|
+
gl_Position = vec4( position, 1.0 );
|
|
11241
|
+
|
|
11242
|
+
}
|
|
11243
11243
|
`;
|
|
11244
11244
|
}
|
|
11245
11245
|
function WebGLCubeUVMaps(renderer) {
|
package/dist/const/colors.d.ts
CHANGED
package/dist/const/colors.js
CHANGED
package/dist/const/colors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/const/colors.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IAClB,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/const/colors.ts"],"names":[],"mappings":";;;AAAa,QAAA,MAAM,GAAG;IAClB,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,SAAS;IACxB,YAAY,EAAE,SAAS;IACvB,OAAO,EAAE,uBAAuB;CACnC,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare class Dictionary<TKey, TValue> {
|
|
2
|
-
private items;
|
|
3
|
-
add(key: TKey, value: TValue): void;
|
|
4
|
-
get(key: TKey): TValue | undefined;
|
|
5
|
-
remove(key: TKey): void;
|
|
6
|
-
containsKey(key: TKey): boolean;
|
|
7
|
-
keys(): TKey[];
|
|
8
|
-
values(): TValue[];
|
|
9
|
-
count(): number;
|
|
10
|
-
}
|
|
@@ -1,42 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Dictionary = void 0;
|
|
4
|
-
class Dictionary {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.items = {};
|
|
7
|
-
}
|
|
8
|
-
// Add a key-value pair to the dictionary
|
|
9
|
-
add(key, value) {
|
|
10
|
-
const stringKey = key;
|
|
11
|
-
this.items[stringKey] = value;
|
|
12
|
-
}
|
|
13
|
-
// Retrieve a value from the dictionary by key
|
|
14
|
-
get(key) {
|
|
15
|
-
const stringKey = key;
|
|
16
|
-
return this.items[stringKey];
|
|
17
|
-
}
|
|
18
|
-
// Remove a key-value pair from the dictionary
|
|
19
|
-
remove(key) {
|
|
20
|
-
const stringKey = key;
|
|
21
|
-
delete this.items[stringKey];
|
|
22
|
-
}
|
|
23
|
-
// Check if the dictionary contains a key
|
|
24
|
-
containsKey(key) {
|
|
25
|
-
const stringKey = key;
|
|
26
|
-
return stringKey in this.items;
|
|
27
|
-
}
|
|
28
|
-
// Get all keys in the dictionary
|
|
29
|
-
keys() {
|
|
30
|
-
return Object.keys(this.items).map(key => key);
|
|
31
|
-
}
|
|
32
|
-
// Get all values in the dictionary
|
|
33
|
-
values() {
|
|
34
|
-
return Object.values(this.items);
|
|
35
|
-
}
|
|
36
|
-
// Get the number of key-value pairs in the dictionary
|
|
37
|
-
count() {
|
|
38
|
-
return Object.keys(this.items).length;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.Dictionary = Dictionary;
|
|
42
1
|
//# sourceMappingURL=dictionary.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.model.js","sourceRoot":"","sources":["../../src/models/dictionary.model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dictionary.model.js","sourceRoot":"","sources":["../../src/models/dictionary.model.ts"],"names":[],"mappings":""}
|