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.
|
@@ -991,8 +991,8 @@ var KHR_animation_pointer = /** @class */ (function () {
|
|
|
991
991
|
if (!extension) {
|
|
992
992
|
return null;
|
|
993
993
|
}
|
|
994
|
-
if (channel.target.path !== "pointer" /* POINTER */) {
|
|
995
|
-
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"));
|
|
994
|
+
if (channel.target.path !== "pointer" /* AnimationChannelTargetPath.POINTER */) {
|
|
995
|
+
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"));
|
|
996
996
|
}
|
|
997
997
|
if (channel.target.node != undefined) {
|
|
998
998
|
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"));
|
|
@@ -1115,11 +1115,11 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
|
|
|
1115
1115
|
var _this = this;
|
|
1116
1116
|
return _glTFLoader__WEBPACK_IMPORTED_MODULE_1__.GLTFLoader.LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
|
|
1117
1117
|
if (primitive.mode != undefined) {
|
|
1118
|
-
if (primitive.mode !== 5 /* TRIANGLE_STRIP */ && primitive.mode !== 4 /* TRIANGLES */) {
|
|
1118
|
+
if (primitive.mode !== 5 /* MeshPrimitiveMode.TRIANGLE_STRIP */ && primitive.mode !== 4 /* MeshPrimitiveMode.TRIANGLES */) {
|
|
1119
1119
|
throw new Error("".concat(context, ": Unsupported mode ").concat(primitive.mode));
|
|
1120
1120
|
}
|
|
1121
1121
|
// TODO: handle triangle strips
|
|
1122
|
-
if (primitive.mode === 5 /* TRIANGLE_STRIP */) {
|
|
1122
|
+
if (primitive.mode === 5 /* MeshPrimitiveMode.TRIANGLE_STRIP */) {
|
|
1123
1123
|
throw new Error("".concat(context, ": Mode ").concat(primitive.mode, " is not currently supported"));
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
@@ -1132,19 +1132,19 @@ var KHR_draco_mesh_compression = /** @class */ (function () {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
attributes[kind] = uniqueId;
|
|
1134
1134
|
var accessor = _glTFLoader__WEBPACK_IMPORTED_MODULE_1__.ArrayItem.Get("".concat(context, "/attributes/").concat(name), _this._loader.gltf.accessors, primitive.attributes[name]);
|
|
1135
|
-
if (accessor.normalized && accessor.componentType !== 5126 /* FLOAT */) {
|
|
1135
|
+
if (accessor.normalized && accessor.componentType !== 5126 /* AccessorComponentType.FLOAT */) {
|
|
1136
1136
|
var divider = 1;
|
|
1137
1137
|
switch (accessor.componentType) {
|
|
1138
|
-
case 5120 /* BYTE */:
|
|
1138
|
+
case 5120 /* AccessorComponentType.BYTE */:
|
|
1139
1139
|
divider = 127.0;
|
|
1140
1140
|
break;
|
|
1141
|
-
case 5121 /* UNSIGNED_BYTE */:
|
|
1141
|
+
case 5121 /* AccessorComponentType.UNSIGNED_BYTE */:
|
|
1142
1142
|
divider = 255.0;
|
|
1143
1143
|
break;
|
|
1144
|
-
case 5122 /* SHORT */:
|
|
1144
|
+
case 5122 /* AccessorComponentType.SHORT */:
|
|
1145
1145
|
divider = 32767.0;
|
|
1146
1146
|
break;
|
|
1147
|
-
case 5123 /* UNSIGNED_SHORT */:
|
|
1147
|
+
case 5123 /* AccessorComponentType.UNSIGNED_SHORT */:
|
|
1148
1148
|
divider = 65535.0;
|
|
1149
1149
|
break;
|
|
1150
1150
|
}
|
|
@@ -1257,15 +1257,15 @@ var KHR_lights = /** @class */ (function () {
|
|
|
1257
1257
|
var name = light.name || babylonMesh.name;
|
|
1258
1258
|
_this._loader.babylonScene._blockEntityCollection = !!_this._loader._assetContainer;
|
|
1259
1259
|
switch (light.type) {
|
|
1260
|
-
case "directional" /* DIRECTIONAL */: {
|
|
1260
|
+
case "directional" /* KHRLightsPunctual_LightType.DIRECTIONAL */: {
|
|
1261
1261
|
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);
|
|
1262
1262
|
break;
|
|
1263
1263
|
}
|
|
1264
|
-
case "point" /* POINT */: {
|
|
1264
|
+
case "point" /* KHRLightsPunctual_LightType.POINT */: {
|
|
1265
1265
|
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);
|
|
1266
1266
|
break;
|
|
1267
1267
|
}
|
|
1268
|
-
case "spot" /* SPOT */: {
|
|
1268
|
+
case "spot" /* KHRLightsPunctual_LightType.SPOT */: {
|
|
1269
1269
|
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);
|
|
1270
1270
|
babylonSpotLight.angle = ((light.spot && light.spot.outerConeAngle) || Math.PI / 4) * 2;
|
|
1271
1271
|
babylonSpotLight.innerAngle = ((light.spot && light.spot.innerConeAngle) || 0) * 2;
|
|
@@ -3196,18 +3196,18 @@ var MSFT_audio_emitter = /** @class */ (function () {
|
|
|
3196
3196
|
};
|
|
3197
3197
|
MSFT_audio_emitter.prototype._getEventAction = function (context, sound, action, time, startOffset) {
|
|
3198
3198
|
switch (action) {
|
|
3199
|
-
case "play" /* play */: {
|
|
3199
|
+
case "play" /* IMSFTAudioEmitter_AnimationEventAction.play */: {
|
|
3200
3200
|
return function (currentFrame) {
|
|
3201
3201
|
var frameOffset = (startOffset || 0) + (currentFrame - time);
|
|
3202
3202
|
sound.play(frameOffset);
|
|
3203
3203
|
};
|
|
3204
3204
|
}
|
|
3205
|
-
case "stop" /* stop */: {
|
|
3205
|
+
case "stop" /* IMSFTAudioEmitter_AnimationEventAction.stop */: {
|
|
3206
3206
|
return function () {
|
|
3207
3207
|
sound.stop();
|
|
3208
3208
|
};
|
|
3209
3209
|
}
|
|
3210
|
-
case "pause" /* pause */: {
|
|
3210
|
+
case "pause" /* IMSFTAudioEmitter_AnimationEventAction.pause */: {
|
|
3211
3211
|
return function () {
|
|
3212
3212
|
sound.pause();
|
|
3213
3213
|
};
|
|
@@ -4695,19 +4695,19 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
4695
4695
|
if (babylonVertexBuffer.getKind() === core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.PositionKind && !_this.parent.alwaysComputeBoundingBox && !babylonMesh.skeleton) {
|
|
4696
4696
|
var mmin = accessor.min, mmax = accessor.max;
|
|
4697
4697
|
if (mmin !== undefined && mmax !== undefined) {
|
|
4698
|
-
if (accessor.normalized && accessor.componentType !== 5126 /* FLOAT */) {
|
|
4698
|
+
if (accessor.normalized && accessor.componentType !== 5126 /* AccessorComponentType.FLOAT */) {
|
|
4699
4699
|
var divider = 1;
|
|
4700
4700
|
switch (accessor.componentType) {
|
|
4701
|
-
case 5120 /* BYTE */:
|
|
4701
|
+
case 5120 /* AccessorComponentType.BYTE */:
|
|
4702
4702
|
divider = 127.0;
|
|
4703
4703
|
break;
|
|
4704
|
-
case 5121 /* UNSIGNED_BYTE */:
|
|
4704
|
+
case 5121 /* AccessorComponentType.UNSIGNED_BYTE */:
|
|
4705
4705
|
divider = 255.0;
|
|
4706
4706
|
break;
|
|
4707
|
-
case 5122 /* SHORT */:
|
|
4707
|
+
case 5122 /* AccessorComponentType.SHORT */:
|
|
4708
4708
|
divider = 32767.0;
|
|
4709
4709
|
break;
|
|
4710
|
-
case 5123 /* UNSIGNED_SHORT */:
|
|
4710
|
+
case 5123 /* AccessorComponentType.UNSIGNED_SHORT */:
|
|
4711
4711
|
divider = 65535.0;
|
|
4712
4712
|
break;
|
|
4713
4713
|
}
|
|
@@ -4746,7 +4746,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
4746
4746
|
loadAttribute("JOINTS_1", core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.MatricesIndicesExtraKind);
|
|
4747
4747
|
loadAttribute("WEIGHTS_1", core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.MatricesWeightsExtraKind);
|
|
4748
4748
|
loadAttribute("COLOR_0", core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.VertexBuffer.ColorKind, function (accessor) {
|
|
4749
|
-
if (accessor.type === "VEC4" /* VEC4 */) {
|
|
4749
|
+
if (accessor.type === "VEC4" /* AccessorType.VEC4 */) {
|
|
4750
4750
|
babylonMesh.hasVertexAlpha = true;
|
|
4751
4751
|
}
|
|
4752
4752
|
});
|
|
@@ -5030,7 +5030,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5030
5030
|
camera._babylonCamera = babylonCamera;
|
|
5031
5031
|
babylonCamera.rotation = new core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Vector3(0, Math.PI, 0);
|
|
5032
5032
|
switch (camera.type) {
|
|
5033
|
-
case "perspective" /* PERSPECTIVE */: {
|
|
5033
|
+
case "perspective" /* CameraType.PERSPECTIVE */: {
|
|
5034
5034
|
var perspective = camera.perspective;
|
|
5035
5035
|
if (!perspective) {
|
|
5036
5036
|
throw new Error("".concat(context, ": Camera perspective properties are missing"));
|
|
@@ -5040,7 +5040,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5040
5040
|
babylonCamera.maxZ = perspective.zfar || 0;
|
|
5041
5041
|
break;
|
|
5042
5042
|
}
|
|
5043
|
-
case "orthographic" /* ORTHOGRAPHIC */: {
|
|
5043
|
+
case "orthographic" /* CameraType.ORTHOGRAPHIC */: {
|
|
5044
5044
|
if (!camera.orthographic) {
|
|
5045
5045
|
throw new Error("".concat(context, ": Camera orthographic properties are missing"));
|
|
5046
5046
|
}
|
|
@@ -5134,25 +5134,25 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5134
5134
|
}
|
|
5135
5135
|
var targetNode = ArrayItem.Get("".concat(context, "/target/node"), this._gltf.nodes, channel.target.node);
|
|
5136
5136
|
// Ignore animations that have no animation targets.
|
|
5137
|
-
if ((channel.target.path === "weights" /* WEIGHTS */ && !targetNode._numMorphTargets) ||
|
|
5138
|
-
(channel.target.path !== "weights" /* WEIGHTS */ && !targetNode._babylonTransformNode)) {
|
|
5137
|
+
if ((channel.target.path === "weights" /* AnimationChannelTargetPath.WEIGHTS */ && !targetNode._numMorphTargets) ||
|
|
5138
|
+
(channel.target.path !== "weights" /* AnimationChannelTargetPath.WEIGHTS */ && !targetNode._babylonTransformNode)) {
|
|
5139
5139
|
return Promise.resolve();
|
|
5140
5140
|
}
|
|
5141
5141
|
var properties;
|
|
5142
5142
|
switch (channel.target.path) {
|
|
5143
|
-
case "translation" /* TRANSLATION */: {
|
|
5143
|
+
case "translation" /* AnimationChannelTargetPath.TRANSLATION */: {
|
|
5144
5144
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.translation;
|
|
5145
5145
|
break;
|
|
5146
5146
|
}
|
|
5147
|
-
case "rotation" /* ROTATION */: {
|
|
5147
|
+
case "rotation" /* AnimationChannelTargetPath.ROTATION */: {
|
|
5148
5148
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.rotation;
|
|
5149
5149
|
break;
|
|
5150
5150
|
}
|
|
5151
|
-
case "scale" /* SCALE */: {
|
|
5151
|
+
case "scale" /* AnimationChannelTargetPath.SCALE */: {
|
|
5152
5152
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.scale;
|
|
5153
5153
|
break;
|
|
5154
5154
|
}
|
|
5155
|
-
case "weights" /* WEIGHTS */: {
|
|
5155
|
+
case "weights" /* AnimationChannelTargetPath.WEIGHTS */: {
|
|
5156
5156
|
properties = _glTFLoaderAnimation__WEBPACK_IMPORTED_MODULE_2__.nodeAnimationData.weights;
|
|
5157
5157
|
break;
|
|
5158
5158
|
}
|
|
@@ -5196,7 +5196,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5196
5196
|
var keys = new Array(input.length);
|
|
5197
5197
|
var outputOffset = 0;
|
|
5198
5198
|
switch (data.interpolation) {
|
|
5199
|
-
case "STEP" /* STEP */: {
|
|
5199
|
+
case "STEP" /* AnimationSamplerInterpolation.STEP */: {
|
|
5200
5200
|
for (var index = 0; index < input.length; index++) {
|
|
5201
5201
|
var value = property.getValue(targetInfo.target, output, outputOffset, 1);
|
|
5202
5202
|
outputOffset += stride;
|
|
@@ -5208,7 +5208,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5208
5208
|
}
|
|
5209
5209
|
break;
|
|
5210
5210
|
}
|
|
5211
|
-
case "CUBICSPLINE" /* CUBICSPLINE */: {
|
|
5211
|
+
case "CUBICSPLINE" /* AnimationSamplerInterpolation.CUBICSPLINE */: {
|
|
5212
5212
|
for (var index = 0; index < input.length; index++) {
|
|
5213
5213
|
var inTangent = property.getValue(targetInfo.target, output, outputOffset, invfps);
|
|
5214
5214
|
outputOffset += stride;
|
|
@@ -5225,7 +5225,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5225
5225
|
}
|
|
5226
5226
|
break;
|
|
5227
5227
|
}
|
|
5228
|
-
case "LINEAR" /* LINEAR */: {
|
|
5228
|
+
case "LINEAR" /* AnimationSamplerInterpolation.LINEAR */: {
|
|
5229
5229
|
for (var index = 0; index < input.length; index++) {
|
|
5230
5230
|
var value = property.getValue(targetInfo.target, output, outputOffset, 1);
|
|
5231
5231
|
outputOffset += stride;
|
|
@@ -5251,11 +5251,11 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5251
5251
|
if (sampler._data) {
|
|
5252
5252
|
return sampler._data;
|
|
5253
5253
|
}
|
|
5254
|
-
var interpolation = sampler.interpolation || "LINEAR" /* LINEAR */;
|
|
5254
|
+
var interpolation = sampler.interpolation || "LINEAR" /* AnimationSamplerInterpolation.LINEAR */;
|
|
5255
5255
|
switch (interpolation) {
|
|
5256
|
-
case "STEP" /* STEP */:
|
|
5257
|
-
case "LINEAR" /* LINEAR */:
|
|
5258
|
-
case "CUBICSPLINE" /* CUBICSPLINE */: {
|
|
5256
|
+
case "STEP" /* AnimationSamplerInterpolation.STEP */:
|
|
5257
|
+
case "LINEAR" /* AnimationSamplerInterpolation.LINEAR */:
|
|
5258
|
+
case "CUBICSPLINE" /* AnimationSamplerInterpolation.CUBICSPLINE */: {
|
|
5259
5259
|
break;
|
|
5260
5260
|
}
|
|
5261
5261
|
default: {
|
|
@@ -5342,7 +5342,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5342
5342
|
else {
|
|
5343
5343
|
var bufferView_1 = ArrayItem.Get("".concat(context, "/bufferView"), this._gltf.bufferViews, accessor.bufferView);
|
|
5344
5344
|
accessor._data = this.loadBufferViewAsync("/bufferViews/".concat(bufferView_1.index), bufferView_1).then(function (data) {
|
|
5345
|
-
if (accessor.componentType === 5126 /* FLOAT */ && !accessor.normalized && (!bufferView_1.byteStride || bufferView_1.byteStride === byteStride)) {
|
|
5345
|
+
if (accessor.componentType === 5126 /* AccessorComponentType.FLOAT */ && !accessor.normalized && (!bufferView_1.byteStride || bufferView_1.byteStride === byteStride)) {
|
|
5346
5346
|
return GLTFLoader._GetTypedArray(context, accessor.componentType, data, accessor.byteOffset, length);
|
|
5347
5347
|
}
|
|
5348
5348
|
else {
|
|
@@ -5368,7 +5368,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5368
5368
|
var indices = GLTFLoader._GetTypedArray("".concat(context, "/sparse/indices"), sparse_1.indices.componentType, indicesData, sparse_1.indices.byteOffset, sparse_1.count);
|
|
5369
5369
|
var sparseLength = numComponents * sparse_1.count;
|
|
5370
5370
|
var values;
|
|
5371
|
-
if (accessor.componentType === 5126 /* FLOAT */ && !accessor.normalized) {
|
|
5371
|
+
if (accessor.componentType === 5126 /* AccessorComponentType.FLOAT */ && !accessor.normalized) {
|
|
5372
5372
|
values = GLTFLoader._GetTypedArray("".concat(context, "/sparse/values"), accessor.componentType, valuesData, sparse_1.values.byteOffset, sparseLength);
|
|
5373
5373
|
}
|
|
5374
5374
|
else {
|
|
@@ -5398,12 +5398,12 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5398
5398
|
return this._loadAccessorAsync(context, accessor, Float32Array);
|
|
5399
5399
|
};
|
|
5400
5400
|
GLTFLoader.prototype._loadIndicesAccessorAsync = function (context, accessor) {
|
|
5401
|
-
if (accessor.type !== "SCALAR" /* SCALAR */) {
|
|
5401
|
+
if (accessor.type !== "SCALAR" /* AccessorType.SCALAR */) {
|
|
5402
5402
|
throw new Error("".concat(context, "/type: Invalid value ").concat(accessor.type));
|
|
5403
5403
|
}
|
|
5404
|
-
if (accessor.componentType !== 5121 /* UNSIGNED_BYTE */ &&
|
|
5405
|
-
accessor.componentType !== 5123 /* UNSIGNED_SHORT */ &&
|
|
5406
|
-
accessor.componentType !== 5125 /* UNSIGNED_INT */) {
|
|
5404
|
+
if (accessor.componentType !== 5121 /* AccessorComponentType.UNSIGNED_BYTE */ &&
|
|
5405
|
+
accessor.componentType !== 5123 /* AccessorComponentType.UNSIGNED_SHORT */ &&
|
|
5406
|
+
accessor.componentType !== 5125 /* AccessorComponentType.UNSIGNED_INT */) {
|
|
5407
5407
|
throw new Error("".concat(context, "/componentType: Invalid value ").concat(accessor.componentType));
|
|
5408
5408
|
}
|
|
5409
5409
|
if (accessor._data) {
|
|
@@ -5644,13 +5644,13 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5644
5644
|
if (!(babylonMaterial instanceof core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial)) {
|
|
5645
5645
|
throw new Error("".concat(context, ": Material type not supported"));
|
|
5646
5646
|
}
|
|
5647
|
-
var alphaMode = material.alphaMode || "OPAQUE" /* OPAQUE */;
|
|
5647
|
+
var alphaMode = material.alphaMode || "OPAQUE" /* MaterialAlphaMode.OPAQUE */;
|
|
5648
5648
|
switch (alphaMode) {
|
|
5649
|
-
case "OPAQUE" /* OPAQUE */: {
|
|
5649
|
+
case "OPAQUE" /* MaterialAlphaMode.OPAQUE */: {
|
|
5650
5650
|
babylonMaterial.transparencyMode = core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial.PBRMATERIAL_OPAQUE;
|
|
5651
5651
|
break;
|
|
5652
5652
|
}
|
|
5653
|
-
case "MASK" /* MASK */: {
|
|
5653
|
+
case "MASK" /* MaterialAlphaMode.MASK */: {
|
|
5654
5654
|
babylonMaterial.transparencyMode = core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial.PBRMATERIAL_ALPHATEST;
|
|
5655
5655
|
babylonMaterial.alphaCutOff = material.alphaCutoff == undefined ? 0.5 : material.alphaCutoff;
|
|
5656
5656
|
if (babylonMaterial.albedoTexture) {
|
|
@@ -5658,7 +5658,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5658
5658
|
}
|
|
5659
5659
|
break;
|
|
5660
5660
|
}
|
|
5661
|
-
case "BLEND" /* BLEND */: {
|
|
5661
|
+
case "BLEND" /* MaterialAlphaMode.BLEND */: {
|
|
5662
5662
|
babylonMaterial.transparencyMode = core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.PBRMaterial.PBRMATERIAL_ALPHABLEND;
|
|
5663
5663
|
if (babylonMaterial.albedoTexture) {
|
|
5664
5664
|
babylonMaterial.albedoTexture.hasAlpha = true;
|
|
@@ -5763,7 +5763,7 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5763
5763
|
GLTFLoader.prototype._loadSampler = function (context, sampler) {
|
|
5764
5764
|
if (!sampler._data) {
|
|
5765
5765
|
sampler._data = {
|
|
5766
|
-
noMipMaps: sampler.minFilter === 9728 /* NEAREST */ || sampler.minFilter === 9729 /* LINEAR */,
|
|
5766
|
+
noMipMaps: sampler.minFilter === 9728 /* TextureMinFilter.NEAREST */ || sampler.minFilter === 9729 /* TextureMinFilter.LINEAR */,
|
|
5767
5767
|
samplingMode: GLTFLoader._GetTextureSamplingMode(context, sampler),
|
|
5768
5768
|
wrapU: GLTFLoader._GetTextureWrapMode("".concat(context, "/wrapS"), sampler.wrapS),
|
|
5769
5769
|
wrapV: GLTFLoader._GetTextureWrapMode("".concat(context, "/wrapT"), sampler.wrapT),
|
|
@@ -5840,13 +5840,13 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5840
5840
|
};
|
|
5841
5841
|
GLTFLoader._GetTextureWrapMode = function (context, mode) {
|
|
5842
5842
|
// Set defaults if undefined
|
|
5843
|
-
mode = mode == undefined ? 10497 /* REPEAT */ : mode;
|
|
5843
|
+
mode = mode == undefined ? 10497 /* TextureWrapMode.REPEAT */ : mode;
|
|
5844
5844
|
switch (mode) {
|
|
5845
|
-
case 33071 /* CLAMP_TO_EDGE */:
|
|
5845
|
+
case 33071 /* TextureWrapMode.CLAMP_TO_EDGE */:
|
|
5846
5846
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.CLAMP_ADDRESSMODE;
|
|
5847
|
-
case 33648 /* MIRRORED_REPEAT */:
|
|
5847
|
+
case 33648 /* TextureWrapMode.MIRRORED_REPEAT */:
|
|
5848
5848
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.MIRROR_ADDRESSMODE;
|
|
5849
|
-
case 10497 /* REPEAT */:
|
|
5849
|
+
case 10497 /* TextureWrapMode.REPEAT */:
|
|
5850
5850
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.WRAP_ADDRESSMODE;
|
|
5851
5851
|
default:
|
|
5852
5852
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, ": Invalid value (").concat(mode, ")"));
|
|
@@ -5855,21 +5855,21 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5855
5855
|
};
|
|
5856
5856
|
GLTFLoader._GetTextureSamplingMode = function (context, sampler) {
|
|
5857
5857
|
// Set defaults if undefined
|
|
5858
|
-
var magFilter = sampler.magFilter == undefined ? 9729 /* LINEAR */ : sampler.magFilter;
|
|
5859
|
-
var minFilter = sampler.minFilter == undefined ? 9987 /* LINEAR_MIPMAP_LINEAR */ : sampler.minFilter;
|
|
5860
|
-
if (magFilter === 9729 /* LINEAR */) {
|
|
5858
|
+
var magFilter = sampler.magFilter == undefined ? 9729 /* TextureMagFilter.LINEAR */ : sampler.magFilter;
|
|
5859
|
+
var minFilter = sampler.minFilter == undefined ? 9987 /* TextureMinFilter.LINEAR_MIPMAP_LINEAR */ : sampler.minFilter;
|
|
5860
|
+
if (magFilter === 9729 /* TextureMagFilter.LINEAR */) {
|
|
5861
5861
|
switch (minFilter) {
|
|
5862
|
-
case 9728 /* NEAREST */:
|
|
5862
|
+
case 9728 /* TextureMinFilter.NEAREST */:
|
|
5863
5863
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_NEAREST;
|
|
5864
|
-
case 9729 /* LINEAR */:
|
|
5864
|
+
case 9729 /* TextureMinFilter.LINEAR */:
|
|
5865
5865
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_LINEAR;
|
|
5866
|
-
case 9984 /* NEAREST_MIPMAP_NEAREST */:
|
|
5866
|
+
case 9984 /* TextureMinFilter.NEAREST_MIPMAP_NEAREST */:
|
|
5867
5867
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_NEAREST_MIPNEAREST;
|
|
5868
|
-
case 9985 /* LINEAR_MIPMAP_NEAREST */:
|
|
5868
|
+
case 9985 /* TextureMinFilter.LINEAR_MIPMAP_NEAREST */:
|
|
5869
5869
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_LINEAR_MIPNEAREST;
|
|
5870
|
-
case 9986 /* NEAREST_MIPMAP_LINEAR */:
|
|
5870
|
+
case 9986 /* TextureMinFilter.NEAREST_MIPMAP_LINEAR */:
|
|
5871
5871
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_NEAREST_MIPLINEAR;
|
|
5872
|
-
case 9987 /* LINEAR_MIPMAP_LINEAR */:
|
|
5872
|
+
case 9987 /* TextureMinFilter.LINEAR_MIPMAP_LINEAR */:
|
|
5873
5873
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.LINEAR_LINEAR_MIPLINEAR;
|
|
5874
5874
|
default:
|
|
5875
5875
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, "/minFilter: Invalid value (").concat(minFilter, ")"));
|
|
@@ -5877,21 +5877,21 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5877
5877
|
}
|
|
5878
5878
|
}
|
|
5879
5879
|
else {
|
|
5880
|
-
if (magFilter !== 9728 /* NEAREST */) {
|
|
5880
|
+
if (magFilter !== 9728 /* TextureMagFilter.NEAREST */) {
|
|
5881
5881
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, "/magFilter: Invalid value (").concat(magFilter, ")"));
|
|
5882
5882
|
}
|
|
5883
5883
|
switch (minFilter) {
|
|
5884
|
-
case 9728 /* NEAREST */:
|
|
5884
|
+
case 9728 /* TextureMinFilter.NEAREST */:
|
|
5885
5885
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_NEAREST;
|
|
5886
|
-
case 9729 /* LINEAR */:
|
|
5886
|
+
case 9729 /* TextureMinFilter.LINEAR */:
|
|
5887
5887
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_LINEAR;
|
|
5888
|
-
case 9984 /* NEAREST_MIPMAP_NEAREST */:
|
|
5888
|
+
case 9984 /* TextureMinFilter.NEAREST_MIPMAP_NEAREST */:
|
|
5889
5889
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_NEAREST_MIPNEAREST;
|
|
5890
|
-
case 9985 /* LINEAR_MIPMAP_NEAREST */:
|
|
5890
|
+
case 9985 /* TextureMinFilter.LINEAR_MIPMAP_NEAREST */:
|
|
5891
5891
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_LINEAR_MIPNEAREST;
|
|
5892
|
-
case 9986 /* NEAREST_MIPMAP_LINEAR */:
|
|
5892
|
+
case 9986 /* TextureMinFilter.NEAREST_MIPMAP_LINEAR */:
|
|
5893
5893
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_NEAREST_MIPLINEAR;
|
|
5894
|
-
case 9987 /* LINEAR_MIPMAP_LINEAR */:
|
|
5894
|
+
case 9987 /* TextureMinFilter.LINEAR_MIPMAP_LINEAR */:
|
|
5895
5895
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Texture.NEAREST_LINEAR_MIPLINEAR;
|
|
5896
5896
|
default:
|
|
5897
5897
|
core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Logger.Warn("".concat(context, "/minFilter: Invalid value (").concat(minFilter, ")"));
|
|
@@ -5901,17 +5901,17 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5901
5901
|
};
|
|
5902
5902
|
GLTFLoader._GetTypedArrayConstructor = function (context, componentType) {
|
|
5903
5903
|
switch (componentType) {
|
|
5904
|
-
case 5120 /* BYTE */:
|
|
5904
|
+
case 5120 /* AccessorComponentType.BYTE */:
|
|
5905
5905
|
return Int8Array;
|
|
5906
|
-
case 5121 /* UNSIGNED_BYTE */:
|
|
5906
|
+
case 5121 /* AccessorComponentType.UNSIGNED_BYTE */:
|
|
5907
5907
|
return Uint8Array;
|
|
5908
|
-
case 5122 /* SHORT */:
|
|
5908
|
+
case 5122 /* AccessorComponentType.SHORT */:
|
|
5909
5909
|
return Int16Array;
|
|
5910
|
-
case 5123 /* UNSIGNED_SHORT */:
|
|
5910
|
+
case 5123 /* AccessorComponentType.UNSIGNED_SHORT */:
|
|
5911
5911
|
return Uint16Array;
|
|
5912
|
-
case 5125 /* UNSIGNED_INT */:
|
|
5912
|
+
case 5125 /* AccessorComponentType.UNSIGNED_INT */:
|
|
5913
5913
|
return Uint32Array;
|
|
5914
|
-
case 5126 /* FLOAT */:
|
|
5914
|
+
case 5126 /* AccessorComponentType.FLOAT */:
|
|
5915
5915
|
return Float32Array;
|
|
5916
5916
|
default:
|
|
5917
5917
|
throw new Error("".concat(context, ": Invalid component type ").concat(componentType));
|
|
@@ -5956,22 +5956,22 @@ var GLTFLoader = /** @class */ (function () {
|
|
|
5956
5956
|
*/
|
|
5957
5957
|
GLTFLoader._GetDrawMode = function (context, mode) {
|
|
5958
5958
|
if (mode == undefined) {
|
|
5959
|
-
mode = 4 /* TRIANGLES */;
|
|
5959
|
+
mode = 4 /* MeshPrimitiveMode.TRIANGLES */;
|
|
5960
5960
|
}
|
|
5961
5961
|
switch (mode) {
|
|
5962
|
-
case 0 /* POINTS */:
|
|
5962
|
+
case 0 /* MeshPrimitiveMode.POINTS */:
|
|
5963
5963
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.PointListDrawMode;
|
|
5964
|
-
case 1 /* LINES */:
|
|
5964
|
+
case 1 /* MeshPrimitiveMode.LINES */:
|
|
5965
5965
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.LineListDrawMode;
|
|
5966
|
-
case 2 /* LINE_LOOP */:
|
|
5966
|
+
case 2 /* MeshPrimitiveMode.LINE_LOOP */:
|
|
5967
5967
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.LineLoopDrawMode;
|
|
5968
|
-
case 3 /* LINE_STRIP */:
|
|
5968
|
+
case 3 /* MeshPrimitiveMode.LINE_STRIP */:
|
|
5969
5969
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.LineStripDrawMode;
|
|
5970
|
-
case 4 /* TRIANGLES */:
|
|
5970
|
+
case 4 /* MeshPrimitiveMode.TRIANGLES */:
|
|
5971
5971
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.TriangleFillMode;
|
|
5972
|
-
case 5 /* TRIANGLE_STRIP */:
|
|
5972
|
+
case 5 /* MeshPrimitiveMode.TRIANGLE_STRIP */:
|
|
5973
5973
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.TriangleStripDrawMode;
|
|
5974
|
-
case 6 /* TRIANGLE_FAN */:
|
|
5974
|
+
case 6 /* MeshPrimitiveMode.TRIANGLE_FAN */:
|
|
5975
5975
|
return core_Misc_deferred__WEBPACK_IMPORTED_MODULE_0__.Material.TriangleFanDrawMode;
|
|
5976
5976
|
}
|
|
5977
5977
|
throw new Error("".concat(context, ": Invalid mesh primitive mode (").concat(mode, ")"));
|