@xeokit/xeokit-sdk 2.4.0-alpha-38 → 2.4.0-alpha-39

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/README.md CHANGED
@@ -64,7 +64,7 @@ which we can pre-convert offline from other formats.
64
64
  <script id="source" type="module">
65
65
 
66
66
  import {Viewer, WebIFCLoaderPlugin} from
67
- "../dist/xeokit-sdk.es.js";
67
+ "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
68
68
 
69
69
  const viewer = new Viewer({
70
70
  canvasId: "myCanvas",
@@ -52500,11 +52500,8 @@ const pickTriangleSurface = (function () {
52500
52500
 
52501
52501
  // Attempt to ray-pick the triangle in local space
52502
52502
 
52503
- let canvasPos;
52504
-
52505
52503
  if (pickResult.canvasPos) {
52506
- canvasPos = pickResult.canvasPos;
52507
- math.canvasPosToLocalRay(canvas.canvas, pickViewMatrix, pickProjMatrix, mesh.worldMatrix, canvasPos, localRayOrigin, localRayDir);
52504
+ math.canvasPosToLocalRay(canvas.canvas, mesh.origin ? createRTCViewMat(pickViewMatrix, mesh.origin) : pickViewMatrix, pickProjMatrix, mesh.worldMatrix, pickResult.canvasPos, localRayOrigin, localRayDir);
52508
52505
 
52509
52506
  } else if (pickResult.origin && pickResult.direction) {
52510
52507
  math.worldRayToLocalRay(mesh.worldMatrix, pickResult.origin, pickResult.direction, localRayOrigin, localRayDir);
@@ -52535,6 +52532,12 @@ const pickTriangleSurface = (function () {
52535
52532
  worldPos[1] = tempVec4b[1];
52536
52533
  worldPos[2] = tempVec4b[2];
52537
52534
 
52535
+ if (pickResult.canvasPos && mesh.origin) {
52536
+ worldPos[0] += mesh.origin[0];
52537
+ worldPos[1] += mesh.origin[1];
52538
+ worldPos[2] += mesh.origin[2];
52539
+ }
52540
+
52538
52541
  pickResult.worldPos = worldPos;
52539
52542
 
52540
52543
  // Get View-space cartesian coordinates of the ray-triangle intersection
@@ -62533,7 +62536,7 @@ class Bitmap extends Component {
62533
62536
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#LineSet_grid)]
62534
62537
  *
62535
62538
  * ````javascript
62536
- * import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "../dist/xeokit-sdk.es.js";
62539
+ * import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
62537
62540
  *
62538
62541
  * const viewer = new Viewer({
62539
62542
  * canvasId: "myCanvas",
@@ -67690,7 +67693,7 @@ class LightMap extends CubeTexture {
67690
67693
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#markers_SpriteMarker)]
67691
67694
  *
67692
67695
  * ```` javascript
67693
- * import {Viewer, SpriteMarker } from "./../dist/xeokit-sdk.es.js";
67696
+ * import {Viewer, SpriteMarker } from "./https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
67694
67697
  *
67695
67698
  * const viewer = new Viewer({
67696
67699
  * canvasId: "myCanvas",
@@ -103677,94 +103680,94 @@ function arrayToMap(array) {
103677
103680
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
103678
103681
  * Released under MIT License
103679
103682
  */
103680
- /*! *****************************************************************************
103681
- Copyright (c) Microsoft Corporation.
103682
-
103683
- Permission to use, copy, modify, and/or distribute this software for any
103684
- purpose with or without fee is hereby granted.
103685
-
103686
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
103687
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
103688
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
103689
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
103690
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
103691
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
103692
- PERFORMANCE OF THIS SOFTWARE.
103693
- ***************************************************************************** */
103694
- /* global Reflect, Promise */
103695
-
103696
- var extendStatics = function(d, b) {
103697
- extendStatics = Object.setPrototypeOf ||
103698
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
103699
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
103700
- return extendStatics(d, b);
103701
- };
103702
-
103703
- function __extends(d, b) {
103704
- if (typeof b !== "function" && b !== null)
103705
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
103706
- extendStatics(d, b);
103707
- function __() { this.constructor = d; }
103708
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
103709
- }
103710
-
103711
- var __assign = function() {
103712
- __assign = Object.assign || function __assign(t) {
103713
- for (var s, i = 1, n = arguments.length; i < n; i++) {
103714
- s = arguments[i];
103715
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
103716
- }
103717
- return t;
103718
- };
103719
- return __assign.apply(this, arguments);
103720
- };
103721
-
103722
- function __awaiter(thisArg, _arguments, P, generator) {
103723
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
103724
- return new (P || (P = Promise))(function (resolve, reject) {
103725
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
103726
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
103727
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
103728
- step((generator = generator.apply(thisArg, _arguments || [])).next());
103729
- });
103730
- }
103731
-
103732
- function __generator(thisArg, body) {
103733
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
103734
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
103735
- function verb(n) { return function (v) { return step([n, v]); }; }
103736
- function step(op) {
103737
- if (f) throw new TypeError("Generator is already executing.");
103738
- while (_) try {
103739
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
103740
- if (y = 0, t) op = [op[0] & 2, t.value];
103741
- switch (op[0]) {
103742
- case 0: case 1: t = op; break;
103743
- case 4: _.label++; return { value: op[1], done: false };
103744
- case 5: _.label++; y = op[1]; op = [0]; continue;
103745
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
103746
- default:
103747
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
103748
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103749
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
103750
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103751
- if (t[2]) _.ops.pop();
103752
- _.trys.pop(); continue;
103753
- }
103754
- op = body.call(thisArg, _);
103755
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
103756
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
103757
- }
103758
- }
103759
-
103760
- function __spreadArray(to, from, pack) {
103761
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
103762
- if (ar || !(i in from)) {
103763
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
103764
- ar[i] = from[i];
103765
- }
103766
- }
103767
- return to.concat(ar || from);
103683
+ /*! *****************************************************************************
103684
+ Copyright (c) Microsoft Corporation.
103685
+
103686
+ Permission to use, copy, modify, and/or distribute this software for any
103687
+ purpose with or without fee is hereby granted.
103688
+
103689
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
103690
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
103691
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
103692
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
103693
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
103694
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
103695
+ PERFORMANCE OF THIS SOFTWARE.
103696
+ ***************************************************************************** */
103697
+ /* global Reflect, Promise */
103698
+
103699
+ var extendStatics = function(d, b) {
103700
+ extendStatics = Object.setPrototypeOf ||
103701
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
103702
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
103703
+ return extendStatics(d, b);
103704
+ };
103705
+
103706
+ function __extends(d, b) {
103707
+ if (typeof b !== "function" && b !== null)
103708
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
103709
+ extendStatics(d, b);
103710
+ function __() { this.constructor = d; }
103711
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
103712
+ }
103713
+
103714
+ var __assign = function() {
103715
+ __assign = Object.assign || function __assign(t) {
103716
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
103717
+ s = arguments[i];
103718
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
103719
+ }
103720
+ return t;
103721
+ };
103722
+ return __assign.apply(this, arguments);
103723
+ };
103724
+
103725
+ function __awaiter(thisArg, _arguments, P, generator) {
103726
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
103727
+ return new (P || (P = Promise))(function (resolve, reject) {
103728
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
103729
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
103730
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
103731
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
103732
+ });
103733
+ }
103734
+
103735
+ function __generator(thisArg, body) {
103736
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
103737
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
103738
+ function verb(n) { return function (v) { return step([n, v]); }; }
103739
+ function step(op) {
103740
+ if (f) throw new TypeError("Generator is already executing.");
103741
+ while (_) try {
103742
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
103743
+ if (y = 0, t) op = [op[0] & 2, t.value];
103744
+ switch (op[0]) {
103745
+ case 0: case 1: t = op; break;
103746
+ case 4: _.label++; return { value: op[1], done: false };
103747
+ case 5: _.label++; y = op[1]; op = [0]; continue;
103748
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
103749
+ default:
103750
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
103751
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103752
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
103753
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103754
+ if (t[2]) _.ops.pop();
103755
+ _.trys.pop(); continue;
103756
+ }
103757
+ op = body.call(thisArg, _);
103758
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
103759
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
103760
+ }
103761
+ }
103762
+
103763
+ function __spreadArray(to, from, pack) {
103764
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
103765
+ if (ar || !(i in from)) {
103766
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
103767
+ ar[i] = from[i];
103768
+ }
103769
+ }
103770
+ return to.concat(ar || from);
103768
103771
  }
103769
103772
 
103770
103773
  var Bounds = /** @class */ (function () {
@@ -112039,7 +112042,7 @@ class Viewer {
112039
112042
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#Configs_disableDoublePrecisionAndRAF)]
112040
112043
  *
112041
112044
  * ````javascript
112042
- * import {Configs, Viewer, XKTLoaderPlugin} from "../dist/xeokit-sdk.es.js";
112045
+ * import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
112043
112046
  *
112044
112047
  * // Access xeoit-sdk global configs.
112045
112048
  * // We typically set configs only before we create any Viewers.
@@ -52496,11 +52496,8 @@ const pickTriangleSurface = (function () {
52496
52496
 
52497
52497
  // Attempt to ray-pick the triangle in local space
52498
52498
 
52499
- let canvasPos;
52500
-
52501
52499
  if (pickResult.canvasPos) {
52502
- canvasPos = pickResult.canvasPos;
52503
- math.canvasPosToLocalRay(canvas.canvas, pickViewMatrix, pickProjMatrix, mesh.worldMatrix, canvasPos, localRayOrigin, localRayDir);
52500
+ math.canvasPosToLocalRay(canvas.canvas, mesh.origin ? createRTCViewMat(pickViewMatrix, mesh.origin) : pickViewMatrix, pickProjMatrix, mesh.worldMatrix, pickResult.canvasPos, localRayOrigin, localRayDir);
52504
52501
 
52505
52502
  } else if (pickResult.origin && pickResult.direction) {
52506
52503
  math.worldRayToLocalRay(mesh.worldMatrix, pickResult.origin, pickResult.direction, localRayOrigin, localRayDir);
@@ -52531,6 +52528,12 @@ const pickTriangleSurface = (function () {
52531
52528
  worldPos[1] = tempVec4b[1];
52532
52529
  worldPos[2] = tempVec4b[2];
52533
52530
 
52531
+ if (pickResult.canvasPos && mesh.origin) {
52532
+ worldPos[0] += mesh.origin[0];
52533
+ worldPos[1] += mesh.origin[1];
52534
+ worldPos[2] += mesh.origin[2];
52535
+ }
52536
+
52534
52537
  pickResult.worldPos = worldPos;
52535
52538
 
52536
52539
  // Get View-space cartesian coordinates of the ray-triangle intersection
@@ -62529,7 +62532,7 @@ class Bitmap extends Component {
62529
62532
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#LineSet_grid)]
62530
62533
  *
62531
62534
  * ````javascript
62532
- * import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "../dist/xeokit-sdk.es.js";
62535
+ * import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
62533
62536
  *
62534
62537
  * const viewer = new Viewer({
62535
62538
  * canvasId: "myCanvas",
@@ -67686,7 +67689,7 @@ class LightMap extends CubeTexture {
67686
67689
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#markers_SpriteMarker)]
67687
67690
  *
67688
67691
  * ```` javascript
67689
- * import {Viewer, SpriteMarker } from "./../dist/xeokit-sdk.es.js";
67692
+ * import {Viewer, SpriteMarker } from "./https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
67690
67693
  *
67691
67694
  * const viewer = new Viewer({
67692
67695
  * canvasId: "myCanvas",
@@ -103673,94 +103676,94 @@ function arrayToMap(array) {
103673
103676
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
103674
103677
  * Released under MIT License
103675
103678
  */
103676
- /*! *****************************************************************************
103677
- Copyright (c) Microsoft Corporation.
103678
-
103679
- Permission to use, copy, modify, and/or distribute this software for any
103680
- purpose with or without fee is hereby granted.
103681
-
103682
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
103683
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
103684
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
103685
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
103686
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
103687
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
103688
- PERFORMANCE OF THIS SOFTWARE.
103689
- ***************************************************************************** */
103690
- /* global Reflect, Promise */
103691
-
103692
- var extendStatics = function(d, b) {
103693
- extendStatics = Object.setPrototypeOf ||
103694
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
103695
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
103696
- return extendStatics(d, b);
103697
- };
103698
-
103699
- function __extends(d, b) {
103700
- if (typeof b !== "function" && b !== null)
103701
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
103702
- extendStatics(d, b);
103703
- function __() { this.constructor = d; }
103704
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
103705
- }
103706
-
103707
- var __assign = function() {
103708
- __assign = Object.assign || function __assign(t) {
103709
- for (var s, i = 1, n = arguments.length; i < n; i++) {
103710
- s = arguments[i];
103711
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
103712
- }
103713
- return t;
103714
- };
103715
- return __assign.apply(this, arguments);
103716
- };
103717
-
103718
- function __awaiter(thisArg, _arguments, P, generator) {
103719
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
103720
- return new (P || (P = Promise))(function (resolve, reject) {
103721
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
103722
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
103723
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
103724
- step((generator = generator.apply(thisArg, _arguments || [])).next());
103725
- });
103726
- }
103727
-
103728
- function __generator(thisArg, body) {
103729
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
103730
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
103731
- function verb(n) { return function (v) { return step([n, v]); }; }
103732
- function step(op) {
103733
- if (f) throw new TypeError("Generator is already executing.");
103734
- while (_) try {
103735
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
103736
- if (y = 0, t) op = [op[0] & 2, t.value];
103737
- switch (op[0]) {
103738
- case 0: case 1: t = op; break;
103739
- case 4: _.label++; return { value: op[1], done: false };
103740
- case 5: _.label++; y = op[1]; op = [0]; continue;
103741
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
103742
- default:
103743
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
103744
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103745
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
103746
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103747
- if (t[2]) _.ops.pop();
103748
- _.trys.pop(); continue;
103749
- }
103750
- op = body.call(thisArg, _);
103751
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
103752
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
103753
- }
103754
- }
103755
-
103756
- function __spreadArray(to, from, pack) {
103757
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
103758
- if (ar || !(i in from)) {
103759
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
103760
- ar[i] = from[i];
103761
- }
103762
- }
103763
- return to.concat(ar || from);
103679
+ /*! *****************************************************************************
103680
+ Copyright (c) Microsoft Corporation.
103681
+
103682
+ Permission to use, copy, modify, and/or distribute this software for any
103683
+ purpose with or without fee is hereby granted.
103684
+
103685
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
103686
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
103687
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
103688
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
103689
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
103690
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
103691
+ PERFORMANCE OF THIS SOFTWARE.
103692
+ ***************************************************************************** */
103693
+ /* global Reflect, Promise */
103694
+
103695
+ var extendStatics = function(d, b) {
103696
+ extendStatics = Object.setPrototypeOf ||
103697
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
103698
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
103699
+ return extendStatics(d, b);
103700
+ };
103701
+
103702
+ function __extends(d, b) {
103703
+ if (typeof b !== "function" && b !== null)
103704
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
103705
+ extendStatics(d, b);
103706
+ function __() { this.constructor = d; }
103707
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
103708
+ }
103709
+
103710
+ var __assign = function() {
103711
+ __assign = Object.assign || function __assign(t) {
103712
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
103713
+ s = arguments[i];
103714
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
103715
+ }
103716
+ return t;
103717
+ };
103718
+ return __assign.apply(this, arguments);
103719
+ };
103720
+
103721
+ function __awaiter(thisArg, _arguments, P, generator) {
103722
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
103723
+ return new (P || (P = Promise))(function (resolve, reject) {
103724
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
103725
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
103726
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
103727
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
103728
+ });
103729
+ }
103730
+
103731
+ function __generator(thisArg, body) {
103732
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
103733
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
103734
+ function verb(n) { return function (v) { return step([n, v]); }; }
103735
+ function step(op) {
103736
+ if (f) throw new TypeError("Generator is already executing.");
103737
+ while (_) try {
103738
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
103739
+ if (y = 0, t) op = [op[0] & 2, t.value];
103740
+ switch (op[0]) {
103741
+ case 0: case 1: t = op; break;
103742
+ case 4: _.label++; return { value: op[1], done: false };
103743
+ case 5: _.label++; y = op[1]; op = [0]; continue;
103744
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
103745
+ default:
103746
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
103747
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103748
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
103749
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103750
+ if (t[2]) _.ops.pop();
103751
+ _.trys.pop(); continue;
103752
+ }
103753
+ op = body.call(thisArg, _);
103754
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
103755
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
103756
+ }
103757
+ }
103758
+
103759
+ function __spreadArray(to, from, pack) {
103760
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
103761
+ if (ar || !(i in from)) {
103762
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
103763
+ ar[i] = from[i];
103764
+ }
103765
+ }
103766
+ return to.concat(ar || from);
103764
103767
  }
103765
103768
 
103766
103769
  var Bounds = /** @class */ (function () {
@@ -112035,7 +112038,7 @@ class Viewer {
112035
112038
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#Configs_disableDoublePrecisionAndRAF)]
112036
112039
  *
112037
112040
  * ````javascript
112038
- * import {Configs, Viewer, XKTLoaderPlugin} from "../dist/xeokit-sdk.es.js";
112041
+ * import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
112039
112042
  *
112040
112043
  * // Access xeoit-sdk global configs.
112041
112044
  * // We typically set configs only before we create any Viewers.
@@ -12746,11 +12746,11 @@ var _i250=primIndex;// Indicates the first triangle index in the indices array
12746
12746
  var indices=geometry.indices;// Indices into geometry arrays, not into shared VertexBufs
12747
12747
  var _positions4=geometry.positions;var ia3;var ib3;var ic3;if(indices){var ia=indices[_i250+0];var ib=indices[_i250+1];var ic=indices[_i250+2];triangleVertices[0]=ia;triangleVertices[1]=ib;triangleVertices[2]=ic;pickResult.indices=triangleVertices;ia3=ia*3;ib3=ib*3;ic3=ic*3;}else{ia3=_i250*3;ib3=ia3+3;ic3=ib3+3;}positionA[0]=_positions4[ia3+0];positionA[1]=_positions4[ia3+1];positionA[2]=_positions4[ia3+2];positionB[0]=_positions4[ib3+0];positionB[1]=_positions4[ib3+1];positionB[2]=_positions4[ib3+2];positionC[0]=_positions4[ic3+0];positionC[1]=_positions4[ic3+1];positionC[2]=_positions4[ic3+2];if(geometry.compressGeometry){// Decompress vertex positions
12748
12748
  var positionsDecodeMatrix=geometry.positionsDecodeMatrix;if(positionsDecodeMatrix){geometryCompressionUtils.decompressPosition(positionA,positionsDecodeMatrix,positionA);geometryCompressionUtils.decompressPosition(positionB,positionsDecodeMatrix,positionB);geometryCompressionUtils.decompressPosition(positionC,positionsDecodeMatrix,positionC);}}// Attempt to ray-pick the triangle in local space
12749
- var _canvasPos2;if(pickResult.canvasPos){_canvasPos2=pickResult.canvasPos;math.canvasPosToLocalRay(_canvas2.canvas,pickViewMatrix,pickProjMatrix,mesh.worldMatrix,_canvasPos2,localRayOrigin,localRayDir);}else if(pickResult.origin&&pickResult.direction){math.worldRayToLocalRay(mesh.worldMatrix,pickResult.origin,pickResult.direction,localRayOrigin,localRayDir);}math.normalizeVec3(localRayDir);math.rayPlaneIntersect(localRayOrigin,localRayDir,positionA,positionB,positionC,position);// Get Local-space cartesian coordinates of the ray-triangle intersection
12749
+ if(pickResult.canvasPos){math.canvasPosToLocalRay(_canvas2.canvas,mesh.origin?createRTCViewMat(pickViewMatrix,mesh.origin):pickViewMatrix,pickProjMatrix,mesh.worldMatrix,pickResult.canvasPos,localRayOrigin,localRayDir);}else if(pickResult.origin&&pickResult.direction){math.worldRayToLocalRay(mesh.worldMatrix,pickResult.origin,pickResult.direction,localRayOrigin,localRayDir);}math.normalizeVec3(localRayDir);math.rayPlaneIntersect(localRayOrigin,localRayDir,positionA,positionB,positionC,position);// Get Local-space cartesian coordinates of the ray-triangle intersection
12750
12750
  pickResult.localPos=position;pickResult.position=position;// Get interpolated World-space coordinates
12751
12751
  // Need to transform homogeneous coords
12752
12752
  tempVec4a[0]=position[0];tempVec4a[1]=position[1];tempVec4a[2]=position[2];tempVec4a[3]=1;// Get World-space cartesian coordinates of the ray-triangle intersection
12753
- math.transformVec4(mesh.worldMatrix,tempVec4a,tempVec4b);worldPos[0]=tempVec4b[0];worldPos[1]=tempVec4b[1];worldPos[2]=tempVec4b[2];pickResult.worldPos=worldPos;// Get View-space cartesian coordinates of the ray-triangle intersection
12753
+ math.transformVec4(mesh.worldMatrix,tempVec4a,tempVec4b);worldPos[0]=tempVec4b[0];worldPos[1]=tempVec4b[1];worldPos[2]=tempVec4b[2];if(pickResult.canvasPos&&mesh.origin){worldPos[0]+=mesh.origin[0];worldPos[1]+=mesh.origin[1];worldPos[2]+=mesh.origin[2];}pickResult.worldPos=worldPos;// Get View-space cartesian coordinates of the ray-triangle intersection
12754
12754
  math.transformVec4(camera.matrix,tempVec4b,tempVec4c);viewPos[0]=tempVec4c[0];viewPos[1]=tempVec4c[1];viewPos[2]=tempVec4c[2];pickResult.viewPos=viewPos;// Get barycentric coordinates of the ray-triangle intersection
12755
12755
  math.cartesianToBarycentric(position,positionA,positionB,positionC,bary);pickResult.bary=bary;// Get interpolated normal vector
12756
12756
  var normals=geometry.normals;if(normals){if(geometry.compressGeometry){// Decompress vertex normals
@@ -15723,7 +15723,7 @@ var positions=K3D.edit.unwrap(m.i_verts,m.c_verts,3);var normals=K3D.edit.unwrap
15723
15723
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#LineSet_grid)]
15724
15724
  *
15725
15725
  * ````javascript
15726
- * import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "../dist/xeokit-sdk.es.js";
15726
+ * import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
15727
15727
  *
15728
15728
  * const viewer = new Viewer({
15729
15729
  * canvasId: "myCanvas",
@@ -17712,7 +17712,7 @@ if(this._src){this._loadSrc(this._src);}}},{key:"_loadSrc",value:function _loadS
17712
17712
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#markers_SpriteMarker)]
17713
17713
  *
17714
17714
  * ```` javascript
17715
- * import {Viewer, SpriteMarker } from "./../dist/xeokit-sdk.es.js";
17715
+ * import {Viewer, SpriteMarker } from "./https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
17716
17716
  *
17717
17717
  * const viewer = new Viewer({
17718
17718
  * canvasId: "myCanvas",
@@ -23477,19 +23477,19 @@ metaModel.rootMetaObjects[_objectId]=_existingObject;this.rootMetaObjects[_objec
23477
23477
  * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
23478
23478
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
23479
23479
  * Released under MIT License
23480
- */ /*! *****************************************************************************
23481
- Copyright (c) Microsoft Corporation.
23482
-
23483
- Permission to use, copy, modify, and/or distribute this software for any
23484
- purpose with or without fee is hereby granted.
23485
-
23486
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23487
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
23488
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23489
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23490
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23491
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23492
- PERFORMANCE OF THIS SOFTWARE.
23480
+ */ /*! *****************************************************************************
23481
+ Copyright (c) Microsoft Corporation.
23482
+
23483
+ Permission to use, copy, modify, and/or distribute this software for any
23484
+ purpose with or without fee is hereby granted.
23485
+
23486
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
23487
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
23488
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23489
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23490
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23491
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23492
+ PERFORMANCE OF THIS SOFTWARE.
23493
23493
  ***************************************************************************** */ /* global Reflect, Promise */var _extendStatics=function extendStatics(d,b){_extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b;}||function(d,b){for(var p in b){if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p];}};return _extendStatics(d,b);};function __extends(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");_extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());}var _assign=function __assign(){_assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p];}}return t;};return _assign.apply(this,arguments);};function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}}function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}step((generator=generator.apply(thisArg,_arguments||[])).next());});}function __generator(thisArg,body){var _={label:0,sent:function sent(){if(t[0]&1)throw t[1];return t[1];},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),"throw":verb(1),"return":verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this;}),g;function verb(n){return function(v){return step([n,v]);};}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_){try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue;}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break;}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break;}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break;}if(t[2])_.ops.pop();_.trys.pop();continue;}op=body.call(thisArg,_);}catch(e){op=[6,e];y=0;}finally{f=t=0;}}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true};}}function __spreadArray(to,from,pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i];}}return to.concat(ar||from);}var Bounds=/** @class */function(){function Bounds(left,top,width,height){this.left=left;this.top=top;this.width=width;this.height=height;}Bounds.prototype.add=function(x,y,w,h){return new Bounds(this.left+x,this.top+y,this.width+w,this.height+h);};Bounds.fromClientRect=function(context,clientRect){return new Bounds(clientRect.left+context.windowBounds.left,clientRect.top+context.windowBounds.top,clientRect.width,clientRect.height);};Bounds.fromDOMRectList=function(context,domRectList){var domRect=Array.from(domRectList).find(function(rect){return rect.width!==0;});return domRect?new Bounds(domRect.left+context.windowBounds.left,domRect.top+context.windowBounds.top,domRect.width,domRect.height):Bounds.EMPTY;};Bounds.EMPTY=new Bounds(0,0,0,0);return Bounds;}();var parseBounds=function parseBounds(context,node){return Bounds.fromClientRect(context,node.getBoundingClientRect());};var parseDocumentSize=function parseDocumentSize(document){var body=document.body;var documentElement=document.documentElement;if(!body||!documentElement){throw new Error("Unable to get document size");}var width=Math.max(Math.max(body.scrollWidth,documentElement.scrollWidth),Math.max(body.offsetWidth,documentElement.offsetWidth),Math.max(body.clientWidth,documentElement.clientWidth));var height=Math.max(Math.max(body.scrollHeight,documentElement.scrollHeight),Math.max(body.offsetHeight,documentElement.offsetHeight),Math.max(body.clientHeight,documentElement.clientHeight));return new Bounds(0,0,width,height);};/*
23494
23494
  * css-line-break 2.1.0 <https://github.com/niklasvh/css-line-break#readme>
23495
23495
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
@@ -24023,7 +24023,7 @@ for(var _i554=0,len=plugins.length;_i554<len;_i554++){var plugin=plugins[_i554];
24023
24023
  * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#Configs_disableDoublePrecisionAndRAF)]
24024
24024
  *
24025
24025
  * ````javascript
24026
- * import {Configs, Viewer, XKTLoaderPlugin} from "../dist/xeokit-sdk.es.js";
24026
+ * import {Configs, Viewer, XKTLoaderPlugin} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
24027
24027
  *
24028
24028
  * // Access xeoit-sdk global configs.
24029
24029
  * // We typically set configs only before we create any Viewers.