@loaders.gl/gltf 4.0.0-beta.2 → 4.0.0-beta.4
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/{dist.min.js → dist.dev.js} +3016 -3442
- package/dist/{esm/glb-loader.js → glb-loader.js} +2 -2
- package/dist/glb-loader.js.map +1 -0
- package/dist/{esm/glb-writer.js → glb-writer.js} +2 -2
- package/dist/glb-writer.js.map +1 -0
- package/dist/{esm/gltf-loader.js → gltf-loader.js} +2 -2
- package/dist/gltf-loader.js.map +1 -0
- package/dist/{esm/gltf-writer.js → gltf-writer.js} +2 -2
- package/dist/gltf-writer.js.map +1 -0
- package/dist/index.cjs +3558 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/{esm/lib → lib}/api/gltf-extensions.js +11 -11
- package/dist/lib/api/gltf-extensions.js.map +1 -0
- package/dist/lib/api/gltf-scenegraph.d.ts.map +1 -1
- package/dist/{esm/lib → lib}/api/gltf-scenegraph.js +9 -17
- package/dist/lib/api/gltf-scenegraph.js.map +1 -0
- package/dist/{esm/lib → lib}/api/normalize-gltf-v1.js +7 -8
- package/dist/lib/api/normalize-gltf-v1.js.map +1 -0
- package/dist/{esm/lib → lib}/api/post-process-gltf.js +19 -20
- package/dist/lib/api/post-process-gltf.js.map +1 -0
- package/dist/lib/encoders/encode-glb.js.map +1 -0
- package/dist/{esm/lib → lib}/encoders/encode-gltf.js +1 -1
- package/dist/lib/encoders/encode-gltf.js.map +1 -0
- package/dist/lib/extensions/EXT_mesh_features.d.ts.map +1 -1
- package/dist/{esm/lib → lib}/extensions/EXT_mesh_features.js +7 -5
- package/dist/lib/extensions/EXT_mesh_features.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/EXT_meshopt_compression.js +2 -2
- package/dist/lib/extensions/EXT_meshopt_compression.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/EXT_structural_metadata.js +7 -7
- package/dist/lib/extensions/EXT_structural_metadata.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/EXT_texture_webp.js +2 -2
- package/dist/lib/extensions/EXT_texture_webp.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/KHR_binary_gltf.js +1 -1
- package/dist/lib/extensions/KHR_binary_gltf.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/KHR_draco_mesh_compression.js +2 -2
- package/dist/lib/extensions/KHR_draco_mesh_compression.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/KHR_texture_basisu.js +1 -1
- package/dist/lib/extensions/KHR_texture_basisu.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/KHR_texture_transform.js +6 -6
- package/dist/lib/extensions/KHR_texture_transform.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/deprecated/EXT_feature_metadata.js +3 -3
- package/dist/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/deprecated/KHR_lights_punctual.js +2 -2
- package/dist/lib/extensions/deprecated/KHR_lights_punctual.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/deprecated/KHR_materials_unlit.js +1 -1
- package/dist/lib/extensions/deprecated/KHR_materials_unlit.js.map +1 -0
- package/dist/{esm/lib → lib}/extensions/deprecated/KHR_techniques_webgl.js +1 -1
- package/dist/lib/extensions/deprecated/KHR_techniques_webgl.js.map +1 -0
- package/dist/lib/extensions/utils/3d-tiles-utils.d.ts +1 -1
- package/dist/lib/extensions/utils/3d-tiles-utils.d.ts.map +1 -1
- package/dist/{esm/lib → lib}/extensions/utils/3d-tiles-utils.js +6 -9
- package/dist/lib/extensions/utils/3d-tiles-utils.js.map +1 -0
- package/dist/lib/gltf-utils/get-typed-array.d.ts +10 -0
- package/dist/lib/gltf-utils/get-typed-array.d.ts.map +1 -1
- package/dist/lib/gltf-utils/get-typed-array.js +51 -0
- package/dist/lib/gltf-utils/get-typed-array.js.map +1 -0
- package/dist/{esm/lib → lib}/gltf-utils/gltf-attribute-utils.js +1 -1
- package/dist/lib/gltf-utils/gltf-attribute-utils.js.map +1 -0
- package/dist/lib/gltf-utils/gltf-constants.js.map +1 -0
- package/dist/lib/gltf-utils/gltf-utils.d.ts +2 -2
- package/dist/lib/gltf-utils/gltf-utils.d.ts.map +1 -1
- package/dist/{esm/lib → lib}/gltf-utils/gltf-utils.js +7 -32
- package/dist/lib/gltf-utils/gltf-utils.js.map +1 -0
- package/dist/{esm/lib → lib}/gltf-utils/resolve-url.js +1 -1
- package/dist/lib/gltf-utils/resolve-url.js.map +1 -0
- package/dist/{esm/lib → lib}/parsers/parse-glb.js +6 -2
- package/dist/lib/parsers/parse-glb.js.map +1 -0
- package/dist/{esm/lib → lib}/parsers/parse-gltf.js +7 -7
- package/dist/lib/parsers/parse-gltf.js.map +1 -0
- package/dist/lib/types/glb-types.js.map +1 -0
- package/dist/lib/types/gltf-ext-feature-metadata-schema.js.map +1 -0
- package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts +3 -1
- package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts.map +1 -1
- package/dist/lib/types/gltf-ext-mesh-features-schema.js.map +1 -0
- package/dist/lib/types/gltf-ext-structural-metadata-schema.js.map +1 -0
- package/dist/lib/types/gltf-json-schema.d.ts +7 -0
- package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/lib/types/gltf-json-schema.js.map +1 -0
- package/dist/lib/types/gltf-postprocessed-schema.js.map +1 -0
- package/dist/lib/types/gltf-types.d.ts +1 -1
- package/dist/lib/types/gltf-types.d.ts.map +1 -1
- package/dist/lib/types/gltf-types.js.map +1 -0
- package/dist/lib/utils/assert.js.map +1 -0
- package/dist/lib/utils/version.js +2 -0
- package/dist/lib/utils/version.js.map +1 -0
- package/dist/{esm/meshopt → meshopt}/meshopt-decoder.js +1 -1
- package/dist/meshopt/meshopt-decoder.js.map +1 -0
- package/dist/{esm/webp → webp}/webp.js +1 -1
- package/dist/webp/webp.js.map +1 -0
- package/package.json +19 -11
- package/src/lib/api/gltf-scenegraph.ts +5 -17
- package/src/lib/extensions/EXT_mesh_features.ts +4 -2
- package/src/lib/extensions/utils/3d-tiles-utils.ts +17 -17
- package/src/lib/gltf-utils/get-typed-array.ts +53 -14
- package/src/lib/gltf-utils/gltf-utils.ts +3 -39
- package/src/lib/types/gltf-ext-mesh-features-schema.ts +3 -1
- package/src/lib/types/gltf-json-schema.ts +7 -0
- package/src/lib/types/gltf-types.ts +1 -1
- package/dist/bundle.d.ts +0 -2
- package/dist/bundle.d.ts.map +0 -1
- package/dist/es5/bundle.js +0 -6
- package/dist/es5/bundle.js.map +0 -1
- package/dist/es5/glb-loader.js +0 -54
- package/dist/es5/glb-loader.js.map +0 -1
- package/dist/es5/glb-writer.js +0 -34
- package/dist/es5/glb-writer.js.map +0 -1
- package/dist/es5/gltf-loader.js +0 -81
- package/dist/es5/gltf-loader.js.map +0 -1
- package/dist/es5/gltf-writer.js +0 -35
- package/dist/es5/gltf-writer.js.map +0 -1
- package/dist/es5/index.js +0 -88
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/lib/api/gltf-extensions.js +0 -111
- package/dist/es5/lib/api/gltf-extensions.js.map +0 -1
- package/dist/es5/lib/api/gltf-scenegraph.js +0 -598
- package/dist/es5/lib/api/gltf-scenegraph.js.map +0 -1
- package/dist/es5/lib/api/normalize-gltf-v1.js +0 -331
- package/dist/es5/lib/api/normalize-gltf-v1.js.map +0 -1
- package/dist/es5/lib/api/post-process-gltf.js +0 -470
- package/dist/es5/lib/api/post-process-gltf.js.map +0 -1
- package/dist/es5/lib/encoders/encode-glb.js +0 -61
- package/dist/es5/lib/encoders/encode-glb.js.map +0 -1
- package/dist/es5/lib/encoders/encode-gltf.js +0 -20
- package/dist/es5/lib/encoders/encode-gltf.js.map +0 -1
- package/dist/es5/lib/extensions/EXT_mesh_features.js +0 -99
- package/dist/es5/lib/extensions/EXT_mesh_features.js.map +0 -1
- package/dist/es5/lib/extensions/EXT_meshopt_compression.js +0 -94
- package/dist/es5/lib/extensions/EXT_meshopt_compression.js.map +0 -1
- package/dist/es5/lib/extensions/EXT_structural_metadata.js +0 -375
- package/dist/es5/lib/extensions/EXT_structural_metadata.js.map +0 -1
- package/dist/es5/lib/extensions/EXT_texture_webp.js +0 -43
- package/dist/es5/lib/extensions/EXT_texture_webp.js.map +0 -1
- package/dist/es5/lib/extensions/KHR_binary_gltf.js +0 -39
- package/dist/es5/lib/extensions/KHR_binary_gltf.js.map +0 -1
- package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js +0 -246
- package/dist/es5/lib/extensions/KHR_draco_mesh_compression.js.map +0 -1
- package/dist/es5/lib/extensions/KHR_texture_basisu.js +0 -36
- package/dist/es5/lib/extensions/KHR_texture_basisu.js.map +0 -1
- package/dist/es5/lib/extensions/KHR_texture_transform.js +0 -231
- package/dist/es5/lib/extensions/KHR_texture_transform.js.map +0 -1
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +0 -260
- package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +0 -1
- package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js +0 -99
- package/dist/es5/lib/extensions/deprecated/KHR_lights_punctual.js.map +0 -1
- package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js +0 -76
- package/dist/es5/lib/extensions/deprecated/KHR_materials_unlit.js.map +0 -1
- package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js +0 -113
- package/dist/es5/lib/extensions/deprecated/KHR_techniques_webgl.js.map +0 -1
- package/dist/es5/lib/extensions/utils/3d-tiles-utils.js +0 -254
- package/dist/es5/lib/extensions/utils/3d-tiles-utils.js.map +0 -1
- package/dist/es5/lib/gltf-utils/get-typed-array.js +0 -23
- package/dist/es5/lib/gltf-utils/get-typed-array.js.map +0 -1
- package/dist/es5/lib/gltf-utils/gltf-attribute-utils.js +0 -68
- package/dist/es5/lib/gltf-utils/gltf-attribute-utils.js.map +0 -1
- package/dist/es5/lib/gltf-utils/gltf-constants.js +0 -48
- package/dist/es5/lib/gltf-utils/gltf-constants.js.map +0 -1
- package/dist/es5/lib/gltf-utils/gltf-utils.js +0 -115
- package/dist/es5/lib/gltf-utils/gltf-utils.js.map +0 -1
- package/dist/es5/lib/gltf-utils/resolve-url.js +0 -18
- package/dist/es5/lib/gltf-utils/resolve-url.js.map +0 -1
- package/dist/es5/lib/parsers/parse-glb.js +0 -120
- package/dist/es5/lib/parsers/parse-glb.js.map +0 -1
- package/dist/es5/lib/parsers/parse-gltf.js +0 -283
- package/dist/es5/lib/parsers/parse-gltf.js.map +0 -1
- package/dist/es5/lib/types/glb-types.js +0 -2
- package/dist/es5/lib/types/glb-types.js.map +0 -1
- package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js +0 -2
- package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js.map +0 -1
- package/dist/es5/lib/types/gltf-ext-mesh-features-schema.js +0 -2
- package/dist/es5/lib/types/gltf-ext-mesh-features-schema.js.map +0 -1
- package/dist/es5/lib/types/gltf-ext-structural-metadata-schema.js +0 -2
- package/dist/es5/lib/types/gltf-ext-structural-metadata-schema.js.map +0 -1
- package/dist/es5/lib/types/gltf-json-schema.js +0 -2
- package/dist/es5/lib/types/gltf-json-schema.js.map +0 -1
- package/dist/es5/lib/types/gltf-postprocessed-schema.js +0 -2
- package/dist/es5/lib/types/gltf-postprocessed-schema.js.map +0 -1
- package/dist/es5/lib/types/gltf-types.js +0 -2
- package/dist/es5/lib/types/gltf-types.js.map +0 -1
- package/dist/es5/lib/utils/assert.js +0 -12
- package/dist/es5/lib/utils/assert.js.map +0 -1
- package/dist/es5/lib/utils/version.js +0 -9
- package/dist/es5/lib/utils/version.js.map +0 -1
- package/dist/es5/meshopt/meshopt-decoder.js +0 -215
- package/dist/es5/meshopt/meshopt-decoder.js.map +0 -1
- package/dist/es5/webp/webp.js +0 -83
- package/dist/es5/webp/webp.js.map +0 -1
- package/dist/esm/bundle.js +0 -4
- package/dist/esm/bundle.js.map +0 -1
- package/dist/esm/glb-loader.js.map +0 -1
- package/dist/esm/glb-writer.js.map +0 -1
- package/dist/esm/gltf-loader.js.map +0 -1
- package/dist/esm/gltf-writer.js.map +0 -1
- package/dist/esm/index.js +0 -13
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lib/api/gltf-extensions.js.map +0 -1
- package/dist/esm/lib/api/gltf-scenegraph.js.map +0 -1
- package/dist/esm/lib/api/normalize-gltf-v1.js.map +0 -1
- package/dist/esm/lib/api/post-process-gltf.js.map +0 -1
- package/dist/esm/lib/encoders/encode-glb.js.map +0 -1
- package/dist/esm/lib/encoders/encode-gltf.js.map +0 -1
- package/dist/esm/lib/extensions/EXT_mesh_features.js.map +0 -1
- package/dist/esm/lib/extensions/EXT_meshopt_compression.js.map +0 -1
- package/dist/esm/lib/extensions/EXT_structural_metadata.js.map +0 -1
- package/dist/esm/lib/extensions/EXT_texture_webp.js.map +0 -1
- package/dist/esm/lib/extensions/KHR_binary_gltf.js.map +0 -1
- package/dist/esm/lib/extensions/KHR_draco_mesh_compression.js.map +0 -1
- package/dist/esm/lib/extensions/KHR_texture_basisu.js.map +0 -1
- package/dist/esm/lib/extensions/KHR_texture_transform.js.map +0 -1
- package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +0 -1
- package/dist/esm/lib/extensions/deprecated/KHR_lights_punctual.js.map +0 -1
- package/dist/esm/lib/extensions/deprecated/KHR_materials_unlit.js.map +0 -1
- package/dist/esm/lib/extensions/deprecated/KHR_techniques_webgl.js.map +0 -1
- package/dist/esm/lib/extensions/utils/3d-tiles-utils.js.map +0 -1
- package/dist/esm/lib/gltf-utils/get-typed-array.js +0 -16
- package/dist/esm/lib/gltf-utils/get-typed-array.js.map +0 -1
- package/dist/esm/lib/gltf-utils/gltf-attribute-utils.js.map +0 -1
- package/dist/esm/lib/gltf-utils/gltf-constants.js.map +0 -1
- package/dist/esm/lib/gltf-utils/gltf-utils.js.map +0 -1
- package/dist/esm/lib/gltf-utils/resolve-url.js.map +0 -1
- package/dist/esm/lib/parsers/parse-glb.js.map +0 -1
- package/dist/esm/lib/parsers/parse-gltf.js.map +0 -1
- package/dist/esm/lib/types/glb-types.js.map +0 -1
- package/dist/esm/lib/types/gltf-ext-feature-metadata-schema.js.map +0 -1
- package/dist/esm/lib/types/gltf-ext-mesh-features-schema.js.map +0 -1
- package/dist/esm/lib/types/gltf-ext-structural-metadata-schema.js.map +0 -1
- package/dist/esm/lib/types/gltf-json-schema.js.map +0 -1
- package/dist/esm/lib/types/gltf-postprocessed-schema.js.map +0 -1
- package/dist/esm/lib/types/gltf-types.js.map +0 -1
- package/dist/esm/lib/utils/assert.js.map +0 -1
- package/dist/esm/lib/utils/version.js +0 -2
- package/dist/esm/lib/utils/version.js.map +0 -1
- package/dist/esm/meshopt/meshopt-decoder.js.map +0 -1
- package/dist/esm/meshopt/meshopt-encoder.ts.disabled +0 -409
- package/dist/esm/webp/webp.js.map +0 -1
- package/src/bundle.ts +0 -4
- /package/dist/{esm/lib → lib}/encoders/encode-glb.js +0 -0
- /package/dist/{esm/lib → lib}/gltf-utils/gltf-constants.js +0 -0
- /package/dist/{esm/lib → lib}/types/glb-types.js +0 -0
- /package/dist/{esm/lib → lib}/types/gltf-ext-feature-metadata-schema.js +0 -0
- /package/dist/{esm/lib → lib}/types/gltf-ext-mesh-features-schema.js +0 -0
- /package/dist/{esm/lib → lib}/types/gltf-ext-structural-metadata-schema.js +0 -0
- /package/dist/{esm/lib → lib}/types/gltf-json-schema.js +0 -0
- /package/dist/{esm/lib → lib}/types/gltf-postprocessed-schema.js +0 -0
- /package/dist/{esm/lib → lib}/types/gltf-types.js +0 -0
- /package/dist/{esm/lib → lib}/utils/assert.js +0 -0
- /package/dist/{es5/meshopt → meshopt}/meshopt-encoder.ts.disabled +0 -0
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.isGLTF = isGLTF;
|
|
8
|
-
exports.parseGLTF = parseGLTF;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
-
var _loaderUtils = require("@loaders.gl/loader-utils");
|
|
13
|
-
var _images = require("@loaders.gl/images");
|
|
14
|
-
var _textures = require("@loaders.gl/textures");
|
|
15
|
-
var _assert = require("../utils/assert");
|
|
16
|
-
var _parseGlb = require("./parse-glb");
|
|
17
|
-
var _resolveUrl = require("../gltf-utils/resolve-url");
|
|
18
|
-
var _getTypedArray = require("../gltf-utils/get-typed-array");
|
|
19
|
-
var _gltfExtensions = require("../api/gltf-extensions");
|
|
20
|
-
var _normalizeGltfV = require("../api/normalize-gltf-v1");
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
24
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
26
|
-
function isGLTF(arrayBuffer, options) {
|
|
27
|
-
var byteOffset = 0;
|
|
28
|
-
return (0, _parseGlb.isGLB)(arrayBuffer, byteOffset, options);
|
|
29
|
-
}
|
|
30
|
-
function parseGLTF(_x, _x2) {
|
|
31
|
-
return _parseGLTF.apply(this, arguments);
|
|
32
|
-
}
|
|
33
|
-
function _parseGLTF() {
|
|
34
|
-
_parseGLTF = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(gltf, arrayBufferOrString) {
|
|
35
|
-
var _options$gltf, _options$gltf2, _options$gltf3;
|
|
36
|
-
var byteOffset,
|
|
37
|
-
options,
|
|
38
|
-
context,
|
|
39
|
-
_args = arguments;
|
|
40
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
41
|
-
while (1) switch (_context.prev = _context.next) {
|
|
42
|
-
case 0:
|
|
43
|
-
byteOffset = _args.length > 2 && _args[2] !== undefined ? _args[2] : 0;
|
|
44
|
-
options = _args.length > 3 ? _args[3] : undefined;
|
|
45
|
-
context = _args.length > 4 ? _args[4] : undefined;
|
|
46
|
-
parseGLTFContainerSync(gltf, arrayBufferOrString, byteOffset, options);
|
|
47
|
-
(0, _normalizeGltfV.normalizeGLTFV1)(gltf, {
|
|
48
|
-
normalize: options === null || options === void 0 ? void 0 : (_options$gltf = options.gltf) === null || _options$gltf === void 0 ? void 0 : _options$gltf.normalize
|
|
49
|
-
});
|
|
50
|
-
(0, _gltfExtensions.preprocessExtensions)(gltf, options, context);
|
|
51
|
-
if (!(options !== null && options !== void 0 && (_options$gltf2 = options.gltf) !== null && _options$gltf2 !== void 0 && _options$gltf2.loadBuffers && gltf.json.buffers)) {
|
|
52
|
-
_context.next = 9;
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
_context.next = 9;
|
|
56
|
-
return loadBuffers(gltf, options, context);
|
|
57
|
-
case 9:
|
|
58
|
-
if (!(options !== null && options !== void 0 && (_options$gltf3 = options.gltf) !== null && _options$gltf3 !== void 0 && _options$gltf3.loadImages)) {
|
|
59
|
-
_context.next = 12;
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
_context.next = 12;
|
|
63
|
-
return loadImages(gltf, options, context);
|
|
64
|
-
case 12:
|
|
65
|
-
_context.next = 14;
|
|
66
|
-
return (0, _gltfExtensions.decodeExtensions)(gltf, options, context);
|
|
67
|
-
case 14:
|
|
68
|
-
return _context.abrupt("return", gltf);
|
|
69
|
-
case 15:
|
|
70
|
-
case "end":
|
|
71
|
-
return _context.stop();
|
|
72
|
-
}
|
|
73
|
-
}, _callee);
|
|
74
|
-
}));
|
|
75
|
-
return _parseGLTF.apply(this, arguments);
|
|
76
|
-
}
|
|
77
|
-
function parseGLTFContainerSync(gltf, data, byteOffset, options) {
|
|
78
|
-
if (options.uri) {
|
|
79
|
-
gltf.baseUri = options.uri;
|
|
80
|
-
}
|
|
81
|
-
if (data instanceof ArrayBuffer && !(0, _parseGlb.isGLB)(data, byteOffset, options)) {
|
|
82
|
-
var textDecoder = new TextDecoder();
|
|
83
|
-
data = textDecoder.decode(data);
|
|
84
|
-
}
|
|
85
|
-
if (typeof data === 'string') {
|
|
86
|
-
gltf.json = (0, _loaderUtils.parseJSON)(data);
|
|
87
|
-
} else if (data instanceof ArrayBuffer) {
|
|
88
|
-
var glb = {};
|
|
89
|
-
byteOffset = (0, _parseGlb.parseGLBSync)(glb, data, byteOffset, options.glb);
|
|
90
|
-
(0, _assert.assert)(glb.type === 'glTF', "Invalid GLB magic string ".concat(glb.type));
|
|
91
|
-
gltf._glb = glb;
|
|
92
|
-
gltf.json = glb.json;
|
|
93
|
-
} else {
|
|
94
|
-
(0, _assert.assert)(false, 'GLTF: must be ArrayBuffer or string');
|
|
95
|
-
}
|
|
96
|
-
var buffers = gltf.json.buffers || [];
|
|
97
|
-
gltf.buffers = new Array(buffers.length).fill(null);
|
|
98
|
-
if (gltf._glb && gltf._glb.header.hasBinChunk) {
|
|
99
|
-
var binChunks = gltf._glb.binChunks;
|
|
100
|
-
gltf.buffers[0] = {
|
|
101
|
-
arrayBuffer: binChunks[0].arrayBuffer,
|
|
102
|
-
byteOffset: binChunks[0].byteOffset,
|
|
103
|
-
byteLength: binChunks[0].byteLength
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
var images = gltf.json.images || [];
|
|
107
|
-
gltf.images = new Array(images.length).fill({});
|
|
108
|
-
}
|
|
109
|
-
function loadBuffers(_x3, _x4, _x5) {
|
|
110
|
-
return _loadBuffers.apply(this, arguments);
|
|
111
|
-
}
|
|
112
|
-
function _loadBuffers() {
|
|
113
|
-
_loadBuffers = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(gltf, options, context) {
|
|
114
|
-
var buffers, i, buffer, _context$fetch, _response$arrayBuffer, fetch, uri, response, arrayBuffer;
|
|
115
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
116
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
117
|
-
case 0:
|
|
118
|
-
buffers = gltf.json.buffers || [];
|
|
119
|
-
i = 0;
|
|
120
|
-
case 2:
|
|
121
|
-
if (!(i < buffers.length)) {
|
|
122
|
-
_context2.next = 22;
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
buffer = buffers[i];
|
|
126
|
-
if (!buffer.uri) {
|
|
127
|
-
_context2.next = 18;
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
fetch = context.fetch;
|
|
131
|
-
(0, _assert.assert)(fetch);
|
|
132
|
-
uri = (0, _resolveUrl.resolveUrl)(buffer.uri, options);
|
|
133
|
-
_context2.next = 10;
|
|
134
|
-
return context === null || context === void 0 ? void 0 : (_context$fetch = context.fetch) === null || _context$fetch === void 0 ? void 0 : _context$fetch.call(context, uri);
|
|
135
|
-
case 10:
|
|
136
|
-
response = _context2.sent;
|
|
137
|
-
_context2.next = 13;
|
|
138
|
-
return response === null || response === void 0 ? void 0 : (_response$arrayBuffer = response.arrayBuffer) === null || _response$arrayBuffer === void 0 ? void 0 : _response$arrayBuffer.call(response);
|
|
139
|
-
case 13:
|
|
140
|
-
arrayBuffer = _context2.sent;
|
|
141
|
-
gltf.buffers[i] = {
|
|
142
|
-
arrayBuffer: arrayBuffer,
|
|
143
|
-
byteOffset: 0,
|
|
144
|
-
byteLength: arrayBuffer.byteLength
|
|
145
|
-
};
|
|
146
|
-
delete buffer.uri;
|
|
147
|
-
_context2.next = 19;
|
|
148
|
-
break;
|
|
149
|
-
case 18:
|
|
150
|
-
if (gltf.buffers[i] === null) {
|
|
151
|
-
gltf.buffers[i] = {
|
|
152
|
-
arrayBuffer: new ArrayBuffer(buffer.byteLength),
|
|
153
|
-
byteOffset: 0,
|
|
154
|
-
byteLength: buffer.byteLength
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
case 19:
|
|
158
|
-
++i;
|
|
159
|
-
_context2.next = 2;
|
|
160
|
-
break;
|
|
161
|
-
case 22:
|
|
162
|
-
case "end":
|
|
163
|
-
return _context2.stop();
|
|
164
|
-
}
|
|
165
|
-
}, _callee2);
|
|
166
|
-
}));
|
|
167
|
-
return _loadBuffers.apply(this, arguments);
|
|
168
|
-
}
|
|
169
|
-
function loadImages(_x6, _x7, _x8) {
|
|
170
|
-
return _loadImages.apply(this, arguments);
|
|
171
|
-
}
|
|
172
|
-
function _loadImages() {
|
|
173
|
-
_loadImages = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(gltf, options, context) {
|
|
174
|
-
var imageIndices, images, promises, _iterator2, _step2, imageIndex;
|
|
175
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
176
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
177
|
-
case 0:
|
|
178
|
-
imageIndices = getReferencesImageIndices(gltf);
|
|
179
|
-
images = gltf.json.images || [];
|
|
180
|
-
promises = [];
|
|
181
|
-
_iterator2 = _createForOfIteratorHelper(imageIndices);
|
|
182
|
-
try {
|
|
183
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
184
|
-
imageIndex = _step2.value;
|
|
185
|
-
promises.push(loadImage(gltf, images[imageIndex], imageIndex, options, context));
|
|
186
|
-
}
|
|
187
|
-
} catch (err) {
|
|
188
|
-
_iterator2.e(err);
|
|
189
|
-
} finally {
|
|
190
|
-
_iterator2.f();
|
|
191
|
-
}
|
|
192
|
-
_context3.next = 7;
|
|
193
|
-
return Promise.all(promises);
|
|
194
|
-
case 7:
|
|
195
|
-
return _context3.abrupt("return", _context3.sent);
|
|
196
|
-
case 8:
|
|
197
|
-
case "end":
|
|
198
|
-
return _context3.stop();
|
|
199
|
-
}
|
|
200
|
-
}, _callee3);
|
|
201
|
-
}));
|
|
202
|
-
return _loadImages.apply(this, arguments);
|
|
203
|
-
}
|
|
204
|
-
function getReferencesImageIndices(gltf) {
|
|
205
|
-
var imageIndices = new Set();
|
|
206
|
-
var textures = gltf.json.textures || [];
|
|
207
|
-
var _iterator = _createForOfIteratorHelper(textures),
|
|
208
|
-
_step;
|
|
209
|
-
try {
|
|
210
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
211
|
-
var texture = _step.value;
|
|
212
|
-
if (texture.source !== undefined) {
|
|
213
|
-
imageIndices.add(texture.source);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
} catch (err) {
|
|
217
|
-
_iterator.e(err);
|
|
218
|
-
} finally {
|
|
219
|
-
_iterator.f();
|
|
220
|
-
}
|
|
221
|
-
return Array.from(imageIndices).sort();
|
|
222
|
-
}
|
|
223
|
-
function loadImage(_x9, _x10, _x11, _x12, _x13) {
|
|
224
|
-
return _loadImage.apply(this, arguments);
|
|
225
|
-
}
|
|
226
|
-
function _loadImage() {
|
|
227
|
-
_loadImage = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(gltf, image, index, options, context) {
|
|
228
|
-
var arrayBuffer, uri, fetch, response, array, parsedImage;
|
|
229
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
230
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
231
|
-
case 0:
|
|
232
|
-
if (!(image.uri && !image.hasOwnProperty('bufferView'))) {
|
|
233
|
-
_context4.next = 10;
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
uri = (0, _resolveUrl.resolveUrl)(image.uri, options);
|
|
237
|
-
fetch = context.fetch;
|
|
238
|
-
_context4.next = 5;
|
|
239
|
-
return fetch(uri);
|
|
240
|
-
case 5:
|
|
241
|
-
response = _context4.sent;
|
|
242
|
-
_context4.next = 8;
|
|
243
|
-
return response.arrayBuffer();
|
|
244
|
-
case 8:
|
|
245
|
-
arrayBuffer = _context4.sent;
|
|
246
|
-
image.bufferView = {
|
|
247
|
-
data: arrayBuffer
|
|
248
|
-
};
|
|
249
|
-
case 10:
|
|
250
|
-
if (Number.isFinite(image.bufferView)) {
|
|
251
|
-
array = (0, _getTypedArray.getTypedArrayForBufferView)(gltf.json, gltf.buffers, image.bufferView);
|
|
252
|
-
arrayBuffer = (0, _loaderUtils.sliceArrayBuffer)(array.buffer, array.byteOffset, array.byteLength);
|
|
253
|
-
}
|
|
254
|
-
(0, _assert.assert)(arrayBuffer, 'glTF image has no data');
|
|
255
|
-
_context4.next = 14;
|
|
256
|
-
return (0, _loaderUtils.parseFromContext)(arrayBuffer, [_images.ImageLoader, _textures.BasisLoader], _objectSpread(_objectSpread({}, options), {}, {
|
|
257
|
-
mimeType: image.mimeType,
|
|
258
|
-
basis: options.basis || {
|
|
259
|
-
format: (0, _textures.selectSupportedBasisFormat)()
|
|
260
|
-
}
|
|
261
|
-
}), context);
|
|
262
|
-
case 14:
|
|
263
|
-
parsedImage = _context4.sent;
|
|
264
|
-
if (parsedImage && parsedImage[0]) {
|
|
265
|
-
parsedImage = {
|
|
266
|
-
compressed: true,
|
|
267
|
-
mipmaps: false,
|
|
268
|
-
width: parsedImage[0].width,
|
|
269
|
-
height: parsedImage[0].height,
|
|
270
|
-
data: parsedImage[0]
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
gltf.images = gltf.images || [];
|
|
274
|
-
gltf.images[index] = parsedImage;
|
|
275
|
-
case 18:
|
|
276
|
-
case "end":
|
|
277
|
-
return _context4.stop();
|
|
278
|
-
}
|
|
279
|
-
}, _callee4);
|
|
280
|
-
}));
|
|
281
|
-
return _loadImage.apply(this, arguments);
|
|
282
|
-
}
|
|
283
|
-
//# sourceMappingURL=parse-gltf.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-gltf.js","names":["_loaderUtils","require","_images","_textures","_assert","_parseGlb","_resolveUrl","_getTypedArray","_gltfExtensions","_normalizeGltfV","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","default","getOwnPropertyDescriptors","defineProperties","defineProperty","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","return","minLen","_arrayLikeToArray","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","isGLTF","arrayBuffer","options","byteOffset","isGLB","parseGLTF","_x","_x2","_parseGLTF","_asyncToGenerator2","_regenerator","mark","_callee","gltf","arrayBufferOrString","_options$gltf","_options$gltf2","_options$gltf3","context","_args","wrap","_callee$","_context","prev","undefined","parseGLTFContainerSync","normalizeGLTFV1","normalize","preprocessExtensions","loadBuffers","json","buffers","loadImages","decodeExtensions","abrupt","stop","data","uri","baseUri","ArrayBuffer","textDecoder","TextDecoder","decode","parseJSON","glb","parseGLBSync","assert","type","concat","_glb","fill","header","hasBinChunk","binChunks","byteLength","images","_x3","_x4","_x5","_loadBuffers","_callee2","buffer","_context$fetch","_response$arrayBuffer","fetch","response","_callee2$","_context2","resolveUrl","sent","_x6","_x7","_x8","_loadImages","_callee3","imageIndices","promises","_iterator2","_step2","imageIndex","_callee3$","_context3","getReferencesImageIndices","loadImage","Promise","all","Set","textures","_iterator","_step","texture","add","sort","_x9","_x10","_x11","_x12","_x13","_loadImage","_callee4","image","index","array","parsedImage","_callee4$","_context4","hasOwnProperty","bufferView","Number","isFinite","getTypedArrayForBufferView","sliceArrayBuffer","parseFromContext","ImageLoader","BasisLoader","mimeType","basis","format","selectSupportedBasisFormat","compressed","mipmaps","width","height"],"sources":["../../../../src/lib/parsers/parse-gltf.ts"],"sourcesContent":["/* eslint-disable camelcase, max-statements, no-restricted-globals */\nimport type {LoaderContext} from '@loaders.gl/loader-utils';\nimport type {GLTFLoaderOptions} from '../../gltf-loader';\nimport type {GLTFWithBuffers} from '../types/gltf-types';\nimport type {GLB} from '../types/glb-types';\nimport type {ParseGLBOptions} from './parse-glb';\n\nimport type {ImageType, TextureLevel} from '@loaders.gl/schema';\nimport {parseJSON, sliceArrayBuffer, parseFromContext} from '@loaders.gl/loader-utils';\nimport {ImageLoader} from '@loaders.gl/images';\nimport {BasisLoader, selectSupportedBasisFormat} from '@loaders.gl/textures';\n\nimport {assert} from '../utils/assert';\nimport {isGLB, parseGLBSync} from './parse-glb';\nimport {resolveUrl} from '../gltf-utils/resolve-url';\nimport {getTypedArrayForBufferView} from '../gltf-utils/get-typed-array';\nimport {preprocessExtensions, decodeExtensions} from '../api/gltf-extensions';\nimport {normalizeGLTFV1} from '../api/normalize-gltf-v1';\n\n/** */\nexport type ParseGLTFOptions = ParseGLBOptions & {\n normalize?: boolean;\n loadImages?: boolean;\n loadBuffers?: boolean;\n decompressMeshes?: boolean;\n excludeExtensions?: string[];\n\n /** @deprecated not supported in v4. `postProcessGLTF()` must be called by the application */\n postProcess?: false;\n};\n\n/** Check if an array buffer appears to contain GLTF data */\nexport function isGLTF(arrayBuffer: ArrayBuffer, options?: ParseGLTFOptions): boolean {\n const byteOffset = 0;\n return isGLB(arrayBuffer, byteOffset, options);\n}\n\nexport async function parseGLTF(\n gltf: GLTFWithBuffers,\n arrayBufferOrString,\n byteOffset = 0,\n options: GLTFLoaderOptions,\n context: LoaderContext\n): Promise<GLTFWithBuffers> {\n parseGLTFContainerSync(gltf, arrayBufferOrString, byteOffset, options);\n\n normalizeGLTFV1(gltf, {normalize: options?.gltf?.normalize});\n\n preprocessExtensions(gltf, options, context);\n\n // Load linked buffers asynchronously and decodes base64 buffers in parallel\n if (options?.gltf?.loadBuffers && gltf.json.buffers) {\n await loadBuffers(gltf, options, context);\n }\n\n // loadImages and decodeExtensions should not be running in parallel, because\n // decodeExtensions uses data from images taken during the loadImages call.\n if (options?.gltf?.loadImages) {\n await loadImages(gltf, options, context);\n }\n\n await decodeExtensions(gltf, options, context);\n\n return gltf;\n}\n\n/**\n *\n * @param gltf\n * @param data - can be ArrayBuffer (GLB), ArrayBuffer (Binary JSON), String (JSON), or Object (parsed JSON)\n * @param byteOffset\n * @param options\n */\nfunction parseGLTFContainerSync(gltf, data, byteOffset, options) {\n // Initialize gltf container\n if (options.uri) {\n gltf.baseUri = options.uri;\n }\n\n // If data is binary and starting with magic bytes, assume binary JSON text, convert to string\n if (data instanceof ArrayBuffer && !isGLB(data, byteOffset, options)) {\n const textDecoder = new TextDecoder();\n data = textDecoder.decode(data);\n }\n\n if (typeof data === 'string') {\n // If string, try to parse as JSON\n gltf.json = parseJSON(data);\n } else if (data instanceof ArrayBuffer) {\n // If still ArrayBuffer, parse as GLB container\n const glb: GLB = {} as GLB;\n byteOffset = parseGLBSync(glb, data, byteOffset, options.glb);\n\n assert(glb.type === 'glTF', `Invalid GLB magic string ${glb.type}`);\n\n gltf._glb = glb;\n gltf.json = glb.json;\n } else {\n assert(false, 'GLTF: must be ArrayBuffer or string');\n }\n\n // Populate buffers\n // Create an external buffers array to hold binary data\n const buffers = gltf.json.buffers || [];\n gltf.buffers = new Array(buffers.length).fill(null);\n\n // Populates JSON and some bin chunk info\n if (gltf._glb && gltf._glb.header.hasBinChunk) {\n const {binChunks} = gltf._glb;\n gltf.buffers[0] = {\n arrayBuffer: binChunks[0].arrayBuffer,\n byteOffset: binChunks[0].byteOffset,\n byteLength: binChunks[0].byteLength\n };\n\n // TODO - this modifies JSON and is a post processing thing\n // gltf.json.buffers[0].data = gltf.buffers[0].arrayBuffer;\n // gltf.json.buffers[0].byteOffset = gltf.buffers[0].byteOffset;\n }\n\n // Populate images\n const images = gltf.json.images || [];\n gltf.images = new Array(images.length).fill({});\n}\n\n/** Asynchronously fetch and parse buffers, store in buffers array outside of json\n * TODO - traverse gltf and determine which buffers are actually needed\n */\nasync function loadBuffers(gltf: GLTFWithBuffers, options, context: LoaderContext) {\n // TODO\n const buffers = gltf.json.buffers || [];\n for (let i = 0; i < buffers.length; ++i) {\n const buffer = buffers[i];\n if (buffer.uri) {\n const {fetch} = context;\n assert(fetch);\n\n const uri = resolveUrl(buffer.uri, options);\n const response = await context?.fetch?.(uri);\n const arrayBuffer = await response?.arrayBuffer?.();\n\n gltf.buffers[i] = {\n arrayBuffer,\n byteOffset: 0,\n byteLength: arrayBuffer.byteLength\n };\n\n delete buffer.uri;\n } else if (gltf.buffers[i] === null) {\n gltf.buffers[i] = {\n arrayBuffer: new ArrayBuffer(buffer.byteLength),\n byteOffset: 0,\n byteLength: buffer.byteLength\n };\n }\n }\n}\n\n/**\n * Loads all images\n * TODO - traverse gltf and determine which images are actually needed\n * @param gltf\n * @param options\n * @param context\n * @returns\n */\nasync function loadImages(gltf: GLTFWithBuffers, options, context: LoaderContext) {\n const imageIndices = getReferencesImageIndices(gltf);\n\n const images = gltf.json.images || [];\n\n const promises: Promise<any>[] = [];\n for (const imageIndex of imageIndices) {\n promises.push(loadImage(gltf, images[imageIndex], imageIndex, options, context));\n }\n\n return await Promise.all(promises);\n}\n\n/** Make sure we only load images that are actually referenced by textures */\nfunction getReferencesImageIndices(gltf: GLTFWithBuffers): number[] {\n const imageIndices = new Set<number>();\n\n const textures = gltf.json.textures || [];\n for (const texture of textures) {\n if (texture.source !== undefined) {\n imageIndices.add(texture.source);\n }\n }\n\n return Array.from(imageIndices).sort();\n}\n\n/** Asynchronously fetches and parses one image, store in images array outside of json */\nasync function loadImage(\n gltf: GLTFWithBuffers,\n image,\n index: number,\n options,\n context: LoaderContext\n) {\n let arrayBuffer;\n\n if (image.uri && !image.hasOwnProperty('bufferView')) {\n const uri = resolveUrl(image.uri, options);\n\n const {fetch} = context;\n const response = await fetch(uri);\n\n arrayBuffer = await response.arrayBuffer();\n image.bufferView = {\n data: arrayBuffer\n };\n }\n\n if (Number.isFinite(image.bufferView)) {\n const array = getTypedArrayForBufferView(gltf.json, gltf.buffers, image.bufferView);\n arrayBuffer = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);\n }\n\n assert(arrayBuffer, 'glTF image has no data');\n\n // Call `parse`\n let parsedImage = (await parseFromContext(\n arrayBuffer,\n [ImageLoader, BasisLoader],\n {\n ...options,\n mimeType: image.mimeType,\n basis: options.basis || {format: selectSupportedBasisFormat()}\n },\n context\n )) as ImageType | TextureLevel[][];\n\n if (parsedImage && parsedImage[0]) {\n parsedImage = {\n compressed: true,\n // @ts-expect-error\n mipmaps: false,\n width: parsedImage[0].width,\n height: parsedImage[0].height,\n data: parsedImage[0]\n };\n }\n // TODO making sure ImageLoader is overridable by using array of loaders\n // const parsedImage = await parse(arrayBuffer, [ImageLoader]);\n\n // Store the loaded image\n gltf.images = gltf.images || [];\n // @ts-expect-error TODO - sort out image typing asap\n gltf.images[index] = parsedImage;\n}\n"],"mappings":";;;;;;;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AAAyD,SAAAS,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,IAAA,EAAAG,OAAA,YAAAH,IAAA;AAAA,SAAAU,cAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,WAAAF,SAAA,CAAAD,CAAA,IAAAC,SAAA,CAAAD,CAA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ACjCA,WAAW,GAAG;cACZgB,UAAU,EAAE,IAAI;cAEhBC,OAAO,EAAE,KAAK;cACdC,KAAK,EAAElB,WAAW,CAAC,CAAC,CAAC,CAACkB,KAAK;cAC3BC,MAAM,EAAEnB,WAAW,CAAC,CAAC,CAAC,CAACmB,MAAM;cAC7BtF,IAAI,EAAEmE,WAAW,CAAC,CAAC;YACrB,CAAC;UACH;UAKA1F,IAAI,CAAC0C,MAAM,GAAG1C,IAAI,CAAC0C,MAAM,IAAI,EAAE;UAE/B1C,IAAI,CAAC0C,MAAM,CAAC8C,KAAK,CAAC,GAAGE,WAAW;QAAC;QAAA;UAAA,OAAAE,SAAA,CAAAtE,IAAA;MAAA;IAAA,GAAAgE,QAAA;EAAA,CAClC;EAAA,OAAAD,UAAA,CAAAtJ,KAAA,OAAAI,SAAA;AAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glb-types.js","names":[],"sources":["../../../../src/lib/types/glb-types.ts"],"sourcesContent":["export type GLBBinChunk = {\n byteOffset: number;\n byteLength: number;\n arrayBuffer: ArrayBuffer;\n};\n\nexport type GLB = {\n type: string;\n version: number; // Version 2 of binary glTF container format\n\n // Put less important stuff in a header, to avoid clutter\n header: {\n byteOffset: number; // Byte offset into the initial arrayBuffer\n byteLength: number;\n hasBinChunk: boolean;\n };\n\n // Per spec we must iterate over chunks, ignoring all except JSON and BIN\n json: Record<string, any>;\n binChunks: GLBBinChunk[];\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-ext-feature-metadata-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-ext-feature-metadata-schema.ts"],"sourcesContent":["import {GLTFTextureInfo} from './gltf-json-schema';\n\n/* eslint-disable camelcase */\n\n/**\n * EXT_feature_metadata extension types\n * This extension has glTF-level metadata and primitive-level feature indexing and segmentation metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata\n *\n * glTF-level metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#gltf-extension-1\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/glTF.EXT_feature_metadata.schema.json\n */\nexport type GLTF_EXT_feature_metadata_GLTF = {\n /** An object defining classes and enums. */\n schema?: GLTF_EXT_feature_metadata_Schema;\n /** A uri to an external schema file. */\n schemaUri?: string;\n /** An object containing statistics about features. */\n statistics?: GLTF_EXT_feature_metadata_Statistics;\n /** A dictionary, where each key is a feature table ID and each value is an object defining the feature table. */\n featureTables?: {\n [key: string]: GLTF_EXT_feature_metadata_FeatureTable;\n };\n /** A dictionary, where each key is a feature texture ID and each value is an object defining the feature texture. */\n featureTextures?: {\n [key: string]: GLTF_EXT_feature_metadata_FeatureTexture;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * An object defining classes and enums.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#schema\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/schema.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Schema = {\n /** The name of the schema. */\n name?: string;\n /** The description of the schema. */\n description?: string;\n /** Application-specific version of the schema. */\n version?: string;\n /** A dictionary, where each key is a class ID and each value is an object defining the class. */\n classes?: {\n [key: string]: GLTF_EXT_feature_metadata_Class;\n };\n /** A dictionary, where each key is an enum ID and each value is an object defining the values for the enum. */\n enums?: {\n [key: string]: GLTF_EXT_feature_metadata_Enum;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * A class containing a set of properties.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/class.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Class = {\n /** The name of the class, e.g. for display purposes. */\n name?: string;\n /** The description of the class. */\n description?: string;\n /** A dictionary, where each key is a property ID and each value is an object defining the property. */\n properties: {\n [key: string]: GLTF_EXT_feature_metadata_ClassProperty;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * A class property.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-property\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/class.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_ClassProperty = {\n /** The name of the property, e.g. for display purposes. */\n name?: string;\n /** The description of the property. */\n description?: string;\n /**\n * The property type. If ENUM is used, then enumType must also be specified.\n * If ARRAY is used, then componentType must also be specified.\n * ARRAY is a fixed-length array when componentCount is defined, and variable-length otherwise.\n */\n type:\n | 'INT8'\n | 'UINT8'\n | 'INT16'\n | 'UINT16'\n | 'INT32'\n | 'UINT32'\n | 'INT64'\n | 'UINT64'\n | 'FLOAT32'\n | 'FLOAT64'\n | 'BOOLEAN'\n | 'STRING'\n | 'ENUM'\n | 'ARRAY'\n | string;\n /**\n * An enum ID as declared in the enums dictionary.\n * This value must be specified when type or componentType is ENUM.\n */\n enumType?: string;\n /**\n * When type is ARRAY this indicates the type of each component of the array.\n * If ENUM is used, then enumType must also be specified.\n */\n componentType?:\n | 'INT8'\n | 'UINT8'\n | 'INT16'\n | 'UINT16'\n | 'INT32'\n | 'UINT32'\n | 'INT64'\n | 'UINT64'\n | 'FLOAT32'\n | 'FLOAT64'\n | 'BOOLEAN'\n | 'STRING'\n | 'ENUM'\n | string;\n /** The number of components per element for ARRAY elements. */\n componentCount?: number;\n /**\n * Specifies whether integer values are normalized.\n * This applies both when type is an integer type, or when type is ARRAY with a componentType that is an integer type.\n * For unsigned integer types, values are normalized between [0.0, 1.0].\n * For signed integer types, values are normalized between [-1.0, 1.0].\n * For all other types, this property is ignored.\n */\n normalized: boolean;\n /**\n * Maximum allowed values for property values.\n * Only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values: they always correspond to the integer values.\n */\n max?: number | number[];\n /**\n * Minimum allowed values for property values.\n * Only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values: they always correspond to the integer values.\n */\n min?: number | number[];\n /**\n * A default value to use when the property value is not defined.\n * If used, optional must be set to true.\n * The type of the default value must match the property definition: For BOOLEAN use true or false.\n * For STRING use a JSON string. For a numeric type use a JSON number.\n * For ENUM use the enum name, not the integer value.\n * For ARRAY use a JSON array containing values matching the componentType.\n */\n default?: boolean | number | string | number[];\n /** If true, this property is optional. */\n optional?: boolean; // default false;\n /**\n * An identifier that describes how this property should be interpreted.\n * The semantic cannot be used by other properties in the class.\n */\n semantic?: string;\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * An object defining the values of an enum.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/enum.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Enum = {\n /** The name of the enum, e.g. for display purposes. */\n name?: string;\n /** The description of the enum. */\n description?: string;\n /** The type of the integer enum value. */\n valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64'; // default: \"UINT16\"\n /** An array of enum values. Duplicate names or duplicate integer values are not allowed. */\n values: GLTF_EXT_feature_metadata_EnumValue[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n [key: string]: unknown;\n};\n\n/**\n * An enum value.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#enum-value\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata/schema/enum.value.schema.json\n */\nexport type GLTF_EXT_feature_metadata_EnumValue = {\n /** The name of the enum value. */\n name: string;\n /** The description of the enum value. */\n description?: string;\n /** The integer enum value. */\n value: number; // default: \"UINT16\"\n extensions?: Record<string, unknown>;\n extras?: unknown;\n [key: string]: unknown;\n};\n\n/**\n * A feature table defined by a class and property values stored in arrays.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table\n * JSON Schenma - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureTable.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureTable = {\n /** The class that property values conform to. The value must be a class ID declared in the classes dictionary. */\n class?: string;\n /** The number of features, as well as the number of elements in each property array. */\n count: number;\n /**\n * A dictionary, where each key corresponds to a property ID in the class properties dictionary\n * and each value is an object describing where property values are stored.\n * Optional properties may be excluded from this dictionary.\n */\n properties?: {\n [key: string]: GLTF_EXT_feature_metadata_FeatureTableProperty;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * An array of binary property values.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-table-property\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureTable.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureTableProperty = {\n /**\n * The index of the buffer view containing property values.\n * The data type of property values is determined by the property definition:\n * When type is BOOLEAN values are packed into a bitfield.\n * When type is STRING values are stored as byte sequences and decoded as UTF-8 strings.\n * When type is a numeric type values are stored as the provided type.\n * When type is ENUM values are stored as the enum's valueType.\n * Each enum value in the buffer must match one of the allowed values in the enum definition.\n * When type is ARRAY elements are packed tightly together and the data type is based on the componentType following the same rules as above.\n * arrayOffsetBufferView is required for variable-size arrays\n * and stringOffsetBufferView is required for strings (for variable-length arrays of strings, both are required)\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes.\n * If the buffer view's buffer is the GLB-stored BIN chunk the byte offset is measured relative to the beginning of the GLB.\n * Otherwise it is measured relative to the beginning of the buffer.\n */\n bufferView: number;\n\n /** The type of values in arrayOffsetBufferView and stringOffsetBufferView. */\n offsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string; // default: \"UINT32\"\n /**\n * The index of the buffer view containing offsets for variable-length arrays.\n * The number of offsets is equal to the feature table count plus one.\n * The offsets represent the start positions of each array, with the last offset representing the position after the last array.\n * The array length is computed using the difference between the current offset and the subsequent offset.\n * If componentType is STRING the offsets index into the string offsets array (stored in stringOffsetBufferView),\n * otherwise they index into the property array (stored in bufferView).\n * The data type of these offsets is determined by offsetType.\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView\n */\n arrayOffsetBufferView?: number;\n /**\n * The index of the buffer view containing offsets for strings.\n * The number of offsets is equal to the number of string components plus one.\n * The offsets represent the byte offsets of each string in the main bufferView,\n * with the last offset representing the byte offset after the last string.\n * The string byte length is computed using the difference between the current offset and the subsequent offset.\n * The data type of these offsets is determined by offsetType.\n * The buffer view byteOffset must be aligned to a multiple of 8 bytes in the same manner as the main bufferView.\n */\n stringOffsetBufferView?: number;\n extensions?: Record<string, unknown>;\n extras?: unknown;\n /** This is not part of the spec. GLTFLoader loads feature tables data into this property */\n data: unknown;\n};\n\n/**\n * Features whose property values are stored directly in texture channels. This is not to be confused with feature ID textures which store feature IDs for use with a feature table.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-texture\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureTexture.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureTexture = {\n /** The class this feature texture conforms to. The value must be a class ID declared in the classes dictionary. */\n class: string;\n /**\n * A dictionary, where each key corresponds to a property ID in the class properties dictionary\n * and each value describes the texture channels containing property values.\n */\n properties: {\n [key: string]: GLTF_EXT_feature_metadata_TextureAccessor;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * A description of how to access property values from the color channels of a texture.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#texture-accessor\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/textureAccessor.schema.json\n */\nexport type GLTF_EXT_feature_metadata_TextureAccessor = {\n /** Texture channels containing property values. Channels are labeled by rgba and are swizzled with a string of 1-4 characters. */\n channels: string;\n /** The glTF texture and texture coordinates to use. */\n texture: GLTFTextureInfo;\n extensions?: Record<string, unknown>;\n extras?: unknown;\n /** This is not part of the spec. GLTFLoader loads feature tables data into this property */\n data: unknown;\n};\n\n/**\n * Statistics about features.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#statistics-1\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Statistics = {\n /**\n * A dictionary, where each key is a class ID declared in the classes dictionary\n * and each value is an object containing statistics about features that conform to the class.\n */\n classes?: {\n [key: string]: GLTF_EXT_feature_metadata_StatisticsClass;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * Statistics about features that conform to the class.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#class-statistics\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.class.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_StatisticsClass = {\n /** The number of features that conform to the class. */\n count?: number;\n /**\n * A dictionary, where each key is a class ID declared in the classes dictionary\n * and each value is an object containing statistics about property values.\n */\n properties?: {\n [key: string]: GLTF_EXT_feature_metadata_StatisticsClassProperty;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * min, max, mean, median, standardDeviation, variance, sum are\n * only applicable for numeric types and fixed-length arrays of numeric types.\n * For numeric types this is a single number.\n * For fixed-length arrays this is an array with componentCount number of elements.\n * The normalized property has no effect on these values.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#property-statistics\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/statistics.class.property.schema.json\n */\nexport type GLTF_EXT_feature_metadata_StatisticsClassProperty = {\n /** The minimum property value. */\n min?: number | number[];\n /** The maximum property value. */\n max?: number | number[];\n /** The arithmetic mean of the property values. */\n mean?: number | number[];\n /** The median of the property values. */\n median?: number | number[];\n /** The standard deviation of the property values. */\n standardDeviation?: number | number[];\n /** The variance of the property values. */\n variance?: number | number[];\n /** The sum of the property values. */\n sum?: number | number[];\n /**\n * A dictionary, where each key corresponds to an enum name and each value is the number of occurrences of that enum.\n * Only applicable when type or componentType is ENUM.\n * For fixed-length arrays, this is an array with componentCount number of elements.\n */\n occurrences: {\n [key: string]: number | number[];\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * EXT_feature_metadata extension types\n * This extension has glTF-level metadata and primitive-level (feature indexing and segmentation) metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata\n *\n * primitive-level metadata\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#primitive-extension\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/mesh.primitive.EXT_feature_metadata.schema.json\n */\nexport type GLTF_EXT_feature_metadata_Primitive = {\n /** Feature ids definition in attributes */\n featureIdAttributes?: GLTF_EXT_feature_metadata_FeatureIdAttribute[];\n /** Feature ids definition in textures */\n featureIdTextures?: GLTF_EXT_feature_metadata_FeatureIdTexture[];\n /** An array of IDs of feature textures from the root EXT_feature_metadata object. */\n featureTextures?: string[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * Attribute which described featureIds definition.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-id-attribute\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureIdAttribute.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdAttribute = {\n /** Name of feature table */\n featureTable: string;\n /** Described how feature ids are defined */\n featureIds: GLTF_EXT_feature_metadata_FeatureIdAttributeFeatureIds;\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * Defining featureIds by attributes or implicitly.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#primitive-extensionfeatureidattributes\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureIdAttribute.featureIds.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdAttributeFeatureIds = {\n /** Name of attribute where featureIds are defined */\n attribute?: string;\n /** Sets a constant feature ID for each vertex. The default is 0. */\n constant?: number;\n /** Sets the rate at which feature IDs increment.\n * If divisor is zero then constant is used.\n * If divisor is greater than zero the feature ID increments once per divisor sets of vertices, starting at constant.\n * The default is 0\n */\n divisor?: number;\n};\n\n/**\n * An object describing a texture used for storing per-texel feature IDs.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#feature-id-texture\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/featureIdTexture.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdTexture = {\n /** The ID of the feature table in the model's root `EXT_feature_metadata.featureTables` dictionary. */\n featureTable: string;\n /** A description of the texture and channel to use for feature IDs. The `channels` property must have a single channel. Furthermore,\n * feature IDs must be whole numbers in the range `[0, count - 1]` (inclusive), where `count` is the total number of features\n * in the feature table. Texel values must be read as integers. Texture filtering should be disabled when fetching feature IDs.\n */\n featureIds: GLTF_EXT_feature_metadata_FeatureIdTextureAccessor;\n};\n\n/**\n * A description of how to access property values from the color channels of a texture.\n * Spec - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata#featureidtexturefeatureids\n * JSON Schema - https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_feature_metadata/schema/textureAccessor.schema.json\n */\nexport type GLTF_EXT_feature_metadata_FeatureIdTextureAccessor = {\n /** gLTF textureInfo object - https://github.com/CesiumGS/glTF/blob/3d-tiles-next/specification/2.0/schema/textureInfo.schema.json */\n texture: GLTFTextureInfo;\n /** Must be a single channel (\"r\", \"g\", \"b\", or \"a\") */\n channels: 'r' | 'g' | 'b' | 'a';\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-ext-mesh-features-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-ext-mesh-features-schema.ts"],"sourcesContent":["import {GLTFTextureInfoMetadata} from './gltf-json-schema';\n/* eslint-disable camelcase */\n\n/**\n * EXT_mesh_features extension types\n * This is a primitive-level extension.\n * An object describing feature IDs for a mesh primitive.\n * @see https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features\n * or https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_mesh_features/schema/mesh.primitive.EXT_mesh_features.schema.json\n */\nexport type GLTF_EXT_mesh_features = {\n /** An array of feature ID sets. */\n featureIds: GLTF_EXT_mesh_features_featureId[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * Feature IDs stored in an attribute or texture.\n * @see https://github.com/CesiumGS/glTF/blob/c38f7f37e894004353c15cd0481bc5b7381ce841/extensions/2.0/Vendor/EXT_mesh_features/schema/featureId.schema.json\n */\nexport type GLTF_EXT_mesh_features_featureId = {\n /** The number of unique features in the attribute or texture. */\n featureCount: number;\n /** A value that indicates that no feature is associated with this vertex or texel. */\n nullFeatureId?: number;\n /** A label assigned to this feature ID set. Labels must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`. */\n label?: string;\n /**\n * An attribute containing feature IDs.\n * When `attribute` and `texture` are omitted the feature IDs are assigned to vertices by their index.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features/schema/featureIdAttribute.schema.json\n * An integer value used to construct a string in the format `_FEATURE_ID_<set index>` which is a reference to a key in `mesh.primitives.attributes`\n * (e.g. a value of `0` corresponds to `_FEATURE_ID_0`).\n */\n attribute?: number;\n /** A texture containing feature IDs. */\n texture?: GLTFTextureInfoMetadata;\n /** The index of the property table containing per-feature property values. Only applicable when using the `EXT_structural_metadata` extension. */\n propertyTable?: number;\n extensions?: Record<string, unknown>;\n extras?: unknown;\n\n /** This is not part of the spec. GLTFLoader loads feature tables data into this property */\n data?: unknown;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-ext-structural-metadata-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-ext-structural-metadata-schema.ts"],"sourcesContent":["import {GLTFTextureInfoMetadata} from './gltf-json-schema';\n\n/* eslint-disable camelcase */\n\n/**\n * glTF extension that provides structural metadata about vertices, texels, and features in a glTF asset.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json\n */\nexport type GLTF_EXT_structural_metadata_GLTF = {\n /** An object defining classes and enums. */\n schema?: GLTF_EXT_structural_metadata_Schema;\n /** A uri to an external schema file. */\n schemaUri?: string;\n /** An array of property table definitions, which may be referenced by index. */\n propertyTables?: GLTF_EXT_structural_metadata_PropertyTable[];\n /** An array of property texture definitions, which may be referenced by index. */\n propertyTextures?: GLTF_EXT_structural_metadata_PropertyTexture[];\n /** \"An array of property attribute definitions, which may be referenced by index. */\n propertyAttributes?: GLTF_EXT_structural_metadata_PropertyAttribute[];\n /** This is not part of the spec. GLTFLoader loads names of attributes crated into this property */\n dataAttributeNames?: string[];\n};\n\n/**\n * An object defining classes and enums.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/schema.schema.json\n */\nexport type GLTF_EXT_structural_metadata_Schema = {\n /** Unique identifier for the schema. Schema IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`. */\n id: string;\n /** The name of the schema. */\n name?: string;\n /** The description of the schema. */\n description?: string;\n /** Application-specific version of the schema. */\n version?: string;\n /** A dictionary, where each key is a class ID and each value is an object defining the class. */\n classes?: {\n [key: string]: GLTF_EXT_structural_metadata_Class;\n };\n /** A dictionary, where each key is an enum ID and each value is an object defining the values for the enum. */\n enums?: {\n [key: string]: GLTF_EXT_structural_metadata_Enum;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * An object defining the values of an enum.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.schema.json\n */\nexport type GLTF_EXT_structural_metadata_Enum = {\n /** The name of the enum, e.g. for display purposes. */\n name?: string;\n /** The description of the enum. */\n description?: string;\n /**\n * The type of the integer enum value.\n * Default value is 'UINT16'\n */\n valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64';\n /** An array of enum values. Duplicate names or duplicate integer values are not allowed. */\n values: GLTF_EXT_structural_metadata_EnumValue[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * An enum value.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.value.schema.json\n */\nexport type GLTF_EXT_structural_metadata_EnumValue = {\n /** The name of the enum value. */\n name: string;\n /** The description of the enum value. */\n description?: string;\n /** The integer enum value. */\n value: number;\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * A class containing a set of properties.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.schema.json\n */\nexport type GLTF_EXT_structural_metadata_Class = {\n /** The name of the class, e.g. for display purposes. */\n name?: string;\n /** The description of the class. */\n description?: string;\n /**\n * A dictionary, where each key is a property ID and each value is an object defining the property.\n * Property IDs must be alphanumeric identifiers matching the regular expression `^[a-zA-Z_][a-zA-Z0-9_]*$`.\n */\n properties: {\n [key: string]: GLTF_EXT_structural_metadata_ClassProperty;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * A class property.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.property.schema.json\n */\nexport type GLTF_EXT_structural_metadata_ClassProperty = {\n /** The name of the property, e.g. for display purposes. */\n name?: string;\n\n /** The description of the property. */\n description?: string;\n\n /** The element type. */\n type:\n | 'SCALAR'\n | 'VEC2'\n | 'VEC3'\n | 'VEC4'\n | 'MAT2'\n | 'MAT3'\n | 'MAT4'\n | 'BOOLEAN'\n | 'STRING'\n | 'ENUM'\n | string;\n\n /** The datatype of the element's components. Only applicable to `SCALAR`, `VECN`, and `MATN` types. */\n componentType?:\n | 'INT8'\n | 'UINT8'\n | 'INT16'\n | 'UINT16'\n | 'INT32'\n | 'UINT32'\n | 'INT64'\n | 'UINT64'\n | 'FLOAT32'\n | 'FLOAT64'\n | string;\n\n /** Enum ID as declared in the `enums` dictionary. Required when `type` is `ENUM`. */\n enumType?: string;\n\n /**\n * Whether the property is an array.\n * When `count` is defined the property is a fixed-length array. Otherwise the property is a variable-length array.\n */\n array?: boolean;\n\n /** The number of array elements. May only be defined when `array` is true. */\n count?: number;\n\n /**\n * Specifies whether integer values are normalized.\n * Only applicable to `SCALAR`, `VECN`, and `MATN` types with integer component types.\n * For unsigned integer component types, values are normalized between `[0.0, 1.0]`.\n * For signed integer component types, values are normalized between `[-1.0, 1.0]`.\n * For all other component types, this property must be false.\n */\n normalized?: boolean;\n\n /**\n * An offset to apply to property values.\n * Only applicable to `SCALAR`, `VECN`, and `MATN` types when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.\n */\n offset?: number | number[];\n\n /**\n * A scale to apply to property values.\n * Only applicable to `SCALAR`, `VECN`, and `MATN` types when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.\n */\n scale?: number | number[];\n\n /**\n * Maximum allowed value for the property.\n * Only applicable to `SCALAR`, `VECN`, and `MATN` types.\n * This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.\n */\n max?: number | number[];\n\n /**\n * Minimum allowed value for the property.\n * Only applicable to `SCALAR`, `VECN`, and `MATN` types.\n * This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.\n */\n min?: number | number[];\n\n default?: boolean | number | string | number[];\n /**\n * If required, the property must be present in every entity conforming to the class.\n * If not required, individual entities may include `noData` values, or the entire property may be omitted.\n * As a result, `noData` has no effect on a required property.\n * Client implementations may use required properties to make performance optimizations.\n * Default value is false.\n */\n required?: boolean;\n\n /**\n * A `noData` value represents missing data — also known as a sentinel value — wherever it appears.\n * `BOOLEAN` properties may not specify `noData` values.\n * This is given as the plain property value, without the transforms from the `normalized`, `offset`, and `scale` properties.\n * Must not be defined if `required` is true.\n */\n noData?: number | string | number[] | string[];\n\n /**\n * An identifier that describes how this property should be interpreted.\n * The semantic cannot be used by other properties in the class.\n */\n semantic?: string;\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * Properties conforming to a class, organized as property values stored in binary columnar arrays.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.schema.json\n */\nexport type GLTF_EXT_structural_metadata_PropertyTable = {\n /** The name of the property table, e.g. for display purposes. */\n name?: string;\n /** The class that property values conform to. The value must be a class ID declared in the `classes` dictionary. */\n class: string;\n /** The number of elements in each property array. */\n count: number;\n /**\n * A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary\n * and each value is an object describing where property values are stored.\n * Required properties must be included in this dictionary.\n */\n properties?: {\n [key: string]: GLTF_EXT_structural_metadata_PropertyTable_Property;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * An array of binary property values.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.property.schema.json\n */\nexport type GLTF_EXT_structural_metadata_PropertyTable_Property = {\n /**\n * The index of the buffer view containing property values.\n * The data type of property values is determined by the property definition:\n * When `type` is `BOOLEAN` values are packed into a bitstream.\n * When `type` is `STRING` values are stored as byte sequences and decoded as UTF-8 strings.\n * When `type` is `SCALAR`, `VECN`, or `MATN` the values are stored as the provided `componentType`\n * and the buffer view `byteOffset` must be aligned to a multiple of the `componentType` size.\n * When `type` is `ENUM` values are stored as the enum's `valueType`\n * and the buffer view `byteOffset` must be aligned to a multiple of the `valueType` size.\n * Each enum value in the array must match one of the allowed values in the enum definition.\n * `arrayOffsets` is required for variable-length arrays and `stringOffsets` is required for strings (for variable-length arrays of strings, both are required).\n */\n values: number;\n /**\n * The index of the buffer view containing offsets for variable-length arrays.\n * The number of offsets is equal to the property table `count` plus one.\n * The offsets represent the start positions of each array, with the last offset representing the position after the last array.\n * The array length is computed using the difference between the subsequent offset and the current offset.\n * If `type` is `STRING` the offsets index into the string offsets array (stored in `stringOffsets`), otherwise they index into the property array (stored in `values`).\n * The data type of these offsets is determined by `arrayOffsetType`.\n * The buffer view `byteOffset` must be aligned to a multiple of the `arrayOffsetType` size.\n */\n arrayOffsets?: number;\n /**\n * The index of the buffer view containing offsets for strings.\n * The number of offsets is equal to the number of string elements plus one.\n * The offsets represent the byte offsets of each string in the property array (stored in `values`), with the last offset representing the byte offset after the last string.\n * The string byte length is computed using the difference between the subsequent offset and the current offset.\n * The data type of these offsets is determined by `stringOffsetType`.\n * The buffer view `byteOffset` must be aligned to a multiple of the `stringOffsetType` size.\n */\n stringOffsets?: number;\n /**\n * The type of values in `arrayOffsets`.\n * Default value is 'UINT32'\n */\n arrayOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;\n\n /**\n * The type of values in `stringOffsets`.\n * Default value is 'UINT32'\n */\n stringOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;\n /**\n * An offset to apply to property values.\n * Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.\n * Overrides the class property's `offset` if both are defined.\n */\n offset?: number | number[];\n /**\n * A scale to apply to property values.\n * Only applicable when the component type is `FLOAT32` or `FLOAT64`, or when the property is `normalized`.\n * Overrides the class property's `scale` if both are defined.\n */\n scale?: number | number[];\n /**\n * Maximum value present in the property values.\n * Only applicable to `SCALAR`, `VECN`, and `MATN` types.\n * This is the maximum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.\n */\n max?: number | number[];\n /**\n * Minimum value present in the property values.\n * Only applicable to `SCALAR`, `VECN`, and `MATN` types.\n * This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.\n */\n min?: number | number[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n /** This is not part of the spec. GLTFLoader loads feature tables data into this property */\n data?: unknown;\n};\n\n/**\n * Properties conforming to a class, organized as property values stored in textures.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.schema.json\n */\nexport type GLTF_EXT_structural_metadata_PropertyTexture = {\n /** The name of the property texture, e.g. for display purposes. */\n name?: string;\n /** The class that property values conform to. The value must be a class ID declared in the `classes` dictionary. */\n class: string;\n /**\n * A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary\n * and each value is an object describing where property values are stored.\n * Required properties must be included in this dictionary.\n *\n * https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata\n * Each property that is defined in the propertyTexture object extends the glTF textureInfo object.\n * The texCoord specifies a texture coordinate set in the referring primitive.\n * The index is the index of the glTF texture object that stores the actual data. Additionally,\n * each property specifies an array of channels, which are the indices of the texture channels providing data for the respective property.\n * Channels of an RGBA texture are numbered 0..3 respectively.\n */\n properties?: {\n [key: string]: GLTFTextureInfoMetadata;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * Properties conforming to a class, organized as property values stored in attributes.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.schema.json\n */\nexport type GLTF_EXT_structural_metadata_PropertyAttribute = {\n /** The name of the property attribute, e.g. for display purposes. */\n name?: string;\n /** The class that property values conform to. The value must be a class ID declared in the `classes` dictionary. */\n class: string;\n /**\n * \"A dictionary, where each key corresponds to a property ID in the class' `properties` dictionary\n * and each value is an object describing where property values are stored.\n * Required properties must be included in this dictionary.\n */\n properties?: {\n [key: string]: unknown;\n };\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n\n/**\n * Structural metadata about a glTF primitive.\n * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/mesh.primitive.EXT_structural_metadata.schema.json\n */\nexport type GLTF_EXT_structural_metadata_Primitive = {\n /** An array of indexes of property textures in the root `EXT_structural_metadata` object. */\n propertyTextures?: number[];\n /** An array of indexes of property attributes in the root `EXT_structural_metadata` object. */\n propertyAttributes?: number[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-json-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-json-schema.ts"],"sourcesContent":["// Types forked from https://github.com/bwasty/gltf-loader-ts under MIT license\n// Generated from official JSON schema using `npm run generate-interface` on 2018-02-24\n\nexport type GLTFId = number;\n\n/**\n * Indices of those attributes that deviate from their initialization value.\n */\nexport type GLTFAccessorSparseIndices = {\n /**\n * The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n /**\n * The indices data type.\n */\n componentType: 5121 | 5123 | 5125 | number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.\n */\nexport type GLTFAccessorSparseValues = {\n /**\n * The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Sparse storage of attributes that deviate from their initialization value.\n */\nexport type GLTFAccessorSparse = {\n /**\n * Number of entries stored in the sparse array.\n */\n count: number;\n /**\n * Index array of size `count` that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase.\n */\n indices: GLTFAccessorSparseIndices;\n /**\n * Array of size `count` times number of components, storing the displaced accessor attributes pointed by `indices`. Substituted values must have the same `componentType` and number of components as the base accessor.\n */\n values: GLTFAccessorSparseValues;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.\n */\nexport type GLTFAccessor = {\n /**\n * The index of the bufferView.\n */\n bufferView?: GLTFId;\n /**\n * The offset relative to the start of the bufferView in bytes.\n */\n byteOffset?: number;\n /**\n * The datatype of components in the attribute.\n */\n componentType: 5120 | 5121 | 5122 | 5123 | 5125 | 5126 | number;\n /**\n * Specifies whether integer data values should be normalized.\n */\n normalized?: boolean;\n /**\n * The number of attributes referenced by this accessor.\n */\n count: number;\n /**\n * Specifies if the attribute is a scalar, vector, or matrix.\n */\n type: 'SCALAR' | 'VEC2' | 'VEC3' | 'VEC4' | 'MAT2' | 'MAT3' | 'MAT4' | string;\n /**\n * Maximum value of each component in this attribute.\n */\n max?: number[];\n /**\n * Minimum value of each component in this attribute.\n */\n min?: number[];\n /**\n * Sparse storage of attributes that deviate from their initialization value.\n */\n sparse?: GLTFAccessorSparse;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The index of the node and TRS property that an animation channel targets.\n */\nexport type GLTFAnimationChannelTarget = {\n /**\n * The index of the node to target.\n */\n node?: GLTFId;\n /**\n * The name of the node's TRS property to modify, or the \"weights\" of the Morph Targets it instantiates. For the \"translation\" property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the \"rotation\" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the \"scale\" property, the values are the scaling factors along the x, y, and z axes.\n */\n path: 'translation' | 'rotation' | 'scale' | 'weights' | string;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Targets an animation's sampler at a node's property.\n */\nexport type GLTFAnimationChannel = {\n /**\n * The index of a sampler in this animation used to compute the value for the target.\n */\n sampler: GLTFId;\n /**\n * The index of the node and TRS property to target.\n */\n target: GLTFAnimationChannelTarget;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\nexport type GLTFAnimationSampler = {\n /**\n * The index of an accessor containing keyframe input values, e.g., time.\n */\n input: GLTFId;\n /**\n * Interpolation algorithm.\n */\n interpolation?: 'LINEAR' | 'STEP' | 'CUBICSPLINE' | string;\n /**\n * The index of an accessor, containing keyframe output values.\n */\n output: GLTFId;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A keyframe animation.\n */\nexport type GLTFAnimation = {\n /**\n * An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets.\n */\n channels: GLTFAnimationChannel[];\n /**\n * An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\n samplers: GLTFAnimationSampler[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Metadata about the glTF asset.\n */\nexport type GLTFAsset = {\n /**\n * A copyright message suitable for display to credit the content creator.\n */\n copyright?: string;\n /**\n * Tool that generated this glTF model. Useful for debugging.\n */\n generator?: string;\n /**\n * The glTF version that this asset targets.\n */\n version: string;\n /**\n * The minimum glTF version that this asset targets.\n */\n minVersion?: string;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A buffer points to binary geometry, animation, or skins.\n */\nexport type GLTFBuffer = {\n /**\n * The uri of the buffer.\n */\n uri?: string;\n /**\n * The length of the buffer in bytes.\n */\n byteLength: number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A view into a buffer generally representing a subset of the buffer.\n */\nexport type GLTFBufferView = {\n /**\n * The index of the buffer.\n */\n buffer: GLTFId;\n /**\n * The offset into the buffer in bytes.\n */\n byteOffset?: number;\n /**\n * The length of the bufferView in bytes.\n */\n byteLength: number;\n /**\n * The stride, in bytes.\n */\n byteStride?: number;\n /**\n * The target that the GPU buffer should be bound to.\n */\n target?: 34962 | 34963 | number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\nexport type GLTFCameraOrthographic = {\n /**\n * The floating-point horizontal magnification of the view. Must not be zero.\n */\n xmag: number;\n /**\n * The floating-point vertical magnification of the view. Must not be zero.\n */\n ymag: number;\n /**\n * The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`.\n */\n zfar: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\nexport type GLTFCameraPerspective = {\n /**\n * The floating-point aspect ratio of the field of view.\n */\n aspectRatio?: number;\n /**\n * The floating-point vertical field of view in radians.\n */\n yfov: number;\n /**\n * The floating-point distance to the far clipping plane.\n */\n zfar?: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.\n */\nexport type GLTFCamera = {\n /**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\n orthographic?: GLTFCameraOrthographic;\n /**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\n perspective?: GLTFCameraPerspective;\n /**\n * Specifies if the camera uses a perspective or orthographic projection.\n */\n type: 'perspective' | 'orthographic' | string;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Image data used to create a texture. Image can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.\n */\nexport type GLTFImage = {\n /**\n * The uri of the image.\n */\n uri?: string;\n /**\n * The image's MIME type.\n */\n mimeType?: 'image/jpeg' | 'image/png' | string;\n /**\n * The index of the bufferView that contains the image. Use this instead of the image's uri property.\n */\n bufferView?: GLTFId;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Reference to a texture.\n */\nexport type GLTFTextureInfo = {\n /**\n * The index of the texture.\n */\n index: GLTFId;\n /**\n * The set index of texture's TEXCOORD attribute used for texture coordinate mapping.\n */\n texCoord?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Extended GLTFTextureInfo that is used in EXT_structural_metadata and EXT_mesh_features\n * https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata\n * https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_mesh_features\n */\nexport type GLTFTextureInfoMetadata = GLTFTextureInfo & {\n channels: number[] | string;\n /** For internal usage */\n data?: unknown;\n};\n\n/**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.\n */\nexport type GLTFMaterialPbrMetallicRoughness = {\n /**\n * The material's base color factor.\n */\n baseColorFactor?: number[];\n /**\n * The base color texture.\n */\n baseColorTexture?: GLTFTextureInfo;\n /**\n * The metalness of the material.\n */\n metallicFactor?: number;\n /**\n * The roughness of the material.\n */\n roughnessFactor?: number;\n /**\n * The metallic-roughness texture.\n */\n metallicRoughnessTexture?: GLTFTextureInfo;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\nexport type GLTFMaterialNormalTextureInfo = {\n index: any;\n texCoord?: any;\n /**\n * The scalar multiplier applied to each normal vector of the normal texture.\n */\n scale?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\nexport type GLTFMaterialOcclusionTextureInfo = {\n index: any;\n texCoord?: any;\n /**\n * A scalar multiplier controlling the amount of occlusion applied.\n */\n strength?: number;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The material appearance of a primitive.\n */\nexport type GLTFMaterial = {\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n /**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.\n */\n pbrMetallicRoughness?: GLTFMaterialPbrMetallicRoughness;\n /**\n * The normal map texture.\n */\n normalTexture?: GLTFMaterialNormalTextureInfo;\n /**\n * The occlusion map texture.\n */\n occlusionTexture?: GLTFMaterialOcclusionTextureInfo;\n /**\n * The emissive map texture.\n */\n emissiveTexture?: GLTFTextureInfo;\n /**\n * The emissive color of the material.\n */\n emissiveFactor?: number[];\n /**\n * The alpha rendering mode of the material.\n */\n alphaMode?: 'OPAQUE' | 'MASK' | 'BLEND' | string;\n /**\n * The alpha cutoff value of the material.\n */\n alphaCutoff?: number;\n /**\n * Specifies whether the material is double sided.\n */\n doubleSided?: boolean;\n // [k: string]: any;\n};\n\n/**\n * Geometry to be rendered with the given material.\n */\nexport type GLTFMeshPrimitive = {\n /**\n * A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.\n */\n attributes: {\n [k: string]: GLTFId;\n };\n /**\n * The index of the accessor that contains the indices.\n */\n indices?: GLTFId;\n /**\n * The index of the material to apply to this primitive when rendering.\n */\n material?: GLTFId;\n /**\n * The type of primitives to render.\n */\n mode?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number;\n /**\n * An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only `POSITION`, `NORMAL`, and `TANGENT` supported) to their deviations in the Morph Target.\n */\n targets?: {\n [k: string]: GLTFId;\n }[];\n extensions?: Record<string, unknown>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.\n */\n\nexport type GLTFMesh = {\n id?: string;\n /**\n * An array of primitives, each defining geometry to be rendered with a material.\n */\n primitives: GLTFMeshPrimitive[];\n /**\n * Array of weights to be applied to the Morph Targets.\n */\n weights?: number[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.\n */\nexport type GLTFNode = {\n /**\n * The index of the camera referenced by this node.\n */\n camera?: GLTFId;\n /**\n * The indices of this node's children.\n */\n children?: GLTFId[];\n /**\n * The index of the skin referenced by this node.\n */\n skin?: GLTFId;\n /**\n * A floating-point 4x4 transformation matrix stored in column-major order.\n */\n matrix?: number[];\n /**\n * The index of the mesh in this node.\n */\n mesh?: GLTFId;\n /**\n * The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.\n */\n rotation?: number[];\n /**\n * The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.\n */\n scale?: number[];\n /**\n * The node's translation along the x, y, and z axes.\n */\n translation?: number[];\n /**\n * The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh.\n */\n weights?: number[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Texture sampler properties for filtering and wrapping modes.\n */\nexport type GLTFSampler = {\n /**\n * Magnification filter.\n */\n magFilter?: 9728 | 9729 | number;\n /**\n * Minification filter.\n */\n minFilter?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number;\n /**\n * s wrapping mode.\n */\n wrapS?: 33071 | 33648 | 10497 | number;\n /**\n * t wrapping mode.\n */\n wrapT?: 33071 | 33648 | 10497 | number;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root nodes of a scene.\n */\nexport type GLTFScene = {\n /**\n * The indices of each root node.\n */\n nodes?: GLTFId[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Joints and matrices defining a skin.\n */\nexport type GLTFSkin = {\n id?: string;\n /**\n * The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied.\n */\n inverseBindMatrices?: GLTFId;\n /**\n * The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root.\n */\n skeleton?: GLTFId;\n /** Indices of skeleton nodes, used as joints in this skin. */\n joints: GLTFId[];\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A texture and its sampler.\n */\nexport type GLTFTexture = {\n /** The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used. */\n sampler?: GLTFId;\n /** The index of the image used by this texture. */\n source?: GLTFId;\n name?: any;\n extensions?: Record<string, any>;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root object for a glTF asset.\n */\nexport type GLTF = {\n /**\n * Names of glTF extensions used somewhere in this asset.\n */\n extensionsUsed?: string[];\n /**\n * Names of glTF extensions required to properly load this asset.\n */\n extensionsRequired?: string[];\n /**\n * An array of accessors.\n */\n accessors?: GLTFAccessor[];\n /**\n * An array of keyframe animations.\n */\n animations?: GLTFAnimation[];\n /**\n * Metadata about the glTF asset.\n */\n asset: GLTFAsset;\n /**\n * An array of buffers.\n */\n buffers?: GLTFBuffer[];\n /**\n * An array of bufferViews.\n */\n bufferViews?: GLTFBufferView[];\n /**\n * An array of cameras.\n */\n cameras?: GLTFCamera[];\n /**\n * An array of images.\n */\n images?: GLTFImage[];\n /**\n * An array of materials.\n */\n materials?: GLTFMaterial[];\n /**\n * An array of meshes.\n */\n meshes?: GLTFMesh[];\n /**\n * An array of nodes.\n */\n nodes?: GLTFNode[];\n /**\n * An array of samplers.\n */\n samplers?: GLTFSampler[];\n /**\n * The index of the default scene.\n */\n scene?: GLTFId;\n /**\n * An array of scenes.\n */\n scenes?: GLTFScene[];\n /**\n * An array of skins.\n */\n skins?: GLTFSkin[];\n /**\n * An array of textures.\n */\n textures?: GLTFTexture[];\n extensions?: Record<string, unknown>;\n extras?: unknown;\n [k: string]: unknown;\n};\n\nexport type GLTFObject =\n | GLTFAccessor\n | GLTFBuffer\n | GLTFBufferView\n | GLTFMeshPrimitive\n | GLTFMesh\n | GLTFNode\n | GLTFMaterial\n | GLTFSampler\n | GLTFScene\n | GLTFSkin\n | GLTFTexture\n | GLTFImage;\n\n// GLTF Extensions\n/* eslint-disable camelcase */\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/1.0/Khronos/KHR_binary_glTF\n * TODO - this can be used on both images and shaders\n */\nexport type GLTF_KHR_binary_glTF = {\n bufferView: number;\n // required for images but not shaders\n mimeType?: string;\n height?: number;\n width?: number;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression\n */\nexport type GLTF_KHR_draco_mesh_compression = {\n bufferView: GLTFId;\n attributes: {[name: string]: number};\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n */\nexport type GLTF_KHR_texture_basisu = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression\n * buffer: number; //\tThe index of the buffer with compressed data.\t✅ Required\n * byteOffset\tinteger\tThe offset into the buffer in bytes.\tDefault: 0\n * byteLength\tinteger\tThe length of the compressed data in bytes.\t✅ Required\n * byteStride\tinteger\tThe stride, in bytes.\t✅ Required\n * count\tinteger\tThe number of elements.\t✅ Required\n * mode\tstring\tThe compression mode.\t✅ Required\n * filter\tstring\tThe compression filter.\tDefault: \"NONE\"\n */\nexport type GLTF_EXT_meshopt_compression = {\n buffer: number;\n byteOffset?: number;\n byteLength: number;\n byteStride: number;\n count: number;\n mode: 'ATTRIBUTES' | 'TRIANGLES' | 'INDICES';\n filter?: 'NONE' | 'OCTAHEDRAL' | 'QUATERNION' | 'EXPONENTIAL';\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp\n */\nexport type GLTF_EXT_texture_webp = {\n source: GLTFId;\n extras?: any;\n};\n\n/**\n * @see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds\n */\nexport type GLTF_MSFT_texture_dds = {\n source: GLTFId;\n extras?: any;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-postprocessed-schema.js","names":[],"sources":["../../../../src/lib/types/gltf-postprocessed-schema.ts"],"sourcesContent":["// Types forked from https://github.com/bwasty/gltf-loader-ts under MIT license\n// Generated from official JSON schema using `npm run generate-type` = on 2018-02-24\n\nimport type {TypedArray} from '@loaders.gl/loader-utils';\n\nexport type GlTfId = number;\n\n// GLTF attributes (possibly overridden)\n\n/**\n * Indices of those attributes that deviate from their initialization value.\n */\nexport type AccessorSparseIndices = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the bufferView with sparse indices. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GlTfId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n /**\n * The indices data type.\n */\n componentType: 5121 | 5123 | 5125 | number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Array of size `accessor.sparse.count` times number of components storing the displaced accessor attributes pointed by `accessor.sparse.indices`.\n */\nexport type AccessorSparseValues = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.\n */\n bufferView: GlTfId;\n /**\n * The offset relative to the start of the bufferView in bytes. Must be aligned.\n */\n byteOffset?: number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Sparse storage of attributes that deviate from their initialization value.\n */\nexport type AccessorSparse = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * Number of entries stored in the sparse array.\n */\n count: number;\n /**\n * Index array of size `count` that points to those accessor attributes that deviate from their initialization value. Indices must strictly increase.\n */\n indices: AccessorSparseIndices;\n /**\n * Array of size `count` times number of components, storing the displaced accessor attributes pointed by `indices`. Substituted values must have the same `componentType` and number of components as the base accessor.\n */\n values: AccessorSparseValues;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A typed view into a bufferView. A bufferView contains raw binary data. An accessor provides a typed view into a bufferView or a subset of a bufferView similar to how WebGL's `vertexAttribPointer()` defines an attribute in a buffer.\n */\nexport type GLTFAccessorPostprocessed = {\n id: string;\n components: number;\n bytesPerComponent: number;\n bytesPerElement: number;\n value: TypedArray;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the bufferView.\n */\n bufferView?: GLTFBufferViewPostprocessed;\n /**\n * The offset relative to the start of the bufferView in bytes.\n */\n byteOffset?: number;\n /**\n * The datatype of components in the attribute.\n */\n componentType: 5120 | 5121 | 5122 | 5123 | 5125 | 5126 | number;\n /**\n * Specifies whether integer data values should be normalized.\n */\n normalized?: boolean;\n /**\n * The number of attributes referenced by this accessor.\n */\n count: number;\n /**\n * Specifies if the attribute is a scalar, vector, or matrix.\n */\n type: 'SCALAR' | 'VEC2' | 'VEC3' | 'VEC4' | 'MAT2' | 'MAT3' | 'MAT4' | string;\n /**\n * Maximum value of each component in this attribute.\n */\n max?: number[];\n /**\n * Minimum value of each component in this attribute.\n */\n min?: number[];\n /**\n * Sparse storage of attributes that deviate from their initialization value.\n */\n sparse?: AccessorSparse;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The index of the node and TRS property that an animation channel targets.\n */\nexport type AnimationChannelTarget = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the node to target.\n */\n node?: GlTfId;\n /**\n * The name of the node's TRS property to modify, or the \"weights\" of the Morph Targets it instantiates. For the \"translation\" property, the values that are provided by the sampler are the translation along the x, y, and z axes. For the \"rotation\" property, the values are a quaternion in the order (x, y, z, w), where w is the scalar. For the \"scale\" property, the values are the scaling factors along the x, y, and z axes.\n */\n path: 'translation' | 'rotation' | 'scale' | 'weights' | string;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Targets an animation's sampler at a node's property.\n */\nexport type AnimationChannel = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of a sampler in this animation used to compute the value for the target.\n */\n sampler: GlTfId;\n /**\n * The index of the node and TRS property to target.\n */\n target: AnimationChannelTarget;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target).\n */\nexport type AnimationSampler = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of an accessor containing keyframe input values, e.g., time.\n */\n input: GlTfId;\n /**\n * Interpolation algorithm.\n */\n interpolation?: 'LINEAR' | 'STEP' | 'CUBICSPLINE' | string;\n /**\n * The index of an accessor, containing keyframe output values.\n */\n output: GlTfId;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A keyframe animation.\n */\nexport type GLTFAnimationPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /** An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets. */\n channels: AnimationChannel[];\n /** An array of samplers that combines input and output accessors with an interpolation algorithm to define a keyframe graph (but not its target). */\n samplers: AnimationSampler[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Metadata about the glTF asset.\n */\nexport type Asset = {\n // GLTF attributes (possibly overridden)\n /**\n * A copyright message suitable for display to credit the content creator.\n */\n copyright?: string;\n /**\n * Tool that generated this glTF model. Useful for debugging.\n */\n generator?: string;\n /**\n * The glTF version that this asset targets.\n */\n version: string;\n /**\n * The minimum glTF version that this asset targets.\n */\n minVersion?: string;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A buffer points to binary geometry, animation, or skins.\n */\nexport type GLTFBufferPostprocessed = {\n id?: string;\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n\n // GLTF attributes (possibly overridden)\n /** The length of the buffer in bytes. */\n byteLength: number;\n\n /** The uri of the buffer. */\n uri?: string;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A view into a buffer generally representing a subset of the buffer.\n */\nexport type GLTFBufferViewPostprocessed = {\n id: string;\n data: Uint8Array;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the buffer.\n */\n buffer: GLTFBufferPostprocessed;\n /**\n * The offset into the buffer in bytes.\n */\n byteOffset?: number;\n /**\n * The length of the bufferView in bytes.\n */\n byteLength: number;\n /**\n * The stride, in bytes.\n */\n byteStride?: number;\n /**\n * The target that the GPU buffer should be bound to.\n */\n target?: 34962 | 34963 | number;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\nexport type CameraOrthographic = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The floating-point horizontal magnification of the view. Must not be zero.\n */\n xmag: number;\n /**\n * The floating-point vertical magnification of the view. Must not be zero.\n */\n ymag: number;\n /**\n * The floating-point distance to the far clipping plane. `zfar` must be greater than `znear`.\n */\n zfar: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\nexport type CameraPerspective = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The floating-point aspect ratio of the field of view.\n */\n aspectRatio?: number;\n /**\n * The floating-point vertical field of view in radians.\n */\n yfov: number;\n /**\n * The floating-point distance to the far clipping plane.\n */\n zfar?: number;\n /**\n * The floating-point distance to the near clipping plane.\n */\n znear: number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A camera's projection. A node can reference a camera to apply a transform to place the camera in the scene.\n */\nexport type GLTFCameraPostprocessed = {\n // GLTF attributes (possibly overridden)\n /**\n * An orthographic camera containing properties to create an orthographic projection matrix.\n */\n orthographic?: CameraOrthographic;\n /**\n * A perspective camera containing properties to create a perspective projection matrix.\n */\n perspective?: CameraPerspective;\n /**\n * Specifies if the camera uses a perspective or orthographic projection.\n */\n type: 'perspective' | 'orthographic' | string;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * GLTFImagePostprocessed data used to create a texture.\n * GLTFImagePostprocessed can be referenced by URI or `bufferView` index.\n * `mimeType` is required in the latter case.\n * @todo GLTF image postprocessing\n */\nexport type GLTFImagePostprocessed = {\n id: string;\n // TODO - extend\n image: {\n data: Uint8Array;\n compressed?: boolean;\n height?: number;\n width?: number;\n components?: number;\n mimeType?: string;\n };\n\n compressed?: boolean;\n\n // GLTF attributes (possibly overridden)\n /**\n * The uri of the image.\n */\n uri?: string;\n /**\n * The image's MIME type.\n */\n mimeType?: 'image/jpeg' | 'image/png' | string;\n /**\n * The index of the bufferView that contains the image. Use this instead of the image's uri property.\n */\n bufferView?: GLTFBufferViewPostprocessed;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Reference to a texture.\n */\nexport type GLTFTextureInfoPostprocessed = {\n id: string;\n texture: GLTFTexturePostprocessed;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the texture.\n */\n index: GlTfId;\n /**\n * The set index of texture's TEXCOORD attribute used for texture coordinate mapping.\n */\n texCoord?: number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology.\n */\nexport type MaterialPbrMetallicRoughnessPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The material's base color factor.\n */\n baseColorFactor?: number[];\n /**\n * The base color texture.\n */\n baseColorTexture?: GLTFTextureInfoPostprocessed;\n /**\n * The metalness of the material.\n */\n metallicFactor?: number;\n /**\n * The roughness of the material.\n */\n roughnessFactor?: number;\n /**\n * The metallic-roughness texture.\n */\n metallicRoughnessTexture?: GLTFTextureInfoPostprocessed;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\nexport type MaterialNormalTextureInfoPostprocessed = {\n id: string;\n texture: GLTFTexturePostprocessed;\n\n // GLTF attributes (possibly overridden)\n index?: any;\n texCoord?: any;\n /**\n * The scalar multiplier applied to each normal vector of the normal texture.\n */\n scale?: number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\nexport type MaterialOcclusionTextureInfoPostprocessed = {\n id: string;\n texture: GLTFTexturePostprocessed;\n\n // GLTF attributes (possibly overridden)\n index?: any;\n texCoord?: any;\n /**\n * A scalar multiplier controlling the amount of occlusion applied.\n */\n strength?: number;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The material appearance of a primitive.\n */\nexport type GLTFMaterialPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n name?: any;\n extensions?: any;\n extras?: any;\n /**\n * A set of parameter values that are used to define the metallic-roughness material model from Physically-Based Rendering (PBR) methodology. When not specified, all the default values of `pbrMetallicRoughness` apply.\n */\n pbrMetallicRoughness?: MaterialPbrMetallicRoughnessPostprocessed;\n /**\n * The normal map texture.\n */\n normalTexture?: MaterialNormalTextureInfoPostprocessed;\n /**\n * The occlusion map texture.\n */\n occlusionTexture?: MaterialOcclusionTextureInfoPostprocessed;\n /**\n * The emissive map texture.\n */\n emissiveTexture?: GLTFTextureInfoPostprocessed;\n /**\n * The emissive color of the material.\n */\n emissiveFactor?: number[];\n /**\n * The alpha rendering mode of the material.\n */\n alphaMode?: 'OPAQUE' | 'MASK' | 'BLEND' | string;\n /**\n * The alpha cutoff value of the material.\n */\n alphaCutoff?: number;\n /**\n * Specifies whether the material is double sided.\n */\n doubleSided?: boolean;\n // [k: string]: any;\n};\n\n/**\n * Geometry to be rendered with the given material.\n */\nexport type GLTFMeshPrimitivePostprocessed = {\n // GLTF attributes (possibly overridden)\n /**\n * A dictionary object, where each key corresponds to mesh attribute semantic and each value is the index of the accessor containing attribute's data.\n */\n attributes: {\n [k: string]: GLTFAccessorPostprocessed;\n };\n /**\n * The index of the accessor that contains the indices.\n */\n indices?: GLTFAccessorPostprocessed;\n /**\n * The index of the material to apply to this primitive when rendering.\n */\n material?: GLTFMaterialPostprocessed;\n /**\n * The type of primitives to render.\n */\n mode?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number;\n /** An array of Morph Targets, each Morph Target is a dictionary mapping attributes (only `POSITION`, `NORMAL`, and `TANGENT` supported) to their deviations in the Morph Target. */\n targets?: {\n [k: string]: GlTfId;\n }[];\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A set of primitives to be rendered. A node can contain one mesh. A node's transform places the mesh in the scene.\n */\nexport type GLTFMeshPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /** An array of primitives, each defining geometry to be rendered with a material. */\n primitives: GLTFMeshPrimitivePostprocessed[];\n /**\n * Array of weights to be applied to the Morph Targets.\n */\n weights?: number[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.\n */\nexport type GLTFNodePostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the camera referenced by this node.\n */\n camera?: GLTFCameraPostprocessed;\n /**\n * The indices of this node's children.\n */\n children?: GLTFNodePostprocessed[];\n /**\n * The index of the skin referenced by this node.\n */\n skin?: GLTFSkinPostprocessed;\n /**\n * A floating-point 4x4 transformation matrix stored in column-major order.\n */\n matrix?: number[];\n /**\n * The index of the mesh in this node.\n */\n mesh?: GLTFMeshPostprocessed;\n /**\n * The node's unit quaternion rotation in the order (x, y, z, w), where w is the scalar.\n */\n rotation?: number[];\n /**\n * The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.\n */\n scale?: number[];\n /**\n * The node's translation along the x, y, and z axes.\n */\n translation?: number[];\n /**\n * The weights of the instantiated Morph Target. Number of elements must match number of Morph Targets of used mesh.\n */\n weights?: number[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * GLTFTexturePostprocessed sampler properties for filtering and wrapping modes.\n */\nexport type GLTFSamplerPostprocessed = {\n id: string;\n /** WebGL parameters */\n parameters: Record<string, number>;\n\n // GLTF attributes (possibly overridden)\n /** Magnification filter. */\n magFilter?: 9728 | 9729 | number;\n /** Minification filter. */\n minFilter?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number;\n /** s wrapping mode. */\n wrapS?: 33071 | 33648 | 10497 | number;\n /** t wrapping mode. */\n wrapT?: 33071 | 33648 | 10497 | number;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root nodes of a scene.\n */\nexport type GLTFScenePostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /** The indices of each root node. */\n nodes?: GLTFNodePostprocessed[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * Joints and matrices defining a skin.\n */\nexport type GLTFSkinPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied.\n */\n inverseBindMatrices?: GLTFAccessorPostprocessed;\n /**\n * The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root.\n */\n skeleton?: GlTfId;\n /**\n * Indices of skeleton nodes, used as joints in this skin.\n */\n joints: GlTfId[];\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * A texture and its sampler.\n */\nexport type GLTFTexturePostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /**\n * The index of the sampler used by this texture. When undefined, a sampler with repeat wrapping and auto filtering should be used.\n */\n sampler?: GLTFSamplerPostprocessed;\n /**\n * The index of the image used by this texture.\n */\n source?: GLTFImagePostprocessed;\n name?: any;\n extensions?: any;\n extras?: any;\n // [k: string]: any;\n};\n\n/**\n * The root object for a glTF asset.\n */\nexport type GLTFPostprocessed = {\n id: string;\n\n // GLTF attributes (possibly overridden)\n /** Names of glTF extensions used somewhere in this asset. */\n extensionsUsed: string[];\n /** Names of glTF extensions required to properly load this asset. */\n extensionsRequired: string[];\n /** An array of accessors. */\n accessors: GLTFAccessorPostprocessed[];\n /** An array of keyframe animations. */\n animations: GLTFAnimationPostprocessed[];\n /** Metadata about the glTF asset. */\n asset: Asset;\n /** An array of buffers. */\n buffers: GLTFBufferPostprocessed[];\n /** An array of bufferViews. */\n bufferViews: GLTFBufferViewPostprocessed[];\n /** An array of cameras. */\n cameras: GLTFCameraPostprocessed[];\n /** An array of images. */\n images: GLTFImagePostprocessed[];\n /** An array of materials. */\n materials: GLTFMaterialPostprocessed[];\n /** An array of meshes. */\n meshes: GLTFMeshPostprocessed[];\n /** An array of nodes. */\n nodes: GLTFNodePostprocessed[];\n /** An array of samplers. */\n samplers: GLTFSamplerPostprocessed[];\n /** The index of the default scene. */\n scene?: GLTFScenePostprocessed;\n /** An array of scenes. */\n scenes: GLTFScenePostprocessed[];\n /** An array of skins. */\n skins: GLTFSkinPostprocessed[];\n /** An array of textures. */\n textures: GLTFTexturePostprocessed[];\n extensions?: Record<string, Record<string, any>>;\n extras?: any;\n // [k: string]: any;\n};\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-types.js","names":[],"sources":["../../../../src/lib/types/gltf-types.ts"],"sourcesContent":["/* eslint-disable camelcase */\n\nimport {ImageType} from '@loaders.gl/images';\nimport type {GLTF} from './gltf-json-schema';\n\n/** GLTFLoader removes processed extensions from `extensionsUsed` and `extensionsUsed`\n * `processedExtensions` is used to track those extensions\n */\nexport type GLTFWithBuffers = {\n json: GLTF;\n binary?: ArrayBuffer;\n buffers: GLTFExternalBuffer[];\n images?: GLTFExternalImage[];\n};\n\ntype GLTFExternalBuffer = {\n arrayBuffer: ArrayBuffer;\n byteOffset: number;\n byteLength: number;\n};\n\ntype GLTFExternalImage =\n | ImageType\n | {\n compressed: true;\n mipmaps: false;\n width: number;\n height: number;\n data: Uint8Array;\n };\n\nexport type FeatureTableJson = {\n [key: string]: any[];\n};\n\nexport type {\n GLTF,\n GLTFAccessor,\n GLTFBuffer,\n GLTFBufferView,\n // GLTFCamera,\n GLTFMeshPrimitive,\n GLTFMesh,\n GLTFNode,\n GLTFMaterial,\n GLTFSampler,\n GLTFScene,\n GLTFSkin,\n GLTFTexture,\n GLTFImage,\n GLTF_KHR_binary_glTF,\n GLTF_KHR_draco_mesh_compression,\n GLTF_KHR_texture_basisu,\n GLTF_EXT_meshopt_compression,\n GLTF_EXT_texture_webp\n} from './gltf-json-schema';\n\nexport type {\n GLTFPostprocessed,\n GLTFAccessorPostprocessed,\n GLTFImagePostprocessed,\n GLTFNodePostprocessed,\n GLTFMeshPostprocessed,\n GLTFMeshPrimitivePostprocessed,\n GLTFMaterialPostprocessed,\n GLTFTexturePostprocessed\n} from './gltf-postprocessed-schema';\n"],"mappings":""}
|