babylonjs-loaders 5.45.2 → 5.46.0
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/babylonjs.loaders.js
CHANGED
|
@@ -5065,8 +5065,8 @@ var KHR_animation_pointer = /** @class */ (function () {
|
|
|
5065
5065
|
if (!extension) {
|
|
5066
5066
|
return null;
|
|
5067
5067
|
}
|
|
5068
|
-
if (channel.target.path !== "pointer" /* POINTER */) {
|
|
5069
|
-
core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.Warn("".concat(context, "/target/path: Value (").concat(channel.target.path, ") must be (").concat("pointer" /* POINTER */, ") when using the ").concat(this.name, " extension"));
|
|
5068
|
+
if (channel.target.path !== "pointer" /* AnimationChannelTargetPath.POINTER */) {
|
|
5069
|
+
core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.Warn("".concat(context, "/target/path: Value (").concat(channel.target.path, ") must be (").concat("pointer" /* AnimationChannelTargetPath.POINTER */, ") when using the ").concat(this.name, " extension"));
|
|
5070
5070
|
}
|
|
5071
5071
|
if (channel.target.node != undefined) {
|
|
5072
5072
|
core_Misc_logger__WEBPACK_IMPORTED_MODULE_1__.Logger.Warn("".concat(context, "/target/node: Value (").concat(channel.target.node, ") must not be present when using the ").concat(this.name, " extension"));
|
|
@@ -5189,11 +5189,11 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
|
|
|
5189
5189
|
var _this = this;
|
|
5190
5190
|
return _glTFLoader__WEBPACK_IMPORTED_MODULE_1__.GLTFLoader.LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
|
|
5191
5191
|
if (primitive.mode != undefined) {
|
|
5192
|
-
if (primitive.mode !== 5 /* TRIANGLE_STRIP */ && primitive.mode !== 4 /* TRIANGLES */) {
|
|
5192
|
+
if (primitive.mode !== 5 /* MeshPrimitiveMode.TRIANGLE_STRIP */ && primitive.mode !== 4 /* MeshPrimitiveMode.TRIANGLES */) {
|
|
5193
5193
|
throw new Error("".concat(context, ": Unsupported mode ").concat(primitive.mode));
|
|
5194
5194
|
}
|
|
5195
5195
|
// TODO: handle triangle strips
|
|
5196
|
-
if (primitive.mode === 5 /* TRIANGLE_STRIP */) {
|
|
5196
|
+
if (primitive.mode === 5 /* MeshPrimitiveMode.TRIANGLE_STRIP */) {
|
|
5197
5197
|
throw new Error("".concat(context, ": Mode ").concat(primitive.mode, " is not currently supported"));
|
|
5198
5198
|
}
|
|
5199
5199
|
}
|
|
@@ -5206,19 +5206,19 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
|
|
|
5206
5206
|
}
|
|
5207
5207
|
attributes[kind] = uniqueId;
|
|
5208
5208
|
var accessor = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__.ArrayItem.Get("".concat(context, "/attributes/").concat(name), _this._loader.gltf.accessors, primitive.attributes[name]);
|
|
5209
|
-
if (accessor.normalized && accessor.componentType !== 5126 /* FLOAT */) {
|
|
5209
|
+
if (accessor.normalized && accessor.componentType !== 5126 /* AccessorComponentType.FLOAT */) {
|
|
5210
5210
|
var divider = 1;
|
|
5211
5211
|
switch (accessor.componentType) {
|
|
5212
|
-
case 5120 /* BYTE */:
|
|
5212
|
+
case 5120 /* AccessorComponentType.BYTE */:
|
|
5213
5213
|
divider = 127.0;
|
|
5214
5214
|
break;
|
|
5215
|
-
case 5121 /* UNSIGNED_BYTE */:
|
|
5215
|
+
case 5121 /* AccessorComponentType.UNSIGNED_BYTE */:
|
|
5216
5216
|
divider = 255.0;
|
|
5217
5217
|
break;
|
|
5218
|
-
case 5122 /* SHORT */:
|
|
5218
|
+
case 5122 /* AccessorComponentType.SHORT */:
|
|
5219
5219
|
divider = 32767.0;
|
|
5220
5220
|
break;
|
|
5221
|
-
case 5123 /* UNSIGNED_SHORT */:
|
|
5221
|
+
case 5123 /* AccessorComponentType.UNSIGNED_SHORT */:
|
|
5222
5222
|
divider = 65535.0;
|
|
5223
5223
|
break;
|
|
5224
5224
|
}
|
|
@@ -5331,15 +5331,15 @@ var KHR_lights = /** @class */ (function () {
|
|
|
5331
5331
|
var name = light.name || babylonMesh.name;
|
|
5332
5332
|
_this._loader.babylonScene._blockEntityCollection = !!_this._loader._assetContainer;
|
|
5333
5333
|
switch (light.type) {
|
|
5334
|
-
case "directional" /* DIRECTIONAL */: {
|
|
5334
|
+
case "directional" /* KHRLightsPunctual_LightType.DIRECTIONAL */: {
|
|
5335
5335
|
babylonLight = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.DirectionalLight(name, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector3.Backward(), _this._loader.babylonScene);
|
|
5336
5336
|
break;
|
|
5337
5337
|
}
|
|
5338
|
-
case "point" /* POINT */: {
|
|
5338
|
+
case "point" /* KHRLightsPunctual_LightType.POINT */: {
|
|
5339
5339
|
babylonLight = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.PointLight(name, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero(), _this._loader.babylonScene);
|
|
5340
5340
|
break;
|
|
5341
5341
|
}
|
|
5342
|
-
case "spot" /* SPOT */: {
|
|
5342
|
+
case "spot" /* KHRLightsPunctual_LightType.SPOT */: {
|
|
5343
5343
|
var babylonSpotLight = new core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.SpotLight(name, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector3.Zero(), core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_0__.Vector3.Backward(), 0, 1, _this._loader.babylonScene);
|
|
5344
5344
|
babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;
|
|
5345
5345
|
babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;
|
|
@@ -7270,18 +7270,18 @@ var MSFT_audio_emitter = /** @class */ (function () {
|
|
|
7270
7270
|
};
|
|
7271
7271
|
MSFT_audio_emitter.prototype._getEventAction = function (context, sound, action, time, startOffset) {
|
|
7272
7272
|
switch (action) {
|
|
7273
|
-
case "play" /* play */: {
|
|
7273
|
+
case "play" /* IMSFTAudioEmitter_AnimationEventAction.play */: {
|
|
7274
7274
|
return function (currentFrame) {
|
|
7275
7275
|
var frameOffset = (startOffset || 0) + (currentFrame - time);
|
|
7276
7276
|
sound.play(frameOffset);
|
|
7277
7277
|
};
|
|
7278
7278
|
}
|
|
7279
|
-
case "stop" /* stop */: {
|
|
7279
|
+
case "stop" /* IMSFTAudioEmitter_AnimationEventAction.stop */: {
|
|
7280
7280
|
return function () {
|
|
7281
7281
|
sound.stop();
|
|
7282
7282
|
};
|
|
7283
7283
|
}
|
|
7284
|
-
case "pause" /* pause */: {
|
|
7284
|
+
case "pause" /* IMSFTAudioEmitter_AnimationEventAction.pause */: {
|
|
7285
7285
|
return function () {
|
|
7286
7286
|
sound.pause();
|
|
7287
7287
|
};
|
|
@@ -8769,19 +8769,19 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
8769
8769
|
if (babylonVertexBuffer.getKind() === core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.PositionKind && !_this.parent.alwaysComputeBoundingBox && !babylonMesh.skeleton) {
|
|
8770
8770
|
var mmin = accessor.min, mmax = accessor.max;
|
|
8771
8771
|
if (mmin !== undefined && mmax !== undefined) {
|
|
8772
|
-
if (accessor.normalized && accessor.componentType !== 5126 /* FLOAT */) {
|
|
8772
|
+
if (accessor.normalized && accessor.componentType !== 5126 /* AccessorComponentType.FLOAT */) {
|
|
8773
8773
|
var divider = 1;
|
|
8774
8774
|
switch (accessor.componentType) {
|
|
8775
|
-
case 5120 /* BYTE */:
|
|
8775
|
+
case 5120 /* AccessorComponentType.BYTE */:
|
|
8776
8776
|
divider = 127.0;
|
|
8777
8777
|
break;
|
|
8778
|
-
case 5121 /* UNSIGNED_BYTE */:
|
|
8778
|
+
case 5121 /* AccessorComponentType.UNSIGNED_BYTE */:
|
|
8779
8779
|
divider = 255.0;
|
|
8780
8780
|
break;
|
|
8781
|
-
case 5122 /* SHORT */:
|
|
8781
|
+
case 5122 /* AccessorComponentType.SHORT */:
|
|
8782
8782
|
divider = 32767.0;
|
|
8783
8783
|
break;
|
|
8784
|
-
case 5123 /* UNSIGNED_SHORT */:
|
|
8784
|
+
case 5123 /* AccessorComponentType.UNSIGNED_SHORT */:
|
|
8785
8785
|
divider = 65535.0;
|
|
8786
8786
|
break;
|
|
8787
8787
|
}
|
|
@@ -8820,7 +8820,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
8820
8820
|
loadAttribute("JOINTS_1", core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.MatricesIndicesExtraKind);
|
|
8821
8821
|
loadAttribute("WEIGHTS_1", core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.MatricesWeightsExtraKind);
|
|
8822
8822
|
loadAttribute("COLOR_0", core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.ColorKind, function (accessor) {
|
|
8823
|
-
if (accessor.type === "VEC4" /* VEC4 */) {
|
|
8823
|
+
if (accessor.type === "VEC4" /* AccessorType.VEC4 */) {
|
|
8824
8824
|
babylonMesh.hasVertexAlpha = true;
|
|
8825
8825
|
}
|
|
8826
8826
|
});
|
|
@@ -9104,7 +9104,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9104
9104
|
camera._babylonCamera = babylonCamera;
|
|
9105
9105
|
babylonCamera.rotation = new core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Vector3(0, Math.PI, 0);
|
|
9106
9106
|
switch (camera.type) {
|
|
9107
|
-
case "perspective" /* PERSPECTIVE */: {
|
|
9107
|
+
case "perspective" /* CameraType.PERSPECTIVE */: {
|
|
9108
9108
|
var perspective = camera.perspective;
|
|
9109
9109
|
if (!perspective) {
|
|
9110
9110
|
throw new Error("".concat(context, ": Camera perspective properties are missing"));
|
|
@@ -9114,7 +9114,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9114
9114
|
babylonCamera.maxZ = perspective.zfar || 0;
|
|
9115
9115
|
break;
|
|
9116
9116
|
}
|
|
9117
|
-
case "orthographic" /* ORTHOGRAPHIC */: {
|
|
9117
|
+
case "orthographic" /* CameraType.ORTHOGRAPHIC */: {
|
|
9118
9118
|
if (!camera.orthographic) {
|
|
9119
9119
|
throw new Error("".concat(context, ": Camera orthographic properties are missing"));
|
|
9120
9120
|
}
|
|
@@ -9208,25 +9208,25 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9208
9208
|
}
|
|
9209
9209
|
var targetNode = ArrayItem.Get("".concat(context, "/target/node"), this._gltf.nodes, channel.target.node);
|
|
9210
9210
|
// Ignore animations that have no animation targets.
|
|
9211
|
-
if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
|
|
9212
|
-
(channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonTransformNode)) {
|
|
9211
|
+
if ((channel.target.path === "weights" /* AnimationChannelTargetPath.WEIGHTS */ && !targetNode._numMorphTargets) ||
|
|
9212
|
+
(channel.target.path !== "weights" /* AnimationChannelTargetPath.WEIGHTS */ && !targetNode._babylonTransformNode)) {
|
|
9213
9213
|
return Promise.resolve();
|
|
9214
9214
|
}
|
|
9215
9215
|
var properties;
|
|
9216
9216
|
switch (channel.target.path) {
|
|
9217
|
-
case "translation" /* TRANSLATION */: {
|
|
9217
|
+
case "translation" /* AnimationChannelTargetPath.TRANSLATION */: {
|
|
9218
9218
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.translation;
|
|
9219
9219
|
break;
|
|
9220
9220
|
}
|
|
9221
|
-
case "rotation" /* ROTATION */: {
|
|
9221
|
+
case "rotation" /* AnimationChannelTargetPath.ROTATION */: {
|
|
9222
9222
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.rotation;
|
|
9223
9223
|
break;
|
|
9224
9224
|
}
|
|
9225
|
-
case "scale" /* SCALE */: {
|
|
9225
|
+
case "scale" /* AnimationChannelTargetPath.SCALE */: {
|
|
9226
9226
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.scale;
|
|
9227
9227
|
break;
|
|
9228
9228
|
}
|
|
9229
|
-
case "weights" /* WEIGHTS */: {
|
|
9229
|
+
case "weights" /* AnimationChannelTargetPath.WEIGHTS */: {
|
|
9230
9230
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.weights;
|
|
9231
9231
|
break;
|
|
9232
9232
|
}
|
|
@@ -9270,7 +9270,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9270
9270
|
var keys = new Array(input.length);
|
|
9271
9271
|
var outputOffset = 0;
|
|
9272
9272
|
switch (data.interpolation) {
|
|
9273
|
-
case "STEP" /* STEP */: {
|
|
9273
|
+
case "STEP" /* AnimationSamplerInterpolation.STEP */: {
|
|
9274
9274
|
for (var index = 0; index < input.length; index++) {
|
|
9275
9275
|
var value = property.getValue(targetInfo.target, output, outputOffset, 1);
|
|
9276
9276
|
outputOffset += stride;
|
|
@@ -9282,7 +9282,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9282
9282
|
}
|
|
9283
9283
|
break;
|
|
9284
9284
|
}
|
|
9285
|
-
case "CUBICSPLINE" /* CUBICSPLINE */: {
|
|
9285
|
+
case "CUBICSPLINE" /* AnimationSamplerInterpolation.CUBICSPLINE */: {
|
|
9286
9286
|
for (var index = 0; index < input.length; index++) {
|
|
9287
9287
|
var inTangent = property.getValue(targetInfo.target, output, outputOffset, invfps);
|
|
9288
9288
|
outputOffset += stride;
|
|
@@ -9299,7 +9299,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9299
9299
|
}
|
|
9300
9300
|
break;
|
|
9301
9301
|
}
|
|
9302
|
-
case "LINEAR" /* LINEAR */: {
|
|
9302
|
+
case "LINEAR" /* AnimationSamplerInterpolation.LINEAR */: {
|
|
9303
9303
|
for (var index = 0; index < input.length; index++) {
|
|
9304
9304
|
var value = property.getValue(targetInfo.target, output, outputOffset, 1);
|
|
9305
9305
|
outputOffset += stride;
|
|
@@ -9325,11 +9325,11 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9325
9325
|
if (sampler._data) {
|
|
9326
9326
|
return sampler._data;
|
|
9327
9327
|
}
|
|
9328
|
-
var interpolation = sampler.interpolation || "LINEAR" /* LINEAR */;
|
|
9328
|
+
var interpolation = sampler.interpolation || "LINEAR" /* AnimationSamplerInterpolation.LINEAR */;
|
|
9329
9329
|
switch (interpolation) {
|
|
9330
|
-
case "STEP" /* STEP */:
|
|
9331
|
-
case "LINEAR" /* LINEAR */:
|
|
9332
|
-
case "CUBICSPLINE" /* CUBICSPLINE */: {
|
|
9330
|
+
case "STEP" /* AnimationSamplerInterpolation.STEP */:
|
|
9331
|
+
case "LINEAR" /* AnimationSamplerInterpolation.LINEAR */:
|
|
9332
|
+
case "CUBICSPLINE" /* AnimationSamplerInterpolation.CUBICSPLINE */: {
|
|
9333
9333
|
break;
|
|
9334
9334
|
}
|
|
9335
9335
|
default: {
|
|
@@ -9416,7 +9416,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9416
9416
|
else {
|
|
9417
9417
|
var bufferView_1 = ArrayItem.Get("".concat(context, "/bufferView"), this._gltf.bufferViews, accessor.bufferView);
|
|
9418
9418
|
accessor._data = this.loadBufferViewAsync("/bufferViews/".concat(bufferView_1.index), bufferView_1).then(function (data) {
|
|
9419
|
-
if (accessor.componentType === 5126 /* FLOAT */ && !accessor.normalized && (!bufferView_1.byteStride || bufferView_1.byteStride === byteStride)) {
|
|
9419
|
+
if (accessor.componentType === 5126 /* AccessorComponentType.FLOAT */ && !accessor.normalized && (!bufferView_1.byteStride || bufferView_1.byteStride === byteStride)) {
|
|
9420
9420
|
return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
|
|
9421
9421
|
}
|
|
9422
9422
|
else {
|
|
@@ -9442,7 +9442,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9442
9442
|
var indices = GLTFLoader._GetTypedArray("".concat(context, "/sparse/indices"), sparse_1.indices.componentType, indicesData, sparse_1.indices.byteOffset, sparse_1.count);
|
|
9443
9443
|
var sparseLength = numComponents * sparse_1.count;
|
|
9444
9444
|
var values;
|
|
9445
|
-
if (accessor.componentType === 5126 /* FLOAT */ && !accessor.normalized) {
|
|
9445
|
+
if (accessor.componentType === 5126 /* AccessorComponentType.FLOAT */ && !accessor.normalized) {
|
|
9446
9446
|
values = GLTFLoader._GetTypedArray("".concat(context, "/sparse/values"), accessor.componentType, valuesData, sparse_1.values.byteOffset, sparseLength);
|
|
9447
9447
|
}
|
|
9448
9448
|
else {
|
|
@@ -9472,12 +9472,12 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9472
9472
|
return this._loadAccessorAsync(context, accessor, Float32Array);
|
|
9473
9473
|
};
|
|
9474
9474
|
GLTFLoader.prototype._loadIndicesAccessorAsync = function (context, accessor) {
|
|
9475
|
-
if (accessor.type !== "SCALAR" /* SCALAR */) {
|
|
9475
|
+
if (accessor.type !== "SCALAR" /* AccessorType.SCALAR */) {
|
|
9476
9476
|
throw new Error("".concat(context, "/type: Invalid value ").concat(accessor.type));
|
|
9477
9477
|
}
|
|
9478
|
-
if (accessor.componentType !== 5121 /* UNSIGNED_BYTE */ &&
|
|
9479
|
-
accessor.componentType !== 5123 /* UNSIGNED_SHORT */ &&
|
|
9480
|
-
accessor.componentType !== 5125 /* UNSIGNED_INT */) {
|
|
9478
|
+
if (accessor.componentType !== 5121 /* AccessorComponentType.UNSIGNED_BYTE */ &&
|
|
9479
|
+
accessor.componentType !== 5123 /* AccessorComponentType.UNSIGNED_SHORT */ &&
|
|
9480
|
+
accessor.componentType !== 5125 /* AccessorComponentType.UNSIGNED_INT */) {
|
|
9481
9481
|
throw new Error("".concat(context, "/componentType: Invalid value ").concat(accessor.componentType));
|
|
9482
9482
|
}
|
|
9483
9483
|
if (accessor._data) {
|
|
@@ -9718,13 +9718,13 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9718
9718
|
if (!(babylonMaterial instanceof core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial)) {
|
|
9719
9719
|
throw new Error("".concat(context, ": Material type not supported"));
|
|
9720
9720
|
}
|
|
9721
|
-
var alphaMode = material.alphaMode || "OPAQUE" /* OPAQUE */;
|
|
9721
|
+
var alphaMode = material.alphaMode || "OPAQUE" /* MaterialAlphaMode.OPAQUE */;
|
|
9722
9722
|
switch (alphaMode) {
|
|
9723
|
-
case "OPAQUE" /* OPAQUE */: {
|
|
9723
|
+
case "OPAQUE" /* MaterialAlphaMode.OPAQUE */: {
|
|
9724
9724
|
babylonMaterial.transparencyMode = core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial.PBRMATERIAL_OPAQUE;
|
|
9725
9725
|
break;
|
|
9726
9726
|
}
|
|
9727
|
-
case "MASK" /* MASK */: {
|
|
9727
|
+
case "MASK" /* MaterialAlphaMode.MASK */: {
|
|
9728
9728
|
babylonMaterial.transparencyMode = core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial.PBRMATERIAL_ALPHATEST;
|
|
9729
9729
|
babylonMaterial.alphaCutOff = material.alphaCutoff == undefined ? 0.5 : material.alphaCutoff;
|
|
9730
9730
|
if (babylonMaterial.albedoTexture) {
|
|
@@ -9732,7 +9732,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9732
9732
|
}
|
|
9733
9733
|
break;
|
|
9734
9734
|
}
|
|
9735
|
-
case "BLEND" /* BLEND */: {
|
|
9735
|
+
case "BLEND" /* MaterialAlphaMode.BLEND */: {
|
|
9736
9736
|
babylonMaterial.transparencyMode = core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial.PBRMATERIAL_ALPHABLEND;
|
|
9737
9737
|
if (babylonMaterial.albedoTexture) {
|
|
9738
9738
|
babylonMaterial.albedoTexture.hasAlpha = true;
|
|
@@ -9837,7 +9837,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9837
9837
|
GLTFLoader.prototype._loadSampler = function (context, sampler) {
|
|
9838
9838
|
if (!sampler._data) {
|
|
9839
9839
|
sampler._data = {
|
|
9840
|
-
noMipMaps: sampler.minFilter === 9728 /* NEAREST */ || sampler.minFilter === 9729 /* LINEAR */,
|
|
9840
|
+
noMipMaps: sampler.minFilter === 9728 /* TextureMinFilter.NEAREST */ || sampler.minFilter === 9729 /* TextureMinFilter.LINEAR */,
|
|
9841
9841
|
samplingMode: GLTFLoader._GetTextureSamplingMode(context, sampler),
|
|
9842
9842
|
wrapU: GLTFLoader._GetTextureWrapMode("".concat(context, "/wrapS"), sampler.wrapS),
|
|
9843
9843
|
wrapV: GLTFLoader._GetTextureWrapMode("".concat(context, "/wrapT"), sampler.wrapT),
|
|
@@ -9914,13 +9914,13 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9914
9914
|
};
|
|
9915
9915
|
GLTFLoader._GetTextureWrapMode = function (context, mode) {
|
|
9916
9916
|
// Set defaults if undefined
|
|
9917
|
-
mode = mode == undefined ? 10497 /* REPEAT */ : mode;
|
|
9917
|
+
mode = mode == undefined ? 10497 /* TextureWrapMode.REPEAT */ : mode;
|
|
9918
9918
|
switch (mode) {
|
|
9919
|
-
case 33071 /* CLAMP_TO_EDGE */:
|
|
9919
|
+
case 33071 /* TextureWrapMode.CLAMP_TO_EDGE */:
|
|
9920
9920
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.CLAMP_ADDRESSMODE;
|
|
9921
|
-
case 33648 /* MIRRORED_REPEAT */:
|
|
9921
|
+
case 33648 /* TextureWrapMode.MIRRORED_REPEAT */:
|
|
9922
9922
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.MIRROR_ADDRESSMODE;
|
|
9923
|
-
case 10497 /* REPEAT */:
|
|
9923
|
+
case 10497 /* TextureWrapMode.REPEAT */:
|
|
9924
9924
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.WRAP_ADDRESSMODE;
|
|
9925
9925
|
default:
|
|
9926
9926
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, ": Invalid value (").concat(mode, ")"));
|
|
@@ -9929,21 +9929,21 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9929
9929
|
};
|
|
9930
9930
|
GLTFLoader._GetTextureSamplingMode = function (context, sampler) {
|
|
9931
9931
|
// Set defaults if undefined
|
|
9932
|
-
var magFilter = sampler.magFilter == undefined ? 9729 /* LINEAR */ : sampler.magFilter;
|
|
9933
|
-
var minFilter = sampler.minFilter == undefined ? 9987 /* LINEAR_MIPMAP_LINEAR */ : sampler.minFilter;
|
|
9934
|
-
if (magFilter === 9729 /* LINEAR */) {
|
|
9932
|
+
var magFilter = sampler.magFilter == undefined ? 9729 /* TextureMagFilter.LINEAR */ : sampler.magFilter;
|
|
9933
|
+
var minFilter = sampler.minFilter == undefined ? 9987 /* TextureMinFilter.LINEAR_MIPMAP_LINEAR */ : sampler.minFilter;
|
|
9934
|
+
if (magFilter === 9729 /* TextureMagFilter.LINEAR */) {
|
|
9935
9935
|
switch (minFilter) {
|
|
9936
|
-
case 9728 /* NEAREST */:
|
|
9936
|
+
case 9728 /* TextureMinFilter.NEAREST */:
|
|
9937
9937
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_NEAREST;
|
|
9938
|
-
case 9729 /* LINEAR */:
|
|
9938
|
+
case 9729 /* TextureMinFilter.LINEAR */:
|
|
9939
9939
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_LINEAR;
|
|
9940
|
-
case 9984 /* NEAREST_MIPMAP_NEAREST */:
|
|
9940
|
+
case 9984 /* TextureMinFilter.NEAREST_MIPMAP_NEAREST */:
|
|
9941
9941
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_NEAREST_MIPNEAREST;
|
|
9942
|
-
case 9985 /* LINEAR_MIPMAP_NEAREST */:
|
|
9942
|
+
case 9985 /* TextureMinFilter.LINEAR_MIPMAP_NEAREST */:
|
|
9943
9943
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_LINEAR_MIPNEAREST;
|
|
9944
|
-
case 9986 /* NEAREST_MIPMAP_LINEAR */:
|
|
9944
|
+
case 9986 /* TextureMinFilter.NEAREST_MIPMAP_LINEAR */:
|
|
9945
9945
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_NEAREST_MIPLINEAR;
|
|
9946
|
-
case 9987 /* LINEAR_MIPMAP_LINEAR */:
|
|
9946
|
+
case 9987 /* TextureMinFilter.LINEAR_MIPMAP_LINEAR */:
|
|
9947
9947
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_LINEAR_MIPLINEAR;
|
|
9948
9948
|
default:
|
|
9949
9949
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, "/minFilter: Invalid value (").concat(minFilter, ")"));
|
|
@@ -9951,21 +9951,21 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9951
9951
|
}
|
|
9952
9952
|
}
|
|
9953
9953
|
else {
|
|
9954
|
-
if (magFilter !== 9728 /* NEAREST */) {
|
|
9954
|
+
if (magFilter !== 9728 /* TextureMagFilter.NEAREST */) {
|
|
9955
9955
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, "/magFilter: Invalid value (").concat(magFilter, ")"));
|
|
9956
9956
|
}
|
|
9957
9957
|
switch (minFilter) {
|
|
9958
|
-
case 9728 /* NEAREST */:
|
|
9958
|
+
case 9728 /* TextureMinFilter.NEAREST */:
|
|
9959
9959
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_NEAREST;
|
|
9960
|
-
case 9729 /* LINEAR */:
|
|
9960
|
+
case 9729 /* TextureMinFilter.LINEAR */:
|
|
9961
9961
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_LINEAR;
|
|
9962
|
-
case 9984 /* NEAREST_MIPMAP_NEAREST */:
|
|
9962
|
+
case 9984 /* TextureMinFilter.NEAREST_MIPMAP_NEAREST */:
|
|
9963
9963
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_NEAREST_MIPNEAREST;
|
|
9964
|
-
case 9985 /* LINEAR_MIPMAP_NEAREST */:
|
|
9964
|
+
case 9985 /* TextureMinFilter.LINEAR_MIPMAP_NEAREST */:
|
|
9965
9965
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_LINEAR_MIPNEAREST;
|
|
9966
|
-
case 9986 /* NEAREST_MIPMAP_LINEAR */:
|
|
9966
|
+
case 9986 /* TextureMinFilter.NEAREST_MIPMAP_LINEAR */:
|
|
9967
9967
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_NEAREST_MIPLINEAR;
|
|
9968
|
-
case 9987 /* LINEAR_MIPMAP_LINEAR */:
|
|
9968
|
+
case 9987 /* TextureMinFilter.LINEAR_MIPMAP_LINEAR */:
|
|
9969
9969
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_LINEAR_MIPLINEAR;
|
|
9970
9970
|
default:
|
|
9971
9971
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, "/minFilter: Invalid value (").concat(minFilter, ")"));
|
|
@@ -9975,17 +9975,17 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
9975
9975
|
};
|
|
9976
9976
|
GLTFLoader._GetTypedArrayConstructor = function (context, componentType) {
|
|
9977
9977
|
switch (componentType) {
|
|
9978
|
-
case 5120 /* BYTE */:
|
|
9978
|
+
case 5120 /* AccessorComponentType.BYTE */:
|
|
9979
9979
|
return Int8Array;
|
|
9980
|
-
case 5121 /* UNSIGNED_BYTE */:
|
|
9980
|
+
case 5121 /* AccessorComponentType.UNSIGNED_BYTE */:
|
|
9981
9981
|
return Uint8Array;
|
|
9982
|
-
case 5122 /* SHORT */:
|
|
9982
|
+
case 5122 /* AccessorComponentType.SHORT */:
|
|
9983
9983
|
return Int16Array;
|
|
9984
|
-
case 5123 /* UNSIGNED_SHORT */:
|
|
9984
|
+
case 5123 /* AccessorComponentType.UNSIGNED_SHORT */:
|
|
9985
9985
|
return Uint16Array;
|
|
9986
|
-
case 5125 /* UNSIGNED_INT */:
|
|
9986
|
+
case 5125 /* AccessorComponentType.UNSIGNED_INT */:
|
|
9987
9987
|
return Uint32Array;
|
|
9988
|
-
case 5126 /* FLOAT */:
|
|
9988
|
+
case 5126 /* AccessorComponentType.FLOAT */:
|
|
9989
9989
|
return Float32Array;
|
|
9990
9990
|
default:
|
|
9991
9991
|
throw new Error("".concat(context, ": Invalid component type ").concat(componentType));
|
|
@@ -10030,22 +10030,22 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
10030
10030
|
*/
|
|
10031
10031
|
GLTFLoader._GetDrawMode = function (context, mode) {
|
|
10032
10032
|
if (mode == undefined) {
|
|
10033
|
-
mode = 4 /* TRIANGLES */;
|
|
10033
|
+
mode = 4 /* MeshPrimitiveMode.TRIANGLES */;
|
|
10034
10034
|
}
|
|
10035
10035
|
switch (mode) {
|
|
10036
|
-
case 0 /* POINTS */:
|
|
10036
|
+
case 0 /* MeshPrimitiveMode.POINTS */:
|
|
10037
10037
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.PointListDrawMode;
|
|
10038
|
-
case 1 /* LINES */:
|
|
10038
|
+
case 1 /* MeshPrimitiveMode.LINES */:
|
|
10039
10039
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.LineListDrawMode;
|
|
10040
|
-
case 2 /* LINE_LOOP */:
|
|
10040
|
+
case 2 /* MeshPrimitiveMode.LINE_LOOP */:
|
|
10041
10041
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.LineLoopDrawMode;
|
|
10042
|
-
case 3 /* LINE_STRIP */:
|
|
10042
|
+
case 3 /* MeshPrimitiveMode.LINE_STRIP */:
|
|
10043
10043
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.LineStripDrawMode;
|
|
10044
|
-
case 4 /* TRIANGLES */:
|
|
10044
|
+
case 4 /* MeshPrimitiveMode.TRIANGLES */:
|
|
10045
10045
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.TriangleFillMode;
|
|
10046
|
-
case 5 /* TRIANGLE_STRIP */:
|
|
10046
|
+
case 5 /* MeshPrimitiveMode.TRIANGLE_STRIP */:
|
|
10047
10047
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.TriangleStripDrawMode;
|
|
10048
|
-
case 6 /* TRIANGLE_FAN */:
|
|
10048
|
+
case 6 /* MeshPrimitiveMode.TRIANGLE_FAN */:
|
|
10049
10049
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.TriangleFanDrawMode;
|
|
10050
10050
|
}
|
|
10051
10051
|
throw new Error("".concat(context, ": Invalid mesh primitive mode (").concat(mode, ")"));
|