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

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
  }
@@ -81908,6 +81912,10 @@ class SceneModel extends Component {
81908
81912
  this.error("[createGeometry] Param expected: `uvDecodeMatrix` (required for `uvCompressed')");
81909
81913
  return null;
81910
81914
  }
81915
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
81916
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
81917
+ cfg.indices = this._createDefaultIndices(numPositions);
81918
+ }
81911
81919
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
81912
81920
  this.error(`[createGeometry] Param expected: indices (required for '${cfg.primitive}' primitive type)`);
81913
81921
  return null;
@@ -82342,7 +82350,12 @@ class SceneModel extends Component {
82342
82350
  this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)");
82343
82351
  return false;
82344
82352
  }
82353
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
82354
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
82355
+ cfg.indices = this._createDefaultIndices(numPositions);
82356
+ }
82345
82357
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
82358
+ cfg.indices = this._createDefaultIndices(numIndices);
82346
82359
  this.error(`Param expected: indices (required for '${cfg.primitive}' primitive type)`);
82347
82360
  return false;
82348
82361
  }
@@ -82352,9 +82365,9 @@ class SceneModel extends Component {
82352
82365
  }
82353
82366
 
82354
82367
  const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles"
82355
- || cfg.primitive === "solid"
82356
- || cfg.primitive === "surface"))
82357
- && (!cfg.textureSetId);
82368
+ || cfg.primitive === "solid"
82369
+ || cfg.primitive === "surface"))
82370
+ && (!cfg.textureSetId);
82358
82371
 
82359
82372
  cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
82360
82373
 
@@ -82570,9 +82583,9 @@ class SceneModel extends Component {
82570
82583
  }
82571
82584
 
82572
82585
  const useDTX = (!!this._dtxEnabled
82573
- && (cfg.geometry.primitive === "triangles"
82574
- || cfg.geometry.primitive === "solid"
82575
- || cfg.geometry.primitive === "surface"))
82586
+ && (cfg.geometry.primitive === "triangles"
82587
+ || cfg.geometry.primitive === "solid"
82588
+ || cfg.geometry.primitive === "surface"))
82576
82589
  && (!cfg.textureSetId);
82577
82590
 
82578
82591
  if (useDTX) {
@@ -82627,6 +82640,14 @@ class SceneModel extends Component {
82627
82640
  return true;
82628
82641
  }
82629
82642
 
82643
+ _createDefaultIndices(numIndices) {
82644
+ const indices = [];
82645
+ for (let i = 0; i < numIndices; i++) {
82646
+ indices.push(i);
82647
+ }
82648
+ return indices;
82649
+ }
82650
+
82630
82651
  _createMesh(cfg) {
82631
82652
  const mesh = new SceneModelMesh(this, cfg.id, cfg.color, cfg.opacity, cfg.transform, cfg.textureSet);
82632
82653
  mesh.pickId = this.scene._renderer.getPickID(mesh);
@@ -83229,7 +83250,7 @@ class SceneModel extends Component {
83229
83250
  for (let i = 0, len = renderFlags.visibleLayers.length; i < len; i++) {
83230
83251
  const layerIndex = renderFlags.visibleLayers[i];
83231
83252
  this.layerList[layerIndex].drawColorOpaque(renderFlags, frameCtx);
83232
- }
83253
+ }
83233
83254
  }
83234
83255
 
83235
83256
  /** @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
  }
@@ -81904,6 +81908,10 @@ class SceneModel extends Component {
81904
81908
  this.error("[createGeometry] Param expected: `uvDecodeMatrix` (required for `uvCompressed')");
81905
81909
  return null;
81906
81910
  }
81911
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
81912
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
81913
+ cfg.indices = this._createDefaultIndices(numPositions);
81914
+ }
81907
81915
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
81908
81916
  this.error(`[createGeometry] Param expected: indices (required for '${cfg.primitive}' primitive type)`);
81909
81917
  return null;
@@ -82338,7 +82346,12 @@ class SceneModel extends Component {
82338
82346
  this.error("Param expected: 'uvCompressed' should be accompanied by `uvDecodeMatrix` ('geometryId' is absent)");
82339
82347
  return false;
82340
82348
  }
82349
+ if (!cfg.buckets && !cfg.indices && (cfg.primitive === "triangles" || cfg.primitive === "solid" || cfg.primitive === "surface")) {
82350
+ const numPositions = (cfg.positions || cfg.positionsCompressed).length / 3;
82351
+ cfg.indices = this._createDefaultIndices(numPositions);
82352
+ }
82341
82353
  if (!cfg.buckets && !cfg.indices && cfg.primitive !== "points") {
82354
+ cfg.indices = this._createDefaultIndices(numIndices);
82342
82355
  this.error(`Param expected: indices (required for '${cfg.primitive}' primitive type)`);
82343
82356
  return false;
82344
82357
  }
@@ -82348,9 +82361,9 @@ class SceneModel extends Component {
82348
82361
  }
82349
82362
 
82350
82363
  const useDTX = (!!this._dtxEnabled && (cfg.primitive === "triangles"
82351
- || cfg.primitive === "solid"
82352
- || cfg.primitive === "surface"))
82353
- && (!cfg.textureSetId);
82364
+ || cfg.primitive === "solid"
82365
+ || cfg.primitive === "surface"))
82366
+ && (!cfg.textureSetId);
82354
82367
 
82355
82368
  cfg.origin = cfg.origin ? math.addVec3(this._origin, cfg.origin, math.vec3()) : this._origin;
82356
82369
 
@@ -82566,9 +82579,9 @@ class SceneModel extends Component {
82566
82579
  }
82567
82580
 
82568
82581
  const useDTX = (!!this._dtxEnabled
82569
- && (cfg.geometry.primitive === "triangles"
82570
- || cfg.geometry.primitive === "solid"
82571
- || cfg.geometry.primitive === "surface"))
82582
+ && (cfg.geometry.primitive === "triangles"
82583
+ || cfg.geometry.primitive === "solid"
82584
+ || cfg.geometry.primitive === "surface"))
82572
82585
  && (!cfg.textureSetId);
82573
82586
 
82574
82587
  if (useDTX) {
@@ -82623,6 +82636,14 @@ class SceneModel extends Component {
82623
82636
  return true;
82624
82637
  }
82625
82638
 
82639
+ _createDefaultIndices(numIndices) {
82640
+ const indices = [];
82641
+ for (let i = 0; i < numIndices; i++) {
82642
+ indices.push(i);
82643
+ }
82644
+ return indices;
82645
+ }
82646
+
82626
82647
  _createMesh(cfg) {
82627
82648
  const mesh = new SceneModelMesh(this, cfg.id, cfg.color, cfg.opacity, cfg.transform, cfg.textureSet);
82628
82649
  mesh.pickId = this.scene._renderer.getPickID(mesh);
@@ -83225,7 +83246,7 @@ class SceneModel extends Component {
83225
83246
  for (let i = 0, len = renderFlags.visibleLayers.length; i < len; i++) {
83226
83247
  const layerIndex = renderFlags.visibleLayers[i];
83227
83248
  this.layerList[layerIndex].drawColorOpaque(renderFlags, frameCtx);
83228
- }
83249
+ }
83229
83250
  }
83230
83251
 
83231
83252
  /** @private */