@xeokit/xeokit-sdk 2.6.73 → 2.6.77-slim-rc1
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/xeokit-sdk.cjs.js +246 -126
- package/dist/xeokit-sdk.es.js +246 -126
- package/dist/xeokit-sdk.es5.js +316 -306
- package/dist/xeokit-sdk.min.cjs.js +8 -8
- package/dist/xeokit-sdk.min.es.js +8 -8
- package/dist/xeokit-sdk.min.es5.js +7 -7
- package/package.json +2 -1
- package/src/extras/ContextMenu/ContextMenu.js +25 -16
- package/src/extras/Skybox/Skybox.js +139 -0
- package/src/extras/index.js +2 -1
- package/src/plugins/CxConverterIFCLoaderPlugin/CxConverterIFCLoaderPlugin.js +81 -81
- package/src/plugins/CxConverterIFCLoaderPlugin/index.js +1 -1
- package/src/plugins/FastNavPlugin/FastNavPlugin.js +10 -18
- package/src/plugins/SectionPlanesPlugin/Control.js +1 -1
- package/src/plugins/TreeViewPlugin/RenderService.js +13 -4
- package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +1 -1
- package/src/plugins/index.js +0 -1
- package/src/viewer/Viewer.js +0 -16
- package/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +29 -8
- package/src/viewer/scene/LineSet/LineSet.js +7 -2
- package/src/viewer/scene/camera/CameraFlightAnimation.js +2 -2
- package/src/viewer/scene/canvas/Canvas.js +7 -4
- package/src/viewer/scene/index.js +0 -1
- package/src/viewer/scene/model/dtx/triangles/renderers/DTXTrianglesColorRenderer.js +5 -0
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesColorRenderer.js +5 -0
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesFlatColorRenderer.js +5 -0
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesColorRenderer.js +5 -0
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesFlatColorRenderer.js +5 -0
- package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +5 -0
- package/types/plugins/index.d.ts +0 -1
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +168 -0
- package/types/viewer/scene/LineSet/LineSet.d.ts +1 -1
- package/types/viewer/scene/camera/CameraPath.d.ts +86 -6
- package/types/viewer/scene/camera/CameraPathAnimation.d.ts +2 -0
- package/types/viewer/scene/geometry/ReadableGeometry.d.ts +14 -0
- package/types/viewer/scene/geometry/VBOGeometry.d.ts +2 -0
- package/types/viewer/scene/geometry/index.d.ts +2 -1
- package/types/viewer/scene/geometry/loaders/index.d.ts +2 -0
- package/types/viewer/scene/geometry/loaders/load3DSGeometry.d.ts +17 -0
- package/types/viewer/scene/geometry/loaders/loadOBJGeometry.d.ts +18 -0
- package/types/viewer/scene/index.d.ts +1 -0
- package/types/viewer/scene/input/input.d.ts +117 -0
- package/types/viewer/scene/lights/AmbientLight.d.ts +41 -0
- package/types/viewer/scene/lights/CubeTexture.d.ts +27 -0
- package/types/viewer/scene/lights/DirLight.d.ts +77 -0
- package/types/viewer/scene/lights/LightMap.d.ts +27 -0
- package/types/viewer/scene/lights/PointLight.d.ts +135 -0
- package/types/viewer/scene/lights/ReflectionMap.d.ts +26 -0
- package/types/viewer/scene/lights/index.d.ts +4 -1
- package/types/viewer/scene/marker/Marker.d.ts +5 -0
- package/types/viewer/scene/materials/EmphasisMaterial.d.ts +5 -0
- package/types/viewer/scene/materials/Fresnel.d.ts +25 -62
- package/types/viewer/scene/materials/LambertMaterial.d.ts +192 -0
- package/types/viewer/scene/materials/MetallicMaterial.d.ts +359 -0
- package/types/viewer/scene/materials/PhongMaterial.d.ts +5 -0
- package/types/viewer/scene/materials/PointsMaterial.d.ts +5 -0
- package/types/viewer/scene/materials/SpecularMaterial.d.ts +342 -0
- package/types/viewer/scene/materials/Texture.d.ts +36 -78
- package/types/viewer/scene/materials/index.d.ts +2 -0
- package/types/viewer/scene/models/SceneModel.d.ts +134 -7
- package/types/viewer/scene/models/SceneModelEntity.d.ts +65 -0
- package/types/viewer/scene/models/SceneModelMesh.d.ts +12 -0
- package/types/viewer/scene/paths/CubicBezierCurve.d.ts +146 -0
- package/types/viewer/scene/paths/Curve.d.ts +75 -0
- package/types/viewer/scene/paths/Path.d.ts +119 -0
- package/types/viewer/scene/paths/QuadraticBezierCurve.d.ts +124 -0
- package/types/viewer/scene/paths/SplineCurve.d.ts +84 -0
- package/types/viewer/scene/paths/index.d.ts +5 -0
- package/types/viewer/scene/scene/Scene.d.ts +102 -0
- package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +41 -0
- package/types/viewer/scene/webgl/PickResult.d.ts +19 -0
- package/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +0 -134
- package/src/plugins/SkyboxesPlugin/index.js +0 -1
- package/src/viewer/scene/skybox/Skybox.js +0 -123
- package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +0 -34
- package/types/plugins/SkyboxesPlugin/index.d.ts +0 -1
- /package/src/{viewer/scene/skybox → extras/Skybox}/index.js +0 -0
|
@@ -66,7 +66,7 @@ class LineSet extends Component {
|
|
|
66
66
|
* @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
67
67
|
* @param {Number[]} cfg.positions World-space 3D vertex positions.
|
|
68
68
|
* @param {Number[]} [cfg.indices] Indices to connect ````positions```` into line segments. Note that these are separate line segments, not a polyline.
|
|
69
|
-
* @param {Number[]} [cfg.color=[
|
|
69
|
+
* @param {Number[]} [cfg.color=[1,1,1]] The color of this ````LineSet````. This is both emissive and diffuse.
|
|
70
70
|
* @param {Boolean} [cfg.visible=true] Indicates whether or not this ````LineSet```` is visible.
|
|
71
71
|
* @param {Number} [cfg.opacity=1.0] ````LineSet````'s initial opacity factor.
|
|
72
72
|
*/
|
|
@@ -86,6 +86,9 @@ class LineSet extends Component {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
this._color = cfg.color || [1, 1, 1];
|
|
90
|
+
this._opacity = cfg.opacity || 1.0;
|
|
91
|
+
|
|
89
92
|
this._sceneModel = new SceneModel(this, {
|
|
90
93
|
isModel: false // Don't register in Scene.models
|
|
91
94
|
});
|
|
@@ -94,7 +97,9 @@ class LineSet extends Component {
|
|
|
94
97
|
id: "linesMesh",
|
|
95
98
|
primitive: "lines",
|
|
96
99
|
positions: this._positions,
|
|
97
|
-
indices: this._indices
|
|
100
|
+
indices: this._indices,
|
|
101
|
+
color: this._color,
|
|
102
|
+
opacity: this._opacity,
|
|
98
103
|
})
|
|
99
104
|
|
|
100
105
|
this._sceneModel.createEntity({
|
|
@@ -330,7 +330,7 @@ class CameraFlightAnimation extends Component {
|
|
|
330
330
|
this.fire("started", params, true);
|
|
331
331
|
|
|
332
332
|
this._time1 = Date.now();
|
|
333
|
-
this._time2 = this._time1 + (params.duration ? params.duration * 1000 : this._duration);
|
|
333
|
+
this._time2 = this._time1 + (Number.isFinite(params.duration) ? params.duration * 1000 : this._duration);
|
|
334
334
|
|
|
335
335
|
this._flying = true; // False as soon as we stop
|
|
336
336
|
|
|
@@ -566,7 +566,7 @@ class CameraFlightAnimation extends Component {
|
|
|
566
566
|
* @param {Number} value New duration value.
|
|
567
567
|
*/
|
|
568
568
|
set duration(value) {
|
|
569
|
-
this._duration = value ? (value * 1000.0) : 500;
|
|
569
|
+
this._duration = Number.isFinite(value) ? (value * 1000.0) : 500;
|
|
570
570
|
this.stop();
|
|
571
571
|
}
|
|
572
572
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {Spinner} from './Spinner.js';
|
|
2
|
+
import { Component } from '../Component.js';
|
|
3
|
+
import { math } from '../math/math.js';
|
|
4
|
+
import { Spinner } from './Spinner.js';
|
|
5
5
|
|
|
6
6
|
const WEBGL_CONTEXT_NAMES = [
|
|
7
7
|
"webgl2",
|
|
@@ -482,9 +482,12 @@ class Canvas extends Component {
|
|
|
482
482
|
// Memory leak avoidance
|
|
483
483
|
this.canvas.removeEventListener("webglcontextlost", this._webglcontextlostListener);
|
|
484
484
|
this.canvas.removeEventListener("webglcontextrestored", this._webglcontextrestoredListener);
|
|
485
|
+
|
|
486
|
+
this.gl.getExtension("WEBGL_lose_context").loseContext();
|
|
485
487
|
this.gl = null;
|
|
488
|
+
|
|
486
489
|
super.destroy();
|
|
487
490
|
}
|
|
488
491
|
}
|
|
489
492
|
|
|
490
|
-
export {Canvas};
|
|
493
|
+
export { Canvas };
|
|
@@ -13,7 +13,6 @@ export * from "./nodes/index.js";
|
|
|
13
13
|
export * from "./paths/index.js";
|
|
14
14
|
export * from "./model/index.js";
|
|
15
15
|
export * from "./sectionPlane/index.js";
|
|
16
|
-
export * from "./skybox/index.js";
|
|
17
16
|
export * from "./utils/index.js";
|
|
18
17
|
export * from "./Component.js";
|
|
19
18
|
export * from "./utils.js";
|
|
@@ -601,6 +601,11 @@ export class DTXTrianglesColorRenderer {
|
|
|
601
601
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
602
602
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
603
603
|
//src.push(" gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
604
|
+
} else {
|
|
605
|
+
src.push(" float dx = dFdx(gl_FragCoord.z);")
|
|
606
|
+
src.push(" float dy = dFdy(gl_FragCoord.z);")
|
|
607
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
608
|
+
src.push(" gl_FragDepth = gl_FragCoord.z + diff;");
|
|
604
609
|
}
|
|
605
610
|
|
|
606
611
|
if (this._withSAO) {
|
|
@@ -225,6 +225,11 @@ export class TrianglesColorRenderer extends TrianglesBatchingRenderer {
|
|
|
225
225
|
src.push(" float dy = dFdy(vFragDepth);")
|
|
226
226
|
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
227
227
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
228
|
+
} else {
|
|
229
|
+
src.push(" float dx = dFdx(gl_FragCoord.z);")
|
|
230
|
+
src.push(" float dy = dFdy(gl_FragCoord.z);")
|
|
231
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
232
|
+
src.push(" gl_FragDepth = gl_FragCoord.z + diff;");
|
|
228
233
|
}
|
|
229
234
|
|
|
230
235
|
if (this._withSAO) {
|
package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesFlatColorRenderer.js
CHANGED
|
@@ -233,6 +233,11 @@ export class TrianglesFlatColorRenderer extends TrianglesBatchingRenderer {
|
|
|
233
233
|
|
|
234
234
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
235
235
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
236
|
+
} else {
|
|
237
|
+
src.push(" float dx = dFdx(gl_FragCoord.z);")
|
|
238
|
+
src.push(" float dy = dFdy(gl_FragCoord.z);")
|
|
239
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
240
|
+
src.push(" gl_FragDepth = gl_FragCoord.z + diff;");
|
|
236
241
|
}
|
|
237
242
|
|
|
238
243
|
src.push("}");
|
|
@@ -238,6 +238,11 @@ class TrianglesColorRenderer extends TrianglesInstancingRenderer {
|
|
|
238
238
|
src.push(" float dy = dFdy(vFragDepth);")
|
|
239
239
|
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
240
240
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth + diff ) * logDepthBufFC * 0.5;");
|
|
241
|
+
} else {
|
|
242
|
+
src.push(" float dx = dFdx(gl_FragCoord.z);")
|
|
243
|
+
src.push(" float dy = dFdy(gl_FragCoord.z);")
|
|
244
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
245
|
+
src.push(" gl_FragDepth = gl_FragCoord.z + diff;");
|
|
241
246
|
}
|
|
242
247
|
|
|
243
248
|
// Doing SAO blend in the main solid fill draw shader just so that edge lines can be drawn over the top
|
package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesFlatColorRenderer.js
CHANGED
|
@@ -242,6 +242,11 @@ export class TrianglesFlatColorRenderer extends TrianglesInstancingRenderer {
|
|
|
242
242
|
|
|
243
243
|
if (scene.logarithmicDepthBufferEnabled) {
|
|
244
244
|
src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
|
|
245
|
+
} else {
|
|
246
|
+
src.push(" float dx = dFdx(gl_FragCoord.z);")
|
|
247
|
+
src.push(" float dy = dFdy(gl_FragCoord.z);")
|
|
248
|
+
src.push(" float diff = sqrt(dx*dx+dy*dy);");
|
|
249
|
+
src.push(" gl_FragDepth = gl_FragCoord.z + diff;");
|
|
245
250
|
}
|
|
246
251
|
|
|
247
252
|
src.push("}");
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Plugin } from "../../viewer/Plugin";
|
|
2
2
|
import { Viewer } from "../../viewer/Viewer";
|
|
3
3
|
|
|
4
|
+
type OnStopped = () => void;
|
|
5
|
+
type OnMoved = () => OnStopped;
|
|
6
|
+
|
|
4
7
|
export declare type FastNavPluginConfiguration = {
|
|
5
8
|
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
|
|
6
9
|
id?: string;
|
|
@@ -22,6 +25,8 @@ export declare type FastNavPluginConfiguration = {
|
|
|
22
25
|
delayBeforeRestore?: boolean;
|
|
23
26
|
/** Delay in seconds before restoring normal rendering after we stop interacting with the Viewer. */
|
|
24
27
|
delayBeforeRestoreSeconds?: number;
|
|
28
|
+
/** Optional callback function fired during moving mode, should return the callback function that will be fired when the interaction stops. */
|
|
29
|
+
onMoved?: OnMoved;
|
|
25
30
|
};
|
|
26
31
|
|
|
27
32
|
/**
|
package/types/plugins/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from "./LASLoaderPlugin";
|
|
|
12
12
|
export * from "./NavCubePlugin";
|
|
13
13
|
export * from "./OBJLoaderPlugin";
|
|
14
14
|
export * from "./SectionPlanesPlugin";
|
|
15
|
-
export * from "./SkyboxesPlugin";
|
|
16
15
|
export * from "./STLLoaderPlugin";
|
|
17
16
|
export * from "./StoreyViewsPlugin";
|
|
18
17
|
export * from "./TreeViewPlugin";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component } from "../Component";
|
|
2
2
|
import { Entity } from "../Entity";
|
|
3
|
+
import { Material } from "../materials";
|
|
3
4
|
import { PickResult } from "../webgl/PickResult";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -24,6 +25,9 @@ export declare class CameraControl extends Component {
|
|
|
24
25
|
AXIS_VIEW_FRONT: number;
|
|
25
26
|
AXIS_VIEW_TOP: number;
|
|
26
27
|
AXIS_VIEW_BOTTOM: number;
|
|
28
|
+
MOUSE_PAN: number;
|
|
29
|
+
MOUSE_ROTATE: number;
|
|
30
|
+
MOUSE_DOLLY: number;
|
|
27
31
|
|
|
28
32
|
/**
|
|
29
33
|
* Fires when the model is loaded
|
|
@@ -240,6 +244,65 @@ export declare class CameraControl extends Component {
|
|
|
240
244
|
*/
|
|
241
245
|
get active(): boolean;
|
|
242
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Sets whether the pointer snap to vertex.
|
|
249
|
+
*
|
|
250
|
+
* @param {boolean} arg
|
|
251
|
+
*/
|
|
252
|
+
set snapToVertex(arg: boolean);
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Gets whether the pointer snap to vertex.
|
|
256
|
+
*
|
|
257
|
+
* @returns {boolean}
|
|
258
|
+
*/
|
|
259
|
+
get snapToVertex(): boolean;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Sets whether the pointer snap to edge.
|
|
263
|
+
*
|
|
264
|
+
* @param {boolean} arg
|
|
265
|
+
*/
|
|
266
|
+
set snapToEdge(arg: boolean);
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Gets whether the pointer snap to edge.
|
|
270
|
+
*
|
|
271
|
+
* @returns {boolean}
|
|
272
|
+
*/
|
|
273
|
+
get snapToEdge(): boolean;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Sets the current snap radius for "hoverSnapOrSurface" events, to specify whether the radius
|
|
277
|
+
* within which the pointer snaps to the nearest vertex or the nearest edge.
|
|
278
|
+
*
|
|
279
|
+
* Default value is 30 pixels.
|
|
280
|
+
*
|
|
281
|
+
* @param {Number} arg The snap radius.
|
|
282
|
+
*/
|
|
283
|
+
set snapRadius(arg: number);
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Gets the current snap radius.
|
|
287
|
+
*
|
|
288
|
+
* @returns {Number} The snap radius.
|
|
289
|
+
*/
|
|
290
|
+
get snapRadius(): number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* If `true`, the keyboard shortcuts are enabled ONLY if the mouse is over the canvas.
|
|
294
|
+
*
|
|
295
|
+
* @param {boolean} arg
|
|
296
|
+
*/
|
|
297
|
+
set keyboardEnabledOnlyIfMouseover(arg: boolean);
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Gets whether the keyboard shortcuts are enabled ONLY if the mouse is over the canvas or ALWAYS.
|
|
301
|
+
*
|
|
302
|
+
* @returns {boolean}
|
|
303
|
+
*/
|
|
304
|
+
get keyboardEnabledOnlyIfMouseover(): boolean;
|
|
305
|
+
|
|
243
306
|
/**
|
|
244
307
|
* Sets whether the {@link Camera} follows the mouse/touch pointer.
|
|
245
308
|
*
|
|
@@ -502,6 +565,47 @@ export declare class CameraControl extends Component {
|
|
|
502
565
|
*/
|
|
503
566
|
get panInertia(): number;
|
|
504
567
|
|
|
568
|
+
/**
|
|
569
|
+
* Sets the keyboard layout.
|
|
570
|
+
*
|
|
571
|
+
* Supported layouts are:
|
|
572
|
+
*
|
|
573
|
+
* * ````"qwerty"```` (default)
|
|
574
|
+
* * ````"azerty"````
|
|
575
|
+
*
|
|
576
|
+
* @deprecated
|
|
577
|
+
* @param {String} arg Selects the keyboard layout.
|
|
578
|
+
*/
|
|
579
|
+
set keyboardLayout(arg: string);
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Gets the keyboard layout.
|
|
583
|
+
*
|
|
584
|
+
* Supported layouts are:
|
|
585
|
+
*
|
|
586
|
+
* * ````"qwerty"```` (default)
|
|
587
|
+
* * ````"azerty"````
|
|
588
|
+
*
|
|
589
|
+
* @deprecated
|
|
590
|
+
* @returns {String} The current keyboard layout.
|
|
591
|
+
*/
|
|
592
|
+
get keyboardLayout(): string;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Sets a sphere as the representation of the pivot position.
|
|
596
|
+
*
|
|
597
|
+
* @param {Object} [cfg] Sphere configuration.
|
|
598
|
+
* @param {String} [cfg.size=1] Optional size factor of the sphere. Defaults to 1.
|
|
599
|
+
* @param {String} [cfg.material=PhongMaterial] Optional size factor of the sphere. Defaults to a red opaque material.
|
|
600
|
+
*/
|
|
601
|
+
enablePivotSphere(cfg: {size: number, material: Material}): void;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Remove the sphere as the representation of the pivot position.
|
|
605
|
+
*
|
|
606
|
+
*/
|
|
607
|
+
disablePivotSphere(): void;
|
|
608
|
+
|
|
505
609
|
/**
|
|
506
610
|
* Sets whether mouse and touch input is enabled.
|
|
507
611
|
*
|
|
@@ -646,6 +750,34 @@ export declare class CameraControl extends Component {
|
|
|
646
750
|
*/
|
|
647
751
|
get panToPointer(): boolean;
|
|
648
752
|
|
|
753
|
+
/**
|
|
754
|
+
* Sets whether this ````CameraControl```` is in plan-view mode.
|
|
755
|
+
*
|
|
756
|
+
* When in plan-view mode, rotation is disabled.
|
|
757
|
+
*
|
|
758
|
+
* Default is ````false````.
|
|
759
|
+
*
|
|
760
|
+
* Deprecated - use {@link CameraControl#navMode} instead.
|
|
761
|
+
*
|
|
762
|
+
* @param {Boolean} arg Set ````true```` to enable plan-view mode.
|
|
763
|
+
* @deprecated
|
|
764
|
+
*/
|
|
765
|
+
set planView(arg: boolean);
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Gets whether this ````CameraControl```` is in plan-view mode.
|
|
769
|
+
*
|
|
770
|
+
* When in plan-view mode, rotation is disabled.
|
|
771
|
+
*
|
|
772
|
+
* Default is ````false````.
|
|
773
|
+
*
|
|
774
|
+
* Deprecated - use {@link CameraControl#navMode} instead.
|
|
775
|
+
*
|
|
776
|
+
* @returns {Boolean} Returns ````true```` if plan-view mode is enabled.
|
|
777
|
+
* @deprecated
|
|
778
|
+
*/
|
|
779
|
+
get planView(): boolean;
|
|
780
|
+
|
|
649
781
|
/**
|
|
650
782
|
* Sets whether this ````CameraControl```` is in first-person mode.
|
|
651
783
|
*
|
|
@@ -701,4 +833,40 @@ export declare class CameraControl extends Component {
|
|
|
701
833
|
* @returns {Boolean} Returns ````true```` when pivoting by default about the selected point on the virtual sphere, or ````false```` when pivoting by default about {@link Camera.look}.
|
|
702
834
|
*/
|
|
703
835
|
get smartPivot(): boolean;
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Sets the double click time frame length in milliseconds.
|
|
839
|
+
*
|
|
840
|
+
* If two mouse click events occur within this time frame, it is considered a double click.
|
|
841
|
+
*
|
|
842
|
+
* Default is ````250````
|
|
843
|
+
*
|
|
844
|
+
* @param {Number} arg New double click time frame.
|
|
845
|
+
*/
|
|
846
|
+
set doubleClickTimeFrame(arg: number);
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Gets the double click time frame length in milliseconds.
|
|
850
|
+
*
|
|
851
|
+
* Default is ````250````
|
|
852
|
+
*
|
|
853
|
+
* @returns {Number} Current double click time frame.
|
|
854
|
+
*/
|
|
855
|
+
get doubleClickTimeFrame(): number;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Sets whether to zoom the camera on mouse wheel
|
|
859
|
+
*
|
|
860
|
+
* Default is ````true````
|
|
861
|
+
*
|
|
862
|
+
* @param {Boolean} arg
|
|
863
|
+
*/
|
|
864
|
+
set zoomOnMouseWheel(arg: boolean);
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* Gets whether to zoom the camera on mouse wheel
|
|
868
|
+
*
|
|
869
|
+
* @returns {Boolean}
|
|
870
|
+
*/
|
|
871
|
+
get zoomOnMouseWheel(): boolean;
|
|
704
872
|
}
|
|
@@ -66,7 +66,7 @@ export declare class LineSet extends Component {
|
|
|
66
66
|
* @param {string} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
67
67
|
* @param {number[]} cfg.positions World-space 3D vertex positions.
|
|
68
68
|
* @param {number[]} [cfg.indices] Indices to connect ````positions```` into line segments. Note that these are separate line segments, not a polyline.
|
|
69
|
-
* @param {number[]} [cfg.color=[
|
|
69
|
+
* @param {number[]} [cfg.color=[1,1,1]] The color of this ````LineSet````. This is both emissive and diffuse.
|
|
70
70
|
* @param {boolean} [cfg.visible=true] Indicates whether or not this ````LineSet```` is visible.
|
|
71
71
|
* @param {number} [cfg.opacity=1.0] ````LineSet````'s initial opacity factor.
|
|
72
72
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component } from "../Component";
|
|
2
|
+
import { SplineCurve } from '../paths/SplineCurve';
|
|
2
3
|
|
|
3
4
|
export declare type Frame = {
|
|
4
5
|
t: number;
|
|
@@ -19,10 +20,89 @@ export declare type CameraPathConfiguration = {
|
|
|
19
20
|
*
|
|
20
21
|
*/
|
|
21
22
|
export declare class CameraPath extends Component {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @constructor
|
|
25
|
+
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CameraPath as well.
|
|
26
|
+
* @param {CameraPathConfiguration} [cfg] Configuration
|
|
27
|
+
*/
|
|
28
|
+
constructor(owner?: Component, cfg?: CameraPathConfiguration);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Gets the camera frames in this CameraPath.
|
|
32
|
+
*
|
|
33
|
+
* @returns {{t:Number, eye:Object, look:Object, up: Object}[]} The frames on this CameraPath.
|
|
34
|
+
*/
|
|
35
|
+
get frames(): Frame[];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Gets the {@link SplineCurve} along which {@link Camera#eye} travels.
|
|
39
|
+
* @returns {SplineCurve} The SplineCurve for {@link Camera#eye}.
|
|
40
|
+
*/
|
|
41
|
+
get eyeCurve(): SplineCurve;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the {@link SplineCurve} along which {@link Camera#look} travels.
|
|
45
|
+
* @returns {SplineCurve} The SplineCurve for {@link Camera#look}.
|
|
46
|
+
*/
|
|
47
|
+
get lookCurve(): SplineCurve;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets the {@link SplineCurve} along which {@link Camera#up} travels.
|
|
51
|
+
* @returns {SplineCurve} The SplineCurve for {@link Camera#up}.
|
|
52
|
+
*/
|
|
53
|
+
get upCurve(): SplineCurve;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Adds a frame to this CameraPath, given as the current position of the {@link Camera}.
|
|
57
|
+
*
|
|
58
|
+
* @param {Number} t Time instant for the new frame.
|
|
59
|
+
*/
|
|
60
|
+
saveFrame(t: number): void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Adds a frame to this CameraPath, specified as values for eye, look and up vectors at a given time instant.
|
|
64
|
+
*
|
|
65
|
+
* @param {Number} t Time instant for the new frame.
|
|
66
|
+
* @param {Number[]} eye A three-element vector specifying the eye position for the new frame.
|
|
67
|
+
* @param {Number[]} look A three-element vector specifying the look position for the new frame.
|
|
68
|
+
* @param {Number[]} up A three-element vector specifying the up vector for the new frame.
|
|
69
|
+
*/
|
|
70
|
+
addFrame(t: number, eye: number, look: number[], up: number[]): void;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Adds multiple frames to this CameraPath, each frame specified as a set of values for eye, look and up vectors at a given time instant.
|
|
74
|
+
*
|
|
75
|
+
* @param {{t:Number, eye:Object, look:Object, up: Object}[]} frames Frames to add to this CameraPath.
|
|
76
|
+
*/
|
|
77
|
+
addFrames(frames: Frame[]): void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Sets the position of the {@link Camera} to a position interpolated within this CameraPath at the given time instant.
|
|
81
|
+
*
|
|
82
|
+
* @param {Number} t Time instant.
|
|
83
|
+
*/
|
|
84
|
+
loadFrame(t: number): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Gets eye, look and up vectors on this CameraPath at a given instant.
|
|
88
|
+
*
|
|
89
|
+
* @param {Number} t Time instant.
|
|
90
|
+
* @param {Number[]} eye The eye position to update.
|
|
91
|
+
* @param {Number[]} look The look position to update.
|
|
92
|
+
* @param {Number[]} up The up vector to update.
|
|
93
|
+
*/
|
|
94
|
+
sampleFrame(t: number, eye: number[], look: number[], up: number[]): void;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Given a total duration (in seconds) for this CameraPath, recomputes the time instant at each frame so that,
|
|
98
|
+
* when animated by {@link CameraPathAnimation}, the {@link Camera} will move along the path at a constant rate.
|
|
99
|
+
*
|
|
100
|
+
* @param {Number} duration The total duration for this CameraPath.
|
|
101
|
+
*/
|
|
102
|
+
smoothFrameTimes(duration: number): void;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Removes all frames from this CameraPath.
|
|
106
|
+
*/
|
|
107
|
+
clearFrames(): void;
|
|
28
108
|
}
|
|
@@ -88,8 +88,22 @@ export declare class ReadableGeometry extends Geometry {
|
|
|
88
88
|
*/
|
|
89
89
|
get obb(): number[];
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Returns the surface area of this Mesh.
|
|
93
|
+
* @returns {number}
|
|
94
|
+
*/
|
|
95
|
+
get surfaceArea(): number;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns the centroid of this Mesh.
|
|
99
|
+
* @returns {number}
|
|
100
|
+
*/
|
|
101
|
+
get centroid(): number;
|
|
102
|
+
|
|
91
103
|
/**
|
|
92
104
|
* Approximate number of triangles in this ReadableGeometry.
|
|
93
105
|
*/
|
|
94
106
|
get numTriangles(): number;
|
|
107
|
+
|
|
108
|
+
destroy(): void;
|
|
95
109
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {Scene} from '../../scene/Scene';
|
|
2
|
+
|
|
3
|
+
export declare type load3DSGeometryConfiguration = {
|
|
4
|
+
/** Path to 3DS file. */
|
|
5
|
+
src?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare type Geometry3DSData = {
|
|
9
|
+
src?: string;
|
|
10
|
+
primitive: string;
|
|
11
|
+
positions: number[];
|
|
12
|
+
normals: number[] | null;
|
|
13
|
+
uv: number[];
|
|
14
|
+
indices: number[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function load3DSGeometry(scene: Scene, cfg?: load3DSGeometryConfiguration) : Promise<Geometry3DSData>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {Scene} from '../../scene/Scene';
|
|
2
|
+
|
|
3
|
+
export declare type LoadObjGeometryConfiguration = {
|
|
4
|
+
/** Path to OBJ file. */
|
|
5
|
+
src?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare type ObjGeometryData = {
|
|
9
|
+
src?: string;
|
|
10
|
+
primitive: string;
|
|
11
|
+
positions: number[];
|
|
12
|
+
normals: number[] | null;
|
|
13
|
+
autoNormals: number[] | null;
|
|
14
|
+
uv: number[];
|
|
15
|
+
indices: number[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function loadOBJGeometry(scene: Scene, cfg?: LoadObjGeometryConfiguration) : Promise<ObjGeometryData>;
|