@xeokit/xeokit-sdk 2.5.2-beta-25 → 2.5.2-beta-27

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.
@@ -20753,7 +20753,7 @@ class Perspective extends Component {
20753
20753
  inverseMatrix: math.mat4(),
20754
20754
  transposedMatrix: math.mat4(),
20755
20755
  near: 0.1,
20756
- far: 2000.0
20756
+ far: 10000.0
20757
20757
  });
20758
20758
 
20759
20759
  this._inverseMatrixDirty = true;
@@ -20903,10 +20903,12 @@ class Perspective extends Component {
20903
20903
  *
20904
20904
  * Fires a "far" event on change.
20905
20905
  *
20906
+ * Default value is ````10000.0````.
20907
+ *
20906
20908
  * @param {Number} value New Perspective far plane position.
20907
20909
  */
20908
20910
  set far(value) {
20909
- const far = (value !== undefined && value !== null) ? value : 2000.0;
20911
+ const far = (value !== undefined && value !== null) ? value : 10000.0;
20910
20912
  if (this._state.far === far) {
20911
20913
  return;
20912
20914
  }
@@ -20918,6 +20920,8 @@ class Perspective extends Component {
20918
20920
  /**
20919
20921
  * Gets the position of this Perspective's far plane on the positive View-space Z-axis.
20920
20922
  *
20923
+ * Default value is ````10000.0````.
20924
+ *
20921
20925
  * @return {Number} The Perspective's far plane position.
20922
20926
  */
20923
20927
  get far() {
@@ -21054,7 +21058,7 @@ class Ortho extends Component {
21054
21058
  inverseMatrix: math.mat4(),
21055
21059
  transposedMatrix: math.mat4(),
21056
21060
  near: 0.1,
21057
- far: 2000.0
21061
+ far: 10000.0
21058
21062
  });
21059
21063
 
21060
21064
  this._inverseMatrixDirty = true;
@@ -21180,12 +21184,12 @@ class Ortho extends Component {
21180
21184
  *
21181
21185
  * Fires a "far" event on change.
21182
21186
  *
21183
- * Default value is ````2000.0````.
21187
+ * Default value is ````10000.0````.
21184
21188
  *
21185
21189
  * @param {Number} value New far ortho plane position.
21186
21190
  */
21187
21191
  set far(value) {
21188
- const far = (value !== undefined && value !== null) ? value : 2000.0;
21192
+ const far = (value !== undefined && value !== null) ? value : 10000.0;
21189
21193
  if (this._state.far === far) {
21190
21194
  return;
21191
21195
  }
@@ -72057,11 +72061,6 @@ class DTXTrianglesPickMeshRenderer {
72057
72061
  // get color
72058
72062
  src.push("uvec4 color = texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
72059
72063
 
72060
- src.push(`if (color.a == 0u) {`);
72061
- src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
72062
- src.push(" return;");
72063
- src.push("};");
72064
-
72065
72064
  // get pick-color
72066
72065
  src.push("vPickColor = vec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0)) / 255.0;");
72067
72066
 
@@ -81908,6 +81907,10 @@ class SceneModel extends Component {
81908
81907
  this.error("[createGeometry] Param expected: `uvDecodeMatrix` (required for `uvCompressed')");
81909
81908
  return null;
81910
81909
  }
81910
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
81911
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
81912
+ cfg.indices = this._createDefaultIndices(numPositions);
81913
+ }
81911
81914
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
81912
81915
  this.error(`[createGeometry] Param expected: indices (required for '${cfg.primitive}' primitive type)`);
81913
81916
  return null;
@@ -82342,7 +82345,12 @@ class SceneModel extends Component {
82342
82345
  this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)");
82343
82346
  return false;
82344
82347
  }
82348
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
82349
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
82350
+ cfg.indices = this._createDefaultIndices(numPositions);
82351
+ }
82345
82352
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
82353
+ cfg.indices = this._createDefaultIndices(numIndices);
82346
82354
  this.error(`Param expected: indices (required for '${cfg.primitive}' primitive type)`);
82347
82355
  return false;
82348
82356
  }
@@ -82352,9 +82360,9 @@ class SceneModel extends Component {
82352
82360
  }
82353
82361
 
82354
82362
  const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles"
82355
- || cfg.primitive === "solid"
82356
- || cfg.primitive === "surface"))
82357
- && (!cfg.textureSetId);
82363
+ || cfg.primitive === "solid"
82364
+ || cfg.primitive === "surface"))
82365
+ && (!cfg.textureSetId);
82358
82366
 
82359
82367
  cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
82360
82368
 
@@ -82570,9 +82578,9 @@ class SceneModel extends Component {
82570
82578
  }
82571
82579
 
82572
82580
  const useDTX = (!!this._dtxEnabled
82573
- && (cfg.geometry.primitive === "triangles"
82574
- || cfg.geometry.primitive === "solid"
82575
- || cfg.geometry.primitive === "surface"))
82581
+ && (cfg.geometry.primitive === "triangles"
82582
+ || cfg.geometry.primitive === "solid"
82583
+ || cfg.geometry.primitive === "surface"))
82576
82584
  && (!cfg.textureSetId);
82577
82585
 
82578
82586
  if (useDTX) {
@@ -82627,6 +82635,14 @@ class SceneModel extends Component {
82627
82635
  return true;
82628
82636
  }
82629
82637
 
82638
+ _createDefaultIndices(numIndices) {
82639
+ const indices = [];
82640
+ for (let i = 0; i < numIndices; i++) {
82641
+ indices.push(i);
82642
+ }
82643
+ return indices;
82644
+ }
82645
+
82630
82646
  _createMesh(cfg) {
82631
82647
  const mesh = new SceneModelMesh(this, cfg.id, cfg.color, cfg.opacity, cfg.transform, cfg.textureSet);
82632
82648
  mesh.pickId = this.scene._renderer.getPickID(mesh);
@@ -83229,7 +83245,7 @@ class SceneModel extends Component {
83229
83245
  for (let i = 0, len = renderFlags.visibleLayers.length; i < len; i++) {
83230
83246
  const layerIndex = renderFlags.visibleLayers[i];
83231
83247
  this.layerList[layerIndex].drawColorOpaque(renderFlags, frameCtx);
83232
- }
83248
+ }
83233
83249
  }
83234
83250
 
83235
83251
  /** @private */
@@ -20749,7 +20749,7 @@ class Perspective extends Component {
20749
20749
  inverseMatrix: math.mat4(),
20750
20750
  transposedMatrix: math.mat4(),
20751
20751
  near: 0.1,
20752
- far: 2000.0
20752
+ far: 10000.0
20753
20753
  });
20754
20754
 
20755
20755
  this._inverseMatrixDirty = true;
@@ -20899,10 +20899,12 @@ class Perspective extends Component {
20899
20899
  *
20900
20900
  * Fires a "far" event on change.
20901
20901
  *
20902
+ * Default value is ````10000.0````.
20903
+ *
20902
20904
  * @param {Number} value New Perspective far plane position.
20903
20905
  */
20904
20906
  set far(value) {
20905
- const far = (value !== undefined && value !== null) ? value : 2000.0;
20907
+ const far = (value !== undefined && value !== null) ? value : 10000.0;
20906
20908
  if (this._state.far === far) {
20907
20909
  return;
20908
20910
  }
@@ -20914,6 +20916,8 @@ class Perspective extends Component {
20914
20916
  /**
20915
20917
  * Gets the position of this Perspective's far plane on the positive View-space Z-axis.
20916
20918
  *
20919
+ * Default value is ````10000.0````.
20920
+ *
20917
20921
  * @return {Number} The Perspective's far plane position.
20918
20922
  */
20919
20923
  get far() {
@@ -21050,7 +21054,7 @@ class Ortho extends Component {
21050
21054
  inverseMatrix: math.mat4(),
21051
21055
  transposedMatrix: math.mat4(),
21052
21056
  near: 0.1,
21053
- far: 2000.0
21057
+ far: 10000.0
21054
21058
  });
21055
21059
 
21056
21060
  this._inverseMatrixDirty = true;
@@ -21176,12 +21180,12 @@ class Ortho extends Component {
21176
21180
  *
21177
21181
  * Fires a "far" event on change.
21178
21182
  *
21179
- * Default value is ````2000.0````.
21183
+ * Default value is ````10000.0````.
21180
21184
  *
21181
21185
  * @param {Number} value New far ortho plane position.
21182
21186
  */
21183
21187
  set far(value) {
21184
- const far = (value !== undefined && value !== null) ? value : 2000.0;
21188
+ const far = (value !== undefined && value !== null) ? value : 10000.0;
21185
21189
  if (this._state.far === far) {
21186
21190
  return;
21187
21191
  }
@@ -72053,11 +72057,6 @@ class DTXTrianglesPickMeshRenderer {
72053
72057
  // get color
72054
72058
  src.push("uvec4 color = texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
72055
72059
 
72056
- src.push(`if (color.a == 0u) {`);
72057
- src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
72058
- src.push(" return;");
72059
- src.push("};");
72060
-
72061
72060
  // get pick-color
72062
72061
  src.push("vPickColor = vec4(texelFetch (uObjectPerObjectColorsAndFlags, ivec2(objectIndexCoords.x*8+1, objectIndexCoords.y), 0)) / 255.0;");
72063
72062
 
@@ -81904,6 +81903,10 @@ class SceneModel extends Component {
81904
81903
  this.error("[createGeometry] Param expected: `uvDecodeMatrix` (required for `uvCompressed')");
81905
81904
  return null;
81906
81905
  }
81906
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
81907
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
81908
+ cfg.indices = this._createDefaultIndices(numPositions);
81909
+ }
81907
81910
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
81908
81911
  this.error(`[createGeometry] Param expected: indices (required for '${cfg.primitive}' primitive type)`);
81909
81912
  return null;
@@ -82338,7 +82341,12 @@ class SceneModel extends Component {
82338
82341
  this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)");
82339
82342
  return false;
82340
82343
  }
82344
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
82345
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
82346
+ cfg.indices = this._createDefaultIndices(numPositions);
82347
+ }
82341
82348
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
82349
+ cfg.indices = this._createDefaultIndices(numIndices);
82342
82350
  this.error(`Param expected: indices (required for '${cfg.primitive}' primitive type)`);
82343
82351
  return false;
82344
82352
  }
@@ -82348,9 +82356,9 @@ class SceneModel extends Component {
82348
82356
  }
82349
82357
 
82350
82358
  const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles"
82351
- || cfg.primitive === "solid"
82352
- || cfg.primitive === "surface"))
82353
- && (!cfg.textureSetId);
82359
+ || cfg.primitive === "solid"
82360
+ || cfg.primitive === "surface"))
82361
+ && (!cfg.textureSetId);
82354
82362
 
82355
82363
  cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
82356
82364
 
@@ -82566,9 +82574,9 @@ class SceneModel extends Component {
82566
82574
  }
82567
82575
 
82568
82576
  const useDTX = (!!this._dtxEnabled
82569
- && (cfg.geometry.primitive === "triangles"
82570
- || cfg.geometry.primitive === "solid"
82571
- || cfg.geometry.primitive === "surface"))
82577
+ && (cfg.geometry.primitive === "triangles"
82578
+ || cfg.geometry.primitive === "solid"
82579
+ || cfg.geometry.primitive === "surface"))
82572
82580
  && (!cfg.textureSetId);
82573
82581
 
82574
82582
  if (useDTX) {
@@ -82623,6 +82631,14 @@ class SceneModel extends Component {
82623
82631
  return true;
82624
82632
  }
82625
82633
 
82634
+ _createDefaultIndices(numIndices) {
82635
+ const indices = [];
82636
+ for (let i = 0; i < numIndices; i++) {
82637
+ indices.push(i);
82638
+ }
82639
+ return indices;
82640
+ }
82641
+
82626
82642
  _createMesh(cfg) {
82627
82643
  const mesh = new SceneModelMesh(this, cfg.id, cfg.color, cfg.opacity, cfg.transform, cfg.textureSet);
82628
82644
  mesh.pickId = this.scene._renderer.getPickID(mesh);
@@ -83225,7 +83241,7 @@ class SceneModel extends Component {
83225
83241
  for (let i = 0, len = renderFlags.visibleLayers.length; i < len; i++) {
83226
83242
  const layerIndex = renderFlags.visibleLayers[i];
83227
83243
  this.layerList[layerIndex].drawColorOpaque(renderFlags, frameCtx);
83228
- }
83244
+ }
83229
83245
  }
83230
83246
 
83231
83247
  /** @private */