@galacean/engine-loader 1.1.0-beta.8 → 1.2.0-alpha.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/dist/main.js +499 -245
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +499 -245
- package/dist/module.js +501 -247
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFLoader.d.ts +1 -0
- package/types/Texture2DLoader.d.ts +9 -1
- package/types/gltf/GLTFResource.d.ts +50 -16
- package/types/gltf/extensions/GLTFExtensionSchema.d.ts +9 -1
- package/types/gltf/extensions/KHR_materials_anisotropy.d.ts +1 -0
- package/types/gltf/extensions/index.d.ts +1 -0
- package/types/gltf/parser/GLTFJSONParser.d.ts +7 -0
- package/types/gltf/parser/GLTFParserContext.d.ts +17 -2
- package/types/gltf/parser/GLTFSceneParser.d.ts +0 -1
- package/types/index.d.ts +1 -1
- package/types/ktx2/KTX2Loader.d.ts +16 -5
- package/types/ktx2/transcoder/AbstractTranscoder.d.ts +1 -1
- package/types/ktx2/transcoder/BinomialLLCTranscoder.d.ts +1 -1
- package/types/ktx2/transcoder/BinomialLLCWorkerCode.d.ts +1 -1
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +1 -1
- package/types/resource-deserialize/resources/schema/MaterialSchema.d.ts +1 -1
- package/types/resource-deserialize/resources/schema/SceneSchema.d.ts +3 -1
- package/types/resource-deserialize/utils/BufferReader.d.ts +1 -1
- package/types/ktx2/BinomialLLCTranscoder/BinomialLLCTranscoder.d.ts +0 -13
- package/types/ktx2/BinomialLLCTranscoder/TranscodeWorkerCode.d.ts +0 -33
- package/types/ktx2/KhronosTranscoder/KhronosTranscoder.d.ts +0 -17
- package/types/ktx2/KhronosTranscoder/TranscoderWorkerCode.d.ts +0 -34
- package/types/ktx2/TranscodeResult.d.ts +0 -10
- package/types/ktx2/constants.d.ts +0 -7
- package/types/ktx2/zstddec.d.ts +0 -62
package/dist/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Utils, ModelMesh, BlendShape, Texture2D, Loader, Entity, Transform, Animator, DirectLight, Camera, MeshRenderer, ParticleRenderer, PointLight, SpotLight, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationClip, AnimationEvent,
|
|
1
|
+
import { Utils, ModelMesh, BlendShape, Texture2D, Loader, Entity, Transform, Animator, DirectLight, Camera, MeshRenderer, ParticleRenderer, PointLight, SpotLight, Script, SpriteMask, SpriteRenderer, TextRenderer, AnimationClip, AnimationEvent, AnimationStringCurve, Keyframe, AnimationBoolCurve, AnimationRefCurve, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, Scene, resourceLoader, AssetPromise, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateMachine, AnimatorStateTransition, TextureCube, TextureFilterMode, TextureCubeFace, AmbientLight, DiffuseMode, Font, ReferResource, IndexFormat, VertexElementFormat, GLCapabilityType, Logger, TextureFormat, request, ContentRestorer, InterpolationType, SkinnedMeshRenderer, PBRMaterial, BlinnPhongMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Skin, TextureWrapMode as TextureWrapMode$1, Material, Shader, SpriteAtlas, Sprite, BackgroundMode, UnlitMaterial } from '@galacean/engine-core';
|
|
2
2
|
import { Color, Vector4, Vector3, Vector2, Quaternion, SphericalHarmonics3, MathUtil, BoundingBox, Matrix, Rect } from '@galacean/engine-math';
|
|
3
3
|
import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
|
|
4
4
|
import { DRACODecoder } from '@galacean/engine-draco';
|
|
@@ -116,116 +116,116 @@ var BufferReader = /*#__PURE__*/ function() {
|
|
|
116
116
|
this.data = data;
|
|
117
117
|
this._dataView = new DataView(data.buffer, data.byteOffset + byteOffset, byteLength != null ? byteLength : data.byteLength - byteOffset);
|
|
118
118
|
this._littleEndian = littleEndian;
|
|
119
|
-
this.
|
|
119
|
+
this._position = 0;
|
|
120
120
|
this._baseOffset = byteOffset;
|
|
121
121
|
}
|
|
122
122
|
var _proto = BufferReader.prototype;
|
|
123
123
|
_proto.nextUint8 = function nextUint8() {
|
|
124
|
-
var value = this._dataView.getUint8(this.
|
|
125
|
-
this.
|
|
124
|
+
var value = this._dataView.getUint8(this._position);
|
|
125
|
+
this._position += 1;
|
|
126
126
|
return value;
|
|
127
127
|
};
|
|
128
128
|
_proto.nextUint16 = function nextUint16() {
|
|
129
|
-
var value = this._dataView.getUint16(this.
|
|
130
|
-
this.
|
|
129
|
+
var value = this._dataView.getUint16(this._position, this._littleEndian);
|
|
130
|
+
this._position += 2;
|
|
131
131
|
return value;
|
|
132
132
|
};
|
|
133
133
|
_proto.nextUint32 = function nextUint32() {
|
|
134
|
-
var value = this._dataView.getUint32(this.
|
|
135
|
-
this.
|
|
134
|
+
var value = this._dataView.getUint32(this._position, this._littleEndian);
|
|
135
|
+
this._position += 4;
|
|
136
136
|
return value;
|
|
137
137
|
};
|
|
138
138
|
_proto.nextInt32 = function nextInt32() {
|
|
139
|
-
var value = this._dataView.getInt32(this.
|
|
140
|
-
this.
|
|
139
|
+
var value = this._dataView.getInt32(this._position, this._littleEndian);
|
|
140
|
+
this._position += 4;
|
|
141
141
|
return value;
|
|
142
142
|
};
|
|
143
143
|
_proto.nextInt32Array = function nextInt32Array(len) {
|
|
144
|
-
var value = new Int32Array(this.data.buffer, this.
|
|
145
|
-
this.
|
|
144
|
+
var value = new Int32Array(this.data.buffer, this._position + this._dataView.byteOffset, len);
|
|
145
|
+
this._position += 4 * len;
|
|
146
146
|
return value;
|
|
147
147
|
};
|
|
148
148
|
_proto.nextFloat32 = function nextFloat32() {
|
|
149
|
-
var value = this._dataView.getFloat32(this.
|
|
150
|
-
this.
|
|
149
|
+
var value = this._dataView.getFloat32(this._position, this._littleEndian);
|
|
150
|
+
this._position += 4;
|
|
151
151
|
return value;
|
|
152
152
|
};
|
|
153
153
|
_proto.nextFloat32Array = function nextFloat32Array(len) {
|
|
154
|
-
var value = new Float32Array(this.data.buffer, this.
|
|
155
|
-
this.
|
|
154
|
+
var value = new Float32Array(this.data.buffer, this._position + this._dataView.byteOffset, len);
|
|
155
|
+
this._position += 4 * len;
|
|
156
156
|
return value;
|
|
157
157
|
};
|
|
158
158
|
_proto.nextUint32Array = function nextUint32Array(len) {
|
|
159
|
-
var value = new Uint32Array(this.data.buffer, this.
|
|
160
|
-
this.
|
|
159
|
+
var value = new Uint32Array(this.data.buffer, this._position + this._dataView.byteOffset, len);
|
|
160
|
+
this._position += 4 * len;
|
|
161
161
|
return value;
|
|
162
162
|
};
|
|
163
163
|
_proto.nextUint8Array = function nextUint8Array(len) {
|
|
164
|
-
var value = new Uint8Array(this.data.buffer, this.
|
|
165
|
-
this.
|
|
164
|
+
var value = new Uint8Array(this.data.buffer, this._position + this._dataView.byteOffset, len);
|
|
165
|
+
this._position += len;
|
|
166
166
|
return value;
|
|
167
167
|
};
|
|
168
168
|
_proto.nextUint64 = function nextUint64() {
|
|
169
|
-
var left = this._dataView.getUint32(this.
|
|
170
|
-
var right = this._dataView.getUint32(this.
|
|
169
|
+
var left = this._dataView.getUint32(this._position, this._littleEndian);
|
|
170
|
+
var right = this._dataView.getUint32(this._position + 4, this._littleEndian);
|
|
171
171
|
var value = left + Math.pow(2, 32) * right;
|
|
172
|
-
this.
|
|
172
|
+
this._position += 8;
|
|
173
173
|
return value;
|
|
174
174
|
};
|
|
175
175
|
_proto.nextStr = function nextStr() {
|
|
176
176
|
var strByteLength = this.nextUint16();
|
|
177
|
-
var uint8Array = new Uint8Array(this.data.buffer, this.
|
|
178
|
-
this.
|
|
177
|
+
var uint8Array = new Uint8Array(this.data.buffer, this._position + this._dataView.byteOffset, strByteLength);
|
|
178
|
+
this._position += strByteLength;
|
|
179
179
|
return Utils.decodeText(uint8Array);
|
|
180
180
|
};
|
|
181
181
|
/**
|
|
182
182
|
* image data 放在最后
|
|
183
183
|
*/ _proto.nextImageData = function nextImageData(count) {
|
|
184
|
-
return new Uint8Array(this.data.buffer, this.data.byteOffset + this.
|
|
184
|
+
return new Uint8Array(this.data.buffer, this.data.byteOffset + this._position);
|
|
185
185
|
};
|
|
186
186
|
_proto.nextImagesData = function nextImagesData(count) {
|
|
187
187
|
var imagesLen = new Array(count);
|
|
188
188
|
// Start offset of Uint32Array should be a multiple of 4. ref: https://stackoverflow.com/questions/15417310/why-typed-array-constructors-require-offset-to-be-multiple-of-underlying-type-si
|
|
189
189
|
for(var i = 0; i < count; i++){
|
|
190
|
-
var len = this._dataView.getUint32(this.
|
|
190
|
+
var len = this._dataView.getUint32(this._position, this._littleEndian);
|
|
191
191
|
imagesLen[i] = len;
|
|
192
|
-
this.
|
|
192
|
+
this._position += 4;
|
|
193
193
|
}
|
|
194
194
|
var imagesData = [];
|
|
195
195
|
for(var i1 = 0; i1 < count; i1++){
|
|
196
196
|
var len1 = imagesLen[i1];
|
|
197
|
-
var buffer = new Uint8Array(this.data.buffer, this._dataView.byteOffset + this.
|
|
198
|
-
this.
|
|
197
|
+
var buffer = new Uint8Array(this.data.buffer, this._dataView.byteOffset + this._position, len1);
|
|
198
|
+
this._position += len1;
|
|
199
199
|
imagesData.push(buffer);
|
|
200
200
|
}
|
|
201
201
|
return imagesData;
|
|
202
202
|
};
|
|
203
203
|
_proto.skip = function skip(bytes) {
|
|
204
|
-
this.
|
|
204
|
+
this._position += bytes;
|
|
205
205
|
return this;
|
|
206
206
|
};
|
|
207
207
|
_proto.scan = function scan(maxByteLength, term) {
|
|
208
208
|
if (term === void 0) term = 0x00;
|
|
209
|
-
var byteOffset = this.
|
|
209
|
+
var byteOffset = this._position;
|
|
210
210
|
var byteLength = 0;
|
|
211
|
-
while(this._dataView.getUint8(this.
|
|
211
|
+
while(this._dataView.getUint8(this._position) !== term && byteLength < maxByteLength){
|
|
212
212
|
byteLength++;
|
|
213
|
-
this.
|
|
213
|
+
this._position++;
|
|
214
214
|
}
|
|
215
|
-
if (byteLength < maxByteLength) this.
|
|
215
|
+
if (byteLength < maxByteLength) this._position++;
|
|
216
216
|
return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);
|
|
217
217
|
};
|
|
218
218
|
_create_class(BufferReader, [
|
|
219
219
|
{
|
|
220
220
|
key: "position",
|
|
221
221
|
get: function get() {
|
|
222
|
-
return this.
|
|
222
|
+
return this._position;
|
|
223
223
|
}
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
226
|
key: "offset",
|
|
227
227
|
get: function get() {
|
|
228
|
-
return this.
|
|
228
|
+
return this._position + this._baseOffset;
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
]);
|
|
@@ -289,75 +289,74 @@ var MeshDecoder = /*#__PURE__*/ function() {
|
|
|
289
289
|
var encodedMeshData = JSON.parse(jsonDataString);
|
|
290
290
|
// @ts-ignore Vector3 is not compatible with {x: number, y: number, z: number}.
|
|
291
291
|
encodedMeshData.bounds && modelMesh.bounds.copyFrom(encodedMeshData.bounds);
|
|
292
|
-
var offset = Math.ceil(bufferReader.offset / 4) * 4;
|
|
292
|
+
var offset = Math.ceil(bufferReader.offset / 4) * 4 + bufferReader.data.byteOffset;
|
|
293
293
|
var buffer = bufferReader.data.buffer;
|
|
294
|
-
var
|
|
295
|
-
var float32Array = new Float32Array(buffer, encodedMeshData.positions.start + offset + byteOffset, (encodedMeshData.positions.end - encodedMeshData.positions.start) / 4);
|
|
294
|
+
var float32Array = new Float32Array(buffer, encodedMeshData.positions.start + offset, (encodedMeshData.positions.end - encodedMeshData.positions.start) / 4);
|
|
296
295
|
var vertexCount = float32Array.length / 3;
|
|
297
296
|
var positions = float32ArrayToVector3(float32Array, vertexCount);
|
|
298
297
|
modelMesh.setPositions(positions);
|
|
299
298
|
if (encodedMeshData.normals) {
|
|
300
|
-
var float32Array1 = new Float32Array(buffer, encodedMeshData.normals.start + offset
|
|
299
|
+
var float32Array1 = new Float32Array(buffer, encodedMeshData.normals.start + offset, (encodedMeshData.normals.end - encodedMeshData.normals.start) / 4);
|
|
301
300
|
var normals = float32ArrayToVector3(float32Array1, vertexCount);
|
|
302
301
|
modelMesh.setNormals(normals);
|
|
303
302
|
}
|
|
304
303
|
if (encodedMeshData.uvs) {
|
|
305
|
-
var float32Array2 = new Float32Array(buffer, encodedMeshData.uvs.start + offset
|
|
304
|
+
var float32Array2 = new Float32Array(buffer, encodedMeshData.uvs.start + offset, (encodedMeshData.uvs.end - encodedMeshData.uvs.start) / 4);
|
|
306
305
|
modelMesh.setUVs(float32ArrayToVector2(float32Array2, vertexCount));
|
|
307
306
|
}
|
|
308
307
|
if (encodedMeshData.uv1) {
|
|
309
|
-
var float32Array3 = new Float32Array(buffer, encodedMeshData.uv1.start + offset
|
|
308
|
+
var float32Array3 = new Float32Array(buffer, encodedMeshData.uv1.start + offset, (encodedMeshData.uv1.end - encodedMeshData.uv1.start) / 4);
|
|
310
309
|
modelMesh.setUVs(float32ArrayToVector2(float32Array3, vertexCount), 1);
|
|
311
310
|
}
|
|
312
311
|
if (encodedMeshData.uv2) {
|
|
313
|
-
var float32Array4 = new Float32Array(buffer, encodedMeshData.uv2.start + offset
|
|
312
|
+
var float32Array4 = new Float32Array(buffer, encodedMeshData.uv2.start + offset, (encodedMeshData.uv2.end - encodedMeshData.uv2.start) / 4);
|
|
314
313
|
modelMesh.setUVs(float32ArrayToVector2(float32Array4, vertexCount), 2);
|
|
315
314
|
}
|
|
316
315
|
if (encodedMeshData.uv3) {
|
|
317
|
-
var float32Array5 = new Float32Array(buffer, encodedMeshData.uv3.start + offset
|
|
316
|
+
var float32Array5 = new Float32Array(buffer, encodedMeshData.uv3.start + offset, (encodedMeshData.uv3.end - encodedMeshData.uv3.start) / 4);
|
|
318
317
|
modelMesh.setUVs(float32ArrayToVector2(float32Array5, vertexCount), 3);
|
|
319
318
|
}
|
|
320
319
|
if (encodedMeshData.uv4) {
|
|
321
|
-
var float32Array6 = new Float32Array(buffer, encodedMeshData.uv4.start + offset
|
|
320
|
+
var float32Array6 = new Float32Array(buffer, encodedMeshData.uv4.start + offset, (encodedMeshData.uv4.end - encodedMeshData.uv4.start) / 4);
|
|
322
321
|
modelMesh.setUVs(float32ArrayToVector2(float32Array6, vertexCount), 4);
|
|
323
322
|
}
|
|
324
323
|
if (encodedMeshData.uv5) {
|
|
325
|
-
var float32Array7 = new Float32Array(buffer, encodedMeshData.uv5.start + offset
|
|
324
|
+
var float32Array7 = new Float32Array(buffer, encodedMeshData.uv5.start + offset, (encodedMeshData.uv5.end - encodedMeshData.uv5.start) / 4);
|
|
326
325
|
modelMesh.setUVs(float32ArrayToVector2(float32Array7, vertexCount), 5);
|
|
327
326
|
}
|
|
328
327
|
if (encodedMeshData.uv6) {
|
|
329
|
-
var float32Array8 = new Float32Array(buffer, encodedMeshData.uv6.start + offset
|
|
328
|
+
var float32Array8 = new Float32Array(buffer, encodedMeshData.uv6.start + offset, (encodedMeshData.uv6.end - encodedMeshData.uv6.start) / 4);
|
|
330
329
|
modelMesh.setUVs(float32ArrayToVector2(float32Array8, vertexCount), 6);
|
|
331
330
|
}
|
|
332
331
|
if (encodedMeshData.uv7) {
|
|
333
|
-
var float32Array9 = new Float32Array(buffer, encodedMeshData.uv7.start + offset
|
|
332
|
+
var float32Array9 = new Float32Array(buffer, encodedMeshData.uv7.start + offset, (encodedMeshData.uv7.end - encodedMeshData.uv7.start) / 4);
|
|
334
333
|
modelMesh.setUVs(float32ArrayToVector2(float32Array9, vertexCount), 7);
|
|
335
334
|
}
|
|
336
335
|
if (encodedMeshData.colors) {
|
|
337
|
-
var float32Array10 = new Float32Array(buffer, encodedMeshData.colors.start + offset
|
|
336
|
+
var float32Array10 = new Float32Array(buffer, encodedMeshData.colors.start + offset, (encodedMeshData.colors.end - encodedMeshData.colors.start) / 4);
|
|
338
337
|
modelMesh.setColors(float32ArrayToVColor(float32Array10, vertexCount));
|
|
339
338
|
}
|
|
340
339
|
if (encodedMeshData.boneWeights) {
|
|
341
|
-
var float32Array11 = new Float32Array(buffer, encodedMeshData.boneWeights.start + offset
|
|
340
|
+
var float32Array11 = new Float32Array(buffer, encodedMeshData.boneWeights.start + offset, (encodedMeshData.boneWeights.end - encodedMeshData.boneWeights.start) / 4);
|
|
342
341
|
modelMesh.setBoneWeights(float32ArrayToVector4(float32Array11, vertexCount));
|
|
343
342
|
}
|
|
344
343
|
if (encodedMeshData.boneIndices) {
|
|
345
|
-
var float32Array12 = new Float32Array(buffer, encodedMeshData.boneIndices.start + offset
|
|
344
|
+
var float32Array12 = new Float32Array(buffer, encodedMeshData.boneIndices.start + offset, (encodedMeshData.boneIndices.end - encodedMeshData.boneIndices.start) / 4);
|
|
346
345
|
modelMesh.setBoneIndices(float32ArrayToVector4(float32Array12, vertexCount));
|
|
347
346
|
}
|
|
348
347
|
if (encodedMeshData.blendShapes) {
|
|
349
348
|
encodedMeshData.blendShapes.forEach(function(blendShapeData) {
|
|
350
349
|
var blendShape = new BlendShape(blendShapeData.name);
|
|
351
350
|
blendShapeData.frames.forEach(function(frameData) {
|
|
352
|
-
var positionArray = new Float32Array(buffer, frameData.deltaPosition.start + offset
|
|
351
|
+
var positionArray = new Float32Array(buffer, frameData.deltaPosition.start + offset, (frameData.deltaPosition.end - frameData.deltaPosition.start) / 4);
|
|
353
352
|
var count = positionArray.length / 3;
|
|
354
353
|
var deltaPosition = float32ArrayToVector3(positionArray, count);
|
|
355
354
|
if (frameData.deltaNormals) {
|
|
356
|
-
var normalsArray = new Float32Array(buffer, frameData.deltaNormals.start + offset
|
|
355
|
+
var normalsArray = new Float32Array(buffer, frameData.deltaNormals.start + offset, (frameData.deltaNormals.end - frameData.deltaNormals.start) / 4);
|
|
357
356
|
float32ArrayToVector3(normalsArray, count);
|
|
358
357
|
}
|
|
359
358
|
if (frameData.deltaTangents) {
|
|
360
|
-
var tangentsArray = new Float32Array(buffer, frameData.deltaTangents.start + offset
|
|
359
|
+
var tangentsArray = new Float32Array(buffer, frameData.deltaTangents.start + offset, (frameData.deltaTangents.end - frameData.deltaTangents.start) / 4);
|
|
361
360
|
float32ArrayToVector4(tangentsArray, count);
|
|
362
361
|
}
|
|
363
362
|
blendShape.addFrame(frameData.weight, deltaPosition);
|
|
@@ -368,9 +367,9 @@ var MeshDecoder = /*#__PURE__*/ function() {
|
|
|
368
367
|
if (encodedMeshData.indices) {
|
|
369
368
|
var indices = null;
|
|
370
369
|
if (encodedMeshData.indices.type === 0) {
|
|
371
|
-
indices = new Uint16Array(buffer, encodedMeshData.indices.start + offset
|
|
370
|
+
indices = new Uint16Array(buffer, encodedMeshData.indices.start + offset, (encodedMeshData.indices.end - encodedMeshData.indices.start) / 2);
|
|
372
371
|
} else {
|
|
373
|
-
indices = new Uint32Array(buffer, encodedMeshData.indices.start + offset
|
|
372
|
+
indices = new Uint32Array(buffer, encodedMeshData.indices.start + offset, (encodedMeshData.indices.end - encodedMeshData.indices.start) / 4);
|
|
374
373
|
}
|
|
375
374
|
modelMesh.setIndices(indices);
|
|
376
375
|
}
|
|
@@ -539,11 +538,17 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
539
538
|
});
|
|
540
539
|
};
|
|
541
540
|
_proto.parseClassObject = function parseClassObject(item) {
|
|
541
|
+
var _this = this;
|
|
542
542
|
var Class = Loader.getClass(item.class);
|
|
543
543
|
var _item_constructParams;
|
|
544
544
|
var params = (_item_constructParams = item.constructParams) != null ? _item_constructParams : [];
|
|
545
|
-
|
|
546
|
-
|
|
545
|
+
return Promise.all(params.map(function(param) {
|
|
546
|
+
return _this.parseBasicType(param);
|
|
547
|
+
})).then(function(resultParams) {
|
|
548
|
+
return _construct(Class, [].concat(resultParams));
|
|
549
|
+
}).then(function(instance) {
|
|
550
|
+
return _this.parsePropsAndMethods(instance, item);
|
|
551
|
+
});
|
|
547
552
|
};
|
|
548
553
|
_proto.parsePropsAndMethods = function parsePropsAndMethods(instance, item) {
|
|
549
554
|
var promises = [];
|
|
@@ -551,16 +556,14 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
551
556
|
for(var methodName in item.methods){
|
|
552
557
|
var methodParams = item.methods[methodName];
|
|
553
558
|
for(var i = 0, count = methodParams.length; i < count; i++){
|
|
554
|
-
|
|
555
|
-
var promise = this.parseMethod(instance, methodName, params);
|
|
556
|
-
promises.push(promise);
|
|
559
|
+
promises.push(this.parseMethod(instance, methodName, methodParams[i]));
|
|
557
560
|
}
|
|
558
561
|
}
|
|
559
562
|
}
|
|
560
563
|
if (item.props) {
|
|
561
564
|
var _this = this, _loop = function(key) {
|
|
562
565
|
var value = item.props[key];
|
|
563
|
-
var promise = _this.parseBasicType(value).then(function(v) {
|
|
566
|
+
var promise = _this.parseBasicType(value, instance[key]).then(function(v) {
|
|
564
567
|
return instance[key] = v;
|
|
565
568
|
});
|
|
566
569
|
promises.push(promise);
|
|
@@ -582,7 +585,7 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
582
585
|
return (_instance = instance)[methodName].apply(_instance, [].concat(result));
|
|
583
586
|
});
|
|
584
587
|
};
|
|
585
|
-
_proto.parseBasicType = function parseBasicType(value) {
|
|
588
|
+
_proto.parseBasicType = function parseBasicType(value, originValue) {
|
|
586
589
|
var _this = this;
|
|
587
590
|
if (Array.isArray(value)) {
|
|
588
591
|
return Promise.all(value.map(function(item) {
|
|
@@ -599,13 +602,33 @@ var ReflectionParser = /*#__PURE__*/ function() {
|
|
|
599
602
|
} else if (ReflectionParser._isEntityRef(value)) {
|
|
600
603
|
// entity reference
|
|
601
604
|
return Promise.resolve(this._context.entityMap.get(value.entityId));
|
|
602
|
-
} else {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
+
} else if (originValue) {
|
|
606
|
+
var _this1 = this, _loop = function(key) {
|
|
607
|
+
if (key === "methods") {
|
|
608
|
+
var methods = value[key];
|
|
609
|
+
for(var methodName in methods){
|
|
610
|
+
var methodParams = methods[methodName];
|
|
611
|
+
for(var i = 0, count = methodParams.length; i < count; i++){
|
|
612
|
+
var params = methodParams[i];
|
|
613
|
+
var promise = _this1.parseMethod(originValue, methodName, params);
|
|
614
|
+
promises.push(promise);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
} else {
|
|
618
|
+
promises.push(_this1.parseBasicType(value[key], originValue[key]).then(function(v) {
|
|
619
|
+
return originValue[key] = v;
|
|
620
|
+
}));
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
var promises = [];
|
|
624
|
+
for(var key in value)_loop(key);
|
|
625
|
+
return Promise.all(promises).then(function() {
|
|
626
|
+
return originValue;
|
|
627
|
+
});
|
|
605
628
|
}
|
|
606
|
-
} else {
|
|
607
|
-
return Promise.resolve(value);
|
|
608
629
|
}
|
|
630
|
+
// primitive type
|
|
631
|
+
return Promise.resolve(value);
|
|
609
632
|
};
|
|
610
633
|
_proto._getEntityByConfig = function _getEntityByConfig(entityConfig) {
|
|
611
634
|
// @ts-ignore
|
|
@@ -710,6 +733,7 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
710
733
|
var componentStr = bufferReader.nextStr();
|
|
711
734
|
var componentType = ComponentMap[componentStr];
|
|
712
735
|
var property = bufferReader.nextStr();
|
|
736
|
+
var getProperty = bufferReader.nextStr();
|
|
713
737
|
var curve = void 0;
|
|
714
738
|
var interpolation = bufferReader.nextUint8();
|
|
715
739
|
var keysLen = bufferReader.nextUint16();
|
|
@@ -834,13 +858,42 @@ var AnimationClipDecoder = /*#__PURE__*/ function() {
|
|
|
834
858
|
for(var j7 = 0; j7 < keysLen; ++j7){
|
|
835
859
|
var keyframe8 = new Keyframe();
|
|
836
860
|
keyframe8.time = bufferReader.nextFloat32();
|
|
837
|
-
|
|
861
|
+
var str = bufferReader.nextStr();
|
|
862
|
+
if (str) {
|
|
863
|
+
keyframe8.value = JSON.parse(str);
|
|
864
|
+
} else {
|
|
865
|
+
keyframe8.value = null;
|
|
866
|
+
}
|
|
838
867
|
curve.addKey(keyframe8);
|
|
839
868
|
}
|
|
840
869
|
break;
|
|
841
870
|
}
|
|
871
|
+
case "AnimationBoolCurve":
|
|
872
|
+
{
|
|
873
|
+
curve = new AnimationBoolCurve();
|
|
874
|
+
curve.interpolation = interpolation;
|
|
875
|
+
for(var j8 = 0; j8 < keysLen; ++j8){
|
|
876
|
+
var keyframe9 = new Keyframe();
|
|
877
|
+
keyframe9.time = bufferReader.nextFloat32();
|
|
878
|
+
keyframe9.value = bufferReader.nextUint8() === 1;
|
|
879
|
+
curve.addKey(keyframe9);
|
|
880
|
+
}
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
case "AnimationStringCurve":
|
|
884
|
+
{
|
|
885
|
+
curve = new AnimationStringCurve();
|
|
886
|
+
curve.interpolation = interpolation;
|
|
887
|
+
for(var j9 = 0; j9 < keysLen; ++j9){
|
|
888
|
+
var keyframe10 = new Keyframe();
|
|
889
|
+
keyframe10.time = bufferReader.nextFloat32();
|
|
890
|
+
keyframe10.value = bufferReader.nextStr();
|
|
891
|
+
curve.addKey(keyframe10);
|
|
892
|
+
}
|
|
893
|
+
break;
|
|
894
|
+
}
|
|
842
895
|
}
|
|
843
|
-
clip.addCurveBinding(relativePath, componentType, property, curve);
|
|
896
|
+
clip.addCurveBinding(relativePath, componentType, property, getProperty, curve);
|
|
844
897
|
}
|
|
845
898
|
resolve(clip);
|
|
846
899
|
});
|
|
@@ -1094,26 +1147,34 @@ var AnimationClipLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
1094
1147
|
var curveBindingPromises = clip.curveBindings.map(function(curveBinding) {
|
|
1095
1148
|
var curve = curveBinding.curve;
|
|
1096
1149
|
var promises = curve.keys.map(function(key) {
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
resourceManager// @ts-ignore
|
|
1101
|
-
.getResourceByRef(value).then(function(asset) {
|
|
1102
|
-
key.value = asset;
|
|
1103
|
-
resolve(key);
|
|
1104
|
-
}).catch(reject);
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1150
|
+
return _this._parseKeyframeValue(key, resourceManager).then(function(actualValue) {
|
|
1151
|
+
key.value = actualValue;
|
|
1152
|
+
});
|
|
1107
1153
|
});
|
|
1108
1154
|
return Promise.all(promises);
|
|
1109
1155
|
});
|
|
1110
1156
|
return Promise.all(curveBindingPromises).then(function() {
|
|
1111
1157
|
resolve(clip);
|
|
1112
1158
|
});
|
|
1113
|
-
});
|
|
1159
|
+
}).catch(reject);
|
|
1114
1160
|
}).catch(reject);
|
|
1115
1161
|
});
|
|
1116
1162
|
};
|
|
1163
|
+
_proto._parseKeyframeValue = function _parseKeyframeValue(keyframe, resourceManager) {
|
|
1164
|
+
var _value;
|
|
1165
|
+
var value = keyframe.value;
|
|
1166
|
+
if (typeof value === "object" && ((_value = value) == null ? void 0 : _value.refId)) {
|
|
1167
|
+
return new Promise(function(resolve) {
|
|
1168
|
+
resourceManager// @ts-ignore
|
|
1169
|
+
.getResourceByRef(value).then(function(asset) {
|
|
1170
|
+
keyframe.value = asset;
|
|
1171
|
+
resolve(keyframe);
|
|
1172
|
+
});
|
|
1173
|
+
});
|
|
1174
|
+
} else {
|
|
1175
|
+
return Promise.resolve(keyframe.value);
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1117
1178
|
return AnimationClipLoader;
|
|
1118
1179
|
}(Loader);
|
|
1119
1180
|
AnimationClipLoader = __decorate([
|
|
@@ -1389,6 +1450,60 @@ FontLoader = __decorate([
|
|
|
1389
1450
|
_this.url = url;
|
|
1390
1451
|
return _this;
|
|
1391
1452
|
}
|
|
1453
|
+
var _proto = GLTFResource.prototype;
|
|
1454
|
+
/**
|
|
1455
|
+
* Instantiate scene root entity.
|
|
1456
|
+
* @param sceneIndex - Scene index
|
|
1457
|
+
* @returns Root entity
|
|
1458
|
+
*/ _proto.instantiateSceneRoot = function instantiateSceneRoot(sceneIndex) {
|
|
1459
|
+
var sceneRoot = sceneIndex === undefined ? this._defaultSceneRoot : this._sceneRoots[sceneIndex];
|
|
1460
|
+
return sceneRoot.clone();
|
|
1461
|
+
};
|
|
1462
|
+
_proto._onDestroy = function _onDestroy() {
|
|
1463
|
+
ReferResource1.prototype._onDestroy.call(this);
|
|
1464
|
+
var _this = this, textures = _this.textures, materials = _this.materials, meshes = _this.meshes;
|
|
1465
|
+
textures && this._disassociationSuperResource(textures);
|
|
1466
|
+
materials && this._disassociationSuperResource(materials);
|
|
1467
|
+
if (meshes) {
|
|
1468
|
+
for(var i = 0, n = meshes.length; i < n; i++){
|
|
1469
|
+
this._disassociationSuperResource(meshes[i]);
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
};
|
|
1473
|
+
_proto._disassociationSuperResource = function _disassociationSuperResource(resources) {
|
|
1474
|
+
for(var i = 0, n = resources.length; i < n; i++){
|
|
1475
|
+
// @ts-ignore
|
|
1476
|
+
resources[i]._disassociationSuperResource(this);
|
|
1477
|
+
}
|
|
1478
|
+
};
|
|
1479
|
+
_create_class(GLTFResource, [
|
|
1480
|
+
{
|
|
1481
|
+
key: "extensionsData",
|
|
1482
|
+
get: /**
|
|
1483
|
+
* Extensions data.
|
|
1484
|
+
*/ function get() {
|
|
1485
|
+
return this._extensionsData;
|
|
1486
|
+
}
|
|
1487
|
+
},
|
|
1488
|
+
{
|
|
1489
|
+
key: "sceneRoots",
|
|
1490
|
+
get: /**
|
|
1491
|
+
* @deprecated Please use `instantiateSceneRoot` instead.
|
|
1492
|
+
* RootEntities after SceneParser.
|
|
1493
|
+
*/ function get() {
|
|
1494
|
+
return this._sceneRoots;
|
|
1495
|
+
}
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
key: "defaultSceneRoot",
|
|
1499
|
+
get: /**
|
|
1500
|
+
* @deprecated Please use `instantiateSceneRoot` instead.
|
|
1501
|
+
* RootEntity after SceneParser.
|
|
1502
|
+
*/ function get() {
|
|
1503
|
+
return this._defaultSceneRoot;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
]);
|
|
1392
1507
|
return GLTFResource;
|
|
1393
1508
|
}(ReferResource);
|
|
1394
1509
|
|
|
@@ -1542,12 +1657,29 @@ var TextureWrapMode;
|
|
|
1542
1657
|
/**
|
|
1543
1658
|
* @internal
|
|
1544
1659
|
*/ var GLTFParserContext = /*#__PURE__*/ function() {
|
|
1545
|
-
function GLTFParserContext(glTFResource, resourceManager,
|
|
1660
|
+
function GLTFParserContext(glTFResource, resourceManager, params) {
|
|
1661
|
+
var _this = this;
|
|
1546
1662
|
this.glTFResource = glTFResource;
|
|
1547
1663
|
this.resourceManager = resourceManager;
|
|
1548
|
-
this.
|
|
1664
|
+
this.params = params;
|
|
1549
1665
|
this.accessorBufferCache = {};
|
|
1550
1666
|
this._resourceCache = new Map();
|
|
1667
|
+
this._progress = {
|
|
1668
|
+
taskDetail: {},
|
|
1669
|
+
taskComplete: {
|
|
1670
|
+
loaded: 0,
|
|
1671
|
+
total: 0
|
|
1672
|
+
}
|
|
1673
|
+
};
|
|
1674
|
+
this./**
|
|
1675
|
+
* @internal
|
|
1676
|
+
*/ _onTaskDetail = function(url, loaded, total) {
|
|
1677
|
+
var _this__progress_taskDetail, _url;
|
|
1678
|
+
var detail = (_this__progress_taskDetail = _this._progress.taskDetail)[_url = url] || (_this__progress_taskDetail[_url] = {});
|
|
1679
|
+
detail.loaded = loaded;
|
|
1680
|
+
detail.total = total;
|
|
1681
|
+
_this._setTaskDetailProgress(url, loaded, total);
|
|
1682
|
+
};
|
|
1551
1683
|
this.contentRestorer = new GLTFContentRestorer(glTFResource);
|
|
1552
1684
|
}
|
|
1553
1685
|
var _proto = GLTFParserContext.prototype;
|
|
@@ -1588,7 +1720,7 @@ var TextureWrapMode;
|
|
|
1588
1720
|
};
|
|
1589
1721
|
_proto.parse = function parse() {
|
|
1590
1722
|
var _this = this;
|
|
1591
|
-
|
|
1723
|
+
var promise = this.get(0).then(function(json) {
|
|
1592
1724
|
_this.glTF = json;
|
|
1593
1725
|
return Promise.all([
|
|
1594
1726
|
_this.get(1),
|
|
@@ -1599,10 +1731,48 @@ var TextureWrapMode;
|
|
|
1599
1731
|
_this.get(9),
|
|
1600
1732
|
_this.get(2)
|
|
1601
1733
|
]).then(function() {
|
|
1734
|
+
var glTFResource = _this.glTFResource;
|
|
1735
|
+
if (glTFResource.skins || glTFResource.animations) {
|
|
1736
|
+
_this._createAnimator(_this, glTFResource.animations);
|
|
1737
|
+
}
|
|
1602
1738
|
_this.resourceManager.addContentRestorer(_this.contentRestorer);
|
|
1603
|
-
return
|
|
1739
|
+
return glTFResource;
|
|
1604
1740
|
});
|
|
1605
1741
|
});
|
|
1742
|
+
this._addTaskCompletePromise(promise);
|
|
1743
|
+
return promise;
|
|
1744
|
+
};
|
|
1745
|
+
/**
|
|
1746
|
+
* @internal
|
|
1747
|
+
*/ _proto._addTaskCompletePromise = function _addTaskCompletePromise(taskPromise) {
|
|
1748
|
+
var _this = this;
|
|
1749
|
+
var task = this._progress.taskComplete;
|
|
1750
|
+
task.total += 1;
|
|
1751
|
+
taskPromise.then(function() {
|
|
1752
|
+
_this._setTaskCompleteProgress(++task.loaded, task.total);
|
|
1753
|
+
});
|
|
1754
|
+
};
|
|
1755
|
+
_proto._createAnimator = function _createAnimator(context, animations) {
|
|
1756
|
+
var defaultSceneRoot = context.glTFResource.defaultSceneRoot;
|
|
1757
|
+
var animator = defaultSceneRoot.addComponent(Animator);
|
|
1758
|
+
var animatorController = new AnimatorController();
|
|
1759
|
+
var layer = new AnimatorControllerLayer("layer");
|
|
1760
|
+
var animatorStateMachine = new AnimatorStateMachine();
|
|
1761
|
+
animatorController.addLayer(layer);
|
|
1762
|
+
animator.animatorController = animatorController;
|
|
1763
|
+
layer.stateMachine = animatorStateMachine;
|
|
1764
|
+
if (animations) {
|
|
1765
|
+
for(var i = 0; i < animations.length; i++){
|
|
1766
|
+
var animationClip = animations[i];
|
|
1767
|
+
var name = animationClip.name;
|
|
1768
|
+
var uniqueName = animatorStateMachine.makeUniqueStateName(name);
|
|
1769
|
+
if (uniqueName !== name) {
|
|
1770
|
+
console.warn("AnimatorState name is existed, name: " + name + " reset to " + uniqueName);
|
|
1771
|
+
}
|
|
1772
|
+
var animatorState = animatorStateMachine.addState(uniqueName);
|
|
1773
|
+
animatorState.clip = animationClip;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1606
1776
|
};
|
|
1607
1777
|
_proto._handleSubAsset = function _handleSubAsset(resource, type, index) {
|
|
1608
1778
|
var _this = this;
|
|
@@ -1666,7 +1836,7 @@ var GLTFParserType;
|
|
|
1666
1836
|
var _obj;
|
|
1667
1837
|
var glTFSchemaMap = (_obj = {}, _obj[2] = "scenes", _obj[3] = "buffers", _obj[4] = "textures", _obj[5] = "materials", _obj[6] = "meshes", _obj[7] = "nodes", _obj[8] = "skins", _obj[9] = "animations", _obj);
|
|
1668
1838
|
var _obj1;
|
|
1669
|
-
var glTFResourceMap = (_obj1 = {}, _obj1[2] = "
|
|
1839
|
+
var glTFResourceMap = (_obj1 = {}, _obj1[2] = "_sceneRoots", _obj1[4] = "textures", _obj1[5] = "materials", _obj1[6] = "meshes", _obj1[7] = "entities", _obj1[8] = "skins", _obj1[9] = "animations", _obj1);
|
|
1670
1840
|
function registerGLTFParser(pipeline) {
|
|
1671
1841
|
return function(Parser) {
|
|
1672
1842
|
var parser = new Parser();
|
|
@@ -2243,7 +2413,7 @@ var SupercompressionScheme;
|
|
|
2243
2413
|
alphaSliceByteLength: sgdReader.nextUint32()
|
|
2244
2414
|
};
|
|
2245
2415
|
}
|
|
2246
|
-
var endpointsByteOffset = sgdByteOffset + sgdReader.
|
|
2416
|
+
var endpointsByteOffset = sgdByteOffset + sgdReader.position;
|
|
2247
2417
|
var selectorsByteOffset = endpointsByteOffset + endpointsByteLength;
|
|
2248
2418
|
var tablesByteOffset = selectorsByteOffset + selectorsByteLength;
|
|
2249
2419
|
var extendedByteOffset = tablesByteOffset + tablesByteLength;
|
|
@@ -2435,6 +2605,25 @@ var AbstractTranscoder = /*#__PURE__*/ function() {
|
|
|
2435
2605
|
}();
|
|
2436
2606
|
|
|
2437
2607
|
/** @internal */ function TranscodeWorkerCode$1() {
|
|
2608
|
+
var initPromise;
|
|
2609
|
+
var init = function init(wasmBinary) {
|
|
2610
|
+
if (!initPromise) {
|
|
2611
|
+
initPromise = new Promise(function(resolve, reject) {
|
|
2612
|
+
var BasisModule = {
|
|
2613
|
+
wasmBinary: wasmBinary,
|
|
2614
|
+
onRuntimeInitialized: function() {
|
|
2615
|
+
return resolve(BasisModule);
|
|
2616
|
+
},
|
|
2617
|
+
onAbort: reject
|
|
2618
|
+
};
|
|
2619
|
+
self["BASIS"](BasisModule);
|
|
2620
|
+
}).then(function(BasisModule) {
|
|
2621
|
+
BasisModule.initializeBasis();
|
|
2622
|
+
return BasisModule.KTX2File;
|
|
2623
|
+
});
|
|
2624
|
+
}
|
|
2625
|
+
return initPromise;
|
|
2626
|
+
};
|
|
2438
2627
|
self.onmessage = function onmessage(event) {
|
|
2439
2628
|
var message = event.data;
|
|
2440
2629
|
switch(message.type){
|
|
@@ -2549,6 +2738,10 @@ function transcode(buffer, targetFormat, KTX2File) {
|
|
|
2549
2738
|
cleanup();
|
|
2550
2739
|
throw new Error("Invalid or unsupported .ktx2 file");
|
|
2551
2740
|
}
|
|
2741
|
+
if (!ktx2File.startTranscoding()) {
|
|
2742
|
+
cleanup();
|
|
2743
|
+
throw new Error("KTX2 startTranscoding failed");
|
|
2744
|
+
}
|
|
2552
2745
|
var width = ktx2File.getWidth();
|
|
2553
2746
|
var height = ktx2File.getHeight();
|
|
2554
2747
|
var layerCount = ktx2File.getLayers() || 1;
|
|
@@ -2557,6 +2750,7 @@ function transcode(buffer, targetFormat, KTX2File) {
|
|
|
2557
2750
|
var faceCount = ktx2File.getFaces();
|
|
2558
2751
|
var format = getTranscodeFormatFromTarget(targetFormat, hasAlpha);
|
|
2559
2752
|
var faces = new Array(faceCount);
|
|
2753
|
+
var isBC = format === 2 || format === 3 || format === 7;
|
|
2560
2754
|
for(var face = 0; face < faceCount; face++){
|
|
2561
2755
|
var mipmaps = new Array(levelCount);
|
|
2562
2756
|
for(var mip = 0; mip < levelCount; mip++){
|
|
@@ -2564,8 +2758,15 @@ function transcode(buffer, targetFormat, KTX2File) {
|
|
|
2564
2758
|
var mipWidth = void 0, mipHeight = void 0;
|
|
2565
2759
|
for(var layer = 0; layer < layerCount; layer++){
|
|
2566
2760
|
var levelInfo = ktx2File.getImageLevelInfo(mip, layer, face);
|
|
2567
|
-
|
|
2568
|
-
|
|
2761
|
+
// see: https://github.com/KhronosGroup/KTX-Software/issues/254
|
|
2762
|
+
if (isBC && mip === 0 && (width !== levelInfo.width || height !== levelInfo.height)) {
|
|
2763
|
+
width = mipWidth = levelInfo.width;
|
|
2764
|
+
height = mipHeight = levelInfo.height;
|
|
2765
|
+
console.warn("KTX2 transcode to BC will resize to width: " + width + ", height: " + height + ". You'd better use an image whose size if multiple of 4.");
|
|
2766
|
+
} else {
|
|
2767
|
+
mipWidth = levelInfo.origWidth;
|
|
2768
|
+
mipHeight = levelInfo.origHeight;
|
|
2769
|
+
}
|
|
2569
2770
|
var dst = new Uint8Array(ktx2File.getImageTranscodedSizeInBytes(mip, layer, 0, format));
|
|
2570
2771
|
var status = ktx2File.transcodeImage(dst, mip, layer, face, format, 0, -1, -1);
|
|
2571
2772
|
if (!status) {
|
|
@@ -2631,7 +2832,7 @@ function transcode(buffer, targetFormat, KTX2File) {
|
|
|
2631
2832
|
} else {
|
|
2632
2833
|
var funcCode = TranscodeWorkerCode$1.toString();
|
|
2633
2834
|
var transcodeString = funcCode.substring(funcCode.indexOf("{"), funcCode.lastIndexOf("}") + 1);
|
|
2634
|
-
var workerCode = "\n " + jsCode + "\n
|
|
2835
|
+
var workerCode = "\n " + jsCode + "\n " + transcode.toString() + "\n " + transcodeString + "\n ";
|
|
2635
2836
|
var workerURL = URL.createObjectURL(new Blob([
|
|
2636
2837
|
workerCode
|
|
2637
2838
|
], {
|
|
@@ -2877,10 +3078,14 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2877
3078
|
return Loader1.apply(this, arguments);
|
|
2878
3079
|
}
|
|
2879
3080
|
var _proto = KTX2Loader1.prototype;
|
|
2880
|
-
_proto.initialize = function initialize(
|
|
3081
|
+
_proto.initialize = function initialize(_, configuration) {
|
|
2881
3082
|
if (configuration.ktx2Loader) {
|
|
2882
3083
|
var options = configuration.ktx2Loader;
|
|
2883
|
-
if (
|
|
3084
|
+
if (options.priorityFormats) {
|
|
3085
|
+
KTX2Loader._priorityFormats["etc1s"] = options.priorityFormats;
|
|
3086
|
+
KTX2Loader._priorityFormats["uastc"] = options.priorityFormats;
|
|
3087
|
+
}
|
|
3088
|
+
if (options.transcoder === /** Khronos transcoder. */ 1) {
|
|
2884
3089
|
return KTX2Loader._getKhronosTranscoder(options.workerCount).init();
|
|
2885
3090
|
} else {
|
|
2886
3091
|
return KTX2Loader._getBinomialLLCTranscoder(options.workerCount).init();
|
|
@@ -2890,34 +3095,16 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2890
3095
|
/**
|
|
2891
3096
|
* @internal
|
|
2892
3097
|
*/ _proto.load = function load(item, resourceManager) {
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
return KTX2Loader.
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
if (priorityFormats === void 0) priorityFormats = [
|
|
2904
|
-
KTX2TargetFormat.ASTC,
|
|
2905
|
-
KTX2TargetFormat.ETC,
|
|
2906
|
-
KTX2TargetFormat.BC7,
|
|
2907
|
-
KTX2TargetFormat.BC1_BC3,
|
|
2908
|
-
KTX2TargetFormat.PVRTC,
|
|
2909
|
-
KTX2TargetFormat.R8G8B8A8
|
|
2910
|
-
];
|
|
2911
|
-
var supportedList = new Array();
|
|
2912
|
-
if (Array.isArray(priorityFormats[0])) {
|
|
2913
|
-
for(var i = 0; i < priorityFormats.length; i++){
|
|
2914
|
-
supportedList.push(KTX2Loader._detectSupportedFormat(engine._hardwareRenderer, priorityFormats[i]));
|
|
2915
|
-
}
|
|
2916
|
-
} else {
|
|
2917
|
-
supportedList.push(KTX2Loader._detectSupportedFormat(engine._hardwareRenderer, priorityFormats));
|
|
2918
|
-
}
|
|
2919
|
-
return supportedList.every(function(format) {
|
|
2920
|
-
return KhronosTranscoder.transcoderMap[format];
|
|
3098
|
+
var _this = this;
|
|
3099
|
+
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
3100
|
+
_this.request(item.url, {
|
|
3101
|
+
type: "arraybuffer"
|
|
3102
|
+
}).onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(buffer) {
|
|
3103
|
+
return KTX2Loader._parseBuffer(new Uint8Array(buffer), resourceManager.engine, item.params).then(function(param) {
|
|
3104
|
+
var engine = param.engine, result = param.result, targetFormat = param.targetFormat, params = param.params;
|
|
3105
|
+
return KTX2Loader._createTextureByBuffer(engine, result, targetFormat, params);
|
|
3106
|
+
});
|
|
3107
|
+
}).then(resolve).catch(reject);
|
|
2921
3108
|
});
|
|
2922
3109
|
};
|
|
2923
3110
|
/**
|
|
@@ -2932,7 +3119,8 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2932
3119
|
/** @internal */ KTX2Loader1._parseBuffer = function _parseBuffer(buffer, engine, params) {
|
|
2933
3120
|
var _params;
|
|
2934
3121
|
var ktx2Container = new KTX2Container(buffer);
|
|
2935
|
-
var
|
|
3122
|
+
var _params_priorityFormats;
|
|
3123
|
+
var formatPriorities = (_params_priorityFormats = (_params = params) == null ? void 0 : _params.priorityFormats) != null ? _params_priorityFormats : KTX2Loader._priorityFormats[ktx2Container.isUASTC ? "uastc" : "etc1s"];
|
|
2936
3124
|
var targetFormat = KTX2Loader._decideTargetFormat(engine, ktx2Container, formatPriorities);
|
|
2937
3125
|
var transcodeResultPromise;
|
|
2938
3126
|
if (KTX2Loader._isBinomialInit || !KhronosTranscoder.transcoderMap[targetFormat] || !ktx2Container.isUASTC) {
|
|
@@ -2999,18 +3187,22 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
2999
3187
|
return targetFormat;
|
|
3000
3188
|
};
|
|
3001
3189
|
KTX2Loader1._detectSupportedFormat = function _detectSupportedFormat(renderer, priorityFormats) {
|
|
3002
|
-
if (priorityFormats === void 0) priorityFormats = [
|
|
3003
|
-
KTX2TargetFormat.ASTC,
|
|
3004
|
-
KTX2TargetFormat.ETC,
|
|
3005
|
-
KTX2TargetFormat.BC7,
|
|
3006
|
-
KTX2TargetFormat.BC1_BC3,
|
|
3007
|
-
KTX2TargetFormat.PVRTC
|
|
3008
|
-
];
|
|
3009
3190
|
for(var i = 0; i < priorityFormats.length; i++){
|
|
3010
|
-
var
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3191
|
+
var format = priorityFormats[i];
|
|
3192
|
+
var capabilities = this._supportedMap[format];
|
|
3193
|
+
if (capabilities) {
|
|
3194
|
+
for(var j = 0; j < capabilities.length; j++){
|
|
3195
|
+
if (renderer.canIUse(capabilities[j])) {
|
|
3196
|
+
return format;
|
|
3197
|
+
}
|
|
3198
|
+
}
|
|
3199
|
+
} else {
|
|
3200
|
+
switch(priorityFormats[i]){
|
|
3201
|
+
case KTX2TargetFormat.R8G8B8A8:
|
|
3202
|
+
return format;
|
|
3203
|
+
case KTX2TargetFormat.R8:
|
|
3204
|
+
case KTX2TargetFormat.R8G8:
|
|
3205
|
+
if (renderer.isWebGL2) return format;
|
|
3014
3206
|
}
|
|
3015
3207
|
}
|
|
3016
3208
|
}
|
|
@@ -3047,6 +3239,23 @@ var KTX2Loader = (_KTX2Loader = /*#__PURE__*/ function(Loader1) {
|
|
|
3047
3239
|
return KTX2Loader1;
|
|
3048
3240
|
}(Loader), function() {
|
|
3049
3241
|
_KTX2Loader._isBinomialInit = false;
|
|
3242
|
+
}(), function() {
|
|
3243
|
+
_KTX2Loader._priorityFormats = {
|
|
3244
|
+
etc1s: [
|
|
3245
|
+
KTX2TargetFormat.ETC,
|
|
3246
|
+
KTX2TargetFormat.BC7,
|
|
3247
|
+
KTX2TargetFormat.ASTC,
|
|
3248
|
+
KTX2TargetFormat.BC1_BC3,
|
|
3249
|
+
KTX2TargetFormat.PVRTC
|
|
3250
|
+
],
|
|
3251
|
+
uastc: [
|
|
3252
|
+
KTX2TargetFormat.ASTC,
|
|
3253
|
+
KTX2TargetFormat.BC7,
|
|
3254
|
+
KTX2TargetFormat.ETC,
|
|
3255
|
+
KTX2TargetFormat.BC1_BC3,
|
|
3256
|
+
KTX2TargetFormat.PVRTC
|
|
3257
|
+
]
|
|
3258
|
+
};
|
|
3050
3259
|
}(), function() {
|
|
3051
3260
|
var _obj;
|
|
3052
3261
|
_KTX2Loader._supportedMap = (_obj = {}, _obj[KTX2TargetFormat.ASTC] = [
|
|
@@ -3067,6 +3276,11 @@ KTX2Loader = __decorate([
|
|
|
3067
3276
|
"ktx2"
|
|
3068
3277
|
])
|
|
3069
3278
|
], KTX2Loader);
|
|
3279
|
+
var KTX2Transcoder;
|
|
3280
|
+
(function(KTX2Transcoder) {
|
|
3281
|
+
KTX2Transcoder[KTX2Transcoder[/** BinomialLLC transcoder. */ "BinomialLLC"] = 0] = "BinomialLLC";
|
|
3282
|
+
KTX2Transcoder[KTX2Transcoder["Khronos"] = 1] = "Khronos";
|
|
3283
|
+
})(KTX2Transcoder || (KTX2Transcoder = {}));
|
|
3070
3284
|
|
|
3071
3285
|
/**
|
|
3072
3286
|
* @internal
|
|
@@ -3417,7 +3631,7 @@ var GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3417
3631
|
};
|
|
3418
3632
|
var isGLB = this._isGLB(url);
|
|
3419
3633
|
contentRestorer.isGLB = isGLB;
|
|
3420
|
-
var promise = isGLB ? request(url, requestConfig).then(function(glb) {
|
|
3634
|
+
var promise = isGLB ? request(url, requestConfig).onProgress(undefined, context._onTaskDetail).then(function(glb) {
|
|
3421
3635
|
restoreBufferRequests.push(new BufferRequestInfo(url, requestConfig));
|
|
3422
3636
|
return GLTFUtils.parseGLB(context, glb);
|
|
3423
3637
|
}).then(function(param) {
|
|
@@ -3426,7 +3640,7 @@ var GLTFSchemaParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3426
3640
|
return glTF;
|
|
3427
3641
|
}) : request(url, {
|
|
3428
3642
|
type: "json"
|
|
3429
|
-
});
|
|
3643
|
+
}).onProgress(undefined, context._onTaskDetail);
|
|
3430
3644
|
return promise;
|
|
3431
3645
|
};
|
|
3432
3646
|
_proto._isGLB = function _isGLB(url) {
|
|
@@ -3458,9 +3672,9 @@ var GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3458
3672
|
* @internal
|
|
3459
3673
|
*/ GLTFAnimationParser1._parseStandardProperty = function _parseStandardProperty(context, animationClip, animationInfo) {
|
|
3460
3674
|
var _loop = function(j, m) {
|
|
3461
|
-
var
|
|
3462
|
-
var inputAccessor = accessors[
|
|
3463
|
-
var outputAccessor = accessors[
|
|
3675
|
+
var glTFSampler = samplers[j];
|
|
3676
|
+
var inputAccessor = accessors[glTFSampler.input];
|
|
3677
|
+
var outputAccessor = accessors[glTFSampler.output];
|
|
3464
3678
|
var promise = Promise.all([
|
|
3465
3679
|
GLTFUtils.getAccessorBuffer(context, bufferViews, inputAccessor),
|
|
3466
3680
|
GLTFUtils.getAccessorBuffer(context, bufferViews, outputAccessor)
|
|
@@ -3476,8 +3690,8 @@ var GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3476
3690
|
output = scaled;
|
|
3477
3691
|
}
|
|
3478
3692
|
var outputStride = output.length / input.length;
|
|
3479
|
-
var
|
|
3480
|
-
var interpolation = (
|
|
3693
|
+
var _glTFSampler_interpolation;
|
|
3694
|
+
var interpolation = (_glTFSampler_interpolation = glTFSampler.interpolation) != null ? _glTFSampler_interpolation : AnimationSamplerInterpolation.Linear;
|
|
3481
3695
|
var samplerInterpolation;
|
|
3482
3696
|
switch(interpolation){
|
|
3483
3697
|
case AnimationSamplerInterpolation.CubicSpine:
|
|
@@ -3510,10 +3724,11 @@ var GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3510
3724
|
var promises = new Array();
|
|
3511
3725
|
// parse samplers
|
|
3512
3726
|
for(var j = 0, m = samplers.length; j < m; j++)_loop(j);
|
|
3727
|
+
promises.push(context.get(GLTFParserType.Scene));
|
|
3513
3728
|
return Promise.all(promises).then(function() {
|
|
3514
3729
|
for(var j = 0, m = channels.length; j < m; j++){
|
|
3515
|
-
var
|
|
3516
|
-
var target =
|
|
3730
|
+
var glTFChannel = channels[j];
|
|
3731
|
+
var target = glTFChannel.target;
|
|
3517
3732
|
var channelTargetEntity = entities[target.node];
|
|
3518
3733
|
var relativePath = "";
|
|
3519
3734
|
var entity = channelTargetEntity;
|
|
@@ -3521,6 +3736,10 @@ var GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3521
3736
|
relativePath = relativePath === "" ? "" + entity.name : entity.name + "/" + relativePath;
|
|
3522
3737
|
entity = entity.parent;
|
|
3523
3738
|
}
|
|
3739
|
+
// If the target node is in the default scene, relativePath will be empty
|
|
3740
|
+
if (context.glTFResource.sceneRoots.indexOf(entity) === -1) {
|
|
3741
|
+
continue;
|
|
3742
|
+
}
|
|
3524
3743
|
var ComponentType = void 0;
|
|
3525
3744
|
var propertyName = void 0;
|
|
3526
3745
|
switch(target.path){
|
|
@@ -3541,14 +3760,21 @@ var GLTFAnimationParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3541
3760
|
propertyName = "blendShapeWeights";
|
|
3542
3761
|
break;
|
|
3543
3762
|
}
|
|
3544
|
-
var curve = _this._addCurve(target.path,
|
|
3545
|
-
|
|
3763
|
+
var curve = _this._addCurve(target.path, glTFChannel, sampleDataCollection);
|
|
3764
|
+
if (target.path === AnimationChannelTargetPath.WEIGHTS) {
|
|
3765
|
+
var mesh = glTF.nodes[target.node].mesh;
|
|
3766
|
+
for(var i = 0, n = glTF.meshes[mesh].primitives.length; i < n; i++){
|
|
3767
|
+
animationClip.addCurveBinding(relativePath, ComponentType, i, propertyName, curve);
|
|
3768
|
+
}
|
|
3769
|
+
} else {
|
|
3770
|
+
animationClip.addCurveBinding(relativePath, ComponentType, propertyName, curve);
|
|
3771
|
+
}
|
|
3546
3772
|
}
|
|
3547
3773
|
return animationClip;
|
|
3548
3774
|
});
|
|
3549
3775
|
};
|
|
3550
|
-
GLTFAnimationParser1._addCurve = function _addCurve(animationChannelTargetPath,
|
|
3551
|
-
var sampleData = sampleDataCollection[
|
|
3776
|
+
GLTFAnimationParser1._addCurve = function _addCurve(animationChannelTargetPath, glTFChannel, sampleDataCollection) {
|
|
3777
|
+
var sampleData = sampleDataCollection[glTFChannel.sampler];
|
|
3552
3778
|
var input = sampleData.input, output = sampleData.output, outputSize = sampleData.outputSize;
|
|
3553
3779
|
switch(animationChannelTargetPath){
|
|
3554
3780
|
case AnimationChannelTargetPath.TRANSLATION:
|
|
@@ -3640,7 +3866,9 @@ var GLTFBufferParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3640
3866
|
};
|
|
3641
3867
|
var absoluteUrl = Utils.resolveAbsoluteUrl(url, bufferInfo.uri);
|
|
3642
3868
|
restoreBufferRequests.push(new BufferRequestInfo(absoluteUrl, requestConfig));
|
|
3643
|
-
|
|
3869
|
+
var promise = request(absoluteUrl, requestConfig).onProgress(undefined, context._onTaskDetail);
|
|
3870
|
+
context._addTaskCompletePromise(promise);
|
|
3871
|
+
return promise;
|
|
3644
3872
|
};
|
|
3645
3873
|
return GLTFBufferParser;
|
|
3646
3874
|
}(GLTFParser);
|
|
@@ -3655,10 +3883,13 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3655
3883
|
}
|
|
3656
3884
|
var _proto = GLTFEntityParser.prototype;
|
|
3657
3885
|
_proto.parse = function parse(context, index) {
|
|
3886
|
+
var glTFResource = context.glTFResource;
|
|
3658
3887
|
var entityInfo = context.glTF.nodes[index];
|
|
3659
|
-
var engine =
|
|
3888
|
+
var engine = glTFResource.engine;
|
|
3660
3889
|
var matrix = entityInfo.matrix, translation = entityInfo.translation, rotation = entityInfo.rotation, scale = entityInfo.scale, extensions = entityInfo.extensions;
|
|
3661
3890
|
var entity = new Entity(engine, entityInfo.name || "_GLTF_ENTITY_" + index);
|
|
3891
|
+
// @ts-ignore
|
|
3892
|
+
entity._markAsTemplate(glTFResource);
|
|
3662
3893
|
var transform = entity.transform;
|
|
3663
3894
|
if (matrix) {
|
|
3664
3895
|
var localMatrix = transform.localMatrix;
|
|
@@ -3700,7 +3931,8 @@ var GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3700
3931
|
var _proto = GLTFMaterialParser1.prototype;
|
|
3701
3932
|
_proto.parse = function parse(context, index) {
|
|
3702
3933
|
var materialInfo = context.glTF.materials[index];
|
|
3703
|
-
var
|
|
3934
|
+
var glTFResource = context.glTFResource;
|
|
3935
|
+
var engine = glTFResource.engine;
|
|
3704
3936
|
var material = GLTFParser.executeExtensionsCreateAndParse(materialInfo.extensions, context, materialInfo);
|
|
3705
3937
|
if (!material) {
|
|
3706
3938
|
material = new PBRMaterial(engine);
|
|
@@ -3708,8 +3940,10 @@ var GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3708
3940
|
GLTFMaterialParser._parseStandardProperty(context, material, materialInfo);
|
|
3709
3941
|
}
|
|
3710
3942
|
return Promise.resolve(material).then(function(material) {
|
|
3711
|
-
material || (material = GLTFMaterialParser._getDefaultMaterial(
|
|
3943
|
+
material || (material = GLTFMaterialParser._getDefaultMaterial(engine));
|
|
3712
3944
|
GLTFParser.executeExtensionsAdditiveAndParse(materialInfo.extensions, context, material, materialInfo);
|
|
3945
|
+
// @ts-ignore
|
|
3946
|
+
material._associationSuperResource(glTFResource);
|
|
3713
3947
|
return material;
|
|
3714
3948
|
});
|
|
3715
3949
|
};
|
|
@@ -3830,14 +4064,20 @@ var GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3830
4064
|
var mesh = GLTFParser.executeExtensionsCreateAndParse(gltfPrimitive.extensions, context, gltfPrimitive, meshInfo);
|
|
3831
4065
|
if (mesh) {
|
|
3832
4066
|
if (_instanceof(mesh, ModelMesh)) {
|
|
4067
|
+
// @ts-ignore
|
|
4068
|
+
mesh._associationSuperResource(glTFResource);
|
|
3833
4069
|
resolve(mesh);
|
|
3834
4070
|
} else {
|
|
3835
4071
|
mesh.then(function(mesh) {
|
|
3836
|
-
|
|
4072
|
+
// @ts-ignore
|
|
4073
|
+
mesh._associationSuperResource(glTFResource);
|
|
4074
|
+
resolve(mesh);
|
|
3837
4075
|
});
|
|
3838
4076
|
}
|
|
3839
4077
|
} else {
|
|
3840
4078
|
var mesh1 = new ModelMesh(engine, meshInfo.name || i + "");
|
|
4079
|
+
// @ts-ignore
|
|
4080
|
+
mesh1._associationSuperResource(glTFResource);
|
|
3841
4081
|
var meshRestoreInfo = new ModelMeshRestoreInfo();
|
|
3842
4082
|
meshRestoreInfo.mesh = mesh1;
|
|
3843
4083
|
context.contentRestorer.meshes.push(meshRestoreInfo);
|
|
@@ -3857,12 +4097,13 @@ var GLTFMeshParser = (_GLTFMeshParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
3857
4097
|
return context.get(GLTFParserType.Buffer).then(function(buffers) {
|
|
3858
4098
|
return GLTFUtils.getAccessorData(glTF, indexAccessor, buffers);
|
|
3859
4099
|
});
|
|
3860
|
-
}, context.keepMeshData).then(resolve);
|
|
4100
|
+
}, context.params.keepMeshData).then(resolve);
|
|
3861
4101
|
}
|
|
3862
4102
|
});
|
|
3863
4103
|
};
|
|
3864
4104
|
var meshInfo = context.glTF.meshes[index];
|
|
3865
|
-
var glTF = context.glTF,
|
|
4105
|
+
var glTF = context.glTF, glTFResource = context.glTFResource;
|
|
4106
|
+
var engine = glTFResource.engine;
|
|
3866
4107
|
var primitivePromises = new Array();
|
|
3867
4108
|
for(var i = 0, length = meshInfo.primitives.length; i < length; i++)_loop(i);
|
|
3868
4109
|
return Promise.all(primitivePromises);
|
|
@@ -4035,9 +4276,9 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4035
4276
|
}
|
|
4036
4277
|
var _proto = GLTFSceneParser.prototype;
|
|
4037
4278
|
_proto.parse = function parse(context, index) {
|
|
4038
|
-
var _this = this;
|
|
4039
4279
|
var _context_glTF = context.glTF, scenes = _context_glTF.scenes, _context_glTF_scene = _context_glTF.scene, scene = _context_glTF_scene === void 0 ? 0 : _context_glTF_scene, glTFResource = context.glTFResource;
|
|
4040
4280
|
var sceneInfo = scenes[index];
|
|
4281
|
+
var sceneExtensions = sceneInfo.extensions;
|
|
4041
4282
|
var engine = glTFResource.engine;
|
|
4042
4283
|
var isDefaultScene = scene === index;
|
|
4043
4284
|
var sceneNodes = sceneInfo.nodes;
|
|
@@ -4051,30 +4292,15 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4051
4292
|
sceneRoot.addChild(childEntity);
|
|
4052
4293
|
}
|
|
4053
4294
|
}
|
|
4054
|
-
// @ts-ignore
|
|
4055
|
-
sceneRoot._hookResource = glTFResource;
|
|
4056
|
-
// @ts-ignore
|
|
4057
|
-
glTFResource._addReferCount(1);
|
|
4058
4295
|
if (isDefaultScene) {
|
|
4059
|
-
glTFResource.
|
|
4296
|
+
glTFResource._defaultSceneRoot = sceneRoot;
|
|
4060
4297
|
}
|
|
4061
4298
|
var promises = new Array();
|
|
4062
4299
|
for(var i1 = 0; i1 < sceneNodes.length; i1++){
|
|
4063
4300
|
promises.push(this._parseEntityComponent(context, sceneNodes[i1]));
|
|
4064
4301
|
}
|
|
4065
4302
|
return Promise.all(promises).then(function() {
|
|
4066
|
-
|
|
4067
|
-
return Promise.all([
|
|
4068
|
-
context.get(GLTFParserType.Skin),
|
|
4069
|
-
context.get(GLTFParserType.Animation)
|
|
4070
|
-
]).then(function(param) {
|
|
4071
|
-
var skins = param[0], animations = param[1];
|
|
4072
|
-
if (skins || animations) {
|
|
4073
|
-
_this._createAnimator(context, animations);
|
|
4074
|
-
}
|
|
4075
|
-
return sceneRoot;
|
|
4076
|
-
});
|
|
4077
|
-
}
|
|
4303
|
+
GLTFParser.executeExtensionsAdditiveAndParse(sceneExtensions, context, sceneRoot, sceneInfo);
|
|
4078
4304
|
return sceneRoot;
|
|
4079
4305
|
});
|
|
4080
4306
|
};
|
|
@@ -4186,28 +4412,6 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4186
4412
|
for(var i = 0; i < glTFMeshPrimitives.length; i++)_loop(i);
|
|
4187
4413
|
return Promise.all(promises);
|
|
4188
4414
|
};
|
|
4189
|
-
_proto._createAnimator = function _createAnimator(context, animations) {
|
|
4190
|
-
var defaultSceneRoot = context.glTFResource.defaultSceneRoot;
|
|
4191
|
-
var animator = defaultSceneRoot.addComponent(Animator);
|
|
4192
|
-
var animatorController = new AnimatorController();
|
|
4193
|
-
var layer = new AnimatorControllerLayer("layer");
|
|
4194
|
-
var animatorStateMachine = new AnimatorStateMachine();
|
|
4195
|
-
animatorController.addLayer(layer);
|
|
4196
|
-
animator.animatorController = animatorController;
|
|
4197
|
-
layer.stateMachine = animatorStateMachine;
|
|
4198
|
-
if (animations) {
|
|
4199
|
-
for(var i = 0; i < animations.length; i++){
|
|
4200
|
-
var animationClip = animations[i];
|
|
4201
|
-
var name = animationClip.name;
|
|
4202
|
-
var uniqueName = animatorStateMachine.makeUniqueStateName(name);
|
|
4203
|
-
if (uniqueName !== name) {
|
|
4204
|
-
console.warn("AnimatorState name is existed, name: " + name + " reset to " + uniqueName);
|
|
4205
|
-
}
|
|
4206
|
-
var animatorState = animatorStateMachine.addState(uniqueName);
|
|
4207
|
-
animatorState.clip = animationClip;
|
|
4208
|
-
}
|
|
4209
|
-
}
|
|
4210
|
-
};
|
|
4211
4415
|
_proto._computeLocalBounds = function _computeLocalBounds(skinnedMeshRenderer, mesh, bones, rootBone, inverseBindMatrices) {
|
|
4212
4416
|
var rootBoneIndex = bones.indexOf(rootBone);
|
|
4213
4417
|
if (rootBoneIndex !== -1) {
|
|
@@ -4356,11 +4560,12 @@ var GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1
|
|
|
4356
4560
|
params: {
|
|
4357
4561
|
mipmap: (_samplerInfo = samplerInfo) == null ? void 0 : _samplerInfo.mipmap
|
|
4358
4562
|
}
|
|
4359
|
-
}).then(function(texture) {
|
|
4563
|
+
}).onProgress(undefined, context._onTaskDetail).then(function(texture) {
|
|
4360
4564
|
texture.name = textureName || imageName || texture.name || "texture_" + index;
|
|
4361
4565
|
useSampler && GLTFUtils.parseSampler(texture, samplerInfo);
|
|
4362
4566
|
return texture;
|
|
4363
4567
|
});
|
|
4568
|
+
context._addTaskCompletePromise(texture);
|
|
4364
4569
|
} else {
|
|
4365
4570
|
var bufferView = glTF.bufferViews[bufferViewIndex];
|
|
4366
4571
|
texture = context.get(GLTFParserType.Buffer).then(function(buffers) {
|
|
@@ -4382,6 +4587,8 @@ var GLTFTextureParser = (_GLTFTextureParser = /*#__PURE__*/ function(GLTFParser1
|
|
|
4382
4587
|
}
|
|
4383
4588
|
return Promise.resolve(texture).then(function(texture) {
|
|
4384
4589
|
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, texture, textureInfo);
|
|
4590
|
+
// @ts-ignore
|
|
4591
|
+
texture._associationSuperResource(glTFResource);
|
|
4385
4592
|
return texture;
|
|
4386
4593
|
});
|
|
4387
4594
|
};
|
|
@@ -4439,12 +4646,17 @@ var GLTFLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
4439
4646
|
}
|
|
4440
4647
|
var _proto = GLTFLoader.prototype;
|
|
4441
4648
|
_proto.load = function load(item, resourceManager) {
|
|
4442
|
-
var _params;
|
|
4443
4649
|
var url = item.url;
|
|
4444
4650
|
var params = item.params;
|
|
4445
4651
|
var glTFResource = new GLTFResource(resourceManager.engine, url);
|
|
4446
|
-
var context = new GLTFParserContext(glTFResource, resourceManager,
|
|
4447
|
-
|
|
4652
|
+
var context = new GLTFParserContext(glTFResource, resourceManager, _extends({
|
|
4653
|
+
keepMeshData: false
|
|
4654
|
+
}, params));
|
|
4655
|
+
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
4656
|
+
context._setTaskCompleteProgress = setTaskCompleteProgress;
|
|
4657
|
+
context._setTaskDetailProgress = setTaskDetailProgress;
|
|
4658
|
+
context.parse().then(resolve).catch(reject);
|
|
4659
|
+
});
|
|
4448
4660
|
};
|
|
4449
4661
|
return GLTFLoader;
|
|
4450
4662
|
}(Loader);
|
|
@@ -5091,6 +5303,12 @@ var MaterialLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
5091
5303
|
materialShaderData.setTexture(key, texture);
|
|
5092
5304
|
}));
|
|
5093
5305
|
break;
|
|
5306
|
+
case "Boolean":
|
|
5307
|
+
materialShaderData.setInt(key, value ? 1 : 0);
|
|
5308
|
+
break;
|
|
5309
|
+
case "Integer":
|
|
5310
|
+
materialShaderData.setInt(key, Number(value));
|
|
5311
|
+
break;
|
|
5094
5312
|
}
|
|
5095
5313
|
};
|
|
5096
5314
|
var engine = resourceManager.engine;
|
|
@@ -5211,7 +5429,7 @@ var SpriteAtlasLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
5211
5429
|
var _proto = SpriteAtlasLoader.prototype;
|
|
5212
5430
|
_proto.load = function load(item, resourceManager) {
|
|
5213
5431
|
var _this = this;
|
|
5214
|
-
return new AssetPromise(function(resolve, reject, _, onCancel) {
|
|
5432
|
+
return new AssetPromise(function(resolve, reject, _, __, onCancel) {
|
|
5215
5433
|
var chainPromises = [];
|
|
5216
5434
|
onCancel(function() {
|
|
5217
5435
|
for(var i = 0; i < chainPromises.length; i++){
|
|
@@ -5226,9 +5444,10 @@ var SpriteAtlasLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
5226
5444
|
var _loop = function(i) {
|
|
5227
5445
|
var atlasItem = atlasItems[i];
|
|
5228
5446
|
if (atlasItem.img) {
|
|
5447
|
+
var _atlasItem_type;
|
|
5229
5448
|
chainPromises.push(resourceManager.load({
|
|
5230
5449
|
url: Utils.resolveAbsoluteUrl(item.url, atlasItem.img),
|
|
5231
|
-
type: AssetType.Texture2D,
|
|
5450
|
+
type: (_atlasItem_type = atlasItem.type) != null ? _atlasItem_type : AssetType.Texture2D,
|
|
5232
5451
|
params: {
|
|
5233
5452
|
format: format,
|
|
5234
5453
|
mipmap: mipmap
|
|
@@ -5358,15 +5577,19 @@ var Texture2DLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
5358
5577
|
var _proto = Texture2DLoader.prototype;
|
|
5359
5578
|
_proto.load = function load(item, resourceManager) {
|
|
5360
5579
|
var _this = this;
|
|
5361
|
-
return new AssetPromise(function(resolve, reject) {
|
|
5580
|
+
return new AssetPromise(function(resolve, reject, setTaskCompleteProgress, setTaskDetailProgress) {
|
|
5362
5581
|
var url = item.url;
|
|
5363
5582
|
var requestConfig = _extends({}, item, {
|
|
5364
5583
|
type: "image"
|
|
5365
5584
|
});
|
|
5366
|
-
_this.request(url, requestConfig).then(function(image) {
|
|
5367
|
-
var
|
|
5368
|
-
var
|
|
5369
|
-
var texture = new Texture2D(resourceManager.engine, image.width, image.height,
|
|
5585
|
+
_this.request(url, requestConfig).onProgress(setTaskCompleteProgress, setTaskDetailProgress).then(function(image) {
|
|
5586
|
+
var _item_params;
|
|
5587
|
+
var _ref = (_item_params = item.params) != null ? _item_params : {}, format = _ref.format, mipmap = _ref.mipmap, anisoLevel = _ref.anisoLevel, wrapModeU = _ref.wrapModeU, wrapModeV = _ref.wrapModeV, filterMode = _ref.filterMode;
|
|
5588
|
+
var texture = new Texture2D(resourceManager.engine, image.width, image.height, format, mipmap);
|
|
5589
|
+
texture.anisoLevel = anisoLevel != null ? anisoLevel : texture.anisoLevel;
|
|
5590
|
+
texture.filterMode = filterMode != null ? filterMode : texture.filterMode;
|
|
5591
|
+
texture.wrapModeU = wrapModeU != null ? wrapModeU : texture.wrapModeU;
|
|
5592
|
+
texture.wrapModeV = wrapModeV != null ? wrapModeV : texture.wrapModeV;
|
|
5370
5593
|
texture.setImageSource(image);
|
|
5371
5594
|
texture.generateMipmaps();
|
|
5372
5595
|
if (url.indexOf("data:") !== 0) {
|
|
@@ -5514,33 +5737,34 @@ var SceneLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
5514
5737
|
var promises = [];
|
|
5515
5738
|
// parse ambient light
|
|
5516
5739
|
var ambient = data.scene.ambient;
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
// prettier-ignore
|
|
5521
|
-
var customAmbientPromise = resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
|
|
5522
|
-
scene.ambientLight = ambientLight;
|
|
5523
|
-
scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
|
|
5524
|
-
scene.ambientLight.specularIntensity = ambient.specularIntensity;
|
|
5525
|
-
scene.ambientLight.diffuseMode = ambient.diffuseMode;
|
|
5526
|
-
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5527
|
-
});
|
|
5528
|
-
promises.push(customAmbientPromise);
|
|
5529
|
-
} else if (!useCustomAmbient && ambient.ambientLight) {
|
|
5530
|
-
// @ts-ignore
|
|
5531
|
-
// prettier-ignore
|
|
5532
|
-
var ambientLightPromise = resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
|
|
5533
|
-
scene.ambientLight = ambientLight;
|
|
5534
|
-
scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
|
|
5535
|
-
scene.ambientLight.specularIntensity = ambient.specularIntensity;
|
|
5536
|
-
scene.ambientLight.diffuseMode = ambient.diffuseMode;
|
|
5537
|
-
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5538
|
-
});
|
|
5539
|
-
promises.push(ambientLightPromise);
|
|
5540
|
-
} else {
|
|
5740
|
+
if (ambient) {
|
|
5741
|
+
var useCustomAmbient = ambient.specularMode === "Custom";
|
|
5742
|
+
var useSH = ambient.diffuseMode === DiffuseMode.SphericalHarmonics;
|
|
5541
5743
|
scene.ambientLight.diffuseIntensity = ambient.diffuseIntensity;
|
|
5542
5744
|
scene.ambientLight.specularIntensity = ambient.specularIntensity;
|
|
5745
|
+
scene.ambientLight.diffuseMode = ambient.diffuseMode;
|
|
5543
5746
|
scene.ambientLight.diffuseSolidColor.copyFrom(ambient.diffuseSolidColor);
|
|
5747
|
+
scene.ambientLight.specularTextureDecodeRGBM = true;
|
|
5748
|
+
if (useCustomAmbient && ambient.customAmbientLight) {
|
|
5749
|
+
promises.push(// @ts-ignore
|
|
5750
|
+
resourceManager.getResourceByRef(ambient.customAmbientLight).then(function(ambientLight) {
|
|
5751
|
+
var _ambientLight;
|
|
5752
|
+
scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
|
|
5753
|
+
}));
|
|
5754
|
+
}
|
|
5755
|
+
if (ambient.ambientLight && (!useCustomAmbient || useSH)) {
|
|
5756
|
+
promises.push(// @ts-ignore
|
|
5757
|
+
resourceManager.getResourceByRef(ambient.ambientLight).then(function(ambientLight) {
|
|
5758
|
+
if (!useCustomAmbient) {
|
|
5759
|
+
var _ambientLight;
|
|
5760
|
+
scene.ambientLight.specularTexture = (_ambientLight = ambientLight) == null ? void 0 : _ambientLight.specularTexture;
|
|
5761
|
+
}
|
|
5762
|
+
if (useSH) {
|
|
5763
|
+
var _ambientLight1;
|
|
5764
|
+
scene.ambientLight.diffuseSphericalHarmonics = (_ambientLight1 = ambientLight) == null ? void 0 : _ambientLight1.diffuseSphericalHarmonics;
|
|
5765
|
+
}
|
|
5766
|
+
}));
|
|
5767
|
+
}
|
|
5544
5768
|
}
|
|
5545
5769
|
var background = data.scene.background;
|
|
5546
5770
|
scene.background.mode = background.mode;
|
|
@@ -5582,6 +5806,9 @@ var SceneLoader = /*#__PURE__*/ function(Loader1) {
|
|
|
5582
5806
|
if (shadow.shadowResolution != undefined) scene.shadowResolution = shadow.shadowResolution;
|
|
5583
5807
|
if (shadow.shadowDistance != undefined) scene.shadowDistance = shadow.shadowDistance;
|
|
5584
5808
|
if (shadow.shadowCascades != undefined) scene.shadowCascades = shadow.shadowCascades;
|
|
5809
|
+
var _shadow_shadowTwoCascadeSplits;
|
|
5810
|
+
scene.shadowTwoCascadeSplits = (_shadow_shadowTwoCascadeSplits = shadow.shadowTwoCascadeSplits) != null ? _shadow_shadowTwoCascadeSplits : scene.shadowTwoCascadeSplits;
|
|
5811
|
+
shadow.shadowFourCascadeSplits && scene.shadowFourCascadeSplits.copyFrom(shadow.shadowFourCascadeSplits);
|
|
5585
5812
|
}
|
|
5586
5813
|
return Promise.all(promises).then(function() {
|
|
5587
5814
|
resolve(scene);
|
|
@@ -5597,13 +5824,13 @@ SceneLoader = __decorate([
|
|
|
5597
5824
|
"scene"
|
|
5598
5825
|
], true)
|
|
5599
5826
|
], SceneLoader);
|
|
5600
|
-
ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item
|
|
5827
|
+
ReflectionParser.registerCustomParseComponent("TextRenderer", /*#__PURE__*/ _async_to_generator(function(instance, item) {
|
|
5601
5828
|
var props;
|
|
5602
5829
|
return __generator(this, function(_state) {
|
|
5603
5830
|
props = item.props;
|
|
5604
5831
|
if (!props.font) {
|
|
5605
5832
|
// @ts-ignore
|
|
5606
|
-
instance.font = Font.createFromOS(engine, props.fontFamily || "Arial");
|
|
5833
|
+
instance.font = Font.createFromOS(instance.engine, props.fontFamily || "Arial");
|
|
5607
5834
|
}
|
|
5608
5835
|
return [
|
|
5609
5836
|
2,
|
|
@@ -5659,7 +5886,7 @@ var KHR_draco_mesh_compression = (_KHR_draco_mesh_compression = /*#__PURE__*/ fu
|
|
|
5659
5886
|
throw "BlendShape animation is not supported when using draco.";
|
|
5660
5887
|
}, function() {
|
|
5661
5888
|
return decodedGeometry.index.array;
|
|
5662
|
-
}, context.keepMeshData);
|
|
5889
|
+
}, context.params.keepMeshData);
|
|
5663
5890
|
});
|
|
5664
5891
|
});
|
|
5665
5892
|
};
|
|
@@ -5950,7 +6177,7 @@ var KHR_materials_variants = /*#__PURE__*/ function(GLTFExtensionParser1) {
|
|
|
5950
6177
|
var _glTFResource;
|
|
5951
6178
|
var _context_glTF = context.glTF, _context_glTF_extensions = _context_glTF.extensions, _context_glTF_extensions_KHR_materials_variants = _context_glTF_extensions.KHR_materials_variants, variantNames = _context_glTF_extensions_KHR_materials_variants.variants, glTFResource = context.glTFResource;
|
|
5952
6179
|
var mappings = schema.mappings;
|
|
5953
|
-
(_glTFResource = glTFResource).
|
|
6180
|
+
(_glTFResource = glTFResource)._extensionsData || (_glTFResource._extensionsData = {});
|
|
5954
6181
|
var extensionData = [];
|
|
5955
6182
|
glTFResource.extensionsData.variants = extensionData;
|
|
5956
6183
|
for(var i = 0; i < mappings.length; i++)_loop(i);
|
|
@@ -5980,7 +6207,7 @@ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser1) {
|
|
|
5980
6207
|
var _proto = KHR_texture_basisu.prototype;
|
|
5981
6208
|
_proto.createAndParse = function createAndParse(context, schema, textureInfo) {
|
|
5982
6209
|
return _async_to_generator(function() {
|
|
5983
|
-
var glTF, glTFResource, engine, url, sampler, textureName, source, _glTF_images_source, uri, bufferViewIndex, mimeType, imageName, samplerInfo, index, bufferView;
|
|
6210
|
+
var glTF, glTFResource, engine, url, sampler, textureName, source, _glTF_images_source, uri, bufferViewIndex, mimeType, imageName, samplerInfo, index, promise, bufferView;
|
|
5984
6211
|
return __generator(this, function(_state) {
|
|
5985
6212
|
glTF = context.glTF, glTFResource = context.glTFResource;
|
|
5986
6213
|
engine = glTFResource.engine, url = glTFResource.url;
|
|
@@ -5990,20 +6217,22 @@ var KHR_texture_basisu = /*#__PURE__*/ function(GLTFExtensionParser1) {
|
|
|
5990
6217
|
samplerInfo = sampler !== undefined && GLTFUtils.getSamplerInfo(glTF.samplers[sampler]);
|
|
5991
6218
|
if (uri) {
|
|
5992
6219
|
index = uri.lastIndexOf(".");
|
|
6220
|
+
promise = engine.resourceManager.load({
|
|
6221
|
+
url: Utils.resolveAbsoluteUrl(url, uri),
|
|
6222
|
+
type: AssetType.KTX2
|
|
6223
|
+
}).onProgress(undefined, context._onTaskDetail).then(function(texture) {
|
|
6224
|
+
if (!texture.name) {
|
|
6225
|
+
texture.name = textureName || imageName || "texture_" + index;
|
|
6226
|
+
}
|
|
6227
|
+
if (sampler !== undefined) {
|
|
6228
|
+
GLTFUtils.parseSampler(texture, samplerInfo);
|
|
6229
|
+
}
|
|
6230
|
+
return texture;
|
|
6231
|
+
});
|
|
6232
|
+
context._addTaskCompletePromise(promise);
|
|
5993
6233
|
return [
|
|
5994
6234
|
2,
|
|
5995
|
-
|
|
5996
|
-
url: Utils.resolveAbsoluteUrl(url, uri),
|
|
5997
|
-
type: AssetType.KTX2
|
|
5998
|
-
}).then(function(texture) {
|
|
5999
|
-
if (!texture.name) {
|
|
6000
|
-
texture.name = textureName || imageName || "texture_" + index;
|
|
6001
|
-
}
|
|
6002
|
-
if (sampler !== undefined) {
|
|
6003
|
-
GLTFUtils.parseSampler(texture, samplerInfo);
|
|
6004
|
-
}
|
|
6005
|
-
return texture;
|
|
6006
|
-
})
|
|
6235
|
+
promise
|
|
6007
6236
|
];
|
|
6008
6237
|
} else {
|
|
6009
6238
|
bufferView = glTF.bufferViews[bufferViewIndex];
|
|
@@ -6073,7 +6302,9 @@ var GALACEAN_materials_remap = /*#__PURE__*/ function(GLTFExtensionParser1) {
|
|
|
6073
6302
|
_proto.createAndParse = function createAndParse(context, schema) {
|
|
6074
6303
|
var engine = context.glTFResource.engine;
|
|
6075
6304
|
// @ts-ignore
|
|
6076
|
-
|
|
6305
|
+
var promise = engine.resourceManager.getResourceByRef(schema);
|
|
6306
|
+
context._addTaskCompletePromise(promise);
|
|
6307
|
+
return promise;
|
|
6077
6308
|
};
|
|
6078
6309
|
return GALACEAN_materials_remap;
|
|
6079
6310
|
}(GLTFExtensionParser);
|
|
@@ -6104,5 +6335,28 @@ GALACEAN_animation_event = __decorate([
|
|
|
6104
6335
|
registerGLTFExtension("GALACEAN_animation_event", GLTFExtensionMode.AdditiveParse)
|
|
6105
6336
|
], GALACEAN_animation_event);
|
|
6106
6337
|
|
|
6107
|
-
|
|
6338
|
+
var KHR_materials_anisotropy = /*#__PURE__*/ function(GLTFExtensionParser1) {
|
|
6339
|
+
_inherits(KHR_materials_anisotropy, GLTFExtensionParser1);
|
|
6340
|
+
function KHR_materials_anisotropy() {
|
|
6341
|
+
return GLTFExtensionParser1.apply(this, arguments);
|
|
6342
|
+
}
|
|
6343
|
+
var _proto = KHR_materials_anisotropy.prototype;
|
|
6344
|
+
_proto.additiveParse = function additiveParse(context, material, schema) {
|
|
6345
|
+
var _schema_anisotropyStrength = schema.anisotropyStrength, anisotropyStrength = _schema_anisotropyStrength === void 0 ? 0 : _schema_anisotropyStrength, _schema_anisotropyRotation = schema.anisotropyRotation, anisotropyRotation = _schema_anisotropyRotation === void 0 ? 0 : _schema_anisotropyRotation, anisotropyTexture = schema.anisotropyTexture;
|
|
6346
|
+
material.anisotropy = anisotropyStrength;
|
|
6347
|
+
material.anisotropyRotation = anisotropyRotation;
|
|
6348
|
+
if (anisotropyTexture) {
|
|
6349
|
+
GLTFMaterialParser._checkOtherTextureTransform(anisotropyTexture, "Anisotropy texture");
|
|
6350
|
+
context.get(GLTFParserType.Texture, anisotropyTexture.index).then(function(texture) {
|
|
6351
|
+
material.anisotropyTexture = texture;
|
|
6352
|
+
});
|
|
6353
|
+
}
|
|
6354
|
+
};
|
|
6355
|
+
return KHR_materials_anisotropy;
|
|
6356
|
+
}(GLTFExtensionParser);
|
|
6357
|
+
KHR_materials_anisotropy = __decorate([
|
|
6358
|
+
registerGLTFExtension("KHR_materials_anisotropy", GLTFExtensionMode.AdditiveParse)
|
|
6359
|
+
], KHR_materials_anisotropy);
|
|
6360
|
+
|
|
6361
|
+
export { AnimationClipDecoder, ComponentMap, EditorTextureLoader, GLTFAnimationParser, GLTFBufferParser, GLTFEntityParser, GLTFExtensionMode, GLTFExtensionParser, GLTFMaterialParser, GLTFMeshParser, GLTFParser, GLTFParserContext, GLTFParserType, GLTFResource, GLTFSceneParser, GLTFSchemaParser, GLTFSkinParser, GLTFTextureParser, GLTFUtils, GLTFValidator, InterpolableValueType, KTX2Loader, KTX2TargetFormat, KTX2Transcoder, MeshDecoder, MeshLoader$1 as MeshLoader, PrefabParser, ReflectionParser, SceneParser, SpecularMode, Texture2DDecoder, decode, parseSingleKTX, registerGLTFExtension, registerGLTFParser };
|
|
6108
6362
|
//# sourceMappingURL=module.js.map
|