@xeokit/xeokit-sdk 2.6.72 → 2.6.75

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.
Files changed (60) hide show
  1. package/dist/xeokit-sdk.cjs.js +985 -400
  2. package/dist/xeokit-sdk.es.js +980 -401
  3. package/dist/xeokit-sdk.es5.js +734 -714
  4. package/dist/xeokit-sdk.min.cjs.js +8 -8
  5. package/dist/xeokit-sdk.min.es.js +8 -8
  6. package/dist/xeokit-sdk.min.es5.js +7 -7
  7. package/package.json +1 -1
  8. package/src/extras/ContextMenu/ContextMenu.js +25 -16
  9. package/src/plugins/FastNavPlugin/FastNavPlugin.js +10 -0
  10. package/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +24 -49
  11. package/src/plugins/TreeViewPlugin/RenderService.js +13 -4
  12. package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +1 -1
  13. package/src/viewer/Viewer.js +0 -16
  14. package/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +29 -8
  15. package/src/viewer/scene/LineSet/LineSet.js +7 -2
  16. package/src/viewer/scene/skybox/Skybox.js +110 -9
  17. package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +18 -4
  18. package/types/viewer/scene/CameraControl/CameraControl.d.ts +168 -0
  19. package/types/viewer/scene/LineSet/LineSet.d.ts +1 -1
  20. package/types/viewer/scene/camera/CameraPath.d.ts +86 -6
  21. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +2 -0
  22. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +14 -0
  23. package/types/viewer/scene/geometry/VBOGeometry.d.ts +2 -0
  24. package/types/viewer/scene/geometry/index.d.ts +2 -1
  25. package/types/viewer/scene/geometry/loaders/index.d.ts +2 -0
  26. package/types/viewer/scene/geometry/loaders/load3DSGeometry.d.ts +17 -0
  27. package/types/viewer/scene/geometry/loaders/loadOBJGeometry.d.ts +18 -0
  28. package/types/viewer/scene/index.d.ts +2 -0
  29. package/types/viewer/scene/input/input.d.ts +117 -0
  30. package/types/viewer/scene/lights/AmbientLight.d.ts +41 -0
  31. package/types/viewer/scene/lights/CubeTexture.d.ts +27 -0
  32. package/types/viewer/scene/lights/DirLight.d.ts +77 -0
  33. package/types/viewer/scene/lights/LightMap.d.ts +27 -0
  34. package/types/viewer/scene/lights/PointLight.d.ts +135 -0
  35. package/types/viewer/scene/lights/ReflectionMap.d.ts +26 -0
  36. package/types/viewer/scene/lights/index.d.ts +4 -1
  37. package/types/viewer/scene/marker/Marker.d.ts +5 -0
  38. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +5 -0
  39. package/types/viewer/scene/materials/Fresnel.d.ts +25 -62
  40. package/types/viewer/scene/materials/LambertMaterial.d.ts +192 -0
  41. package/types/viewer/scene/materials/MetallicMaterial.d.ts +359 -0
  42. package/types/viewer/scene/materials/PhongMaterial.d.ts +5 -0
  43. package/types/viewer/scene/materials/PointsMaterial.d.ts +5 -0
  44. package/types/viewer/scene/materials/SpecularMaterial.d.ts +342 -0
  45. package/types/viewer/scene/materials/Texture.d.ts +36 -78
  46. package/types/viewer/scene/materials/index.d.ts +2 -0
  47. package/types/viewer/scene/models/SceneModel.d.ts +134 -7
  48. package/types/viewer/scene/models/SceneModelEntity.d.ts +65 -0
  49. package/types/viewer/scene/models/SceneModelMesh.d.ts +12 -0
  50. package/types/viewer/scene/paths/CubicBezierCurve.d.ts +146 -0
  51. package/types/viewer/scene/paths/Curve.d.ts +75 -0
  52. package/types/viewer/scene/paths/Path.d.ts +119 -0
  53. package/types/viewer/scene/paths/QuadraticBezierCurve.d.ts +124 -0
  54. package/types/viewer/scene/paths/SplineCurve.d.ts +84 -0
  55. package/types/viewer/scene/paths/index.d.ts +5 -0
  56. package/types/viewer/scene/scene/Scene.d.ts +102 -0
  57. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +41 -0
  58. package/types/viewer/scene/skybox/Skybox.d.ts +59 -0
  59. package/types/viewer/scene/skybox/index.d.ts +1 -0
  60. package/types/viewer/scene/webgl/PickResult.d.ts +19 -0
@@ -0,0 +1,27 @@
1
+ import { Component } from '../Component';
2
+ import { CubeTexture } from './CubeTexture';
3
+
4
+ export declare type LightMapConfiguration = {
5
+ /**Optional ID for this LightMap, unique among all components in the parent scene, generated automatically when omitted. */
6
+ id?: string;
7
+ /**Optional map of user-defined metadata to attach to this LightMap. */
8
+ /**Don't know where this property is being used */
9
+ meta?: any;
10
+ /**Paths to six image files to load into this LightMap. */
11
+ src: string[];
12
+ /**Flips this LightMap's source data along its vertical axis when true. */
13
+ flipY?: boolean;
14
+ /**Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}. */
15
+ encoding?: number;
16
+ }
17
+
18
+ export declare class LightMap extends CubeTexture {
19
+ /**
20
+ * @constructor
21
+ * @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
22
+ * @param {LightMapConfiguration} [cfg] Configs
23
+ */
24
+ constructor(owner: Component, cfg?: LightMapConfiguration);
25
+
26
+ destroy(): void;
27
+ }
@@ -28,4 +28,139 @@ export declare class PointLight extends Light {
28
28
  * @param {PointLightConfiguration} [cfg] PointLight configuration
29
29
  */
30
30
  constructor(owner: Component, cfg: PointLightConfiguration);
31
+
32
+ /**
33
+ * Sets the position of this PointLight.
34
+ *
35
+ * This will be either World- or View-space, depending on the value of {@link PointLight#space}.
36
+ *
37
+ * Default value is ````[1.0, 1.0, 1.0]````.
38
+ *
39
+ * @param {Number[]} pos The position.
40
+ */
41
+ set pos(pos: number[]);
42
+
43
+ /**
44
+ * Gets the position of this PointLight.
45
+ *
46
+ * This will be either World- or View-space, depending on the value of {@link PointLight#space}.
47
+ *
48
+ * Default value is ````[1.0, 1.0, 1.0]````.
49
+ *
50
+ * @returns {Number[]} The position.
51
+ */
52
+ get pos(): number[];
53
+
54
+ /**
55
+ * Sets the RGB color of this PointLight.
56
+ *
57
+ * Default value is ````[0.7, 0.7, 0.8]````.
58
+ *
59
+ * @param {Number[]} color The PointLight's RGB color.
60
+ */
61
+ set color(color: number[]);
62
+
63
+ /**
64
+ * Gets the RGB color of this PointLight.
65
+ *
66
+ * Default value is ````[0.7, 0.7, 0.8]````.
67
+ *
68
+ * @returns {Number[]} The PointLight's RGB color.
69
+ */
70
+ get color(): number[];
71
+
72
+ /**
73
+ * Sets the intensity of this PointLight.
74
+ *
75
+ * Default intensity is ````1.0```` for maximum intensity.
76
+ *
77
+ * @param {Number} intensity The PointLight's intensity
78
+ */
79
+ set intensity(intensity: number);
80
+
81
+ /**
82
+ * Gets the intensity of this PointLight.
83
+ *
84
+ * Default value is ````1.0```` for maximum intensity.
85
+ *
86
+ * @returns {Number} The PointLight's intensity.
87
+ */
88
+ get intensity(): number;
89
+
90
+ /**
91
+ * Sets the constant attenuation factor for this PointLight.
92
+ *
93
+ * Default value is ````0````.
94
+ *
95
+ * @param {Number} value The constant attenuation factor.
96
+ */
97
+ set constantAttenuation(value: number);
98
+
99
+ /**
100
+ * Gets the constant attenuation factor for this PointLight.
101
+ *
102
+ * Default value is ````0````.
103
+ *
104
+ * @returns {Number} The constant attenuation factor.
105
+ */
106
+ get constantAttenuation(): number;
107
+
108
+ /**
109
+ * Sets the linear attenuation factor for this PointLight.
110
+ *
111
+ * Default value is ````0````.
112
+ *
113
+ * @param {Number} value The linear attenuation factor.
114
+ */
115
+ set linearAttenuation(value: number);
116
+
117
+ /**
118
+ * Gets the linear attenuation factor for this PointLight.
119
+ *
120
+ * Default value is ````0````.
121
+ *
122
+ * @returns {Number} The linear attenuation factor.
123
+ */
124
+ get linearAttenuation(): number;
125
+
126
+ /**
127
+ * Sets the quadratic attenuation factor for this PointLight.
128
+ *
129
+ * Default value is ````0````.
130
+ *
131
+ * @param {Number} value The quadratic attenuation factor.
132
+ */
133
+ set quadraticAttenuation(value: number);
134
+
135
+ /**
136
+ * Gets the quadratic attenuation factor for this PointLight.
137
+ *
138
+ * Default value is ````0````.
139
+ *
140
+ * @returns {Number} The quadratic attenuation factor.
141
+ */
142
+ get quadraticAttenuation(): number;
143
+
144
+ /**
145
+ * Sets if this PointLight casts a shadow.
146
+ *
147
+ * Default value is ````false````.
148
+ *
149
+ * @param {Boolean} castsShadow Set ````true```` to cast shadows.
150
+ */
151
+ set castsShadow(castsShadow: boolean);
152
+
153
+ /**
154
+ * Gets if this PointLight casts a shadow.
155
+ *
156
+ * Default value is ````false````.
157
+ *
158
+ * @returns {Boolean} ````true```` if this PointLight casts shadows.
159
+ */
160
+ get castsShadow(): boolean;
161
+
162
+ /**
163
+ * Destroys this PointLight.
164
+ */
165
+ destroy(): void;
31
166
  }
@@ -0,0 +1,26 @@
1
+ import { Component } from '../Component';
2
+ import { CubeTexture } from './CubeTexture';
3
+
4
+ export declare type CubeTextureConfiguraton = {
5
+ /**Optional ID for this ReflectionMap, unique among all components in the parent scene, generated automatically when omitted. */
6
+ id?: string;
7
+ /** Paths to six image files to load into this ReflectionMap. */
8
+ src: string[];
9
+ /** Flips this ReflectionMap's source data along its vertical axis when true. */
10
+ flipY: boolean;
11
+ /** Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}. */
12
+ encoding?: number;
13
+ }
14
+
15
+ export declare class ReflectionMap extends CubeTexture {
16
+ /**
17
+ * @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
18
+ * @param {CubeTextureConfiguraton} [cfg] Configs
19
+ */
20
+ constructor(owner: Component, cfg?: CubeTextureConfiguraton);
21
+
22
+ /**
23
+ * Destroys this ReflectionMap.
24
+ */
25
+ destroy(): void;
26
+ }
@@ -1,3 +1,6 @@
1
1
  export * from "./AmbientLight";
2
+ export * from './CubeTexture';
2
3
  export * from "./DirLight";
3
- export * from "./PointLight";
4
+ export * from './LightMap';
5
+ export * from "./PointLight";
6
+ export * from "./ReflectionMap";
@@ -133,4 +133,9 @@ export declare class Marker extends Component {
133
133
  * @type {Boolean}
134
134
  */
135
135
  get visible(): boolean;
136
+
137
+ /**
138
+ * Destroys this Marker.
139
+ */
140
+ destroy(): void;
136
141
  }
@@ -238,4 +238,9 @@ export declare class EmphasisMaterial extends Material {
238
238
  * @type {Boolean}
239
239
  */
240
240
  get glowThrough(): boolean;
241
+
242
+ /**
243
+ * Destroys this EmphasisMaterial.
244
+ */
245
+ destroy(): void;
241
246
  }
@@ -1,69 +1,28 @@
1
- /**
2
- * @desc Configures Fresnel effects for {@link PhongMaterial}s.
3
- *
4
- * Fresnels are attached to {@link PhongMaterial}s, which are attached to {@link Mesh}es.
5
- *
6
- * ## Usage
7
- *
8
- * In the example below we'll create a {@link Mesh} with a {@link PhongMaterial} that applies a Fresnel to its alpha channel to give a glasss-like effect.
9
- *
10
- * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#materials_Fresnel)]
11
- *
12
- * ````javascript
13
- * import {Viewer, Mesh, buildTorusGeometry,
14
- * ReadableGeometry, PhongMaterial, Texture, Fresnel} from "xeokit-sdk.es.js";
15
- *
16
- * const viewer = new Viewer({
17
- * canvasId: "myCanvas",
18
- * transparent: true
19
- * });
20
- *
21
- * viewer.scene.camera.eye = [0, 0, 5];
22
- * viewer.scene.camera.look = [0, 0, 0];
23
- * viewer.scene.camera.up = [0, 1, 0];
24
- *
25
- * new Mesh(viewer.scene, {
26
- * geometry: new ReadableGeometry(viewer.scene, buildTorusGeometry({
27
- * center: [0, 0, 0],
28
- * radius: 1.5,
29
- * tube: 0.5,
30
- * radialSegments: 32,
31
- * tubeSegments: 24,
32
- * arc: Math.PI * 2.0
33
- * }),
34
- * material: new PhongMaterial(viewer.scene, {
35
- * alpha: 0.9,
36
- * alphaMode: "blend",
37
- * ambient: [0.0, 0.0, 0.0],
38
- * shininess: 30,
39
- * diffuseMap: new Texture(viewer.scene, {
40
- * src: "textures/diffuse/uvGrid2.jpg"
41
- * }),
42
- * alphaFresnel: new Fresnel(viewer.scene, {
43
- v edgeBias: 0.2,
44
- * centerBias: 0.8,
45
- * edgeColor: [1.0, 1.0, 1.0],
46
- * centerColor: [0.0, 0.0, 0.0],
47
- * power: 2
48
- * })
49
- * })
50
- * });
51
- * ````
52
- */
1
+ import { Component } from "../Component";
2
+
3
+ export declare type FresnelMaterialConfiguration = {
4
+ /** Optional ID, unique among all components in the parent scene, generated automatically when omitted. */
5
+ id?: string;
6
+ /** Color used on edges. */
7
+ edgeColor?: number[];
8
+ /** Color used on center. */
9
+ centerColor?: number[];
10
+ /** Bias at the edge. */
11
+ edgeBias?: number;
12
+ /** Bias at the center. */
13
+ centerBias?: number;
14
+ /** The power. */
15
+ power?: number;
16
+ }
17
+
53
18
  export declare class Fresnel extends Component {
54
19
  /**
55
20
  * @constructor
56
21
  * @param {Component} owner Owner component. When destroyed, the owner will destroy this Fresnel as well.
57
- * @param {*} [cfg] Configs
58
- * @param {String} [cfg.id] Optional ID, unique among all components in the parent scene, generated automatically when omitted.
59
- * @param {Number[]} [cfg.edgeColor=[ 0.0, 0.0, 0.0 ]] Color used on edges.
60
- * @param {Number[]} [cfg.centerColor=[ 1.0, 1.0, 1.0 ]] Color used on center.
61
- * @param {Number} [cfg.edgeBias=0] Bias at the edge.
62
- * @param {Number} [cfg.centerBias=1] Bias at the center.
63
- * @param {Number} [cfg.power=0] The power.
22
+ * @param {FresnelMaterialConfiguration} [cfg] Configs
64
23
  */
65
- constructor(owner: Component, cfg?: any);
66
- _state: any;
24
+ constructor(owner: Component, cfg?: FresnelMaterialConfiguration);
25
+
67
26
  /**
68
27
  * Sets the Fresnel's edge color.
69
28
  *
@@ -144,5 +103,9 @@ export declare class Fresnel extends Component {
144
103
  * @type {Number}
145
104
  */
146
105
  get power(): number;
106
+
107
+ /**
108
+ * Destroys this Fresnel.
109
+ */
110
+ destroy(): void;
147
111
  }
148
- import { Component } from "../Component";
@@ -0,0 +1,192 @@
1
+ import { Material } from "./Material";
2
+ import { Component } from "../Component";
3
+
4
+ export declare type LambertMaterialConfiguration = {
5
+ /** Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted. */
6
+ id?: string;
7
+ /** Metadata to attach to this LambertMaterial. */
8
+ meta?: any;
9
+ /** LambertMaterial ambient color. */
10
+ ambient?: number[];
11
+ /** LambertMaterial diffuse color. */
12
+ color?: number[];
13
+ /** LambertMaterial emissive color. */
14
+ emissive?: number[];
15
+ /** Scalar in range 0-1 that controls alpha, where 0 is completely transparent and 1 is completely opaque. */
16
+ alpha?: number;
17
+ /** Scalar in range 0-1 that controls how much {@link ReflectionMap} is reflected. */
18
+ reflectivity?: number;
19
+ /** Scalar that controls the width of {@link Geometry} lines. */
20
+ lineWidth: number;
21
+ /** Scalar that controls the size of points for {@link Geometry} with {@link Geometry#primitive} set to "points". */
22
+ pointSize: number;
23
+ /** Whether to render {@link Geometry} backfaces. */
24
+ backfaces: boolean;
25
+ /** The winding order for {@link Geometry} front faces - "cw" for clockwise, or "ccw" for counter-clockwise. */
26
+ frontface: "cw" | "ccw";
27
+ };
28
+
29
+ /**
30
+ * Configures the shape of "lines" geometry primitives.
31
+ */
32
+ export declare class LambertMaterial extends Material {
33
+ /**
34
+ * @constructor
35
+ * @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
36
+ * @param {LambertMaterialConfiguration} [cfg] The LambertMaterial configuration
37
+ */
38
+ constructor(owner: Component, cfg?: LambertMaterialConfiguration);
39
+
40
+ /**
41
+ * Sets the LambertMaterial's ambient color.
42
+ *
43
+ * Default value is ````[0.3, 0.3, 0.3]````.
44
+ *
45
+ * @type {Number[]}
46
+ */
47
+ set ambient(value: number[]);
48
+
49
+ /**
50
+ * Gets the LambertMaterial's ambient color.
51
+ *
52
+ * Default value is ````[0.3, 0.3, 0.3]````.
53
+ *
54
+ * @type {Number[]}
55
+ */
56
+ get ambient(): number[];
57
+
58
+ /**
59
+ * Sets the LambertMaterial's diffuse color.
60
+ *
61
+ * Default value is ````[1.0, 1.0, 1.0]````.
62
+ *
63
+ * @type {Number[]}
64
+ */
65
+ set color(value: number[]);
66
+
67
+ /**
68
+ * Gets the LambertMaterial's diffuse color.
69
+ *
70
+ * Default value is ````[1.0, 1.0, 1.0]````.
71
+ *
72
+ * @type {Number[]}
73
+ */
74
+ get color(): number[];
75
+
76
+ /**
77
+ * Sets the LambertMaterial's emissive color.
78
+ *
79
+ * Default value is ````[0.0, 0.0, 0.0]````.
80
+ *
81
+ * @type {Number[]}
82
+ */
83
+ set emissive(value: number[]);
84
+
85
+ /**
86
+ * Gets the LambertMaterial's emissive color.
87
+ *
88
+ * Default value is ````[0.0, 0.0, 0.0]````.
89
+ *
90
+ * @type {Number[]}
91
+ */
92
+ get emissive(): number[];
93
+
94
+ /**
95
+ * Sets factor in the range ````[0..1]```` indicating how transparent the LambertMaterial is.
96
+ *
97
+ * A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
98
+ *
99
+ * Default value is ````1.0````
100
+ *
101
+ * @type {Number}
102
+ */
103
+ set alpha(value: number);
104
+
105
+ /**
106
+ * Gets factor in the range ````[0..1]```` indicating how transparent the LambertMaterial is.
107
+ *
108
+ * A value of ````0.0```` indicates fully transparent, ````1.0```` is fully opaque.
109
+ *
110
+ * Default value is ````1.0````
111
+ *
112
+ * @type {Number}
113
+ */
114
+ get alpha(): number;
115
+
116
+ /**
117
+ * Sets the LambertMaterial's line width.
118
+ *
119
+ * This is not supported by WebGL implementations based on DirectX [2019].
120
+ *
121
+ * Default value is ````1.0````.
122
+ *
123
+ * @type {Number}
124
+ */
125
+ set lineWidth(value: number);
126
+
127
+ /**
128
+ * Gets the LambertMaterial's line width.
129
+ *
130
+ * This is not supported by WebGL implementations based on DirectX [2019].
131
+ *
132
+ * Default value is ````1.0````.
133
+ *
134
+ * @type {Number}
135
+ */
136
+ get lineWidth(): number;
137
+
138
+ /**
139
+ * Sets the LambertMaterial's point size.
140
+ *
141
+ * Default value is ````1.0````.
142
+ *
143
+ * @type {Number}
144
+ */
145
+ set pointSize(value: number);
146
+
147
+ /**
148
+ * Gets the LambertMaterial's point size.
149
+ *
150
+ * Default value is ````1.0````.
151
+ *
152
+ * @type {Number}
153
+ */
154
+ get pointSize(): number;
155
+
156
+ /**
157
+ * Sets whether backfaces are visible on attached {@link Mesh}es.
158
+ *
159
+ * @type {Boolean}
160
+ */
161
+ set backfaces(value: boolean);
162
+
163
+ /**
164
+ * Gets whether backfaces are visible on attached {@link Mesh}es.
165
+ *
166
+ * @type {Boolean}
167
+ */
168
+ get backfaces(): boolean;
169
+
170
+ /**
171
+ * Sets the winding direction of front faces of {@link Geometry} of attached {@link Mesh}es.
172
+ *
173
+ * Default value is ````"ccw"````.
174
+ *
175
+ * @type {String}
176
+ */
177
+ set frontface(value: "cw" | "ccw");
178
+
179
+ /**
180
+ * Gets the winding direction of front faces of {@link Geometry} of attached {@link Mesh}es.
181
+ *
182
+ * Default value is ````"ccw"````.
183
+ *
184
+ * @type {String}
185
+ */
186
+ get frontface(): "cw" | "ccw";
187
+
188
+ /**
189
+ * Destroys this LambertMaterial.
190
+ */
191
+ destroy(): void;
192
+ }