@xeokit/xeokit-sdk 2.0.20 → 2.1.0-beta.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/xeokit-sdk.cjs.js +152012 -0
- package/dist/xeokit-sdk.es.js +41 -95
- package/dist/xeokit-sdk.min.cjs.js +1 -0
- package/dist/xeokit-sdk.min.es.js +1 -1
- package/package.json +3 -2
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -6454,7 +6454,6 @@ class Queue {
|
|
|
6454
6454
|
|
|
6455
6455
|
/**
|
|
6456
6456
|
* xeokit runtime statistics.
|
|
6457
|
-
* @private
|
|
6458
6457
|
* @type {{components: {models: number, objects: number, scenes: number, meshes: number}, memory: {indices: number, uvs: number, textures: number, materials: number, transforms: number, positions: number, programs: number, normals: number, meshes: number, colors: number}, build: {version: string}, client: {browser: string}, frame: {frameCount: number, useProgram: number, bindTexture: number, drawElements: number, bindArray: number, tasksRun: number, fps: number, drawArrays: number, tasksScheduled: number}}}
|
|
6459
6458
|
*/
|
|
6460
6459
|
const stats = {
|
|
@@ -6947,9 +6946,6 @@ const utils = {
|
|
|
6947
6946
|
flattenParentChildHierarchy: flattenParentChildHierarchy
|
|
6948
6947
|
};
|
|
6949
6948
|
|
|
6950
|
-
let rafEnabled = true;
|
|
6951
|
-
let interval = null;
|
|
6952
|
-
|
|
6953
6949
|
const scenesRenderInfo = {}; // Used for throttling FPS for each Scene
|
|
6954
6950
|
const sceneIDMap = new Map$1(); // Ensures unique scene IDs
|
|
6955
6951
|
const taskQueue = new Queue(); // Task queue, which is pumped on each frame; tasks are pushed to it with calls to xeokit.schedule
|
|
@@ -7017,32 +7013,6 @@ function Core() {
|
|
|
7017
7013
|
});
|
|
7018
7014
|
};
|
|
7019
7015
|
|
|
7020
|
-
/**
|
|
7021
|
-
* @private
|
|
7022
|
-
*/
|
|
7023
|
-
this.setRAFEnabled = function (value) {
|
|
7024
|
-
if (value === rafEnabled) {
|
|
7025
|
-
return;
|
|
7026
|
-
}
|
|
7027
|
-
rafEnabled = value;
|
|
7028
|
-
if (rafEnabled) {
|
|
7029
|
-
if (interval !== null) {
|
|
7030
|
-
clearInterval(interval);
|
|
7031
|
-
interval = null;
|
|
7032
|
-
}
|
|
7033
|
-
(window.requestPostAnimationFrame !== undefined) ? window.requestPostAnimationFrame(frame) : requestAnimationFrame(frame);
|
|
7034
|
-
} else {
|
|
7035
|
-
interval = setInterval(frame, 16);
|
|
7036
|
-
}
|
|
7037
|
-
};
|
|
7038
|
-
|
|
7039
|
-
/**
|
|
7040
|
-
* @private
|
|
7041
|
-
*/
|
|
7042
|
-
this.getRAFEnabled = function () {
|
|
7043
|
-
return rafEnabled;
|
|
7044
|
-
};
|
|
7045
|
-
|
|
7046
7016
|
/**
|
|
7047
7017
|
* @private
|
|
7048
7018
|
*/
|
|
@@ -7125,9 +7095,7 @@ const frame = function () {
|
|
|
7125
7095
|
fireTickEvents(time);
|
|
7126
7096
|
renderScenes();
|
|
7127
7097
|
lastTime = time;
|
|
7128
|
-
|
|
7129
|
-
(window.requestPostAnimationFrame !== undefined) ? window.requestPostAnimationFrame(frame) : requestAnimationFrame(frame);
|
|
7130
|
-
}
|
|
7098
|
+
(window.requestPostAnimationFrame !== undefined) ? window.requestPostAnimationFrame(frame) : requestAnimationFrame(frame);
|
|
7131
7099
|
};
|
|
7132
7100
|
|
|
7133
7101
|
function runTasks(time) { // Process as many enqueued tasks as we can within the per-frame task budget
|
|
@@ -7203,11 +7171,7 @@ function renderScenes() {
|
|
|
7203
7171
|
}
|
|
7204
7172
|
}
|
|
7205
7173
|
|
|
7206
|
-
|
|
7207
|
-
(window.requestPostAnimationFrame !== undefined) ? window.requestPostAnimationFrame(frame) : requestAnimationFrame(frame);
|
|
7208
|
-
} else {
|
|
7209
|
-
interval = setInterval(frame, 16);
|
|
7210
|
-
}
|
|
7174
|
+
(window.requestPostAnimationFrame !== undefined) ? window.requestPostAnimationFrame(frame) : requestAnimationFrame(frame);
|
|
7211
7175
|
|
|
7212
7176
|
/**
|
|
7213
7177
|
* @desc Base class for all xeokit components.
|
|
@@ -15893,30 +15857,29 @@ const Renderer = function (scene, options) {
|
|
|
15893
15857
|
if (renderFlags.edgesTransparent) {
|
|
15894
15858
|
normalEdgesTransparentBin[normalEdgesTransparentBinLen++] = drawable;
|
|
15895
15859
|
}
|
|
15860
|
+
}
|
|
15861
|
+
if (renderFlags.selectedEdgesTransparent) {
|
|
15862
|
+
selectedEdgesTransparentBin[selectedEdgesTransparentBinLen++] = drawable;
|
|
15863
|
+
}
|
|
15896
15864
|
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
if (renderFlags.selectedEdgesOpaque) {
|
|
15902
|
-
selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
|
|
15903
|
-
}
|
|
15865
|
+
if (renderFlags.selectedEdgesOpaque) {
|
|
15866
|
+
selectedEdgesOpaqueBin[selectedEdgesOpaqueBinLen++] = drawable;
|
|
15867
|
+
}
|
|
15904
15868
|
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15869
|
+
if (renderFlags.xrayedEdgesTransparent) {
|
|
15870
|
+
xrayEdgesTransparentBin[xrayEdgesTransparentBinLen++] = drawable;
|
|
15871
|
+
}
|
|
15908
15872
|
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15873
|
+
if (renderFlags.xrayedEdgesOpaque) {
|
|
15874
|
+
xrayEdgesOpaqueBin[xrayEdgesOpaqueBinLen++] = drawable;
|
|
15875
|
+
}
|
|
15912
15876
|
|
|
15913
|
-
|
|
15914
|
-
|
|
15915
|
-
|
|
15877
|
+
if (renderFlags.highlightedEdgesTransparent) {
|
|
15878
|
+
highlightedEdgesTransparentBin[highlightedEdgesTransparentBinLen++] = drawable;
|
|
15879
|
+
}
|
|
15916
15880
|
|
|
15917
|
-
|
|
15918
|
-
|
|
15919
|
-
}
|
|
15881
|
+
if (renderFlags.highlightedEdgesOpaque) {
|
|
15882
|
+
highlightedEdgesOpaqueBin[highlightedEdgesOpaqueBinLen++] = drawable;
|
|
15920
15883
|
}
|
|
15921
15884
|
}
|
|
15922
15885
|
}
|
|
@@ -16085,6 +16048,7 @@ const Renderer = function (scene, options) {
|
|
|
16085
16048
|
|
|
16086
16049
|
frameStats.renderTime = (endTime - startTime) / 1000.0;
|
|
16087
16050
|
frameStats.drawElements = frameCtx.drawElements;
|
|
16051
|
+
frameStats.drawArrays = frameCtx.drawArrays;
|
|
16088
16052
|
frameStats.useProgram = frameCtx.useProgram;
|
|
16089
16053
|
frameStats.bindTexture = frameCtx.bindTexture;
|
|
16090
16054
|
frameStats.bindArray = frameCtx.bindArray;
|
|
@@ -40374,6 +40338,8 @@ class TrianglesBatchingColorRenderer {
|
|
|
40374
40338
|
state.indicesBuf.bind();
|
|
40375
40339
|
|
|
40376
40340
|
gl.drawElements(gl.TRIANGLES, state.indicesBuf.numItems, state.indicesBuf.itemType, 0);
|
|
40341
|
+
|
|
40342
|
+
frameCtx.drawElements++;
|
|
40377
40343
|
}
|
|
40378
40344
|
|
|
40379
40345
|
_allocate() {
|
|
@@ -44381,6 +44347,8 @@ class TrianglesBatchingColorQualityRenderer {
|
|
|
44381
44347
|
state.indicesBuf.bind();
|
|
44382
44348
|
|
|
44383
44349
|
gl.drawElements(gl.TRIANGLES, state.indicesBuf.numItems, state.indicesBuf.itemType, 0);
|
|
44350
|
+
|
|
44351
|
+
frameCtx.drawElements++;
|
|
44384
44352
|
}
|
|
44385
44353
|
|
|
44386
44354
|
_allocate() {
|
|
@@ -47199,6 +47167,8 @@ class TrianglesInstancingColorRenderer {
|
|
|
47199
47167
|
|
|
47200
47168
|
instanceExt.drawElementsInstancedANGLE(gl.TRIANGLES, state.indicesBuf.numItems, state.indicesBuf.itemType, 0, state.numInstances);
|
|
47201
47169
|
|
|
47170
|
+
frameCtx.drawElements++;
|
|
47171
|
+
|
|
47202
47172
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol0.location, 0);
|
|
47203
47173
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol1.location, 0);
|
|
47204
47174
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol2.location, 0);
|
|
@@ -51707,6 +51677,8 @@ class TrianglesInstancingColorQualityRenderer {
|
|
|
51707
51677
|
|
|
51708
51678
|
instanceExt.drawElementsInstancedANGLE(gl.TRIANGLES, state.indicesBuf.numItems, state.indicesBuf.itemType, 0, state.numInstances);
|
|
51709
51679
|
|
|
51680
|
+
frameCtx.drawElements++;
|
|
51681
|
+
|
|
51710
51682
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol0.location, 0);
|
|
51711
51683
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol1.location, 0);
|
|
51712
51684
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol2.location, 0);
|
|
@@ -54259,6 +54231,8 @@ class LinesBatchingColorRenderer {
|
|
|
54259
54231
|
state.indicesBuf.bind();
|
|
54260
54232
|
|
|
54261
54233
|
gl.drawElements(gl.LINES, state.indicesBuf.numItems, state.indicesBuf.itemType, 0);
|
|
54234
|
+
|
|
54235
|
+
frameCtx.drawElements++;
|
|
54262
54236
|
}
|
|
54263
54237
|
|
|
54264
54238
|
_allocate() {
|
|
@@ -55741,6 +55715,8 @@ class LinesInstancingColorRenderer {
|
|
|
55741
55715
|
|
|
55742
55716
|
instanceExt.drawElementsInstancedANGLE(gl.LINES, state.indicesBuf.numItems, state.indicesBuf.itemType, 0, state.numInstances);
|
|
55743
55717
|
|
|
55718
|
+
frameCtx.drawElements++;
|
|
55719
|
+
|
|
55744
55720
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol0.location, 0);
|
|
55745
55721
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol1.location, 0);
|
|
55746
55722
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol2.location, 0);
|
|
@@ -57196,6 +57172,8 @@ class PointsBatchingColorRenderer {
|
|
|
57196
57172
|
gl.uniform1f(this._uNearPlaneHeight, nearPlaneHeight);
|
|
57197
57173
|
|
|
57198
57174
|
gl.drawArrays(gl.POINTS, 0, state.positionsBuf.numItems);
|
|
57175
|
+
|
|
57176
|
+
frameCtx.drawArrays++;
|
|
57199
57177
|
}
|
|
57200
57178
|
|
|
57201
57179
|
_allocate() {
|
|
@@ -59774,6 +59752,8 @@ class PointsInstancingColorRenderer {
|
|
|
59774
59752
|
|
|
59775
59753
|
instanceExt.drawArraysInstancedANGLE(gl.POINTS, 0, state.positionsBuf.numItems, state.numInstances);
|
|
59776
59754
|
|
|
59755
|
+
frameCtx.drawArrays++;
|
|
59756
|
+
|
|
59777
59757
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol0.location, 0);
|
|
59778
59758
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol1.location, 0);
|
|
59779
59759
|
instanceExt.vertexAttribDivisorANGLE(this._aModelMatrixCol2.location, 0);
|
|
@@ -75745,6 +75725,7 @@ class Skybox extends Component {
|
|
|
75745
75725
|
// stationary: true,
|
|
75746
75726
|
visible: false,
|
|
75747
75727
|
pickable: false,
|
|
75728
|
+
clippable: false,
|
|
75748
75729
|
collidable: false
|
|
75749
75730
|
});
|
|
75750
75731
|
|
|
@@ -89751,6 +89732,7 @@ function load(viewer, options, inflatedData, performanceModel) {
|
|
|
89751
89732
|
if (geometryArrays.geometryPositions.length > 1000) ;
|
|
89752
89733
|
if (geometryArrays.batchThisMesh) {
|
|
89753
89734
|
geometryArrays.decompressedPositions = new Float32Array(geometryArrays.geometryPositions.length);
|
|
89735
|
+
geometryArrays.transformedAndRecompressedPositions = new Uint16Array(geometryArrays.geometryPositions.length);
|
|
89754
89736
|
const geometryPositions = geometryArrays.geometryPositions;
|
|
89755
89737
|
const decompressedPositions = geometryArrays.decompressedPositions;
|
|
89756
89738
|
for (let i = 0, len = geometryPositions.length; i < len; i += 3) {
|
|
@@ -89769,7 +89751,7 @@ function load(viewer, options, inflatedData, performanceModel) {
|
|
|
89769
89751
|
if (geometryArrays.batchThisMesh) {
|
|
89770
89752
|
|
|
89771
89753
|
const decompressedPositions = geometryArrays.decompressedPositions;
|
|
89772
|
-
const transformedAndRecompressedPositions =
|
|
89754
|
+
const transformedAndRecompressedPositions = geometryArrays.transformedAndRecompressedPositions;
|
|
89773
89755
|
|
|
89774
89756
|
for (let i = 0, len = decompressedPositions.length; i < len; i += 3) {
|
|
89775
89757
|
tempVec4a$2[0] = decompressedPositions[i + 0];
|
|
@@ -148098,9 +148080,6 @@ class Viewer {
|
|
|
148098
148080
|
*
|
|
148099
148081
|
* That's OK if we know that we're not going to view models that are geographically vast, or offset far from the World coordinate origin.
|
|
148100
148082
|
*
|
|
148101
|
-
* We'll also switch xeokit from using ````window.requestAnimationFrame```` to ````window.setInterval```` for its render loop,
|
|
148102
|
-
* which may give a smoother experience in some cases.
|
|
148103
|
-
*
|
|
148104
148083
|
* [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#Configs_disableDoublePrecisionAndRAF)]
|
|
148105
148084
|
*
|
|
148106
148085
|
* ````javascript
|
|
@@ -148114,11 +148093,6 @@ class Viewer {
|
|
|
148114
148093
|
* // Only set this config once, before you create any Viewers.
|
|
148115
148094
|
* configs.doublePrecisionEnabled = false;
|
|
148116
148095
|
*
|
|
148117
|
-
* // Disable window.requestAnimationFrame (RAF) and use
|
|
148118
|
-
* // window.setInterval for Viewer render loops.
|
|
148119
|
-
* // This config can be switched dynamically, if needed.
|
|
148120
|
-
* configs.rafEnabled = false;
|
|
148121
|
-
*
|
|
148122
148096
|
* // Create a Viewer, to which our configs apply
|
|
148123
148097
|
* const viewer = new Viewer({
|
|
148124
148098
|
* canvasId: "myCanvas"
|
|
@@ -148170,34 +148144,6 @@ class Configs {
|
|
|
148170
148144
|
get doublePrecisionEnabled() {
|
|
148171
148145
|
return math.getDoublePrecisionEnabled();
|
|
148172
148146
|
}
|
|
148173
|
-
|
|
148174
|
-
/**
|
|
148175
|
-
* Sets whether Viewers currently use ````window.requestAnimationFrame```` (RAF) or ````window.setInterval```` for animations.
|
|
148176
|
-
*
|
|
148177
|
-
* With RAF, the render loop is suspended whenever we switch away from the browser tab that
|
|
148178
|
-
* contains our application. With setInterval, the render loop will continue running. Since a Viewer only
|
|
148179
|
-
* renders frames when the view has actually updated, disabling RAF can actually give a performance boost.
|
|
148180
|
-
*
|
|
148181
|
-
* This is ````true```` by default, to use RAF.
|
|
148182
|
-
*
|
|
148183
|
-
* This can be dynamically set at any time.
|
|
148184
|
-
*
|
|
148185
|
-
* @returns {boolean}
|
|
148186
|
-
*/
|
|
148187
|
-
set rafEnabled(rafEnabled) {
|
|
148188
|
-
core.setRAFEnabled(rafEnabled);
|
|
148189
|
-
}
|
|
148190
|
-
|
|
148191
|
-
/**
|
|
148192
|
-
* Gets whether Viewers currently use ````window.requestAnimationFrame```` (RAF) or ````window.setInterval```` for animations.
|
|
148193
|
-
*
|
|
148194
|
-
* @returns {boolean}
|
|
148195
|
-
*/
|
|
148196
|
-
get rafEnabled() {
|
|
148197
|
-
return core.getRAFEnabled();
|
|
148198
|
-
}
|
|
148199
|
-
|
|
148200
|
-
|
|
148201
148147
|
}
|
|
148202
148148
|
|
|
148203
148149
|
const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - smaller size for increasing distance
|
|
@@ -151984,4 +151930,4 @@ class LASLoaderPlugin extends Plugin {
|
|
|
151984
151930
|
}
|
|
151985
151931
|
}
|
|
151986
151932
|
|
|
151987
|
-
export { AmbientLight, AngleMeasurementsPlugin, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, CameraMemento, CameraPath, CameraPathAnimation, Component, Configs, ContextMenu, CubicBezierCurve, Curve, DirLight, DistanceMeasurementsPlugin, EdgeMaterial, EmphasisMaterial, FastNavPlugin, Fresnel, GLTFDefaultDataSource, GLTFLoaderPlugin, IFCLoaderPlugin, ImagePlane, LASLoaderPlugin, LambertMaterial, LightMap, LocaleService, Map$1 as Map, Marker, Mesh, MetallicMaterial, ModelMemento, NavCubePlugin, Node, OBJLoaderPlugin, ObjectsMemento, Path, PerformanceModel, PhongMaterial, Plugin, PointLight, QuadraticBezierCurve, Queue, ReadableGeometry, ReflectionMap, STLDefaultDataSource, STLLoaderPlugin, SectionPlane, SectionPlanesPlugin, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TreeViewPlugin, VBOGeometry, ViewCullPlugin, Viewer, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, buildBoxGeometry, buildBoxLinesGeometry, buildCylinderGeometry, buildGridGeometry, buildPlaneGeometry, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, load3DSGeometry, loadOBJGeometry, math, utils };
|
|
151933
|
+
export { AmbientLight, AngleMeasurementsPlugin, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, CameraMemento, CameraPath, CameraPathAnimation, Component, Configs, ContextMenu, CubicBezierCurve, Curve, DirLight, DistanceMeasurementsPlugin, EdgeMaterial, EmphasisMaterial, FastNavPlugin, Fresnel, GLTFDefaultDataSource, GLTFLoaderPlugin, IFCLoaderPlugin, ImagePlane, LASLoaderPlugin, LambertMaterial, LightMap, LocaleService, Map$1 as Map, Marker, Mesh, MetallicMaterial, ModelMemento, NavCubePlugin, Node, OBJLoaderPlugin, ObjectsMemento, Path, PerformanceModel, PhongMaterial, Plugin, PointLight, QuadraticBezierCurve, Queue, ReadableGeometry, ReflectionMap, STLDefaultDataSource, STLLoaderPlugin, SectionPlane, SectionPlanesPlugin, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TreeViewPlugin, VBOGeometry, ViewCullPlugin, Viewer, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, buildBoxGeometry, buildBoxLinesGeometry, buildCylinderGeometry, buildGridGeometry, buildPlaneGeometry, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, load3DSGeometry, loadOBJGeometry, math, stats, utils };
|