@shapediver/viewer.rendering-engine.light-engine 1.15.6 → 2.0.1
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/implementation/AbstractLight.d.ts +3 -3
- package/dist/implementation/AbstractLight.d.ts.map +1 -1
- package/dist/implementation/LightEngine.d.ts +9 -5
- package/dist/implementation/LightEngine.d.ts.map +1 -1
- package/dist/implementation/LightEngine.js +41 -30
- package/dist/implementation/LightEngine.js.map +1 -1
- package/dist/implementation/LightScene.d.ts +8 -3
- package/dist/implementation/LightScene.d.ts.map +1 -1
- package/dist/implementation/LightScene.js +12 -1
- package/dist/implementation/LightScene.js.map +1 -1
- package/dist/implementation/types/AmbientLight.d.ts +3 -3
- package/dist/implementation/types/AmbientLight.d.ts.map +1 -1
- package/dist/implementation/types/AmbientLight.js +1 -1
- package/dist/implementation/types/AmbientLight.js.map +1 -1
- package/dist/implementation/types/DirectionalLight.d.ts +3 -3
- package/dist/implementation/types/DirectionalLight.d.ts.map +1 -1
- package/dist/implementation/types/DirectionalLight.js +1 -1
- package/dist/implementation/types/DirectionalLight.js.map +1 -1
- package/dist/implementation/types/HemisphereLight.d.ts +3 -3
- package/dist/implementation/types/HemisphereLight.d.ts.map +1 -1
- package/dist/implementation/types/HemisphereLight.js +1 -1
- package/dist/implementation/types/HemisphereLight.js.map +1 -1
- package/dist/implementation/types/PointLight.d.ts +3 -3
- package/dist/implementation/types/PointLight.d.ts.map +1 -1
- package/dist/implementation/types/PointLight.js +1 -1
- package/dist/implementation/types/PointLight.js.map +1 -1
- package/dist/implementation/types/SpotLight.d.ts +3 -3
- package/dist/implementation/types/SpotLight.d.ts.map +1 -1
- package/dist/implementation/types/SpotLight.js +1 -1
- package/dist/implementation/types/SpotLight.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interface/ILight.d.ts +4 -3
- package/dist/interface/ILight.d.ts.map +1 -1
- package/dist/interface/ILight.js +10 -10
- package/dist/interface/ILight.js.map +1 -1
- package/dist/interface/ILightEngine.d.ts +1 -0
- package/dist/interface/ILightEngine.d.ts.map +1 -1
- package/dist/interface/ILightScene.d.ts +3 -2
- package/dist/interface/ILightScene.d.ts.map +1 -1
- package/dist/interface/types/IAmbientLight.d.ts +5 -0
- package/dist/interface/types/IAmbientLight.d.ts.map +1 -0
- package/dist/interface/types/IAmbientLight.js +3 -0
- package/dist/interface/types/IAmbientLight.js.map +1 -0
- package/dist/interface/types/IDirectionalLight.d.ts +10 -0
- package/dist/interface/types/IDirectionalLight.d.ts.map +1 -0
- package/dist/interface/types/IDirectionalLight.js +3 -0
- package/dist/interface/types/IDirectionalLight.js.map +1 -0
- package/dist/interface/types/IHemisphereLight.d.ts +7 -0
- package/dist/interface/types/IHemisphereLight.d.ts.map +1 -0
- package/dist/interface/types/IHemisphereLight.js +3 -0
- package/dist/interface/types/IHemisphereLight.js.map +1 -0
- package/dist/interface/types/IPointLight.d.ts +9 -0
- package/dist/interface/types/IPointLight.d.ts.map +1 -0
- package/dist/interface/types/IPointLight.js +3 -0
- package/dist/interface/types/IPointLight.js.map +1 -0
- package/dist/interface/types/ISpotLight.d.ts +12 -0
- package/dist/interface/types/ISpotLight.d.ts.map +1 -0
- package/dist/interface/types/ISpotLight.js +3 -0
- package/dist/interface/types/ISpotLight.js.map +1 -0
- package/package.json +14 -10
- package/src/implementation/AbstractLight.ts +94 -0
- package/src/implementation/LightEngine.ts +312 -0
- package/src/implementation/LightScene.ts +128 -0
- package/src/implementation/types/AmbientLight.ts +41 -0
- package/src/implementation/types/DirectionalLight.ts +104 -0
- package/src/implementation/types/HemisphereLight.ts +65 -0
- package/src/implementation/types/PointLight.ts +90 -0
- package/src/implementation/types/SpotLight.ts +129 -0
- package/src/index.ts +28 -0
- package/src/interface/ILight.ts +24 -0
- package/src/interface/ILightEngine.ts +17 -0
- package/src/interface/ILightScene.ts +27 -0
- package/src/interface/types/IAmbientLight.ts +5 -0
- package/src/interface/types/IDirectionalLight.ts +12 -0
- package/src/interface/types/IHemisphereLight.ts +9 -0
- package/src/interface/types/IPointLight.ts +11 -0
- package/src/interface/types/ISpotLight.ts +14 -0
- package/tsconfig.json +17 -0
|
@@ -11,7 +11,7 @@ class PointLight extends AbstractLight_1.AbstractLight {
|
|
|
11
11
|
super({
|
|
12
12
|
color: properties.color || '#ffffff',
|
|
13
13
|
intensity: properties.intensity !== undefined ? properties.intensity : 0.5,
|
|
14
|
-
type: ILight_1.
|
|
14
|
+
type: ILight_1.LIGHT_TYPE.POINT,
|
|
15
15
|
name: properties.name,
|
|
16
16
|
order: properties.order,
|
|
17
17
|
id: properties.id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PointLight.js","sourceRoot":"","sources":["../../../src/implementation/types/PointLight.ts"],"names":[],"mappings":";;;AACA,yCAAgC;AAEhC,
|
|
1
|
+
{"version":3,"file":"PointLight.js","sourceRoot":"","sources":["../../../src/implementation/types/PointLight.ts"],"names":[],"mappings":";;;AACA,yCAAgC;AAEhC,mDAAmD;AAEnD,oDAAgD;AAEhD,MAAa,UAAW,SAAQ,6BAAa;IAO3C,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,UASX;QACC,KAAK,CAAC;YACJ,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,mBAAU,CAAC,KAAK;YACtB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,EAAE,EAAE,UAAU,CAAC,EAAE;SAClB,CAAC,CAAC;QA3BL,yBAAyB;QAEjB,WAAM,GAAW,CAAC,CAAC;QACnB,cAAS,GAAW,CAAC,CAAC;QACtB,cAAS,GAAS,gB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EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CAGF;AAlFD,gCAkFC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
2
1
|
import { vec3 } from 'gl-matrix';
|
|
2
|
+
import { ISpotLight } from '../../interface/types/ISpotLight';
|
|
3
3
|
import { AbstractLight } from '../AbstractLight';
|
|
4
|
-
export declare class SpotLight extends AbstractLight {
|
|
4
|
+
export declare class SpotLight extends AbstractLight implements ISpotLight {
|
|
5
5
|
private _angle;
|
|
6
6
|
private _decay;
|
|
7
7
|
private _distance;
|
|
@@ -33,6 +33,6 @@ export declare class SpotLight extends AbstractLight {
|
|
|
33
33
|
set position(value: vec3);
|
|
34
34
|
get target(): vec3;
|
|
35
35
|
set target(value: vec3);
|
|
36
|
-
clone():
|
|
36
|
+
clone(): ISpotLight;
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=SpotLight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotLight.d.ts","sourceRoot":"","sources":["../../../src/implementation/types/SpotLight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpotLight.d.ts","sourceRoot":"","sources":["../../../src/implementation/types/SpotLight.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,SAAU,SAAQ,aAAc,YAAW,UAAU;IAGhE,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,SAAS,CAAe;IAChC,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,OAAO,CAAkC;gBAMrC,UAAU,EAAE;QACtB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,IAAI,CAAC;QAChB,MAAM,CAAC,EAAE,IAAI,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,EAAE,CAAC,EAAE,MAAM,CAAA;KACZ;IAqBD,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAED,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,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,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,UAAU;CAgB3B"}
|
|
@@ -11,7 +11,7 @@ class SpotLight extends AbstractLight_1.AbstractLight {
|
|
|
11
11
|
super({
|
|
12
12
|
color: properties.color || '#ffffff',
|
|
13
13
|
intensity: properties.intensity !== undefined ? properties.intensity : 0.5,
|
|
14
|
-
type: ILight_1.
|
|
14
|
+
type: ILight_1.LIGHT_TYPE.SPOT,
|
|
15
15
|
name: properties.name,
|
|
16
16
|
order: properties.order,
|
|
17
17
|
id: properties.id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotLight.js","sourceRoot":"","sources":["../../../src/implementation/types/SpotLight.ts"],"names":[],"mappings":";;;AACA,yCAAgC;AAEhC,
|
|
1
|
+
{"version":3,"file":"SpotLight.js","sourceRoot":"","sources":["../../../src/implementation/types/SpotLight.ts"],"names":[],"mappings":";;;AACA,yCAAgC;AAEhC,mDAAmD;AAEnD,oDAAgD;AAEhD,MAAa,SAAU,SAAQ,6BAAa;IAU1C,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,UAYX;QACC,KAAK,CAAC;YACJ,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,mBAAU,CAAC,IAAI;YACrB,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,EAAE,EAAE,UAAU,CAAC,EAAE;SAClB,CAAC,CAAC;QAjCL,yBAAyB;QAEjB,WAAM,GAAW,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;QAC/B,WAAM,GAAW,CAAC,CAAC;QACnB,cAAS,GAAW,CAAC,CAAC;QACtB,cAAS,GAAW,GAAG,CAAC;QACxB,cAAS,GAAS,gBAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5C,YAAO,GAAS,gBAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QA2B/C,IAAI,UAAU,CAAC,QAAQ;YAAE,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;QAC9D,IAAI,UAAU,CAAC,MAAM;YAAE,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC;QACxD,IAAI,UAAU,CAAC,QAAQ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,CAAC;QACvB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,MAAM,CAAC,KAAW;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED,mCAAmC;IAEnC,6BAA6B;IAEtB,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
CHANGED
|
@@ -6,9 +6,15 @@ import { DirectionalLight } from './implementation/types/DirectionalLight';
|
|
|
6
6
|
import { HemisphereLight } from './implementation/types/HemisphereLight';
|
|
7
7
|
import { PointLight } from './implementation/types/PointLight';
|
|
8
8
|
import { SpotLight } from './implementation/types/SpotLight';
|
|
9
|
-
import { ILight,
|
|
9
|
+
import { ILight, LIGHT_TYPE } from './interface/ILight';
|
|
10
10
|
import { ILightEngine } from './interface/ILightEngine';
|
|
11
11
|
import { ILightScene } from './interface/ILightScene';
|
|
12
|
-
|
|
12
|
+
import { IAmbientLight } from './interface/types/IAmbientLight';
|
|
13
|
+
import { IDirectionalLight } from './interface/types/IDirectionalLight';
|
|
14
|
+
import { IHemisphereLight } from './interface/types/IHemisphereLight';
|
|
15
|
+
import { IPointLight } from './interface/types/IPointLight';
|
|
16
|
+
import { ISpotLight } from './interface/types/ISpotLight';
|
|
17
|
+
export { ILightEngine, LightEngine, LIGHT_TYPE, ILightScene, LightScene, ILight };
|
|
18
|
+
export { IAmbientLight, IDirectionalLight, IHemisphereLight, IPointLight, ISpotLight };
|
|
13
19
|
export { AbstractLight, AmbientLight, DirectionalLight, HemisphereLight, PointLight, SpotLight };
|
|
14
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
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,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAEzD,OAAO,EACL,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EACvE,CAAA;AAED,OAAO,EACL,aAAa,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAC5E,CAAA;AAED,OAAO,EACL,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EACtF,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpotLight = exports.PointLight = exports.HemisphereLight = exports.DirectionalLight = exports.AmbientLight = exports.AbstractLight = exports.LightScene = exports.
|
|
3
|
+
exports.SpotLight = exports.PointLight = exports.HemisphereLight = exports.DirectionalLight = exports.AmbientLight = exports.AbstractLight = exports.LightScene = exports.LIGHT_TYPE = exports.LightEngine = void 0;
|
|
4
4
|
const AbstractLight_1 = require("./implementation/AbstractLight");
|
|
5
5
|
Object.defineProperty(exports, "AbstractLight", { enumerable: true, get: function () { return AbstractLight_1.AbstractLight; } });
|
|
6
6
|
const LightEngine_1 = require("./implementation/LightEngine");
|
|
@@ -18,5 +18,5 @@ Object.defineProperty(exports, "PointLight", { enumerable: true, get: function (
|
|
|
18
18
|
const SpotLight_1 = require("./implementation/types/SpotLight");
|
|
19
19
|
Object.defineProperty(exports, "SpotLight", { enumerable: true, get: function () { return SpotLight_1.SpotLight; } });
|
|
20
20
|
const ILight_1 = require("./interface/ILight");
|
|
21
|
-
Object.defineProperty(exports, "
|
|
21
|
+
Object.defineProperty(exports, "LIGHT_TYPE", { enumerable: true, get: function () { return ILight_1.LIGHT_TYPE; } });
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kEAA8D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kEAA8D;AA0B5D,8FA1BO,6BAAa,OA0BP;AAzBf,8DAA0D;AAiB1C,4FAjBP,yBAAW,OAiBO;AAhB3B,4DAAwD;AAgBF,2FAhB7C,uBAAU,OAgB6C;AAfhE,sEAAkE;AAuBjD,6FAvBR,2BAAY,OAuBQ;AAtB7B,8EAA0E;AAsB3C,iGAtBtB,mCAAgB,OAsBsB;AArB/C,4EAAwE;AAqBvB,gGArBxC,iCAAe,OAqBwC;AApBhE,kEAA8D;AAoBI,2FApBzD,uBAAU,OAoByD;AAnB5E,gEAA4D;AAmBkB,0FAnBrE,qBAAS,OAmBqE;AAlBvF,+CAAuD;AAU1B,2FAVZ,mBAAU,OAUY"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
1
2
|
import { vec3 } from 'gl-matrix';
|
|
2
|
-
export declare enum
|
|
3
|
+
export declare enum LIGHT_TYPE {
|
|
3
4
|
AMBIENT = "ambient",
|
|
4
5
|
DIRECTIONAL = "directional",
|
|
5
6
|
HEMISPHERE = "hemisphere",
|
|
@@ -7,12 +8,12 @@ export declare enum LIGHTTYPE {
|
|
|
7
8
|
RECTANGLE = "rectangle",
|
|
8
9
|
SPOT = "spot"
|
|
9
10
|
}
|
|
10
|
-
export interface ILight {
|
|
11
|
+
export interface ILight extends ITreeNodeData {
|
|
11
12
|
id: string;
|
|
12
13
|
color: string | number | vec3;
|
|
13
14
|
intensity: number;
|
|
14
15
|
name?: string;
|
|
15
16
|
order?: number;
|
|
16
|
-
type:
|
|
17
|
+
type: LIGHT_TYPE;
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=ILight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILight.d.ts","sourceRoot":"","sources":["../../src/interface/ILight.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ILight.d.ts","sourceRoot":"","sources":["../../src/interface/ILight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,IAAI,SAAS;CACd;AAED,MAAM,WAAW,MAAO,SAAQ,aAAa;IAG3C,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,UAAU,CAAC;CAGlB"}
|
package/dist/interface/ILight.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
(function (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(
|
|
3
|
+
exports.LIGHT_TYPE = void 0;
|
|
4
|
+
var LIGHT_TYPE;
|
|
5
|
+
(function (LIGHT_TYPE) {
|
|
6
|
+
LIGHT_TYPE["AMBIENT"] = "ambient";
|
|
7
|
+
LIGHT_TYPE["DIRECTIONAL"] = "directional";
|
|
8
|
+
LIGHT_TYPE["HEMISPHERE"] = "hemisphere";
|
|
9
|
+
LIGHT_TYPE["POINT"] = "point";
|
|
10
|
+
LIGHT_TYPE["RECTANGLE"] = "rectangle";
|
|
11
|
+
LIGHT_TYPE["SPOT"] = "spot";
|
|
12
|
+
})(LIGHT_TYPE = exports.LIGHT_TYPE || (exports.LIGHT_TYPE = {}));
|
|
13
13
|
//# sourceMappingURL=ILight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILight.js","sourceRoot":"","sources":["../../src/interface/ILight.ts"],"names":[],"mappings":";;;AAGA,IAAY,
|
|
1
|
+
{"version":3,"file":"ILight.js","sourceRoot":"","sources":["../../src/interface/ILight.ts"],"names":[],"mappings":";;;AAGA,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,yCAA2B,CAAA;IAC3B,uCAAyB,CAAA;IACzB,6BAAe,CAAA;IACf,qCAAuB,CAAA;IACvB,2BAAa,CAAA;AACf,CAAC,EAPW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAOrB"}
|
|
@@ -1 +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"}
|
|
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,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAMpB,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
2
2
|
import { vec3 } from 'gl-matrix';
|
|
3
3
|
import { ILight } from './ILight';
|
|
4
4
|
export interface ILightScene {
|
|
@@ -7,7 +7,8 @@ export interface ILightScene {
|
|
|
7
7
|
[key: string]: ILight;
|
|
8
8
|
};
|
|
9
9
|
name?: string;
|
|
10
|
-
node:
|
|
10
|
+
node: ITreeNode;
|
|
11
|
+
update?: () => void;
|
|
11
12
|
addAmbientLight(properties: {
|
|
12
13
|
color?: string | number | vec3;
|
|
13
14
|
intensity?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILightScene.d.ts","sourceRoot":"","sources":["../../src/interface/ILightScene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ILightScene.d.ts","sourceRoot":"","sources":["../../src/interface/ILightScene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAY,MAAM,qCAAqC,CAAA;AACzE,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,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAMpB,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,CAAC,UAAU,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,IAAI,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,MAAM,CAAC;IACxN,kBAAkB,CAAC,UAAU,EAAE;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QAAC,S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ACzC,KAAK,IAAI,aAAa,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAmbientLight.js","sourceRoot":"","sources":["../../../src/interface/types/IAmbientLight.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { vec3 } from 'gl-matrix';
|
|
2
|
+
import { ILight } from '../ILight';
|
|
3
|
+
export interface IDirectionalLight extends ILight {
|
|
4
|
+
castShadow: boolean;
|
|
5
|
+
direction: vec3;
|
|
6
|
+
shadowMapBias: number;
|
|
7
|
+
shadowMapResolution: number;
|
|
8
|
+
clone(): IDirectionalLight;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=IDirectionalLight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDirectionalLight.d.ts","sourceRoot":"","sources":["../../../src/interface/types/IDirectionalLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,WAAW,iBAAkB,SAAQ,MAAM;IAC7C,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAE5B,KAAK,IAAI,iBAAiB,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDirectionalLight.js","sourceRoot":"","sources":["../../../src/interface/types/IDirectionalLight.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHemisphereLight.d.ts","sourceRoot":"","sources":["../../../src/interface/types/IHemisphereLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,WAAW,gBAAiB,SAAQ,MAAM;IAC5C,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAEpC,KAAK,IAAI,gBAAgB,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IHemisphereLight.js","sourceRoot":"","sources":["../../../src/interface/types/IHemisphereLight.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPointLight.d.ts","sourceRoot":"","sources":["../../../src/interface/types/IPointLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,WAAW,WAAY,SAAQ,MAAM;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,IAAI,CAAC;IAEf,KAAK,IAAI,WAAW,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPointLight.js","sourceRoot":"","sources":["../../../src/interface/types/IPointLight.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { vec3 } from 'gl-matrix';
|
|
2
|
+
import { ILight } from '../ILight';
|
|
3
|
+
export interface ISpotLight extends ILight {
|
|
4
|
+
angle: number;
|
|
5
|
+
decay: number;
|
|
6
|
+
distance: number;
|
|
7
|
+
penumbra: number;
|
|
8
|
+
position: vec3;
|
|
9
|
+
target: vec3;
|
|
10
|
+
clone(): ISpotLight;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ISpotLight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISpotLight.d.ts","sourceRoot":"","sources":["../../../src/interface/types/ISpotLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,MAAM,WAAW,UAAW,SAAQ,MAAM;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;IAEb,KAAK,IAAI,UAAU,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISpotLight.js","sourceRoot":"","sources":["../../../src/interface/types/ISpotLight.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.rendering-engine.light-engine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
"test": "__tests__"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"dist"
|
|
13
|
+
"dist",
|
|
14
|
+
"src",
|
|
15
|
+
"package.json",
|
|
16
|
+
"README.md",
|
|
17
|
+
"tsconfig.json"
|
|
14
18
|
],
|
|
15
19
|
"publishConfig": {
|
|
16
20
|
"access": "public"
|
|
@@ -20,11 +24,10 @@
|
|
|
20
24
|
"url": "git+https://github.com/shapediver/Viewer.git"
|
|
21
25
|
},
|
|
22
26
|
"scripts": {
|
|
23
|
-
"test": "bash ../../scripts/test.sh",
|
|
24
27
|
"check": "tsc --noEmit",
|
|
25
|
-
"build": "bash ../../scripts/build.sh",
|
|
26
|
-
"build-watch": "bash ../../scripts/build-watch.sh",
|
|
27
|
-
"build-dep": "bash ../../scripts/build-dep.sh"
|
|
28
|
+
"build": "bash ../../scripts/building/build.sh",
|
|
29
|
+
"build-watch": "bash ../../scripts/building/build-watch.sh",
|
|
30
|
+
"build-dep": "bash ../../scripts/building/build-dep.sh"
|
|
28
31
|
},
|
|
29
32
|
"bugs": {
|
|
30
33
|
"url": "https://github.com/shapediver/Viewer/issues"
|
|
@@ -36,12 +39,13 @@
|
|
|
36
39
|
"testEnvironment": "node"
|
|
37
40
|
},
|
|
38
41
|
"dependencies": {
|
|
42
|
+
"@shapediver/viewer.rendering-engine.rendering-engine": "2.0.1",
|
|
39
43
|
"@shapediver/viewer.settings": "0.1.36",
|
|
40
|
-
"@shapediver/viewer.shared.node-tree": "
|
|
41
|
-
"@shapediver/viewer.shared.services": "
|
|
42
|
-
"@shapediver/viewer.shared.types": "
|
|
44
|
+
"@shapediver/viewer.shared.node-tree": "2.0.1",
|
|
45
|
+
"@shapediver/viewer.shared.services": "2.0.1",
|
|
46
|
+
"@shapediver/viewer.shared.types": "2.0.1",
|
|
43
47
|
"gl-matrix": "3.3.0",
|
|
44
48
|
"tsyringe": "^4.5.0"
|
|
45
49
|
},
|
|
46
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "439d43d5219976059b89ab173d54cdafdd1f5c20"
|
|
47
51
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { vec3 } from 'gl-matrix'
|
|
2
|
+
import { UuidGenerator } from '@shapediver/viewer.shared.services'
|
|
3
|
+
import { AbstractTreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
4
|
+
import { container } from 'tsyringe'
|
|
5
|
+
|
|
6
|
+
import { ILight, LIGHT_TYPE } from '../interface/ILight'
|
|
7
|
+
|
|
8
|
+
export abstract class AbstractLight extends AbstractTreeNodeData implements ILight {
|
|
9
|
+
// #region Properties (6)
|
|
10
|
+
|
|
11
|
+
private readonly _type: LIGHT_TYPE;
|
|
12
|
+
|
|
13
|
+
private _color: string;
|
|
14
|
+
private _intensity: number;
|
|
15
|
+
private _name?: string;
|
|
16
|
+
private _order?: number;
|
|
17
|
+
private _useNodeData: boolean = false;
|
|
18
|
+
|
|
19
|
+
protected readonly _uuidGenerator: UuidGenerator = <UuidGenerator>container.resolve(UuidGenerator);
|
|
20
|
+
|
|
21
|
+
// #endregion Properties (6)
|
|
22
|
+
|
|
23
|
+
// #region Constructors (1)
|
|
24
|
+
|
|
25
|
+
constructor(properties: {
|
|
26
|
+
color: string,
|
|
27
|
+
intensity: number,
|
|
28
|
+
type: LIGHT_TYPE,
|
|
29
|
+
name?: string,
|
|
30
|
+
order?: number,
|
|
31
|
+
id?: string
|
|
32
|
+
}) {
|
|
33
|
+
super(properties.id);
|
|
34
|
+
this._color = properties.color;
|
|
35
|
+
this._intensity = properties.intensity;
|
|
36
|
+
this._type = properties.type;
|
|
37
|
+
this._name = properties.name;
|
|
38
|
+
this._order = properties.order;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// #endregion Constructors (1)
|
|
42
|
+
|
|
43
|
+
// #region Public Accessors (9)
|
|
44
|
+
|
|
45
|
+
public get color(): string {
|
|
46
|
+
return this._color;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public set color(value: string) {
|
|
50
|
+
this._color = value;
|
|
51
|
+
this.updateVersion();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public get intensity(): number {
|
|
55
|
+
return this._intensity;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public set intensity(value: number) {
|
|
59
|
+
this._intensity = value;
|
|
60
|
+
this.updateVersion();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public get name(): string | undefined {
|
|
64
|
+
return this._name;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public set name(value: string | undefined) {
|
|
68
|
+
this._name = value;
|
|
69
|
+
this.updateVersion();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public get order(): number | undefined {
|
|
73
|
+
return this._order;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public set order(value: number | undefined) {
|
|
77
|
+
this._order = value;
|
|
78
|
+
this.updateVersion();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public get type(): LIGHT_TYPE {
|
|
82
|
+
return this._type;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public set useNodeData(value: boolean) {
|
|
86
|
+
this._useNodeData = value;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public get useNodeData(): boolean {
|
|
90
|
+
return this._useNodeData;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// #endregion Public Accessors (9)
|
|
94
|
+
}
|