@xeokit/xeokit-sdk 2.4.2-beta-44 → 2.4.2-beta-46
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 +142 -89
- package/dist/xeokit-sdk.es.js +142 -89
- package/dist/xeokit-sdk.es5.js +82 -67
- package/dist/xeokit-sdk.min.cjs.js +5 -5
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/viewer/Configs.js +49 -0
- package/src/viewer/scene/mesh/emphasis/EmphasisEdgesShaderSource.js +2 -1
- package/src/viewer/scene/mesh/emphasis/EmphasisFillShaderSource.js +2 -1
- package/src/viewer/scene/mesh/occlusion/OcclusionShaderSource.js +2 -1
- package/src/viewer/scene/mesh/pick/PickMeshShaderSource.js +2 -1
- package/src/viewer/scene/mesh/pick/PickTriangleShaderSource.js +2 -1
- package/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js +4 -1
- package/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingBuffer.js +7 -8
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -33273,7 +33273,8 @@ function buildVertex$5(mesh) {
|
|
|
33273
33273
|
const scene = mesh.scene;
|
|
33274
33274
|
const lightsState = scene._lightsState;
|
|
33275
33275
|
const normals = hasNormals(mesh);
|
|
33276
|
-
const
|
|
33276
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
33277
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
33277
33278
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
33278
33279
|
const billboard = mesh._state.billboard;
|
|
33279
33280
|
const stationary = mesh._state.stationary;
|
|
@@ -33803,7 +33804,8 @@ class EmphasisEdgesShaderSource {
|
|
|
33803
33804
|
|
|
33804
33805
|
function buildVertex$4(mesh) {
|
|
33805
33806
|
const scene = mesh.scene;
|
|
33806
|
-
const
|
|
33807
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
33808
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
33807
33809
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
33808
33810
|
const billboard = mesh._state.billboard;
|
|
33809
33811
|
const stationary = mesh._state.stationary;
|
|
@@ -34213,7 +34215,8 @@ class PickMeshShaderSource {
|
|
|
34213
34215
|
|
|
34214
34216
|
function buildVertex$3(mesh) {
|
|
34215
34217
|
const scene = mesh.scene;
|
|
34216
|
-
const
|
|
34218
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
34219
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
34217
34220
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
34218
34221
|
const billboard = mesh._state.billboard;
|
|
34219
34222
|
const stationary = mesh._state.stationary;
|
|
@@ -34575,7 +34578,8 @@ class PickTriangleShaderSource {
|
|
|
34575
34578
|
|
|
34576
34579
|
function buildVertex$2(mesh) {
|
|
34577
34580
|
const scene = mesh.scene;
|
|
34578
|
-
const
|
|
34581
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
34582
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
34579
34583
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
34580
34584
|
const src = [];
|
|
34581
34585
|
src.push('#version 300 es');
|
|
@@ -34890,7 +34894,8 @@ class OcclusionShaderSource {
|
|
|
34890
34894
|
|
|
34891
34895
|
function buildVertex$1(mesh) {
|
|
34892
34896
|
const scene = mesh.scene;
|
|
34893
|
-
const
|
|
34897
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
34898
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
34894
34899
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
34895
34900
|
const billboard = mesh._state.billboard;
|
|
34896
34901
|
const stationary = mesh._state.stationary;
|
|
@@ -60470,19 +60475,141 @@ function getBatchingRenderers$1(scene) {
|
|
|
60470
60475
|
return batchingRenderers;
|
|
60471
60476
|
}
|
|
60472
60477
|
|
|
60478
|
+
let maxDataTextureHeight = 1 << 16;
|
|
60479
|
+
let maxGeometryBatchSize = 4096;
|
|
60480
|
+
|
|
60473
60481
|
/**
|
|
60474
|
-
* @
|
|
60482
|
+
* Manages global configurations for all {@link Viewer}s.
|
|
60483
|
+
*
|
|
60484
|
+
* ## Example
|
|
60485
|
+
*
|
|
60486
|
+
* In the example below, we'll disable xeokit's double-precision support, which gives a performance and memory boost
|
|
60487
|
+
* on low-power devices, but also means that we can no longer render double-precision models without jittering.
|
|
60488
|
+
*
|
|
60489
|
+
* 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.
|
|
60490
|
+
*
|
|
60491
|
+
* [[Run this example](/examples/#Configs_disableDoublePrecisionAndRAF)]
|
|
60492
|
+
*
|
|
60493
|
+
* ````javascript
|
|
60494
|
+
* import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
|
|
60495
|
+
*
|
|
60496
|
+
* // Access xeoit-sdk global configs.
|
|
60497
|
+
* // We typically set configs only before we create any Viewers.
|
|
60498
|
+
* const configs = new Configs();
|
|
60499
|
+
*
|
|
60500
|
+
* // Disable 64-bit precision for extra speed.
|
|
60501
|
+
* // Only set this config once, before you create any Viewers.
|
|
60502
|
+
* configs.doublePrecisionEnabled = false;
|
|
60503
|
+
*
|
|
60504
|
+
* // Create a Viewer, to which our configs apply
|
|
60505
|
+
* const viewer = new Viewer({
|
|
60506
|
+
* canvasId: "myCanvas"
|
|
60507
|
+
* });
|
|
60508
|
+
*
|
|
60509
|
+
* viewer.camera.eye = [-3.933, 2.855, 27.018];
|
|
60510
|
+
* viewer.camera.look = [4.400, 3.724, 8.899];
|
|
60511
|
+
* viewer.camera.up = [-0.018, 0.999, 0.039];
|
|
60512
|
+
*
|
|
60513
|
+
* const xktLoader = new XKTLoaderPlugin(viewer);
|
|
60514
|
+
*
|
|
60515
|
+
* const model = xktLoader.load({
|
|
60516
|
+
* src: "../assets/models/xkt/v8/ifc/Duplex.ifc.xkt"
|
|
60517
|
+
* });
|
|
60518
|
+
* ````
|
|
60475
60519
|
*/
|
|
60476
|
-
class
|
|
60520
|
+
class Configs {
|
|
60477
60521
|
|
|
60478
|
-
|
|
60522
|
+
/**
|
|
60523
|
+
* Creates a Configs.
|
|
60524
|
+
*/
|
|
60525
|
+
constructor() {
|
|
60479
60526
|
|
|
60480
|
-
|
|
60481
|
-
|
|
60527
|
+
}
|
|
60528
|
+
|
|
60529
|
+
/**
|
|
60530
|
+
* Sets whether double precision mode is enabled for Viewers.
|
|
60531
|
+
*
|
|
60532
|
+
* When double precision mode is enabled (default), Viewers will accurately render models that contain
|
|
60533
|
+
* double-precision coordinates, without jittering.
|
|
60534
|
+
*
|
|
60535
|
+
* Internally, double precision incurs extra performance and memory overhead, so if we're certain that
|
|
60536
|
+
* we're not going to render models that rely on double-precision coordinates, then it's a good idea to disable
|
|
60537
|
+
* it, especially on low-power devices.
|
|
60538
|
+
*
|
|
60539
|
+
* This should only be set once, before creating any Viewers.
|
|
60540
|
+
*
|
|
60541
|
+
* @returns {Boolean}
|
|
60542
|
+
*/
|
|
60543
|
+
set doublePrecisionEnabled(doublePrecision) {
|
|
60544
|
+
math.setDoublePrecisionEnabled(doublePrecision);
|
|
60545
|
+
}
|
|
60546
|
+
|
|
60547
|
+
/**
|
|
60548
|
+
* Gets whether double precision mode is enabled for all Viewers.
|
|
60549
|
+
*
|
|
60550
|
+
* @returns {Boolean}
|
|
60551
|
+
*/
|
|
60552
|
+
get doublePrecisionEnabled() {
|
|
60553
|
+
return math.getDoublePrecisionEnabled();
|
|
60554
|
+
}
|
|
60555
|
+
|
|
60556
|
+
/**
|
|
60557
|
+
* Sets the maximum data texture height.
|
|
60558
|
+
*
|
|
60559
|
+
* Should be a multiple of 1024. Default is 4096, which is the maximum allowed value.
|
|
60560
|
+
*/
|
|
60561
|
+
set maxDataTextureHeight(value) {
|
|
60562
|
+
value = Math.ceil(value / 1024) * 1024;
|
|
60563
|
+
if (value > 4096) {
|
|
60564
|
+
value = 4096;
|
|
60565
|
+
} else if (value < 1024) {
|
|
60566
|
+
value = 1024;
|
|
60482
60567
|
}
|
|
60568
|
+
maxDataTextureHeight = value;
|
|
60569
|
+
}
|
|
60483
60570
|
|
|
60484
|
-
|
|
60485
|
-
|
|
60571
|
+
/**
|
|
60572
|
+
* Sets maximum data texture height.
|
|
60573
|
+
* @returns {*|number}
|
|
60574
|
+
*/
|
|
60575
|
+
get maxDataTextureHeight() {
|
|
60576
|
+
return maxDataTextureHeight;
|
|
60577
|
+
}
|
|
60578
|
+
|
|
60579
|
+
/**
|
|
60580
|
+
* Sets the maximum batched geometry VBO size.
|
|
60581
|
+
*
|
|
60582
|
+
* Default value is 5000000, which is the maximum size.
|
|
60583
|
+
*
|
|
60584
|
+
* Minimum size is 100000.
|
|
60585
|
+
*/
|
|
60586
|
+
set maxGeometryBatchSize(value) {
|
|
60587
|
+
if (value < 100000) {
|
|
60588
|
+
value = 100000;
|
|
60589
|
+
} else if (value > 5000000) {
|
|
60590
|
+
value = 5000000;
|
|
60591
|
+
}
|
|
60592
|
+
maxGeometryBatchSize = value;
|
|
60593
|
+
}
|
|
60594
|
+
|
|
60595
|
+
/**
|
|
60596
|
+
* Gets the maximum batched geometry VBO size.
|
|
60597
|
+
*/
|
|
60598
|
+
get maxGeometryBatchSize() {
|
|
60599
|
+
return maxGeometryBatchSize;
|
|
60600
|
+
}
|
|
60601
|
+
}
|
|
60602
|
+
|
|
60603
|
+
const configs$1 = new Configs();
|
|
60604
|
+
|
|
60605
|
+
/**
|
|
60606
|
+
* @private
|
|
60607
|
+
*/
|
|
60608
|
+
class TrianglesBatchingBuffer {
|
|
60609
|
+
|
|
60610
|
+
constructor() {
|
|
60611
|
+
this.maxVerts = configs$1.maxGeometryBatchSize;
|
|
60612
|
+
this.maxIndices = configs$1.maxGeometryBatchSize * 3; // Rough rule-of-thumb
|
|
60486
60613
|
this.positions = [];
|
|
60487
60614
|
this.colors = [];
|
|
60488
60615
|
this.uv = [];
|
|
@@ -81121,6 +81248,8 @@ class DataTextureGenerator {
|
|
|
81121
81248
|
}
|
|
81122
81249
|
}
|
|
81123
81250
|
|
|
81251
|
+
const configs = new Configs();
|
|
81252
|
+
|
|
81124
81253
|
/**
|
|
81125
81254
|
* 12-bits allowed for object ids.
|
|
81126
81255
|
* Limits the per-object texture height in the layer.
|
|
@@ -81131,7 +81260,7 @@ const MAX_NUMBER_OF_OBJECTS_IN_LAYER = (1 << 16);
|
|
|
81131
81260
|
* 4096 is max data texture height.
|
|
81132
81261
|
* Limits the aggregated geometry texture height in the layer.
|
|
81133
81262
|
*/
|
|
81134
|
-
const MAX_DATA_TEXTURE_HEIGHT =
|
|
81263
|
+
const MAX_DATA_TEXTURE_HEIGHT = configs.maxDataTextureHeight;
|
|
81135
81264
|
|
|
81136
81265
|
/**
|
|
81137
81266
|
* Align `indices` and `edgeIndices` memory layout to 8 elements.
|
|
@@ -100726,82 +100855,6 @@ class Viewer {
|
|
|
100726
100855
|
}
|
|
100727
100856
|
}
|
|
100728
100857
|
|
|
100729
|
-
/**
|
|
100730
|
-
* Manages global configurations for all {@link Viewer}s.
|
|
100731
|
-
*
|
|
100732
|
-
* ## Example
|
|
100733
|
-
*
|
|
100734
|
-
* In the example below, we'll disable xeokit's double-precision support, which gives a performance and memory boost
|
|
100735
|
-
* on low-power devices, but also means that we can no longer render double-precision models without jittering.
|
|
100736
|
-
*
|
|
100737
|
-
* 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.
|
|
100738
|
-
*
|
|
100739
|
-
* [[Run this example](/examples/#Configs_disableDoublePrecisionAndRAF)]
|
|
100740
|
-
*
|
|
100741
|
-
* ````javascript
|
|
100742
|
-
* import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
|
|
100743
|
-
*
|
|
100744
|
-
* // Access xeoit-sdk global configs.
|
|
100745
|
-
* // We typically set configs only before we create any Viewers.
|
|
100746
|
-
* const configs = new Configs();
|
|
100747
|
-
*
|
|
100748
|
-
* // Disable 64-bit precision for extra speed.
|
|
100749
|
-
* // Only set this config once, before you create any Viewers.
|
|
100750
|
-
* configs.doublePrecisionEnabled = false;
|
|
100751
|
-
*
|
|
100752
|
-
* // Create a Viewer, to which our configs apply
|
|
100753
|
-
* const viewer = new Viewer({
|
|
100754
|
-
* canvasId: "myCanvas"
|
|
100755
|
-
* });
|
|
100756
|
-
*
|
|
100757
|
-
* viewer.camera.eye = [-3.933, 2.855, 27.018];
|
|
100758
|
-
* viewer.camera.look = [4.400, 3.724, 8.899];
|
|
100759
|
-
* viewer.camera.up = [-0.018, 0.999, 0.039];
|
|
100760
|
-
*
|
|
100761
|
-
* const xktLoader = new XKTLoaderPlugin(viewer);
|
|
100762
|
-
*
|
|
100763
|
-
* const model = xktLoader.load({
|
|
100764
|
-
* src: "../assets/models/xkt/v8/ifc/Duplex.ifc.xkt"
|
|
100765
|
-
* });
|
|
100766
|
-
* ````
|
|
100767
|
-
*/
|
|
100768
|
-
class Configs {
|
|
100769
|
-
|
|
100770
|
-
/**
|
|
100771
|
-
* Creates a Configs.
|
|
100772
|
-
*/
|
|
100773
|
-
constructor() {
|
|
100774
|
-
|
|
100775
|
-
}
|
|
100776
|
-
|
|
100777
|
-
/**
|
|
100778
|
-
* Sets whether double precision mode is enabled for Viewers.
|
|
100779
|
-
*
|
|
100780
|
-
* When double precision mode is enabled (default), Viewers will accurately render models that contain
|
|
100781
|
-
* double-precision coordinates, without jittering.
|
|
100782
|
-
*
|
|
100783
|
-
* Internally, double precision incurs extra performance and memory overhead, so if we're certain that
|
|
100784
|
-
* we're not going to render models that rely on double-precision coordinates, then it's a good idea to disable
|
|
100785
|
-
* it, especially on low-power devices.
|
|
100786
|
-
*
|
|
100787
|
-
* This should only be set once, before creating any Viewers.
|
|
100788
|
-
*
|
|
100789
|
-
* @returns {Boolean}
|
|
100790
|
-
*/
|
|
100791
|
-
set doublePrecisionEnabled(doublePrecision) {
|
|
100792
|
-
math.setDoublePrecisionEnabled(doublePrecision);
|
|
100793
|
-
}
|
|
100794
|
-
|
|
100795
|
-
/**
|
|
100796
|
-
* Gets whether double precision mode is enabled for all Viewers.
|
|
100797
|
-
*
|
|
100798
|
-
* @returns {Boolean}
|
|
100799
|
-
*/
|
|
100800
|
-
get doublePrecisionEnabled() {
|
|
100801
|
-
return math.getDoublePrecisionEnabled();
|
|
100802
|
-
}
|
|
100803
|
-
}
|
|
100804
|
-
|
|
100805
100858
|
function assert$5(condition, message) {
|
|
100806
100859
|
if (!condition) {
|
|
100807
100860
|
throw new Error(message || 'loader assertion failed.');
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -33269,7 +33269,8 @@ function buildVertex$5(mesh) {
|
|
|
33269
33269
|
const scene = mesh.scene;
|
|
33270
33270
|
const lightsState = scene._lightsState;
|
|
33271
33271
|
const normals = hasNormals(mesh);
|
|
33272
|
-
const
|
|
33272
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
33273
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
33273
33274
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
33274
33275
|
const billboard = mesh._state.billboard;
|
|
33275
33276
|
const stationary = mesh._state.stationary;
|
|
@@ -33799,7 +33800,8 @@ class EmphasisEdgesShaderSource {
|
|
|
33799
33800
|
|
|
33800
33801
|
function buildVertex$4(mesh) {
|
|
33801
33802
|
const scene = mesh.scene;
|
|
33802
|
-
const
|
|
33803
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
33804
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
33803
33805
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
33804
33806
|
const billboard = mesh._state.billboard;
|
|
33805
33807
|
const stationary = mesh._state.stationary;
|
|
@@ -34209,7 +34211,8 @@ class PickMeshShaderSource {
|
|
|
34209
34211
|
|
|
34210
34212
|
function buildVertex$3(mesh) {
|
|
34211
34213
|
const scene = mesh.scene;
|
|
34212
|
-
const
|
|
34214
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
34215
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
34213
34216
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
34214
34217
|
const billboard = mesh._state.billboard;
|
|
34215
34218
|
const stationary = mesh._state.stationary;
|
|
@@ -34571,7 +34574,8 @@ class PickTriangleShaderSource {
|
|
|
34571
34574
|
|
|
34572
34575
|
function buildVertex$2(mesh) {
|
|
34573
34576
|
const scene = mesh.scene;
|
|
34574
|
-
const
|
|
34577
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
34578
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
34575
34579
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
34576
34580
|
const src = [];
|
|
34577
34581
|
src.push('#version 300 es');
|
|
@@ -34886,7 +34890,8 @@ class OcclusionShaderSource {
|
|
|
34886
34890
|
|
|
34887
34891
|
function buildVertex$1(mesh) {
|
|
34888
34892
|
const scene = mesh.scene;
|
|
34889
|
-
const
|
|
34893
|
+
const sectionPlanesState = scene._sectionPlanesState;
|
|
34894
|
+
const clipping = sectionPlanesState.getNumAllocatedSectionPlanes() > 0;
|
|
34890
34895
|
const quantizedGeometry = !!mesh._geometry._state.compressGeometry;
|
|
34891
34896
|
const billboard = mesh._state.billboard;
|
|
34892
34897
|
const stationary = mesh._state.stationary;
|
|
@@ -60466,19 +60471,141 @@ function getBatchingRenderers$1(scene) {
|
|
|
60466
60471
|
return batchingRenderers;
|
|
60467
60472
|
}
|
|
60468
60473
|
|
|
60474
|
+
let maxDataTextureHeight = 1 << 16;
|
|
60475
|
+
let maxGeometryBatchSize = 4096;
|
|
60476
|
+
|
|
60469
60477
|
/**
|
|
60470
|
-
* @
|
|
60478
|
+
* Manages global configurations for all {@link Viewer}s.
|
|
60479
|
+
*
|
|
60480
|
+
* ## Example
|
|
60481
|
+
*
|
|
60482
|
+
* In the example below, we'll disable xeokit's double-precision support, which gives a performance and memory boost
|
|
60483
|
+
* on low-power devices, but also means that we can no longer render double-precision models without jittering.
|
|
60484
|
+
*
|
|
60485
|
+
* 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.
|
|
60486
|
+
*
|
|
60487
|
+
* [[Run this example](/examples/#Configs_disableDoublePrecisionAndRAF)]
|
|
60488
|
+
*
|
|
60489
|
+
* ````javascript
|
|
60490
|
+
* import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
|
|
60491
|
+
*
|
|
60492
|
+
* // Access xeoit-sdk global configs.
|
|
60493
|
+
* // We typically set configs only before we create any Viewers.
|
|
60494
|
+
* const configs = new Configs();
|
|
60495
|
+
*
|
|
60496
|
+
* // Disable 64-bit precision for extra speed.
|
|
60497
|
+
* // Only set this config once, before you create any Viewers.
|
|
60498
|
+
* configs.doublePrecisionEnabled = false;
|
|
60499
|
+
*
|
|
60500
|
+
* // Create a Viewer, to which our configs apply
|
|
60501
|
+
* const viewer = new Viewer({
|
|
60502
|
+
* canvasId: "myCanvas"
|
|
60503
|
+
* });
|
|
60504
|
+
*
|
|
60505
|
+
* viewer.camera.eye = [-3.933, 2.855, 27.018];
|
|
60506
|
+
* viewer.camera.look = [4.400, 3.724, 8.899];
|
|
60507
|
+
* viewer.camera.up = [-0.018, 0.999, 0.039];
|
|
60508
|
+
*
|
|
60509
|
+
* const xktLoader = new XKTLoaderPlugin(viewer);
|
|
60510
|
+
*
|
|
60511
|
+
* const model = xktLoader.load({
|
|
60512
|
+
* src: "../assets/models/xkt/v8/ifc/Duplex.ifc.xkt"
|
|
60513
|
+
* });
|
|
60514
|
+
* ````
|
|
60471
60515
|
*/
|
|
60472
|
-
class
|
|
60516
|
+
class Configs {
|
|
60473
60517
|
|
|
60474
|
-
|
|
60518
|
+
/**
|
|
60519
|
+
* Creates a Configs.
|
|
60520
|
+
*/
|
|
60521
|
+
constructor() {
|
|
60475
60522
|
|
|
60476
|
-
|
|
60477
|
-
|
|
60523
|
+
}
|
|
60524
|
+
|
|
60525
|
+
/**
|
|
60526
|
+
* Sets whether double precision mode is enabled for Viewers.
|
|
60527
|
+
*
|
|
60528
|
+
* When double precision mode is enabled (default), Viewers will accurately render models that contain
|
|
60529
|
+
* double-precision coordinates, without jittering.
|
|
60530
|
+
*
|
|
60531
|
+
* Internally, double precision incurs extra performance and memory overhead, so if we're certain that
|
|
60532
|
+
* we're not going to render models that rely on double-precision coordinates, then it's a good idea to disable
|
|
60533
|
+
* it, especially on low-power devices.
|
|
60534
|
+
*
|
|
60535
|
+
* This should only be set once, before creating any Viewers.
|
|
60536
|
+
*
|
|
60537
|
+
* @returns {Boolean}
|
|
60538
|
+
*/
|
|
60539
|
+
set doublePrecisionEnabled(doublePrecision) {
|
|
60540
|
+
math.setDoublePrecisionEnabled(doublePrecision);
|
|
60541
|
+
}
|
|
60542
|
+
|
|
60543
|
+
/**
|
|
60544
|
+
* Gets whether double precision mode is enabled for all Viewers.
|
|
60545
|
+
*
|
|
60546
|
+
* @returns {Boolean}
|
|
60547
|
+
*/
|
|
60548
|
+
get doublePrecisionEnabled() {
|
|
60549
|
+
return math.getDoublePrecisionEnabled();
|
|
60550
|
+
}
|
|
60551
|
+
|
|
60552
|
+
/**
|
|
60553
|
+
* Sets the maximum data texture height.
|
|
60554
|
+
*
|
|
60555
|
+
* Should be a multiple of 1024. Default is 4096, which is the maximum allowed value.
|
|
60556
|
+
*/
|
|
60557
|
+
set maxDataTextureHeight(value) {
|
|
60558
|
+
value = Math.ceil(value / 1024) * 1024;
|
|
60559
|
+
if (value > 4096) {
|
|
60560
|
+
value = 4096;
|
|
60561
|
+
} else if (value < 1024) {
|
|
60562
|
+
value = 1024;
|
|
60478
60563
|
}
|
|
60564
|
+
maxDataTextureHeight = value;
|
|
60565
|
+
}
|
|
60479
60566
|
|
|
60480
|
-
|
|
60481
|
-
|
|
60567
|
+
/**
|
|
60568
|
+
* Sets maximum data texture height.
|
|
60569
|
+
* @returns {*|number}
|
|
60570
|
+
*/
|
|
60571
|
+
get maxDataTextureHeight() {
|
|
60572
|
+
return maxDataTextureHeight;
|
|
60573
|
+
}
|
|
60574
|
+
|
|
60575
|
+
/**
|
|
60576
|
+
* Sets the maximum batched geometry VBO size.
|
|
60577
|
+
*
|
|
60578
|
+
* Default value is 5000000, which is the maximum size.
|
|
60579
|
+
*
|
|
60580
|
+
* Minimum size is 100000.
|
|
60581
|
+
*/
|
|
60582
|
+
set maxGeometryBatchSize(value) {
|
|
60583
|
+
if (value < 100000) {
|
|
60584
|
+
value = 100000;
|
|
60585
|
+
} else if (value > 5000000) {
|
|
60586
|
+
value = 5000000;
|
|
60587
|
+
}
|
|
60588
|
+
maxGeometryBatchSize = value;
|
|
60589
|
+
}
|
|
60590
|
+
|
|
60591
|
+
/**
|
|
60592
|
+
* Gets the maximum batched geometry VBO size.
|
|
60593
|
+
*/
|
|
60594
|
+
get maxGeometryBatchSize() {
|
|
60595
|
+
return maxGeometryBatchSize;
|
|
60596
|
+
}
|
|
60597
|
+
}
|
|
60598
|
+
|
|
60599
|
+
const configs$1 = new Configs();
|
|
60600
|
+
|
|
60601
|
+
/**
|
|
60602
|
+
* @private
|
|
60603
|
+
*/
|
|
60604
|
+
class TrianglesBatchingBuffer {
|
|
60605
|
+
|
|
60606
|
+
constructor() {
|
|
60607
|
+
this.maxVerts = configs$1.maxGeometryBatchSize;
|
|
60608
|
+
this.maxIndices = configs$1.maxGeometryBatchSize * 3; // Rough rule-of-thumb
|
|
60482
60609
|
this.positions = [];
|
|
60483
60610
|
this.colors = [];
|
|
60484
60611
|
this.uv = [];
|
|
@@ -81117,6 +81244,8 @@ class DataTextureGenerator {
|
|
|
81117
81244
|
}
|
|
81118
81245
|
}
|
|
81119
81246
|
|
|
81247
|
+
const configs = new Configs();
|
|
81248
|
+
|
|
81120
81249
|
/**
|
|
81121
81250
|
* 12-bits allowed for object ids.
|
|
81122
81251
|
* Limits the per-object texture height in the layer.
|
|
@@ -81127,7 +81256,7 @@ const MAX_NUMBER_OF_OBJECTS_IN_LAYER = (1 << 16);
|
|
|
81127
81256
|
* 4096 is max data texture height.
|
|
81128
81257
|
* Limits the aggregated geometry texture height in the layer.
|
|
81129
81258
|
*/
|
|
81130
|
-
const MAX_DATA_TEXTURE_HEIGHT =
|
|
81259
|
+
const MAX_DATA_TEXTURE_HEIGHT = configs.maxDataTextureHeight;
|
|
81131
81260
|
|
|
81132
81261
|
/**
|
|
81133
81262
|
* Align `indices` and `edgeIndices` memory layout to 8 elements.
|
|
@@ -100722,82 +100851,6 @@ class Viewer {
|
|
|
100722
100851
|
}
|
|
100723
100852
|
}
|
|
100724
100853
|
|
|
100725
|
-
/**
|
|
100726
|
-
* Manages global configurations for all {@link Viewer}s.
|
|
100727
|
-
*
|
|
100728
|
-
* ## Example
|
|
100729
|
-
*
|
|
100730
|
-
* In the example below, we'll disable xeokit's double-precision support, which gives a performance and memory boost
|
|
100731
|
-
* on low-power devices, but also means that we can no longer render double-precision models without jittering.
|
|
100732
|
-
*
|
|
100733
|
-
* 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.
|
|
100734
|
-
*
|
|
100735
|
-
* [[Run this example](/examples/#Configs_disableDoublePrecisionAndRAF)]
|
|
100736
|
-
*
|
|
100737
|
-
* ````javascript
|
|
100738
|
-
* import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
|
|
100739
|
-
*
|
|
100740
|
-
* // Access xeoit-sdk global configs.
|
|
100741
|
-
* // We typically set configs only before we create any Viewers.
|
|
100742
|
-
* const configs = new Configs();
|
|
100743
|
-
*
|
|
100744
|
-
* // Disable 64-bit precision for extra speed.
|
|
100745
|
-
* // Only set this config once, before you create any Viewers.
|
|
100746
|
-
* configs.doublePrecisionEnabled = false;
|
|
100747
|
-
*
|
|
100748
|
-
* // Create a Viewer, to which our configs apply
|
|
100749
|
-
* const viewer = new Viewer({
|
|
100750
|
-
* canvasId: "myCanvas"
|
|
100751
|
-
* });
|
|
100752
|
-
*
|
|
100753
|
-
* viewer.camera.eye = [-3.933, 2.855, 27.018];
|
|
100754
|
-
* viewer.camera.look = [4.400, 3.724, 8.899];
|
|
100755
|
-
* viewer.camera.up = [-0.018, 0.999, 0.039];
|
|
100756
|
-
*
|
|
100757
|
-
* const xktLoader = new XKTLoaderPlugin(viewer);
|
|
100758
|
-
*
|
|
100759
|
-
* const model = xktLoader.load({
|
|
100760
|
-
* src: "../assets/models/xkt/v8/ifc/Duplex.ifc.xkt"
|
|
100761
|
-
* });
|
|
100762
|
-
* ````
|
|
100763
|
-
*/
|
|
100764
|
-
class Configs {
|
|
100765
|
-
|
|
100766
|
-
/**
|
|
100767
|
-
* Creates a Configs.
|
|
100768
|
-
*/
|
|
100769
|
-
constructor() {
|
|
100770
|
-
|
|
100771
|
-
}
|
|
100772
|
-
|
|
100773
|
-
/**
|
|
100774
|
-
* Sets whether double precision mode is enabled for Viewers.
|
|
100775
|
-
*
|
|
100776
|
-
* When double precision mode is enabled (default), Viewers will accurately render models that contain
|
|
100777
|
-
* double-precision coordinates, without jittering.
|
|
100778
|
-
*
|
|
100779
|
-
* Internally, double precision incurs extra performance and memory overhead, so if we're certain that
|
|
100780
|
-
* we're not going to render models that rely on double-precision coordinates, then it's a good idea to disable
|
|
100781
|
-
* it, especially on low-power devices.
|
|
100782
|
-
*
|
|
100783
|
-
* This should only be set once, before creating any Viewers.
|
|
100784
|
-
*
|
|
100785
|
-
* @returns {Boolean}
|
|
100786
|
-
*/
|
|
100787
|
-
set doublePrecisionEnabled(doublePrecision) {
|
|
100788
|
-
math.setDoublePrecisionEnabled(doublePrecision);
|
|
100789
|
-
}
|
|
100790
|
-
|
|
100791
|
-
/**
|
|
100792
|
-
* Gets whether double precision mode is enabled for all Viewers.
|
|
100793
|
-
*
|
|
100794
|
-
* @returns {Boolean}
|
|
100795
|
-
*/
|
|
100796
|
-
get doublePrecisionEnabled() {
|
|
100797
|
-
return math.getDoublePrecisionEnabled();
|
|
100798
|
-
}
|
|
100799
|
-
}
|
|
100800
|
-
|
|
100801
100854
|
function assert$5(condition, message) {
|
|
100802
100855
|
if (!condition) {
|
|
100803
100856
|
throw new Error(message || 'loader assertion failed.');
|