@shapediver/viewer.rendering-engine.light-engine 1.5.3
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 +73 -0
- package/README.md +3 -0
- package/dist/implementation/AbstractLight.d.ts +29 -0
- package/dist/implementation/AbstractLight.d.ts.map +1 -0
- package/dist/implementation/AbstractLight.js +50 -0
- package/dist/implementation/AbstractLight.js.map +1 -0
- package/dist/implementation/LightEngine.d.ts +25 -0
- package/dist/implementation/LightEngine.d.ts.map +1 -0
- package/dist/implementation/LightEngine.js +243 -0
- package/dist/implementation/LightEngine.js.map +1 -0
- package/dist/implementation/LightScene.d.ts +68 -0
- package/dist/implementation/LightScene.d.ts.map +1 -0
- package/dist/implementation/LightScene.js +80 -0
- package/dist/implementation/LightScene.js.map +1 -0
- package/dist/implementation/types/AmbientLight.d.ts +13 -0
- package/dist/implementation/types/AmbientLight.d.ts.map +1 -0
- package/dist/implementation/types/AmbientLight.js +27 -0
- package/dist/implementation/types/AmbientLight.js.map +1 -0
- package/dist/implementation/types/DirectionalLight.d.ts +30 -0
- package/dist/implementation/types/DirectionalLight.d.ts.map +1 -0
- package/dist/implementation/types/DirectionalLight.js +72 -0
- package/dist/implementation/types/DirectionalLight.js.map +1 -0
- package/dist/implementation/types/HemisphereLight.d.ts +17 -0
- package/dist/implementation/types/HemisphereLight.d.ts.map +1 -0
- package/dist/implementation/types/HemisphereLight.js +38 -0
- package/dist/implementation/types/HemisphereLight.js.map +1 -0
- package/dist/implementation/types/PointLight.d.ts +26 -0
- package/dist/implementation/types/PointLight.d.ts.map +1 -0
- package/dist/implementation/types/PointLight.js +61 -0
- package/dist/implementation/types/PointLight.js.map +1 -0
- package/dist/implementation/types/SpotLight.d.ts +38 -0
- package/dist/implementation/types/SpotLight.d.ts.map +1 -0
- package/dist/implementation/types/SpotLight.js +94 -0
- package/dist/implementation/types/SpotLight.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/interface/ILight.d.ts +18 -0
- package/dist/interface/ILight.d.ts.map +1 -0
- package/dist/interface/ILight.js +13 -0
- package/dist/interface/ILight.js.map +1 -0
- package/dist/interface/ILightEngine.d.ts +11 -0
- package/dist/interface/ILightEngine.d.ts.map +1 -0
- package/dist/interface/ILightEngine.js +3 -0
- package/dist/interface/ILightEngine.js.map +1 -0
- package/dist/interface/ILightScene.d.ts +57 -0
- package/dist/interface/ILightScene.d.ts.map +1 -0
- package/dist/interface/ILightScene.js +3 -0
- package/dist/interface/ILightScene.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AmbientLight = void 0;
|
|
4
|
+
const ILight_1 = require("../../interface/ILight");
|
|
5
|
+
const AbstractLight_1 = require("../AbstractLight");
|
|
6
|
+
class AmbientLight extends AbstractLight_1.AbstractLight {
|
|
7
|
+
constructor(properties) {
|
|
8
|
+
super({
|
|
9
|
+
color: properties.color || '#ffffff',
|
|
10
|
+
intensity: properties.intensity !== undefined ? properties.intensity : 0.5,
|
|
11
|
+
type: ILight_1.LIGHTTYPE.AMBIENT,
|
|
12
|
+
name: properties.name,
|
|
13
|
+
order: properties.order,
|
|
14
|
+
id: properties.id
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
clone() {
|
|
18
|
+
return new AmbientLight({
|
|
19
|
+
color: this.color || '#ffffff',
|
|
20
|
+
intensity: this.intensity || 0.5,
|
|
21
|
+
name: this.name,
|
|
22
|
+
order: this.order
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.AmbientLight = AmbientLight;
|
|
27
|
+
//# sourceMappingURL=AmbientLight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmbientLight.js","sourceRoot":"","sources":["../../../src/implementation/types/AmbientLight.ts"],"names":[],"mappings":";;;AAGA,mDAAkD;AAClD,oDAAgD;AAEhD,MAAa,YAAa,SAAQ,6BAAa;IAG3C,YAAY,UAMX;QACG,KAAK,CAAC;YACF,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS;YACpC,SAAS,EAAE,UAAU,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG;YAC1E,IAAI,EAAE,kBAAS,CAAC,OAAO;YACvB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,EAAE,EAAE,UAAU,CAAC,EAAE;SACpB,CAAC,CAAC;IACP,CAAC;IAMM,KAAK;QACR,OAAO,IAAI,YAAY,CAAC;YACpB,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;YAC9B,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,GAAG;YAChC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC,CAAC;IACP,CAAC;CAGJ;AAlCD,oCAkCC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
2
|
+
import { vec3 } from 'gl-matrix';
|
|
3
|
+
import { AbstractLight } from '../AbstractLight';
|
|
4
|
+
export declare class DirectionalLight extends AbstractLight {
|
|
5
|
+
private _castShadow;
|
|
6
|
+
private _direction;
|
|
7
|
+
private _shadowMapBias;
|
|
8
|
+
private _shadowMapResolution;
|
|
9
|
+
constructor(properties: {
|
|
10
|
+
color?: string;
|
|
11
|
+
intensity?: number;
|
|
12
|
+
direction?: vec3;
|
|
13
|
+
castShadow?: boolean;
|
|
14
|
+
shadowMapResolution?: number;
|
|
15
|
+
shadowMapBias?: number;
|
|
16
|
+
name?: string;
|
|
17
|
+
order?: number;
|
|
18
|
+
id?: string;
|
|
19
|
+
});
|
|
20
|
+
get castShadow(): boolean;
|
|
21
|
+
set castShadow(value: boolean);
|
|
22
|
+
get direction(): vec3;
|
|
23
|
+
set direction(value: vec3);
|
|
24
|
+
get shadowMapBias(): number;
|
|
25
|
+
set shadowMapBias(value: number);
|
|
26
|
+
get shadowMapResolution(): number;
|
|
27
|
+
set shadowMapResolution(value: number);
|
|
28
|
+
clone(): ITreeNodeData;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=DirectionalLight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectionalLight.d.ts","sourceRoot":"","sources":["../../../src/implementation/types/DirectionalLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,gBAAiB,SAAQ,aAAa;IAG/C,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,UAAU,CAAmC;IACrD,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,oBAAoB,CAAgB;gBAMhC,UAAU,EAAE;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,CAAA;KACd;IAoBD,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,IAAW,UAAU,CAAC,KAAK,EAAE,OAAO,EAGnC;IAED,IAAW,SAAS,IAAI,IAAI,CAE3B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,IAAI,EAG/B;IAED,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED,IAAW,aAAa,CAAC,KAAK,EAAE,MAAM,EAGrC;IAED,IAAW,mBAAmB,IAAI,MAAM,CAEvC;IAED,IAAW,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAG3C;IAMM,KAAK,IAAI,aAAa;CAchC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DirectionalLight = void 0;
|
|
4
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
5
|
+
const ILight_1 = require("../../interface/ILight");
|
|
6
|
+
const AbstractLight_1 = require("../AbstractLight");
|
|
7
|
+
class DirectionalLight extends AbstractLight_1.AbstractLight {
|
|
8
|
+
constructor(properties) {
|
|
9
|
+
super({
|
|
10
|
+
color: properties.color || '#ffffff',
|
|
11
|
+
intensity: properties.intensity !== undefined ? properties.intensity : 0.5,
|
|
12
|
+
type: ILight_1.LIGHTTYPE.DIRECTIONAL,
|
|
13
|
+
name: properties.name,
|
|
14
|
+
order: properties.order,
|
|
15
|
+
id: properties.id
|
|
16
|
+
});
|
|
17
|
+
this._castShadow = false;
|
|
18
|
+
this._direction = gl_matrix_1.vec3.fromValues(-1, 0, 1);
|
|
19
|
+
this._shadowMapBias = -0.003;
|
|
20
|
+
this._shadowMapResolution = 1024;
|
|
21
|
+
if (properties.direction)
|
|
22
|
+
this._direction = properties.direction;
|
|
23
|
+
if (properties.castShadow)
|
|
24
|
+
this._castShadow = properties.castShadow;
|
|
25
|
+
if (properties.shadowMapResolution)
|
|
26
|
+
this._shadowMapResolution = properties.shadowMapResolution;
|
|
27
|
+
if (properties.shadowMapBias)
|
|
28
|
+
this._shadowMapBias = properties.shadowMapBias;
|
|
29
|
+
}
|
|
30
|
+
get castShadow() {
|
|
31
|
+
return this._castShadow;
|
|
32
|
+
}
|
|
33
|
+
set castShadow(value) {
|
|
34
|
+
this._castShadow = value;
|
|
35
|
+
this.updateVersion();
|
|
36
|
+
}
|
|
37
|
+
get direction() {
|
|
38
|
+
return this._direction;
|
|
39
|
+
}
|
|
40
|
+
set direction(value) {
|
|
41
|
+
this._direction = value;
|
|
42
|
+
this.updateVersion();
|
|
43
|
+
}
|
|
44
|
+
get shadowMapBias() {
|
|
45
|
+
return this._shadowMapBias;
|
|
46
|
+
}
|
|
47
|
+
set shadowMapBias(value) {
|
|
48
|
+
this._shadowMapBias = value;
|
|
49
|
+
this.updateVersion();
|
|
50
|
+
}
|
|
51
|
+
get shadowMapResolution() {
|
|
52
|
+
return this._shadowMapResolution;
|
|
53
|
+
}
|
|
54
|
+
set shadowMapResolution(value) {
|
|
55
|
+
this._shadowMapResolution = value;
|
|
56
|
+
this.updateVersion();
|
|
57
|
+
}
|
|
58
|
+
clone() {
|
|
59
|
+
return new DirectionalLight({
|
|
60
|
+
color: this.color,
|
|
61
|
+
intensity: this.intensity,
|
|
62
|
+
direction: this.direction,
|
|
63
|
+
castShadow: this.castShadow,
|
|
64
|
+
shadowMapResolution: this.shadowMapResolution,
|
|
65
|
+
shadowMapBias: this.shadowMapBias,
|
|
66
|
+
name: this.name,
|
|
67
|
+
order: this.order
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.DirectionalLight = DirectionalLight;
|
|
72
|
+
//# sourceMappingURL=DirectionalLight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectionalLight.js","sourceRoot":"","sources":["../../../src/implementation/types/DirectionalLight.ts"],"names":[],"mappings":";;;AACA,yCAAgC;AAEhC,mDAAkD;AAClD,oDAAgD;AAEhD,MAAa,gBAAiB,SAAQ,6BAAa;IAY/C,YAAY,UAUX;QACG,KAAK,CAAC;YACF,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS;YACpC,SAAS,EAAE,UAAU,CAAC,SAAS,KAAK,SAA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W,aAAa,CAAC,KAAa;QAClC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAED,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED,IAAW,mBAAmB,CAAC,KAAa;QACxC,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;QAClC,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAMM,KAAK;QACR,OAAO,IAAI,gBAAgB,CAAC;YACxB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC,CAAC;IACP,CAAC;CAGJ;AAhGD,4CAgGC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
2
|
+
import { AbstractLight } from '../AbstractLight';
|
|
3
|
+
export declare class HemisphereLight extends AbstractLight {
|
|
4
|
+
private _groundColor;
|
|
5
|
+
constructor(properties: {
|
|
6
|
+
color?: string;
|
|
7
|
+
groundColor?: string;
|
|
8
|
+
intensity?: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
order?: number;
|
|
11
|
+
id?: string;
|
|
12
|
+
});
|
|
13
|
+
get groundColor(): string;
|
|
14
|
+
set groundColor(value: string);
|
|
15
|
+
clone(): ITreeNodeData;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=HemisphereLight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HemisphereLight.d.ts","sourceRoot":"","sources":["../../../src/implementation/types/HemisphereLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AAInE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,eAAgB,SAAQ,aAAa;IAG9C,OAAO,CAAC,YAAY,CAAqB;gBAM7B,UAAU,EAAE;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,CAAA;KACd;IAiBD,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,MAAM,EAGnC;IAMM,KAAK,IAAI,aAAa;CAWhC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HemisphereLight = void 0;
|
|
4
|
+
const ILight_1 = require("../../interface/ILight");
|
|
5
|
+
const AbstractLight_1 = require("../AbstractLight");
|
|
6
|
+
class HemisphereLight extends AbstractLight_1.AbstractLight {
|
|
7
|
+
constructor(properties) {
|
|
8
|
+
super({
|
|
9
|
+
color: properties.color || '#ffffff',
|
|
10
|
+
intensity: properties.intensity !== undefined ? properties.intensity : 0.5,
|
|
11
|
+
type: ILight_1.LIGHTTYPE.HEMISPHERE,
|
|
12
|
+
name: properties.name,
|
|
13
|
+
order: properties.order,
|
|
14
|
+
id: properties.id
|
|
15
|
+
});
|
|
16
|
+
this._groundColor = '#ffffff';
|
|
17
|
+
if (properties.groundColor)
|
|
18
|
+
this._groundColor = properties.groundColor;
|
|
19
|
+
}
|
|
20
|
+
get groundColor() {
|
|
21
|
+
return this._groundColor;
|
|
22
|
+
}
|
|
23
|
+
set groundColor(value) {
|
|
24
|
+
this._groundColor = value;
|
|
25
|
+
this.updateVersion();
|
|
26
|
+
}
|
|
27
|
+
clone() {
|
|
28
|
+
return new HemisphereLight({
|
|
29
|
+
color: this.color,
|
|
30
|
+
groundColor: this.groundColor,
|
|
31
|
+
intensity: this.intensity,
|
|
32
|
+
name: this.name,
|
|
33
|
+
order: this.order
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.HemisphereLight = HemisphereLight;
|
|
38
|
+
//# sourceMappingURL=HemisphereLight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HemisphereLight.js","sourceRoot":"","sources":["../../../src/implementation/types/HemisphereLight.ts"],"names":[],"mappings":";;;AAGA,mDAAkD;AAClD,oDAAgD;AAEhD,MAAa,eAAgB,SAAQ,6BAAa;IAS9C,YAAY,UAOX;QACG,KAAK,CAAC;YACF,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS;YACpC,SAAS,EAAE,UAAU,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG;YAC1E,IAAI,EAAE,kBAAS,CAAC,UAAU;YAC1B,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,EAAE,EAAE,UAAU,CAAC,EAAE;SACpB,CAAC,CAAC;QArBC,iBAAY,GAAW,SAAS,CAAC;QAuBrC,IAAI,UAAU,CAAC,WAAW;YAAE,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,WAAW,CAAC;IAC3E,CAAC;IAMD,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAW,WAAW,CAAC,KAAa;QAChC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAMM,KAAK;QACR,OAAO,IAAI,eAAe,CAAC;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;SACpB,CAAC,CAAC;IACP,CAAC;CAGJ;AAzDD,0CAyDC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
2
|
+
import { vec3 } from 'gl-matrix';
|
|
3
|
+
import { AbstractLight } from '../AbstractLight';
|
|
4
|
+
export declare class PointLight extends AbstractLight {
|
|
5
|
+
private _decay;
|
|
6
|
+
private _distance;
|
|
7
|
+
private _position;
|
|
8
|
+
constructor(properties: {
|
|
9
|
+
color?: string;
|
|
10
|
+
intensity?: number;
|
|
11
|
+
position?: vec3;
|
|
12
|
+
distance?: number;
|
|
13
|
+
decay?: number;
|
|
14
|
+
name?: string;
|
|
15
|
+
order?: number;
|
|
16
|
+
id?: string;
|
|
17
|
+
});
|
|
18
|
+
get decay(): number;
|
|
19
|
+
set decay(value: number);
|
|
20
|
+
get distance(): number;
|
|
21
|
+
set distance(value: number);
|
|
22
|
+
get position(): vec3;
|
|
23
|
+
set position(value: vec3);
|
|
24
|
+
clone(): ITreeNodeData;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=PointLight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointLight.d.ts","sourceRoot":"","sources":["../../../src/implementation/types/PointLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,UAAW,SAAQ,aAAa;IAG3C,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,SAAS,CAAkC;gBAMvC,UAAU,EAAE;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,CAAA;KACZ;IAkBD,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAGhC;IAED,IAAW,QAAQ,IAAI,IAAI,CAE1B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,IAAI,EAG9B;IAMM,KAAK,IAAI,aAAa;CAa9B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PointLight = void 0;
|
|
4
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
5
|
+
const ILight_1 = require("../../interface/ILight");
|
|
6
|
+
const AbstractLight_1 = require("../AbstractLight");
|
|
7
|
+
class PointLight extends AbstractLight_1.AbstractLight {
|
|
8
|
+
constructor(properties) {
|
|
9
|
+
super({
|
|
10
|
+
color: properties.color || '#ffffff',
|
|
11
|
+
intensity: properties.intensity !== undefined ? properties.intensity : 0.5,
|
|
12
|
+
type: ILight_1.LIGHTTYPE.POINT,
|
|
13
|
+
name: properties.name,
|
|
14
|
+
order: properties.order,
|
|
15
|
+
id: properties.id
|
|
16
|
+
});
|
|
17
|
+
this._decay = 2;
|
|
18
|
+
this._distance = 0;
|
|
19
|
+
this._position = gl_matrix_1.vec3.fromValues(0, 0, 0);
|
|
20
|
+
if (properties.position)
|
|
21
|
+
this._position = properties.position;
|
|
22
|
+
if (properties.distance)
|
|
23
|
+
this._distance = properties.distance;
|
|
24
|
+
if (properties.decay)
|
|
25
|
+
this._decay = properties.decay;
|
|
26
|
+
}
|
|
27
|
+
get decay() {
|
|
28
|
+
return this._decay;
|
|
29
|
+
}
|
|
30
|
+
set decay(value) {
|
|
31
|
+
this._decay = value;
|
|
32
|
+
this.updateVersion();
|
|
33
|
+
}
|
|
34
|
+
get distance() {
|
|
35
|
+
return this._distance;
|
|
36
|
+
}
|
|
37
|
+
set distance(value) {
|
|
38
|
+
this._distance = value;
|
|
39
|
+
this.updateVersion();
|
|
40
|
+
}
|
|
41
|
+
get position() {
|
|
42
|
+
return this._position;
|
|
43
|
+
}
|
|
44
|
+
set position(value) {
|
|
45
|
+
this._position = value;
|
|
46
|
+
this.updateVersion();
|
|
47
|
+
}
|
|
48
|
+
clone() {
|
|
49
|
+
return new PointLight({
|
|
50
|
+
color: this.color,
|
|
51
|
+
position: this.position,
|
|
52
|
+
distance: this.distance,
|
|
53
|
+
decay: this.decay,
|
|
54
|
+
intensity: this.intensity,
|
|
55
|
+
name: this.name,
|
|
56
|
+
order: this.order
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.PointLight = PointLight;
|
|
61
|
+
//# sourceMappingURL=PointLight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PointLight.js","sourceRoot":"","sources":["../../../src/implementation/types/PointLight.ts"],"names":[],"mappings":";;;AACA,yCAAgC;AAEhC,mDAAkD;AAClD,oDAAgD;AAEhD,MAAa,UAAW,SAAQ,6BAAa;IAW3C,YAAY,UASX;QACC,KAAK,CAAC;YACJ,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS;YACpC,SAAS,EAAE,UAAU,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,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pB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CAGF;AAlFD,gCAkFC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
2
|
+
import { vec3 } from 'gl-matrix';
|
|
3
|
+
import { AbstractLight } from '../AbstractLight';
|
|
4
|
+
export declare class SpotLight extends AbstractLight {
|
|
5
|
+
private _angle;
|
|
6
|
+
private _decay;
|
|
7
|
+
private _distance;
|
|
8
|
+
private _penumbra;
|
|
9
|
+
private _position;
|
|
10
|
+
private _target;
|
|
11
|
+
constructor(properties: {
|
|
12
|
+
color?: string;
|
|
13
|
+
intensity?: number;
|
|
14
|
+
position?: vec3;
|
|
15
|
+
target?: vec3;
|
|
16
|
+
distance?: number;
|
|
17
|
+
decay?: number;
|
|
18
|
+
angle?: number;
|
|
19
|
+
penumbra?: number;
|
|
20
|
+
name?: string;
|
|
21
|
+
order?: number;
|
|
22
|
+
id?: string;
|
|
23
|
+
});
|
|
24
|
+
get angle(): number;
|
|
25
|
+
set angle(value: number);
|
|
26
|
+
get decay(): number;
|
|
27
|
+
set decay(value: number);
|
|
28
|
+
get distance(): number;
|
|
29
|
+
set distance(value: number);
|
|
30
|
+
get penumbra(): number;
|
|
31
|
+
set penumbra(value: number);
|
|
32
|
+
get position(): vec3;
|
|
33
|
+
set position(value: vec3);
|
|
34
|
+
get target(): vec3;
|
|
35
|
+
set target(value: vec3);
|
|
36
|
+
clone(): ITreeNodeData;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=SpotLight.d.ts.map
|
|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E,MAAM,EAGhC;IAED,IAAW,QAAQ,IAAI,IAAI,CAE1B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,IAAI,EAG9B;IAED,IAAW,MAAM,IAAI,IAAI,CAExB;IAED,IAAW,MAAM,CAAC,KAAK,EAAE,IAAI,EAG5B;IAMM,KAAK,IAAI,aAAa;CAgB9B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpotLight = void 0;
|
|
4
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
5
|
+
const ILight_1 = require("../../interface/ILight");
|
|
6
|
+
const AbstractLight_1 = require("../AbstractLight");
|
|
7
|
+
class SpotLight extends AbstractLight_1.AbstractLight {
|
|
8
|
+
constructor(properties) {
|
|
9
|
+
super({
|
|
10
|
+
color: properties.color || '#ffffff',
|
|
11
|
+
intensity: properties.intensity !== undefined ? properties.intensity : 0.5,
|
|
12
|
+
type: ILight_1.LIGHTTYPE.SPOT,
|
|
13
|
+
name: properties.name,
|
|
14
|
+
order: properties.order,
|
|
15
|
+
id: properties.id
|
|
16
|
+
});
|
|
17
|
+
this._angle = Math.PI / 4.0;
|
|
18
|
+
this._decay = 1;
|
|
19
|
+
this._distance = 0;
|
|
20
|
+
this._penumbra = 0.5;
|
|
21
|
+
this._position = gl_matrix_1.vec3.fromValues(-1, 0, 1);
|
|
22
|
+
this._target = gl_matrix_1.vec3.fromValues(0, 0, 0);
|
|
23
|
+
if (properties.position)
|
|
24
|
+
this._position = properties.position;
|
|
25
|
+
if (properties.target)
|
|
26
|
+
this._target = properties.target;
|
|
27
|
+
if (properties.distance)
|
|
28
|
+
this._distance = properties.distance;
|
|
29
|
+
if (properties.decay)
|
|
30
|
+
this._decay = properties.decay;
|
|
31
|
+
if (properties.angle)
|
|
32
|
+
this._angle = properties.angle;
|
|
33
|
+
if (properties.penumbra)
|
|
34
|
+
this._penumbra = properties.penumbra;
|
|
35
|
+
}
|
|
36
|
+
get angle() {
|
|
37
|
+
return this._angle;
|
|
38
|
+
}
|
|
39
|
+
set angle(value) {
|
|
40
|
+
this._angle = value;
|
|
41
|
+
this.updateVersion();
|
|
42
|
+
}
|
|
43
|
+
get decay() {
|
|
44
|
+
return this._decay;
|
|
45
|
+
}
|
|
46
|
+
set decay(value) {
|
|
47
|
+
this._decay = value;
|
|
48
|
+
this.updateVersion();
|
|
49
|
+
}
|
|
50
|
+
get distance() {
|
|
51
|
+
return this._distance;
|
|
52
|
+
}
|
|
53
|
+
set distance(value) {
|
|
54
|
+
this._distance = value;
|
|
55
|
+
this.updateVersion();
|
|
56
|
+
}
|
|
57
|
+
get penumbra() {
|
|
58
|
+
return this._penumbra;
|
|
59
|
+
}
|
|
60
|
+
set penumbra(value) {
|
|
61
|
+
this._penumbra = value;
|
|
62
|
+
this.updateVersion();
|
|
63
|
+
}
|
|
64
|
+
get position() {
|
|
65
|
+
return this._position;
|
|
66
|
+
}
|
|
67
|
+
set position(value) {
|
|
68
|
+
this._position = value;
|
|
69
|
+
this.updateVersion();
|
|
70
|
+
}
|
|
71
|
+
get target() {
|
|
72
|
+
return this._target;
|
|
73
|
+
}
|
|
74
|
+
set target(value) {
|
|
75
|
+
this._target = value;
|
|
76
|
+
this.updateVersion();
|
|
77
|
+
}
|
|
78
|
+
clone() {
|
|
79
|
+
return new SpotLight({
|
|
80
|
+
color: this.color,
|
|
81
|
+
position: this.position,
|
|
82
|
+
target: this.target,
|
|
83
|
+
distance: this.distance,
|
|
84
|
+
decay: this.decay,
|
|
85
|
+
angle: this.angle,
|
|
86
|
+
penumbra: this.penumbra,
|
|
87
|
+
intensity: this.intensity,
|
|
88
|
+
name: this.name,
|
|
89
|
+
order: this.order
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.SpotLight = SpotLight;
|
|
94
|
+
//# sourceMappingURL=SpotLight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AAC;IACvB,CAAC;IAMM,KAAK;QACV,OAAO,IAAI,SAAS,CAAC;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CAGF;AAzHD,8BAyHC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractLight } from './implementation/AbstractLight';
|
|
2
|
+
import { LightEngine } from './implementation/LightEngine';
|
|
3
|
+
import { LightScene } from './implementation/LightScene';
|
|
4
|
+
import { AmbientLight } from './implementation/types/AmbientLight';
|
|
5
|
+
import { DirectionalLight } from './implementation/types/DirectionalLight';
|
|
6
|
+
import { HemisphereLight } from './implementation/types/HemisphereLight';
|
|
7
|
+
import { PointLight } from './implementation/types/PointLight';
|
|
8
|
+
import { SpotLight } from './implementation/types/SpotLight';
|
|
9
|
+
import { ILight, LIGHTTYPE } from './interface/ILight';
|
|
10
|
+
import { ILightEngine } from './interface/ILightEngine';
|
|
11
|
+
import { ILightScene } from './interface/ILightScene';
|
|
12
|
+
export { ILightEngine, LightEngine, LIGHTTYPE, ILightScene, LightScene, ILight };
|
|
13
|
+
export { AbstractLight, AmbientLight, DirectionalLight, HemisphereLight, PointLight, SpotLight };
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,EACL,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EACtE,CAAA;AAED,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EACtF,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpotLight = exports.PointLight = exports.HemisphereLight = exports.DirectionalLight = exports.AmbientLight = exports.AbstractLight = exports.LightScene = exports.LIGHTTYPE = exports.LightEngine = void 0;
|
|
4
|
+
const AbstractLight_1 = require("./implementation/AbstractLight");
|
|
5
|
+
Object.defineProperty(exports, "AbstractLight", { enumerable: true, get: function () { return AbstractLight_1.AbstractLight; } });
|
|
6
|
+
const LightEngine_1 = require("./implementation/LightEngine");
|
|
7
|
+
Object.defineProperty(exports, "LightEngine", { enumerable: true, get: function () { return LightEngine_1.LightEngine; } });
|
|
8
|
+
const LightScene_1 = require("./implementation/LightScene");
|
|
9
|
+
Object.defineProperty(exports, "LightScene", { enumerable: true, get: function () { return LightScene_1.LightScene; } });
|
|
10
|
+
const AmbientLight_1 = require("./implementation/types/AmbientLight");
|
|
11
|
+
Object.defineProperty(exports, "AmbientLight", { enumerable: true, get: function () { return AmbientLight_1.AmbientLight; } });
|
|
12
|
+
const DirectionalLight_1 = require("./implementation/types/DirectionalLight");
|
|
13
|
+
Object.defineProperty(exports, "DirectionalLight", { enumerable: true, get: function () { return DirectionalLight_1.DirectionalLight; } });
|
|
14
|
+
const HemisphereLight_1 = require("./implementation/types/HemisphereLight");
|
|
15
|
+
Object.defineProperty(exports, "HemisphereLight", { enumerable: true, get: function () { return HemisphereLight_1.HemisphereLight; } });
|
|
16
|
+
const PointLight_1 = require("./implementation/types/PointLight");
|
|
17
|
+
Object.defineProperty(exports, "PointLight", { enumerable: true, get: function () { return PointLight_1.PointLight; } });
|
|
18
|
+
const SpotLight_1 = require("./implementation/types/SpotLight");
|
|
19
|
+
Object.defineProperty(exports, "SpotLight", { enumerable: true, get: function () { return SpotLight_1.SpotLight; } });
|
|
20
|
+
const ILight_1 = require("./interface/ILight");
|
|
21
|
+
Object.defineProperty(exports, "LIGHTTYPE", { enumerable: true, get: function () { return ILight_1.LIGHTTYPE; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kEAA8D;AAiB5D,8FAjBO,6BAAa,OAiBP;AAhBf,8DAA0D;AAY1C,4FAZP,yBAAW,OAYO;AAX3B,4DAAwD;AAWH,2FAX5C,uBAAU,OAW4C;AAV/D,sEAAkE;AAcjD,6FAdR,2BAAY,OAcQ;AAb7B,8EAA0E;AAa3C,iGAbtB,mCAAgB,OAasB;AAZ/C,4EAAwE;AAYvB,gGAZxC,iCAAe,OAYwC;AAXhE,kEAA8D;AAWI,2FAXzD,uBAAU,OAWyD;AAV5E,gEAA4D;AAUkB,0FAVrE,qBAAS,OAUqE;AATvF,+CAAsD;AAKzB,0FALZ,kBAAS,OAKY"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { vec3 } from 'gl-matrix';
|
|
2
|
+
export declare enum LIGHTTYPE {
|
|
3
|
+
AMBIENT = "ambient",
|
|
4
|
+
DIRECTIONAL = "directional",
|
|
5
|
+
HEMISPHERE = "hemisphere",
|
|
6
|
+
POINT = "point",
|
|
7
|
+
RECTANGLE = "rectangle",
|
|
8
|
+
SPOT = "spot"
|
|
9
|
+
}
|
|
10
|
+
export interface ILight {
|
|
11
|
+
id: string;
|
|
12
|
+
color: string | number | vec3;
|
|
13
|
+
intensity: number;
|
|
14
|
+
name?: string;
|
|
15
|
+
order?: number;
|
|
16
|
+
type: LIGHTTYPE;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ILight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ILight.d.ts","sourceRoot":"","sources":["../../src/interface/ILight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,IAAI,SAAS;CACd;AAED,MAAM,WAAW,MAAM;IAGrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,SAAS,CAAC;CAGjB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LIGHTTYPE = void 0;
|
|
4
|
+
var LIGHTTYPE;
|
|
5
|
+
(function (LIGHTTYPE) {
|
|
6
|
+
LIGHTTYPE["AMBIENT"] = "ambient";
|
|
7
|
+
LIGHTTYPE["DIRECTIONAL"] = "directional";
|
|
8
|
+
LIGHTTYPE["HEMISPHERE"] = "hemisphere";
|
|
9
|
+
LIGHTTYPE["POINT"] = "point";
|
|
10
|
+
LIGHTTYPE["RECTANGLE"] = "rectangle";
|
|
11
|
+
LIGHTTYPE["SPOT"] = "spot";
|
|
12
|
+
})(LIGHTTYPE = exports.LIGHTTYPE || (exports.LIGHTTYPE = {}));
|
|
13
|
+
//# sourceMappingURL=ILight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ILight.js","sourceRoot":"","sources":["../../src/interface/ILight.ts"],"names":[],"mappings":";;;AAGA,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,gCAAmB,CAAA;IACnB,wCAA2B,CAAA;IAC3B,sCAAyB,CAAA;IACzB,4BAAe,CAAA;IACf,oCAAuB,CAAA;IACvB,0BAAa,CAAA;AACf,CAAC,EAPW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAOpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ILightScene } from './ILightScene';
|
|
2
|
+
export interface ILightEngine {
|
|
3
|
+
assignLightScene(id: string): boolean;
|
|
4
|
+
createLightScene(properties: {
|
|
5
|
+
name?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
standard?: boolean;
|
|
8
|
+
}): ILightScene;
|
|
9
|
+
removeLightScene(id: string): boolean;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ILightEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ILightEngine.d.ts","sourceRoot":"","sources":["../../src/interface/ILightEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,WAAW,YAAY;IAGzB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,gBAAgB,CAAC,UAAU,EAAE;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,GAAG,WAAW,CAAC;IAC5F,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;CAGzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ILightEngine.js","sourceRoot":"","sources":["../../src/interface/ILightEngine.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { TreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
2
|
+
import { vec3 } from 'gl-matrix';
|
|
3
|
+
import { ILight } from './ILight';
|
|
4
|
+
export interface ILightScene {
|
|
5
|
+
id: string;
|
|
6
|
+
lights: {
|
|
7
|
+
[key: string]: ILight;
|
|
8
|
+
};
|
|
9
|
+
name?: string;
|
|
10
|
+
node: TreeNode;
|
|
11
|
+
addAmbientLight(properties: {
|
|
12
|
+
color?: string | number | vec3;
|
|
13
|
+
intensity?: number;
|
|
14
|
+
id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
}): ILight;
|
|
17
|
+
addDirectionalLight(properties: {
|
|
18
|
+
color?: string | number | vec3;
|
|
19
|
+
intensity?: number;
|
|
20
|
+
direction?: vec3;
|
|
21
|
+
castShadow?: boolean;
|
|
22
|
+
shadowMapResolution?: number;
|
|
23
|
+
shadowMapBias?: number;
|
|
24
|
+
id?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
}): ILight;
|
|
27
|
+
addHemisphereLight(properties: {
|
|
28
|
+
color?: string | number | vec3;
|
|
29
|
+
intensity?: number;
|
|
30
|
+
groundColor?: string | number | vec3;
|
|
31
|
+
id?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
}): ILight;
|
|
34
|
+
addPointLight(properties: {
|
|
35
|
+
color?: string | number | vec3;
|
|
36
|
+
intensity?: number;
|
|
37
|
+
position?: vec3;
|
|
38
|
+
distance?: number;
|
|
39
|
+
decay?: number;
|
|
40
|
+
id?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
}): ILight;
|
|
43
|
+
addSpotLight(properties: {
|
|
44
|
+
color?: string | number | vec3;
|
|
45
|
+
intensity?: number;
|
|
46
|
+
position?: vec3;
|
|
47
|
+
target?: vec3;
|
|
48
|
+
distance?: number;
|
|
49
|
+
decay?: number;
|
|
50
|
+
angle?: number;
|
|
51
|
+
penumbra?: number;
|
|
52
|
+
id?: string;
|
|
53
|
+
name?: string;
|
|
54
|
+
}): ILight;
|
|
55
|
+
removeLight(id: string): boolean;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=ILightScene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ILightScene.d.ts","sourceRoot":"","sources":["../../src/interface/ILightScene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,MAAM,WAAW,WAAW;IAGxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,CAAC;IAMf,eAAe,CAAC,UAAU,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC;IACtH,mBAAmB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