@galacean/effects-plugin-model 2.0.0-alpha.16 → 2.0.0-alpha.18
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/alipay.js +508 -488
- package/dist/alipay.js.map +1 -1
- package/dist/alipay.mjs +181 -180
- package/dist/alipay.mjs.map +1 -1
- package/dist/gltf/json-converter.d.ts +1 -1
- package/dist/index.js +509 -489
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +182 -181
- package/dist/index.mjs.map +1 -1
- package/dist/loader.mjs +182 -181
- package/dist/loader.mjs.map +1 -1
- package/dist/plugin/model-plugin.d.ts +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Description: Galacean Effects player model plugin
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 飂兮
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.18
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import * as EFFECTS from '@galacean/effects';
|
|
10
|
+
import { math, Transform, PLAYER_OPTIONS_ENV_EDITOR, spec, glContext, Texture, TextureSourceType, RenderPassAttachmentStorageType, Material, Mesh, Geometry, GLSLVersion, addItem, removeItem, effectsClass, RendererComponent, ItemBehaviour, HitTestType, AnimationClip, RenderPass, TextureLoadAction, DestroyOptions, RenderPassDestroyAttachmentType, Player, Renderer, getDefaultTextureFactory, loadImage, generateGUID, VFXItem, AbstractPlugin, glType2VertexFormatType, Downloader, getStandardJSON, isObject, registerPlugin, logger } from '@galacean/effects';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Model 插件元素类型
|
|
@@ -1155,7 +1156,7 @@ var TextureDataMode;
|
|
|
1155
1156
|
var matList = props.inverseBindMatrices;
|
|
1156
1157
|
if (matList !== undefined && matList.length > 0) {
|
|
1157
1158
|
if (matList.length % 16 !== 0 || matList.length !== this.jointItem.length * 16) {
|
|
1158
|
-
throw new Error("Invalid array length, invert bind matrices " + matList.length + ", joint array " + this.jointItem.length);
|
|
1159
|
+
throw new Error("Invalid array length, invert bind matrices " + matList.length + ", joint array " + this.jointItem.length + ".");
|
|
1159
1160
|
}
|
|
1160
1161
|
var matrixCount = matList.length / 16;
|
|
1161
1162
|
for(var i = 0; i < matrixCount; i++){
|
|
@@ -1186,7 +1187,7 @@ var TextureDataMode;
|
|
|
1186
1187
|
});
|
|
1187
1188
|
} else {
|
|
1188
1189
|
this.animationMatrices = this.inverseBindMatrices;
|
|
1189
|
-
console.error("Some error occured, replace skin animation matrices by invert bind matrices");
|
|
1190
|
+
console.error("Some error occured, replace skin animation matrices by invert bind matrices.");
|
|
1190
1191
|
}
|
|
1191
1192
|
};
|
|
1192
1193
|
/**
|
|
@@ -1247,7 +1248,7 @@ var TextureDataMode;
|
|
|
1247
1248
|
} else if (detail.halfFloatTexture) {
|
|
1248
1249
|
return 2;
|
|
1249
1250
|
} else {
|
|
1250
|
-
throw new Error("Too many joint count " + jointCount + ", half float texture not support");
|
|
1251
|
+
throw new Error("Too many joint count " + jointCount + ", half float texture not support.");
|
|
1251
1252
|
}
|
|
1252
1253
|
} else {
|
|
1253
1254
|
return 0;
|
|
@@ -1260,7 +1261,7 @@ var TextureDataMode;
|
|
|
1260
1261
|
(_props_boneNames = props.boneNames) == null ? void 0 : _props_boneNames.forEach(function(boneName) {
|
|
1261
1262
|
var node = name2Item[boneName];
|
|
1262
1263
|
if (!node) {
|
|
1263
|
-
throw new Error("Can't find node of bone name " + boneName);
|
|
1264
|
+
throw new Error("Can't find node of bone name " + boneName + ".");
|
|
1264
1265
|
}
|
|
1265
1266
|
jointItems.push(node);
|
|
1266
1267
|
});
|
|
@@ -1357,19 +1358,19 @@ var TextureDataMode;
|
|
|
1357
1358
|
* 还要注意最大数目不能超过5,否则也直接报错。
|
|
1358
1359
|
* 后续考虑是否做个兼容,目前还是严格报错比较好。
|
|
1359
1360
|
*/ if (positionCount > 0 && positionCount != this.morphWeightsLength) {
|
|
1360
|
-
console.error("Position morph count mismatch: " + this.morphWeightsLength + ", " + positionCount);
|
|
1361
|
+
console.error("Position morph count mismatch: " + this.morphWeightsLength + ", " + positionCount + ".");
|
|
1361
1362
|
return false;
|
|
1362
1363
|
}
|
|
1363
1364
|
if (normalCount > 0 && normalCount != this.morphWeightsLength) {
|
|
1364
|
-
console.error("Normal morph count mismatch: " + this.morphWeightsLength + ", " + normalCount);
|
|
1365
|
+
console.error("Normal morph count mismatch: " + this.morphWeightsLength + ", " + normalCount + ".");
|
|
1365
1366
|
return false;
|
|
1366
1367
|
}
|
|
1367
1368
|
if (tangentCount > 0 && tangentCount != this.morphWeightsLength) {
|
|
1368
|
-
console.error("Tangent morph count mismatch: " + this.morphWeightsLength + ", " + tangentCount);
|
|
1369
|
+
console.error("Tangent morph count mismatch: " + this.morphWeightsLength + ", " + tangentCount + ".");
|
|
1369
1370
|
return false;
|
|
1370
1371
|
}
|
|
1371
1372
|
if (this.morphWeightsLength > 5) {
|
|
1372
|
-
console.error("Tangent morph count should not greater than 5, current " + this.morphWeightsLength);
|
|
1373
|
+
console.error("Tangent morph count should not greater than 5, current " + this.morphWeightsLength + ".");
|
|
1373
1374
|
return false;
|
|
1374
1375
|
}
|
|
1375
1376
|
return true;
|
|
@@ -1391,7 +1392,7 @@ var TextureDataMode;
|
|
|
1391
1392
|
_proto.updateWeights = function updateWeights(weights) {
|
|
1392
1393
|
var _this = this;
|
|
1393
1394
|
if (weights.length != this.morphWeightsArray.length) {
|
|
1394
|
-
console.error("Length of morph weights mismatch: input " + weights.length + ", internel " + this.morphWeightsArray.length);
|
|
1395
|
+
console.error("Length of morph weights mismatch: input " + weights.length + ", internel " + this.morphWeightsArray.length + ".");
|
|
1395
1396
|
return;
|
|
1396
1397
|
}
|
|
1397
1398
|
weights.forEach(function(value, index) {
|
|
@@ -1512,16 +1513,16 @@ var PAnimPathType;
|
|
|
1512
1513
|
this.component = this.dataArray.length / this.timeArray.length;
|
|
1513
1514
|
// special checker for weights animation
|
|
1514
1515
|
if (this.component <= 0) {
|
|
1515
|
-
console.error("Invalid weights component: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length);
|
|
1516
|
+
console.error("Invalid weights component: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length + ".");
|
|
1516
1517
|
} else if (this.timeArray.length * this.component != this.dataArray.length) {
|
|
1517
|
-
console.error("Invalid weights array length: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length);
|
|
1518
|
+
console.error("Invalid weights array length: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length + ".");
|
|
1518
1519
|
}
|
|
1519
1520
|
} else {
|
|
1520
1521
|
// should never happened
|
|
1521
|
-
console.error("Invalid path status: " + path);
|
|
1522
|
+
console.error("Invalid path status: " + path + ".");
|
|
1522
1523
|
}
|
|
1523
1524
|
if (this.timeArray.length * this.component > this.dataArray.length) {
|
|
1524
|
-
throw new Error("Data length mismatch: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length);
|
|
1525
|
+
throw new Error("Data length mismatch: " + this.timeArray.length + ", " + this.component + ", " + this.dataArray.length + ".");
|
|
1525
1526
|
}
|
|
1526
1527
|
if (interpolation === "LINEAR") {
|
|
1527
1528
|
this.interp = 0;
|
|
@@ -2541,7 +2542,7 @@ function _assert_this_initialized(self) {
|
|
|
2541
2542
|
_this.subMeshes.push(subMesh);
|
|
2542
2543
|
});
|
|
2543
2544
|
if (_this.subMeshes.length <= 0) {
|
|
2544
|
-
console.warn("No primitive inside mesh item " + name);
|
|
2545
|
+
console.warn("No primitive inside mesh item " + name + ".");
|
|
2545
2546
|
}
|
|
2546
2547
|
_this.boundingBox = _this.getItemBoundingBox(meshData.interaction);
|
|
2547
2548
|
return _this;
|
|
@@ -2629,7 +2630,7 @@ function _assert_this_initialized(self) {
|
|
|
2629
2630
|
return;
|
|
2630
2631
|
}
|
|
2631
2632
|
if (updatedArray.length != weightsArray.length) {
|
|
2632
|
-
throw new Error("
|
|
2633
|
+
throw new Error("Weight array length mismatch.");
|
|
2633
2634
|
}
|
|
2634
2635
|
for(var i = 0; i < updatedArray.length; i++){
|
|
2635
2636
|
updatedArray[i] = weightsArray[i];
|
|
@@ -3623,7 +3624,7 @@ var EffectsMeshProxy = /*#__PURE__*/ function() {
|
|
|
3623
3624
|
this.brdfLUT = this.sceneCache.getBrdfLutTexture();
|
|
3624
3625
|
this.initGlobalState(opts);
|
|
3625
3626
|
if (this.maxLightCount > 8) {
|
|
3626
|
-
console.warn("Too many light items: " + this.maxLightCount + " light(s)");
|
|
3627
|
+
console.warn("Too many light items: " + this.maxLightCount + " light(s).");
|
|
3627
3628
|
}
|
|
3628
3629
|
};
|
|
3629
3630
|
_proto.initGlobalState = function initGlobalState(opts) {
|
|
@@ -3973,9 +3974,8 @@ var StandardShaderSource;
|
|
|
3973
3974
|
}
|
|
3974
3975
|
if (isWebGL2) {
|
|
3975
3976
|
return "#version 300 es\n" + source;
|
|
3976
|
-
} else {
|
|
3977
|
-
return "#version 100\n" + source;
|
|
3978
3977
|
}
|
|
3978
|
+
return "#version 100\n" + source;
|
|
3979
3979
|
}
|
|
3980
3980
|
StandardShaderSource.getSourceCode = getSourceCode;
|
|
3981
3981
|
})(StandardShaderSource || (StandardShaderSource = {}));
|
|
@@ -4253,7 +4253,7 @@ function getQuadFilterVS() {
|
|
|
4253
4253
|
if (func !== undefined) {
|
|
4254
4254
|
return func(context);
|
|
4255
4255
|
} else {
|
|
4256
|
-
throw new Error("Invalid material type " + materialType + ", shader content " + context);
|
|
4256
|
+
throw new Error("Invalid material type " + materialType + ", shader content " + context + ".");
|
|
4257
4257
|
}
|
|
4258
4258
|
};
|
|
4259
4259
|
/**
|
|
@@ -4850,10 +4850,10 @@ var ModelAnimationClip = /*#__PURE__*/ function(AnimationClip) {
|
|
|
4850
4850
|
var properties = curve3.property.split(".");
|
|
4851
4851
|
setProperty(component, properties, value3);
|
|
4852
4852
|
} else {
|
|
4853
|
-
console.error("Can't find mesh component");
|
|
4853
|
+
console.error("Can't find mesh component.");
|
|
4854
4854
|
}
|
|
4855
4855
|
} else {
|
|
4856
|
-
console.warn("Ignore curve: className " + curve3.className);
|
|
4856
|
+
console.warn("Ignore curve: className " + curve3.className + ".");
|
|
4857
4857
|
}
|
|
4858
4858
|
}
|
|
4859
4859
|
};
|
|
@@ -4881,7 +4881,7 @@ var ModelAnimationClip = /*#__PURE__*/ function(AnimationClip) {
|
|
|
4881
4881
|
}
|
|
4882
4882
|
}
|
|
4883
4883
|
if (!findTag) {
|
|
4884
|
-
throw new Error("Can't find path in tree " + rootItem.id + ", " + path);
|
|
4884
|
+
throw new Error("Can't find path in tree " + rootItem.id + ", " + path + ".");
|
|
4885
4885
|
}
|
|
4886
4886
|
}
|
|
4887
4887
|
this.path2Node[path] = target;
|
|
@@ -4895,7 +4895,7 @@ function setProperty(obj, properties, value) {
|
|
|
4895
4895
|
for(var i = 0; i < len - 1; i++){
|
|
4896
4896
|
var propName = properties[i];
|
|
4897
4897
|
if (!(propName in current) || typeof current[propName] !== "object") {
|
|
4898
|
-
console.error("Invalid properties " + properties);
|
|
4898
|
+
console.error("Invalid properties " + properties + ".");
|
|
4899
4899
|
return;
|
|
4900
4900
|
}
|
|
4901
4901
|
current = current[propName];
|
|
@@ -5138,7 +5138,7 @@ var normal = new Vector3();
|
|
|
5138
5138
|
var blob, urlCreator, imageUrl, imageObj;
|
|
5139
5139
|
return __generator(this, function(_state) {
|
|
5140
5140
|
if (image.imageData === undefined) {
|
|
5141
|
-
console.error("createTexture2D: Invalid image data from " + image);
|
|
5141
|
+
console.error("createTexture2D: Invalid image data from " + image + ".");
|
|
5142
5142
|
// 这里不应该发生的,做个兜底
|
|
5143
5143
|
return [
|
|
5144
5144
|
2,
|
|
@@ -6157,7 +6157,7 @@ var normal = new Vector3();
|
|
|
6157
6157
|
if (_instanceof1(inverseBindMatrices, Float32Array)) {
|
|
6158
6158
|
studioSkin.inverseBindMatrices = inverseBindMatrices;
|
|
6159
6159
|
} else {
|
|
6160
|
-
console.error("setupItem3DOptions: Invalid inverseBindMatrices type, " + inverseBindMatrices);
|
|
6160
|
+
console.error("setupItem3DOptions: Invalid inverseBindMatrices type, " + inverseBindMatrices + ".");
|
|
6161
6161
|
}
|
|
6162
6162
|
}
|
|
6163
6163
|
} else if (item.type === spec.ItemType.tree) {
|
|
@@ -6175,12 +6175,12 @@ var normal = new Vector3();
|
|
|
6175
6175
|
if (_instanceof1(inputArray, Float32Array)) {
|
|
6176
6176
|
studioTrack.input = inputArray;
|
|
6177
6177
|
} else {
|
|
6178
|
-
console.error("setupItem3DOptions: Type of inputArray should be float32, " + inputArray);
|
|
6178
|
+
console.error("setupItem3DOptions: Type of inputArray should be float32, " + inputArray + ".");
|
|
6179
6179
|
}
|
|
6180
6180
|
if (_instanceof1(outputArray, Float32Array)) {
|
|
6181
6181
|
studioTrack.output = outputArray;
|
|
6182
6182
|
} else {
|
|
6183
|
-
console.error("setupItem3DOptions: Type of outputArray should be float32, " + outputArray);
|
|
6183
|
+
console.error("setupItem3DOptions: Type of outputArray should be float32, " + outputArray + ".");
|
|
6184
6184
|
}
|
|
6185
6185
|
});
|
|
6186
6186
|
});
|
|
@@ -6192,7 +6192,7 @@ var normal = new Vector3();
|
|
|
6192
6192
|
var studioOptions = studioSkybox.content.options;
|
|
6193
6193
|
var specularImage = _this.getTextureObj(composition.textures, options.specularImage);
|
|
6194
6194
|
if (specularImage === undefined) {
|
|
6195
|
-
console.error("setupItem3DOptions: skybox specualrImage is undefined, " + CheckerHelper.stringify(options));
|
|
6195
|
+
console.error("setupItem3DOptions: skybox specualrImage is undefined, " + CheckerHelper.stringify(options) + ".");
|
|
6196
6196
|
}
|
|
6197
6197
|
studioOptions.specularImage = specularImage;
|
|
6198
6198
|
//
|
|
@@ -6236,7 +6236,7 @@ var normal = new Vector3();
|
|
|
6236
6236
|
case WebGLRenderingContext["UNSIGNED_BYTE"]:
|
|
6237
6237
|
return array;
|
|
6238
6238
|
default:
|
|
6239
|
-
console.error("Invalid index attribute type " + type);
|
|
6239
|
+
console.error("Invalid index attribute type " + type + ".");
|
|
6240
6240
|
}
|
|
6241
6241
|
};
|
|
6242
6242
|
/**
|
|
@@ -6264,7 +6264,7 @@ var normal = new Vector3();
|
|
|
6264
6264
|
// aPos, aNormal, aTangent,
|
|
6265
6265
|
// aUV, aUV2, aJoints, aWeights
|
|
6266
6266
|
// aTargetXXX
|
|
6267
|
-
console.warn("Unknown attribute name: " + name);
|
|
6267
|
+
console.warn("Unknown attribute name: " + name + ".");
|
|
6268
6268
|
}
|
|
6269
6269
|
return name;
|
|
6270
6270
|
};
|
|
@@ -6278,7 +6278,7 @@ var normal = new Vector3();
|
|
|
6278
6278
|
return null;
|
|
6279
6279
|
}
|
|
6280
6280
|
if (index < 0 || index >= textures.length) {
|
|
6281
|
-
console.error("Invalid index for textures: " + index + ", " + textures.length);
|
|
6281
|
+
console.error("Invalid index for textures: " + index + ", " + textures.length + ".");
|
|
6282
6282
|
}
|
|
6283
6283
|
return textures[index];
|
|
6284
6284
|
};
|
|
@@ -6404,7 +6404,7 @@ var normal = new Vector3();
|
|
|
6404
6404
|
if (b) {
|
|
6405
6405
|
resolve(b.arrayBuffer());
|
|
6406
6406
|
} else {
|
|
6407
|
-
reject(new Error("
|
|
6407
|
+
reject(new Error("No canvas blob."));
|
|
6408
6408
|
}
|
|
6409
6409
|
}, "image/png", 1);
|
|
6410
6410
|
})
|
|
@@ -6566,7 +6566,7 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
6566
6566
|
this.offset = (_inAttrib_offset = inAttrib.offset) != null ? _inAttrib_offset : 0;
|
|
6567
6567
|
if (this.offset > 0) {
|
|
6568
6568
|
if (this.offset % this.typeSize !== 0) {
|
|
6569
|
-
console.error("Invalid offset " + this.offset + ", type size " + this.typeSize);
|
|
6569
|
+
console.error("Invalid offset " + this.offset + ", type size " + this.typeSize + ".");
|
|
6570
6570
|
}
|
|
6571
6571
|
this.offset = this.offset / this.typeSize;
|
|
6572
6572
|
}
|
|
@@ -6575,7 +6575,7 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
6575
6575
|
this.stride = (_inAttrib_stride = inAttrib.stride) != null ? _inAttrib_stride : 0;
|
|
6576
6576
|
if (this.stride > 0) {
|
|
6577
6577
|
if (this.stride % this.typeSize !== 0) {
|
|
6578
|
-
console.error("Invalid stride " + this.stride + ", type size " + this.typeSize);
|
|
6578
|
+
console.error("Invalid stride " + this.stride + ", type size " + this.typeSize + ".");
|
|
6579
6579
|
}
|
|
6580
6580
|
this.stride = this.stride / this.typeSize;
|
|
6581
6581
|
} else {
|
|
@@ -7088,7 +7088,7 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7088
7088
|
*/ CheckerHelper.checkTexture = function checkTexture(v) {
|
|
7089
7089
|
if (_instanceof1(v, Texture)) {
|
|
7090
7090
|
if (v.isDestroyed) {
|
|
7091
|
-
console.error("Texture is destroyed, " + v.name);
|
|
7091
|
+
console.error("Texture is destroyed, " + v.name + ".");
|
|
7092
7092
|
}
|
|
7093
7093
|
return !v.isDestroyed;
|
|
7094
7094
|
} else {
|
|
@@ -7165,14 +7165,14 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7165
7165
|
* @param s - 蒙皮参数
|
|
7166
7166
|
*/ CheckerHelper.assertGeometry = function assertGeometry(v, s) {
|
|
7167
7167
|
if (!_instanceof1(v, Geometry)) {
|
|
7168
|
-
console.error("Invalid geometry type " + this.stringify(v));
|
|
7168
|
+
console.error("Invalid geometry type " + this.stringify(v) + ".");
|
|
7169
7169
|
}
|
|
7170
7170
|
// @ts-expect-error
|
|
7171
7171
|
if (v.isDestroyed === true) {
|
|
7172
|
-
console.error("Geometry object is destroyed");
|
|
7172
|
+
console.error("Geometry object is destroyed.");
|
|
7173
7173
|
}
|
|
7174
7174
|
if (!this.checkNonnegative(v.getDrawStart())) {
|
|
7175
|
-
console.error("Invalid geometry draw start: " + v.getDrawStart() + ", " + this.stringify(v));
|
|
7175
|
+
console.error("Invalid geometry draw start: " + v.getDrawStart() + ", " + this.stringify(v) + ".");
|
|
7176
7176
|
}
|
|
7177
7177
|
// // drawCount不再为负
|
|
7178
7178
|
// if (!this.checkPositive(v.getDrawCount())) {
|
|
@@ -7231,7 +7231,7 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7231
7231
|
var attribArray = this.createAttributeArray(v, name);
|
|
7232
7232
|
if (attribArray !== undefined) {
|
|
7233
7233
|
if (attribArray.getLength() < drawCount) {
|
|
7234
|
-
console.error(name + " Length(" + attribArray.getLength() + ") is less than draw count(" + drawCount + "), " + this.stringify(v));
|
|
7234
|
+
console.error(name + " Length(" + attribArray.getLength() + ") is less than draw count(" + drawCount + "), " + this.stringify(v) + ".");
|
|
7235
7235
|
}
|
|
7236
7236
|
}
|
|
7237
7237
|
};
|
|
@@ -7264,24 +7264,24 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7264
7264
|
* @param v - 蒙皮参数
|
|
7265
7265
|
*/ CheckerHelper.assertModelSkinOptions = function assertModelSkinOptions(v) {
|
|
7266
7266
|
if (!this.checkStringUndef(v.name)) {
|
|
7267
|
-
console.error("Invalid skin name " + v.name + ", " + this.stringify(v));
|
|
7267
|
+
console.error("Invalid skin name " + v.name + ", " + this.stringify(v) + ".");
|
|
7268
7268
|
}
|
|
7269
7269
|
if (!this.checkNumberArray(v.joints)) {
|
|
7270
|
-
console.error("Invalid skin joints " + v.joints + ", " + this.stringify(v));
|
|
7270
|
+
console.error("Invalid skin joints " + v.joints + ", " + this.stringify(v) + ".");
|
|
7271
7271
|
}
|
|
7272
7272
|
if (!this.checkNumberUndef(v.skeleton)) {
|
|
7273
|
-
console.error("Invalid skin skeleton " + v.skeleton + ", " + this.stringify(v));
|
|
7273
|
+
console.error("Invalid skin skeleton " + v.skeleton + ", " + this.stringify(v) + ".");
|
|
7274
7274
|
}
|
|
7275
7275
|
if (!this.checkFloat32ArrayUndef(v.inverseBindMatrices)) {
|
|
7276
|
-
console.error("Invalid skin inverseBindMatrices " + v.inverseBindMatrices + ", " + this.stringify(v));
|
|
7276
|
+
console.error("Invalid skin inverseBindMatrices " + v.inverseBindMatrices + ", " + this.stringify(v) + ".");
|
|
7277
7277
|
}
|
|
7278
7278
|
//
|
|
7279
7279
|
if (v.inverseBindMatrices !== undefined) {
|
|
7280
7280
|
if (v.inverseBindMatrices.length <= 0 || v.inverseBindMatrices.length % 16 !== 0) {
|
|
7281
|
-
console.error("Invalid skin inverseBindMatrices length " + v.inverseBindMatrices + ", " + this.stringify(v));
|
|
7281
|
+
console.error("Invalid skin inverseBindMatrices length " + v.inverseBindMatrices + ", " + this.stringify(v) + ".");
|
|
7282
7282
|
}
|
|
7283
7283
|
if (v.joints.length * 16 !== v.inverseBindMatrices.length) {
|
|
7284
|
-
console.error("Mismatch: skin joints and inverseBindMatrices length, " + v.joints + ", " + v.inverseBindMatrices + ", " + this.stringify(v));
|
|
7284
|
+
console.error("Mismatch: skin joints and inverseBindMatrices length, " + v.joints + ", " + v.inverseBindMatrices + ", " + this.stringify(v) + ".");
|
|
7285
7285
|
}
|
|
7286
7286
|
var mat = new Matrix4();
|
|
7287
7287
|
for(var i = 0; i < v.inverseBindMatrices.length; i += 16){
|
|
@@ -7289,12 +7289,12 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7289
7289
|
mat.elements[j] = v.inverseBindMatrices[i + j];
|
|
7290
7290
|
}
|
|
7291
7291
|
if (Math.abs(mat.determinant()) < 1e-5) {
|
|
7292
|
-
console.error("Determinant of inverseBindMatrices is too small " + mat.determinant() + ", index " + i / 16 + ", " + this.stringify(v));
|
|
7292
|
+
console.error("Determinant of inverseBindMatrices is too small " + mat.determinant() + ", index " + i / 16 + ", " + this.stringify(v) + ".");
|
|
7293
7293
|
}
|
|
7294
7294
|
}
|
|
7295
7295
|
} else {
|
|
7296
7296
|
if (v.joints.length <= 0) {
|
|
7297
|
-
console.error("Invalid skin joints length " + v.joints + ", " + this.stringify(v));
|
|
7297
|
+
console.error("Invalid skin joints length " + v.joints + ", " + this.stringify(v) + ".");
|
|
7298
7298
|
}
|
|
7299
7299
|
}
|
|
7300
7300
|
};
|
|
@@ -7304,138 +7304,138 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7304
7304
|
*/ CheckerHelper.assertMatOptions = function assertMatOptions(v) {
|
|
7305
7305
|
if (v.type === spec.MaterialType.unlit) {
|
|
7306
7306
|
if (!this.checkString(v.name)) {
|
|
7307
|
-
console.error("Invalid material name " + v.name + ", " + this.stringify(v));
|
|
7307
|
+
console.error("Invalid material name " + v.name + ", " + this.stringify(v) + ".");
|
|
7308
7308
|
}
|
|
7309
7309
|
//
|
|
7310
7310
|
if (!this.checkNonnegative4(v.baseColorFactor)) {
|
|
7311
|
-
console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v));
|
|
7311
|
+
console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v) + ".");
|
|
7312
7312
|
}
|
|
7313
7313
|
if (!this.checkTextureUndef(v.baseColorTexture)) {
|
|
7314
|
-
console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v));
|
|
7314
|
+
console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v) + ".");
|
|
7315
7315
|
}
|
|
7316
7316
|
if (!this.checkTexTransformUndef(v.baseColorTextureTransform)) {
|
|
7317
|
-
console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v));
|
|
7317
|
+
console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v) + ".");
|
|
7318
7318
|
}
|
|
7319
7319
|
if (!this.checkTexCoord(v.baseColorTextureCoordinate)) {
|
|
7320
|
-
console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v));
|
|
7320
|
+
console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v) + ".");
|
|
7321
7321
|
}
|
|
7322
7322
|
//
|
|
7323
7323
|
if (!this.checkBooleanUndef(v.depthMask)) {
|
|
7324
|
-
console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v));
|
|
7324
|
+
console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v) + ".");
|
|
7325
7325
|
}
|
|
7326
7326
|
if (!this.checkMatBlending(v.blending)) {
|
|
7327
|
-
console.error("Invalid material blending " + v.blending + ", " + this.stringify(v));
|
|
7327
|
+
console.error("Invalid material blending " + v.blending + ", " + this.stringify(v) + ".");
|
|
7328
7328
|
}
|
|
7329
7329
|
if (!this.checkMatSide(v.side)) {
|
|
7330
|
-
console.error("Invalid material side " + v.side + ", " + this.stringify(v));
|
|
7330
|
+
console.error("Invalid material side " + v.side + ", " + this.stringify(v) + ".");
|
|
7331
7331
|
}
|
|
7332
7332
|
if (v.blending === spec.MaterialBlending.masked) {
|
|
7333
7333
|
if (v.alphaCutOff === undefined) {
|
|
7334
|
-
console.error("Material alphaCutOff is required for mask, " + this.stringify(v));
|
|
7334
|
+
console.error("Material alphaCutOff is required for mask, " + this.stringify(v) + ".");
|
|
7335
7335
|
}
|
|
7336
7336
|
}
|
|
7337
7337
|
if (!this.checkNumber01Undef(v.alphaCutOff)) {
|
|
7338
|
-
console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v));
|
|
7338
|
+
console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v) + ".");
|
|
7339
7339
|
}
|
|
7340
7340
|
} else if (v.type === spec.MaterialType.pbr) {
|
|
7341
7341
|
if (!this.checkString(v.name)) {
|
|
7342
|
-
console.error("Invalid material name " + v.name + ", " + this.stringify(v));
|
|
7342
|
+
console.error("Invalid material name " + v.name + ", " + this.stringify(v) + ".");
|
|
7343
7343
|
}
|
|
7344
7344
|
//
|
|
7345
7345
|
if (!this.checkNonnegative4(v.baseColorFactor)) {
|
|
7346
|
-
console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v));
|
|
7346
|
+
console.error("Invalid material baseColorFactor " + v.baseColorFactor + ", " + this.stringify(v) + ".");
|
|
7347
7347
|
}
|
|
7348
7348
|
if (!this.checkTextureUndef(v.baseColorTexture)) {
|
|
7349
|
-
console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v));
|
|
7349
|
+
console.error("Invalid material baseColorTexture " + v.baseColorTexture + ", " + this.stringify(v) + ".");
|
|
7350
7350
|
}
|
|
7351
7351
|
if (!this.checkTexTransformUndef(v.baseColorTextureTransform)) {
|
|
7352
|
-
console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v));
|
|
7352
|
+
console.error("Invalid material baseColorTextureTransform " + v.baseColorTextureTransform + ", " + this.stringify(v) + ".");
|
|
7353
7353
|
}
|
|
7354
7354
|
if (!this.checkTexCoord(v.baseColorTextureCoordinate)) {
|
|
7355
|
-
console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v));
|
|
7355
|
+
console.error("Invalid material baseColorTextureCoordinate " + v.baseColorTextureCoordinate + ", " + this.stringify(v) + ".");
|
|
7356
7356
|
}
|
|
7357
7357
|
//
|
|
7358
7358
|
if (!this.checkBooleanUndef(v.useSpecularAA)) {
|
|
7359
|
-
console.error("Invalid material useSpecularAA " + v.useSpecularAA + ", " + this.stringify(v));
|
|
7359
|
+
console.error("Invalid material useSpecularAA " + v.useSpecularAA + ", " + this.stringify(v) + ".");
|
|
7360
7360
|
}
|
|
7361
7361
|
if (!this.checkNumber01(v.metallicFactor)) {
|
|
7362
|
-
console.error("Invalid material metallicFactor " + v.metallicFactor + ", " + this.stringify(v));
|
|
7362
|
+
console.error("Invalid material metallicFactor " + v.metallicFactor + ", " + this.stringify(v) + ".");
|
|
7363
7363
|
}
|
|
7364
7364
|
if (!this.checkNonnegative(v.roughnessFactor)) {
|
|
7365
|
-
console.error("Invalid material roughnessFactor " + v.roughnessFactor + ", " + this.stringify(v));
|
|
7365
|
+
console.error("Invalid material roughnessFactor " + v.roughnessFactor + ", " + this.stringify(v) + ".");
|
|
7366
7366
|
}
|
|
7367
7367
|
if (!this.checkTextureUndef(v.metallicRoughnessTexture)) {
|
|
7368
|
-
console.error("Invalid material metallicRoughnessTexture " + v.metallicRoughnessTexture + ", " + this.stringify(v));
|
|
7368
|
+
console.error("Invalid material metallicRoughnessTexture " + v.metallicRoughnessTexture + ", " + this.stringify(v) + ".");
|
|
7369
7369
|
}
|
|
7370
7370
|
if (!this.checkTexTransformUndef(v.metallicRoughnessTextureTransform)) {
|
|
7371
|
-
console.error("Invalid material metallicRoughnessTextureTransform " + v.metallicRoughnessTextureTransform + ", " + this.stringify(v));
|
|
7371
|
+
console.error("Invalid material metallicRoughnessTextureTransform " + v.metallicRoughnessTextureTransform + ", " + this.stringify(v) + ".");
|
|
7372
7372
|
}
|
|
7373
7373
|
if (!this.checkTexCoord(v.metallicRoughnessTextureCoordinate)) {
|
|
7374
|
-
console.error("Invalid material metallicRoughnessTextureCoordinate " + v.metallicRoughnessTextureCoordinate + ", " + this.stringify(v));
|
|
7374
|
+
console.error("Invalid material metallicRoughnessTextureCoordinate " + v.metallicRoughnessTextureCoordinate + ", " + this.stringify(v) + ".");
|
|
7375
7375
|
}
|
|
7376
7376
|
//
|
|
7377
7377
|
if (!this.checkTextureUndef(v.normalTexture)) {
|
|
7378
|
-
console.error("Invalid material normalTexture " + v.normalTexture + ", " + this.stringify(v));
|
|
7378
|
+
console.error("Invalid material normalTexture " + v.normalTexture + ", " + this.stringify(v) + ".");
|
|
7379
7379
|
}
|
|
7380
7380
|
if (!this.checkNonnegativeUndef(v.normalTextureScale)) {
|
|
7381
|
-
console.error("Invalid material normalTextureScale " + v.normalTextureScale + ", " + this.stringify(v));
|
|
7381
|
+
console.error("Invalid material normalTextureScale " + v.normalTextureScale + ", " + this.stringify(v) + ".");
|
|
7382
7382
|
}
|
|
7383
7383
|
if (!this.checkTexTransformUndef(v.normalTextureTransform)) {
|
|
7384
|
-
console.error("Invalid material normalTextureTransform " + v.normalTextureTransform + ", " + this.stringify(v));
|
|
7384
|
+
console.error("Invalid material normalTextureTransform " + v.normalTextureTransform + ", " + this.stringify(v) + ".");
|
|
7385
7385
|
}
|
|
7386
7386
|
if (!this.checkTexCoord(v.normalTextureCoordinate)) {
|
|
7387
|
-
console.error("Invalid material normalTextureCoordinate " + v.normalTextureCoordinate + ", " + this.stringify(v));
|
|
7387
|
+
console.error("Invalid material normalTextureCoordinate " + v.normalTextureCoordinate + ", " + this.stringify(v) + ".");
|
|
7388
7388
|
}
|
|
7389
7389
|
//
|
|
7390
7390
|
if (!this.checkTextureUndef(v.occlusionTexture)) {
|
|
7391
|
-
console.error("Invalid material occlusionTexture " + v.occlusionTexture + ", " + this.stringify(v));
|
|
7391
|
+
console.error("Invalid material occlusionTexture " + v.occlusionTexture + ", " + this.stringify(v) + ".");
|
|
7392
7392
|
}
|
|
7393
7393
|
if (!this.checkNumber01Undef(v.occlusionTextureStrength)) {
|
|
7394
|
-
console.error("Invalid material occlusionTextureStrength " + v.occlusionTextureStrength + ", " + this.stringify(v));
|
|
7394
|
+
console.error("Invalid material occlusionTextureStrength " + v.occlusionTextureStrength + ", " + this.stringify(v) + ".");
|
|
7395
7395
|
}
|
|
7396
7396
|
if (!this.checkTexTransformUndef(v.occlusionTextureTransform)) {
|
|
7397
|
-
console.error("Invalid material occlusionTextureTransform " + v.occlusionTextureTransform + ", " + this.stringify(v));
|
|
7397
|
+
console.error("Invalid material occlusionTextureTransform " + v.occlusionTextureTransform + ", " + this.stringify(v) + ".");
|
|
7398
7398
|
}
|
|
7399
7399
|
if (!this.checkTexCoord(v.occlusionTextureCoordinate)) {
|
|
7400
|
-
console.error("Invalid material occlusionTextureCoordinate " + v.occlusionTextureCoordinate + ", " + this.stringify(v));
|
|
7400
|
+
console.error("Invalid material occlusionTextureCoordinate " + v.occlusionTextureCoordinate + ", " + this.stringify(v) + ".");
|
|
7401
7401
|
}
|
|
7402
7402
|
//
|
|
7403
7403
|
//
|
|
7404
7404
|
if (!this.checkNonnegative4(v.emissiveFactor)) {
|
|
7405
|
-
console.error("Invalid material emissiveFactor " + v.emissiveFactor + ", " + this.stringify(v));
|
|
7405
|
+
console.error("Invalid material emissiveFactor " + v.emissiveFactor + ", " + this.stringify(v) + ".");
|
|
7406
7406
|
}
|
|
7407
7407
|
if (!this.checkNonnegative(v.emissiveIntensity)) {
|
|
7408
|
-
console.error("Invalid material emissiveIntensity " + v.emissiveIntensity + ", " + this.stringify(v));
|
|
7408
|
+
console.error("Invalid material emissiveIntensity " + v.emissiveIntensity + ", " + this.stringify(v) + ".");
|
|
7409
7409
|
}
|
|
7410
7410
|
if (!this.checkTextureUndef(v.emissiveTexture)) {
|
|
7411
|
-
console.error("Invalid material emissiveTexture " + v.emissiveTexture + ", " + this.stringify(v));
|
|
7411
|
+
console.error("Invalid material emissiveTexture " + v.emissiveTexture + ", " + this.stringify(v) + ".");
|
|
7412
7412
|
}
|
|
7413
7413
|
if (!this.checkTexTransformUndef(v.emissiveTextureTransform)) {
|
|
7414
|
-
console.error("Invalid material emissiveTextureTransform " + v.emissiveTextureTransform + ", " + this.stringify(v));
|
|
7414
|
+
console.error("Invalid material emissiveTextureTransform " + v.emissiveTextureTransform + ", " + this.stringify(v) + ".");
|
|
7415
7415
|
}
|
|
7416
7416
|
if (!this.checkTexCoord(v.emissiveTextureCoordinate)) {
|
|
7417
|
-
console.error("Invalid material emissiveTextureCoordinate " + v.emissiveTextureCoordinate + ", " + this.stringify(v));
|
|
7417
|
+
console.error("Invalid material emissiveTextureCoordinate " + v.emissiveTextureCoordinate + ", " + this.stringify(v) + ".");
|
|
7418
7418
|
}
|
|
7419
7419
|
//
|
|
7420
7420
|
if (!this.checkBooleanUndef(v.depthMask)) {
|
|
7421
|
-
console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v));
|
|
7421
|
+
console.error("Invalid material depthMask " + v.depthMask + ", " + this.stringify(v) + ".");
|
|
7422
7422
|
}
|
|
7423
7423
|
if (!this.checkMatBlending(v.blending)) {
|
|
7424
|
-
console.error("Invalid material blending " + v.blending + ", " + this.stringify(v));
|
|
7424
|
+
console.error("Invalid material blending " + v.blending + ", " + this.stringify(v) + ".");
|
|
7425
7425
|
}
|
|
7426
7426
|
if (!this.checkMatSide(v.side)) {
|
|
7427
|
-
console.error("Invalid material side " + v.side + ", " + this.stringify(v));
|
|
7427
|
+
console.error("Invalid material side " + v.side + ", " + this.stringify(v) + ".");
|
|
7428
7428
|
}
|
|
7429
7429
|
if (v.blending === spec.MaterialBlending.masked) {
|
|
7430
7430
|
if (v.alphaCutOff === undefined) {
|
|
7431
|
-
console.error("Material alphaCutOff is required for mask, " + this.stringify(v));
|
|
7431
|
+
console.error("Material alphaCutOff is required for mask, " + this.stringify(v) + ".");
|
|
7432
7432
|
}
|
|
7433
7433
|
}
|
|
7434
7434
|
if (!this.checkNumber01Undef(v.alphaCutOff)) {
|
|
7435
|
-
console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v));
|
|
7435
|
+
console.error("Invalid material alphaCutOff " + v.alphaCutOff + ", " + this.stringify(v) + ".");
|
|
7436
7436
|
}
|
|
7437
7437
|
} else {
|
|
7438
|
-
console.error("Invalid material type " + this.stringify(v));
|
|
7438
|
+
console.error("Invalid material type " + this.stringify(v) + ".");
|
|
7439
7439
|
}
|
|
7440
7440
|
};
|
|
7441
7441
|
/**
|
|
@@ -7453,7 +7453,7 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7453
7453
|
* @param v - Model 插件 Mesh 参数
|
|
7454
7454
|
*/ CheckerHelper.assertModelMeshOptions = function assertModelMeshOptions(v) {
|
|
7455
7455
|
if (!this.checkParent(v.parent)) {
|
|
7456
|
-
console.error("Invalid mesh parent " + v.parent + ", " + this.stringify(v));
|
|
7456
|
+
console.error("Invalid mesh parent " + v.parent + ", " + this.stringify(v) + ".");
|
|
7457
7457
|
}
|
|
7458
7458
|
if (v.skin !== undefined) {
|
|
7459
7459
|
this.assertModelSkinOptions(v.skin);
|
|
@@ -7462,7 +7462,7 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7462
7462
|
for(var i = 0; i < v.primitives.length; i++){
|
|
7463
7463
|
var prim = v.primitives[i];
|
|
7464
7464
|
if (!this.assertPrimOptions(prim)) {
|
|
7465
|
-
console.error("Invalid primitive " + prim + ", " + this.stringify(v));
|
|
7465
|
+
console.error("Invalid primitive " + prim + ", " + this.stringify(v) + ".");
|
|
7466
7466
|
}
|
|
7467
7467
|
var morph = new PMorph();
|
|
7468
7468
|
morph.create(prim.geometry);
|
|
@@ -7472,11 +7472,11 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7472
7472
|
var morph0 = morphList[i1 - 1];
|
|
7473
7473
|
var morph1 = morphList[i1];
|
|
7474
7474
|
if (!morph0.equals(morph1)) {
|
|
7475
|
-
console.error("Morph states mismatch: " + this.stringify(morph0) + ", " + this.stringify(morph1) + ", " + this.stringify(v));
|
|
7475
|
+
console.error("Morph states mismatch: " + this.stringify(morph0) + ", " + this.stringify(morph1) + ", " + this.stringify(v) + ".");
|
|
7476
7476
|
}
|
|
7477
7477
|
}
|
|
7478
7478
|
if (!this.checkBooleanUndef(v.hide)) {
|
|
7479
|
-
console.error("Invalid mesh hide " + v.hide + ", " + this.stringify(v));
|
|
7479
|
+
console.error("Invalid mesh hide " + v.hide + ", " + this.stringify(v) + ".");
|
|
7480
7480
|
}
|
|
7481
7481
|
};
|
|
7482
7482
|
/**
|
|
@@ -7484,22 +7484,22 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7484
7484
|
* @param v - Model 插件相机参数
|
|
7485
7485
|
*/ CheckerHelper.assertModelCameraOptions = function assertModelCameraOptions(v) {
|
|
7486
7486
|
if (!this.checkParent(v.parent)) {
|
|
7487
|
-
console.error("Invalid camera parent " + v.parent + ", " + this.stringify(v));
|
|
7487
|
+
console.error("Invalid camera parent " + v.parent + ", " + this.stringify(v) + ".");
|
|
7488
7488
|
}
|
|
7489
7489
|
if (!this.checkNumberUndef(v.aspect)) {
|
|
7490
|
-
console.error("Invalid camera aspect " + v.aspect + ", " + this.stringify(v));
|
|
7490
|
+
console.error("Invalid camera aspect " + v.aspect + ", " + this.stringify(v) + ".");
|
|
7491
7491
|
}
|
|
7492
7492
|
if (!this.checkPositive(v.near)) {
|
|
7493
|
-
console.error("Invalid camera near " + v.near + ", " + this.stringify(v));
|
|
7493
|
+
console.error("Invalid camera near " + v.near + ", " + this.stringify(v) + ".");
|
|
7494
7494
|
}
|
|
7495
7495
|
if (!this.checkPositive(v.far) || v.far <= v.near) {
|
|
7496
|
-
console.error("Invalid camera far " + v.far + ", " + this.stringify(v));
|
|
7496
|
+
console.error("Invalid camera far " + v.far + ", " + this.stringify(v) + ".");
|
|
7497
7497
|
}
|
|
7498
7498
|
if (!this.checkPositive(v.fov)) {
|
|
7499
|
-
console.error("Invalid camera fov " + v.fov + ", " + this.stringify(v));
|
|
7499
|
+
console.error("Invalid camera fov " + v.fov + ", " + this.stringify(v) + ".");
|
|
7500
7500
|
}
|
|
7501
7501
|
if (!this.checkNumber01(v.clipMode)) {
|
|
7502
|
-
console.error("Invalid camera clipMode " + v.clipMode + ", " + this.stringify(v));
|
|
7502
|
+
console.error("Invalid camera clipMode " + v.clipMode + ", " + this.stringify(v) + ".");
|
|
7503
7503
|
}
|
|
7504
7504
|
};
|
|
7505
7505
|
/**
|
|
@@ -7508,58 +7508,58 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7508
7508
|
*/ CheckerHelper.assertModelLightOptions = function assertModelLightOptions(v) {
|
|
7509
7509
|
if (v.lightType === "directional") {
|
|
7510
7510
|
if (!this.checkParent(v.parent)) {
|
|
7511
|
-
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
|
|
7511
|
+
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
|
|
7512
7512
|
}
|
|
7513
7513
|
if (!this.checkNonnegative4(v.color)) {
|
|
7514
|
-
console.error("Invalid light color " + v.color + ", " + this.stringify(v));
|
|
7514
|
+
console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
|
|
7515
7515
|
}
|
|
7516
7516
|
if (!this.checkNonnegative(v.intensity)) {
|
|
7517
|
-
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
|
|
7517
|
+
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
|
|
7518
7518
|
}
|
|
7519
7519
|
} else if (v.lightType === "point") {
|
|
7520
7520
|
if (!this.checkParent(v.parent)) {
|
|
7521
|
-
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
|
|
7521
|
+
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
|
|
7522
7522
|
}
|
|
7523
7523
|
if (!this.checkNonnegative4(v.color)) {
|
|
7524
|
-
console.error("Invalid light color " + v.color + ", " + this.stringify(v));
|
|
7524
|
+
console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
|
|
7525
7525
|
}
|
|
7526
7526
|
if (!this.checkNonnegative(v.intensity)) {
|
|
7527
|
-
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
|
|
7527
|
+
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
|
|
7528
7528
|
}
|
|
7529
7529
|
if (!this.checkNonnegative(v.range)) {
|
|
7530
|
-
console.error("Invalid light range " + v.range + ", " + this.stringify(v));
|
|
7530
|
+
console.error("Invalid light range " + v.range + ", " + this.stringify(v) + ".");
|
|
7531
7531
|
}
|
|
7532
7532
|
} else if (v.lightType === "spot") {
|
|
7533
7533
|
if (!this.checkParent(v.parent)) {
|
|
7534
|
-
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
|
|
7534
|
+
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
|
|
7535
7535
|
}
|
|
7536
7536
|
if (!this.checkNonnegative4(v.color)) {
|
|
7537
|
-
console.error("Invalid light color " + v.color + ", " + this.stringify(v));
|
|
7537
|
+
console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
|
|
7538
7538
|
}
|
|
7539
7539
|
if (!this.checkNonnegative(v.intensity)) {
|
|
7540
|
-
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
|
|
7540
|
+
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
|
|
7541
7541
|
}
|
|
7542
7542
|
if (!this.checkNonnegative(v.range)) {
|
|
7543
|
-
console.error("Invalid light range " + v.range + ", " + this.stringify(v));
|
|
7543
|
+
console.error("Invalid light range " + v.range + ", " + this.stringify(v) + ".");
|
|
7544
7544
|
}
|
|
7545
7545
|
if (!this.checkNonnegative(v.innerConeAngle)) {
|
|
7546
|
-
console.error("Invalid light innerConeAngle " + v.innerConeAngle + ", " + this.stringify(v));
|
|
7546
|
+
console.error("Invalid light innerConeAngle " + v.innerConeAngle + ", " + this.stringify(v) + ".");
|
|
7547
7547
|
}
|
|
7548
7548
|
if (!this.checkNonnegative(v.outerConeAngle)) {
|
|
7549
|
-
console.error("Invalid light outerConeAngle " + v.outerConeAngle + ", " + this.stringify(v));
|
|
7549
|
+
console.error("Invalid light outerConeAngle " + v.outerConeAngle + ", " + this.stringify(v) + ".");
|
|
7550
7550
|
}
|
|
7551
7551
|
} else if (v.lightType === "ambient") {
|
|
7552
7552
|
if (!this.checkParent(v.parent)) {
|
|
7553
|
-
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v));
|
|
7553
|
+
console.error("Invalid light parent " + v.parent + ", " + this.stringify(v) + ".");
|
|
7554
7554
|
}
|
|
7555
7555
|
if (!this.checkNonnegative4(v.color)) {
|
|
7556
|
-
console.error("Invalid light color " + v.color + ", " + this.stringify(v));
|
|
7556
|
+
console.error("Invalid light color " + v.color + ", " + this.stringify(v) + ".");
|
|
7557
7557
|
}
|
|
7558
7558
|
if (!this.checkNonnegative(v.intensity)) {
|
|
7559
|
-
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v));
|
|
7559
|
+
console.error("Invalid light intensity " + v.intensity + ", " + this.stringify(v) + ".");
|
|
7560
7560
|
}
|
|
7561
7561
|
} else {
|
|
7562
|
-
console.error("Invalid light type " + this.stringify(v));
|
|
7562
|
+
console.error("Invalid light type " + this.stringify(v) + ".");
|
|
7563
7563
|
}
|
|
7564
7564
|
};
|
|
7565
7565
|
/**
|
|
@@ -7568,43 +7568,43 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7568
7568
|
*/ CheckerHelper.assertModelSkyboxOptions = function assertModelSkyboxOptions(v) {
|
|
7569
7569
|
var _this = this;
|
|
7570
7570
|
if (!this.checkBoolean(v.renderable)) {
|
|
7571
|
-
console.error("Invalid skybox renderable " + v.renderable + ", " + this.stringify(v));
|
|
7571
|
+
console.error("Invalid skybox renderable " + v.renderable + ", " + this.stringify(v) + ".");
|
|
7572
7572
|
}
|
|
7573
7573
|
if (!this.checkNonnegative(v.intensity)) {
|
|
7574
|
-
console.error("Invalid skybox intensity " + v.intensity + ", " + this.stringify(v));
|
|
7574
|
+
console.error("Invalid skybox intensity " + v.intensity + ", " + this.stringify(v) + ".");
|
|
7575
7575
|
}
|
|
7576
7576
|
if (!this.checkNonnegative(v.reflectionsIntensity)) {
|
|
7577
|
-
console.error("Invalid skybox reflectionsIntensity " + v.reflectionsIntensity + ", " + this.stringify(v));
|
|
7577
|
+
console.error("Invalid skybox reflectionsIntensity " + v.reflectionsIntensity + ", " + this.stringify(v) + ".");
|
|
7578
7578
|
}
|
|
7579
7579
|
//
|
|
7580
7580
|
var c = v.irradianceCoeffs;
|
|
7581
7581
|
if (c !== undefined) {
|
|
7582
7582
|
if (!Array.isArray(c) || c.length != 9) {
|
|
7583
|
-
console.error("Invalid skybox irradianceCoeffs " + c + ", " + this.stringify(v));
|
|
7583
|
+
console.error("Invalid skybox irradianceCoeffs " + c + ", " + this.stringify(v) + ".");
|
|
7584
7584
|
}
|
|
7585
7585
|
c.forEach(function(v) {
|
|
7586
7586
|
if (!_this.checkVec3(v)) {
|
|
7587
|
-
console.error("Invalid skybox irradianceCoeffs " + c + ", " + _this.stringify(v));
|
|
7587
|
+
console.error("Invalid skybox irradianceCoeffs " + c + ", " + _this.stringify(v) + ".");
|
|
7588
7588
|
}
|
|
7589
7589
|
});
|
|
7590
7590
|
} else if (v.diffuseImage !== undefined) {
|
|
7591
7591
|
if (!this.checkTexture(v.diffuseImage)) {
|
|
7592
|
-
console.error("Invalid skybox diffuseImage " + v.diffuseImage + ", " + this.stringify(v));
|
|
7592
|
+
console.error("Invalid skybox diffuseImage " + v.diffuseImage + ", " + this.stringify(v) + ".");
|
|
7593
7593
|
}
|
|
7594
7594
|
} else {
|
|
7595
|
-
console.error("Invalid skybox, irradianceCoeffs or diffuseImage should give one, " + this.stringify(v));
|
|
7595
|
+
console.error("Invalid skybox, irradianceCoeffs or diffuseImage should give one, " + this.stringify(v) + ".");
|
|
7596
7596
|
}
|
|
7597
7597
|
if (!this.checkTexture(v.specularImage)) {
|
|
7598
|
-
console.error("Invalid skybox specularImage " + v.specularImage + ", " + this.stringify(v));
|
|
7598
|
+
console.error("Invalid skybox specularImage " + v.specularImage + ", " + this.stringify(v) + ".");
|
|
7599
7599
|
}
|
|
7600
7600
|
if (!this.checkPositive(v.specularImageSize)) {
|
|
7601
|
-
console.error("Invalid skybox specularImageSize " + v.specularImageSize + ", " + this.stringify(v));
|
|
7601
|
+
console.error("Invalid skybox specularImageSize " + v.specularImageSize + ", " + this.stringify(v) + ".");
|
|
7602
7602
|
}
|
|
7603
7603
|
if (!this.checkPositive(v.specularMipCount)) {
|
|
7604
|
-
console.error("Invalid skybox specularMipCount " + v.specularMipCount + ", " + this.stringify(v));
|
|
7604
|
+
console.error("Invalid skybox specularMipCount " + v.specularMipCount + ", " + this.stringify(v) + ".");
|
|
7605
7605
|
}
|
|
7606
7606
|
if (this.pow2(v.specularMipCount) > v.specularImageSize) {
|
|
7607
|
-
console.error("Invalid skybox specularMipCount or specularImageSize, " + this.stringify(v));
|
|
7607
|
+
console.error("Invalid skybox specularMipCount or specularImageSize, " + this.stringify(v) + ".");
|
|
7608
7608
|
}
|
|
7609
7609
|
};
|
|
7610
7610
|
/**
|
|
@@ -7640,14 +7640,14 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7640
7640
|
*/ CheckerHelper.assertModelAnimOptions = function assertModelAnimOptions(v) {
|
|
7641
7641
|
var _this = this;
|
|
7642
7642
|
if (!this.checkStringUndef(v.name)) {
|
|
7643
|
-
console.error("Invalid animation name " + v.name + ", " + this.stringify(v));
|
|
7643
|
+
console.error("Invalid animation name " + v.name + ", " + this.stringify(v) + ".");
|
|
7644
7644
|
}
|
|
7645
7645
|
if (!Array.isArray(v.tracks)) {
|
|
7646
|
-
console.error("Invalid animation tracks " + v.tracks + ", " + this.stringify(v));
|
|
7646
|
+
console.error("Invalid animation tracks " + v.tracks + ", " + this.stringify(v) + ".");
|
|
7647
7647
|
}
|
|
7648
7648
|
v.tracks.forEach(function(t) {
|
|
7649
7649
|
if (!_this.checkModelAnimTrackOptions(t)) {
|
|
7650
|
-
console.error("Invalid animation track " + t + ", " + _this.stringify(v));
|
|
7650
|
+
console.error("Invalid animation track " + t + ", " + _this.stringify(v) + ".");
|
|
7651
7651
|
}
|
|
7652
7652
|
});
|
|
7653
7653
|
};
|
|
@@ -7657,18 +7657,18 @@ var AttributeArray = /*#__PURE__*/ function() {
|
|
|
7657
7657
|
*/ CheckerHelper.assertTreeOptions = function assertTreeOptions(v) {
|
|
7658
7658
|
var _this = this;
|
|
7659
7659
|
if (!this.checkNumberUndef(v.animation)) {
|
|
7660
|
-
console.error("Invalid tree animation " + v.animation + ", " + this.stringify(v));
|
|
7660
|
+
console.error("Invalid tree animation " + v.animation + ", " + this.stringify(v) + ".");
|
|
7661
7661
|
}
|
|
7662
7662
|
if (v.animations !== undefined) {
|
|
7663
7663
|
if (!Array.isArray(v.animations)) {
|
|
7664
|
-
console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v));
|
|
7664
|
+
console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v) + ".");
|
|
7665
7665
|
}
|
|
7666
7666
|
v.animations.forEach(function(anim) {
|
|
7667
7667
|
_this.assertModelAnimOptions(anim);
|
|
7668
7668
|
});
|
|
7669
7669
|
if (v.animation !== undefined) {
|
|
7670
7670
|
if (v.animation < -1 || v.animation >= v.animations.length) {
|
|
7671
|
-
console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v));
|
|
7671
|
+
console.error("Invalid tree animations " + v.animations + ", " + this.stringify(v) + ".");
|
|
7672
7672
|
}
|
|
7673
7673
|
}
|
|
7674
7674
|
}
|
|
@@ -8793,7 +8793,7 @@ var CullMode;
|
|
|
8793
8793
|
} else {
|
|
8794
8794
|
var coeffs = this.irradianceCoeffs;
|
|
8795
8795
|
if (coeffs === undefined || coeffs.length != 9) {
|
|
8796
|
-
throw new Error("Invalid skybox irradiance coeffs " + coeffs);
|
|
8796
|
+
throw new Error("Invalid skybox irradiance coeffs " + coeffs + ".");
|
|
8797
8797
|
}
|
|
8798
8798
|
var aliasName = [
|
|
8799
8799
|
"l00",
|
|
@@ -8856,11 +8856,11 @@ var PSkyboxType;
|
|
|
8856
8856
|
if (i > 0) {
|
|
8857
8857
|
if (i % 6 === 0) {
|
|
8858
8858
|
if (image.width * 2 !== lastImage.width || image.height * 2 !== lastImage.height) {
|
|
8859
|
-
throw new Error("Invalid cube map list1: index " + i + ", image0 " + lastImage + ", image1 " + image);
|
|
8859
|
+
throw new Error("Invalid cube map list1: index " + i + ", image0 " + lastImage + ", image1 " + image + ".");
|
|
8860
8860
|
}
|
|
8861
8861
|
} else {
|
|
8862
8862
|
if (image.width !== lastImage.width || image.height !== lastImage.height) {
|
|
8863
|
-
throw new Error("Invalid cube map list2: index " + i + ", image0 " + lastImage + ", image1 " + image);
|
|
8863
|
+
throw new Error("Invalid cube map list2: index " + i + ", image0 " + lastImage + ", image1 " + image + ".");
|
|
8864
8864
|
}
|
|
8865
8865
|
}
|
|
8866
8866
|
}
|
|
@@ -9394,7 +9394,7 @@ var PSkyboxType;
|
|
|
9394
9394
|
this.loadSkybox = loadSkybox;
|
|
9395
9395
|
if (this.brdfLutTexture === undefined || this.brdfLutTexture.isDestroyed) {
|
|
9396
9396
|
if (CompositionCache.brdfLutTexOptions === undefined) {
|
|
9397
|
-
throw new Error("Please load brdfLutTexOptions at first");
|
|
9397
|
+
throw new Error("Please load brdfLutTexOptions at first.");
|
|
9398
9398
|
}
|
|
9399
9399
|
//
|
|
9400
9400
|
var brdfLutTextureName = "brdfLutTexture";
|
|
@@ -9803,8 +9803,8 @@ var ModelPluginComponent = /*#__PURE__*/ function(ItemBehaviour) {
|
|
|
9803
9803
|
var newPosition = invWorldMatrix.transformPoint(position);
|
|
9804
9804
|
component.setTransform(newPosition);
|
|
9805
9805
|
// 正式版本不会走到这个流程,只在测试时使用
|
|
9806
|
-
console.info("Scene AABB [" + sceneAABB.min.toArray() + "], [" + sceneAABB.max.toArray() + "]");
|
|
9807
|
-
console.info("Update camera position [" + newPosition.toArray() + "]");
|
|
9806
|
+
console.info("Scene AABB [" + sceneAABB.min.toArray() + "], [" + sceneAABB.max.toArray() + "].");
|
|
9807
|
+
console.info("Update camera position [" + newPosition.toArray() + "].");
|
|
9808
9808
|
}
|
|
9809
9809
|
}
|
|
9810
9810
|
});
|
|
@@ -10154,7 +10154,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
|
|
|
10154
10154
|
// can't find camera item, throw error message
|
|
10155
10155
|
var item = this.getItem();
|
|
10156
10156
|
if (item === undefined) {
|
|
10157
|
-
console.warn("
|
|
10157
|
+
console.warn("[CameraGestureHandlerImp] Unable to locate camera item with ID: " + this.startParams.target + ".");
|
|
10158
10158
|
return this.composition.camera.getOptions();
|
|
10159
10159
|
}
|
|
10160
10160
|
var camera = this.composition.camera;
|
|
@@ -10325,7 +10325,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
|
|
|
10325
10325
|
this.startParams.type = CameraGestureType.none;
|
|
10326
10326
|
var item = this.getItem();
|
|
10327
10327
|
if (item === undefined) {
|
|
10328
|
-
console.warn("
|
|
10328
|
+
console.warn("[CameraGestureHandlerImp] Can't find camera item.");
|
|
10329
10329
|
return;
|
|
10330
10330
|
}
|
|
10331
10331
|
this.setPosition(item, position);
|
|
@@ -10335,7 +10335,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
|
|
|
10335
10335
|
this.startParams.type = CameraGestureType.none;
|
|
10336
10336
|
var item = this.getItem();
|
|
10337
10337
|
if (item === undefined) {
|
|
10338
|
-
console.warn("
|
|
10338
|
+
console.warn("[CameraGestureHandlerImp] Can't find camera item.");
|
|
10339
10339
|
return;
|
|
10340
10340
|
}
|
|
10341
10341
|
this.setQuaternion(item, quat);
|
|
@@ -10345,7 +10345,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
|
|
|
10345
10345
|
this.startParams.type = CameraGestureType.none;
|
|
10346
10346
|
var item = this.getItem();
|
|
10347
10347
|
if (item === undefined) {
|
|
10348
|
-
console.warn("
|
|
10348
|
+
console.warn("[CameraGestureHandlerImp] Can't find camera item.");
|
|
10349
10349
|
return;
|
|
10350
10350
|
}
|
|
10351
10351
|
var newDistance = distance != null ? distance : 5;
|
|
@@ -10402,7 +10402,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
|
|
|
10402
10402
|
this.startParams = args;
|
|
10403
10403
|
this.updateCameraTransform(this.composition.camera.getOptions());
|
|
10404
10404
|
if (!this.getItem()) {
|
|
10405
|
-
console.warn("
|
|
10405
|
+
console.warn("[CameraGestureHandlerImp] Invalid target specified in startGesture.");
|
|
10406
10406
|
}
|
|
10407
10407
|
return this.composition.camera.getOptions();
|
|
10408
10408
|
};
|
|
@@ -10410,7 +10410,7 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
|
|
|
10410
10410
|
if (this.getCurrentType() === arg.type) {
|
|
10411
10411
|
var item = this.getItem();
|
|
10412
10412
|
if (item === undefined) {
|
|
10413
|
-
console.warn("
|
|
10413
|
+
console.warn("[CameraGestureHandlerImp] Can't find camera item.");
|
|
10414
10414
|
return this.composition.camera.getOptions();
|
|
10415
10415
|
}
|
|
10416
10416
|
var _arg_speed;
|
|
@@ -10464,10 +10464,10 @@ var CameraGestureHandlerImp = /*#__PURE__*/ function() {
|
|
|
10464
10464
|
item.transform.setQuaternion(newRotation1.x, newRotation1.y, newRotation1.z, newRotation1.w);
|
|
10465
10465
|
this.setTransform(item, newPosition, item.transform.rotation);
|
|
10466
10466
|
} else {
|
|
10467
|
-
console.warn("not
|
|
10467
|
+
console.warn("[CameraGestureHandlerImp] Movement type not implemented.");
|
|
10468
10468
|
}
|
|
10469
10469
|
} else {
|
|
10470
|
-
console.warn("
|
|
10470
|
+
console.warn("[CameraGestureHandlerImp] Invalid move type specified: " + arg.type);
|
|
10471
10471
|
}
|
|
10472
10472
|
return this.composition.camera.getOptions();
|
|
10473
10473
|
};
|
|
@@ -10736,7 +10736,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
10736
10736
|
var nodeList = scene.nodes.map(function(node, nodeIndex) {
|
|
10737
10737
|
var children = node.children.map(function(child) {
|
|
10738
10738
|
if (child.nodeIndex === undefined) {
|
|
10739
|
-
throw new Error("Undefined nodeIndex for child " + child);
|
|
10739
|
+
throw new Error("Undefined nodeIndex for child " + child + ".");
|
|
10740
10740
|
}
|
|
10741
10741
|
return child.nodeIndex;
|
|
10742
10742
|
});
|
|
@@ -10745,7 +10745,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
10745
10745
|
var scale;
|
|
10746
10746
|
if (node.matrix !== undefined) {
|
|
10747
10747
|
if (node.matrix.length !== 16) {
|
|
10748
|
-
throw new Error("Invalid matrix length " + node.matrix.length + " for node " + node);
|
|
10748
|
+
throw new Error("Invalid matrix length " + node.matrix.length + " for node " + node + ".");
|
|
10749
10749
|
}
|
|
10750
10750
|
var mat = Matrix4.fromArray(node.matrix);
|
|
10751
10751
|
var transform = mat.getTransform();
|
|
@@ -10778,7 +10778,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
10778
10778
|
});
|
|
10779
10779
|
var rootNodes = scene.rootNodes.map(function(root) {
|
|
10780
10780
|
if (root.nodeIndex === undefined) {
|
|
10781
|
-
throw new Error("Undefined nodeIndex for root " + root);
|
|
10781
|
+
throw new Error("Undefined nodeIndex for root " + root + ".");
|
|
10782
10782
|
}
|
|
10783
10783
|
return root.nodeIndex;
|
|
10784
10784
|
});
|
|
@@ -10823,18 +10823,18 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
10823
10823
|
_proto.createTextureCube = function createTextureCube(cubeImages, level0Size) {
|
|
10824
10824
|
var _this = this;
|
|
10825
10825
|
if (cubeImages.length == 0) {
|
|
10826
|
-
throw new Error("createTextureCube: Invalid cubeImages length " + cubeImages);
|
|
10826
|
+
throw new Error("createTextureCube: Invalid cubeImages length " + cubeImages + ".");
|
|
10827
10827
|
}
|
|
10828
10828
|
var mipmaps = [];
|
|
10829
10829
|
cubeImages.forEach(function(cubeImage) {
|
|
10830
10830
|
if (cubeImage.length != 6) {
|
|
10831
|
-
throw new Error("createTextureCube: cubeimage count should always be 6, " + cubeImage);
|
|
10831
|
+
throw new Error("createTextureCube: cubeimage count should always be 6, " + cubeImage + ".");
|
|
10832
10832
|
}
|
|
10833
10833
|
//
|
|
10834
10834
|
var imgList = [];
|
|
10835
10835
|
cubeImage.forEach(function(img) {
|
|
10836
10836
|
if (img.imageData === undefined) {
|
|
10837
|
-
throw new Error("createTextureCube: Invalid image data from " + img);
|
|
10837
|
+
throw new Error("createTextureCube: Invalid image data from " + img + ".");
|
|
10838
10838
|
}
|
|
10839
10839
|
//
|
|
10840
10840
|
imgList.push({
|
|
@@ -10902,7 +10902,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
10902
10902
|
};
|
|
10903
10903
|
_proto.createDefaultSkybox = function createDefaultSkybox(typeName) {
|
|
10904
10904
|
if (typeName !== "NFT" && typeName !== "FARM") {
|
|
10905
|
-
throw new Error("Invalid skybox type
|
|
10905
|
+
throw new Error("Invalid skybox type specified: '" + typeName + "'. Valid types are: 'NFT', 'FARM'.");
|
|
10906
10906
|
}
|
|
10907
10907
|
//
|
|
10908
10908
|
var typ = typeName === "NFT" ? PSkyboxType.NFT : PSkyboxType.FARM;
|
|
@@ -10933,7 +10933,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
10933
10933
|
};
|
|
10934
10934
|
gltfResource = options.gltf.resource;
|
|
10935
10935
|
if (typeof gltfResource === "string" || _instanceof1(gltfResource, Uint8Array)) {
|
|
10936
|
-
throw new Error("Please load resource
|
|
10936
|
+
throw new Error("Please load the resource using GLTFTools first.");
|
|
10937
10937
|
}
|
|
10938
10938
|
_this._gltfScene = gltfResource.scenes[0];
|
|
10939
10939
|
_this._gltfSkins = _this._gltfScene.skins;
|
|
@@ -11144,7 +11144,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
11144
11144
|
var texIndex = texInfo.index;
|
|
11145
11145
|
var tex = this.getTextureManager().getTexture(matIndex, texIndex, isBaseColor);
|
|
11146
11146
|
if (tex === undefined && noWarning !== true) {
|
|
11147
|
-
console.warn("Can't find texture for mat " + matIndex + ", tex " + JSON.stringify(texInfo) + ", basecolor " + isBaseColor);
|
|
11147
|
+
console.warn("Can't find texture for mat " + matIndex + ", tex " + JSON.stringify(texInfo) + ", basecolor " + isBaseColor + ".");
|
|
11148
11148
|
}
|
|
11149
11149
|
return tex;
|
|
11150
11150
|
};
|
|
@@ -11176,7 +11176,7 @@ var LoaderImpl = /*#__PURE__*/ function() {
|
|
|
11176
11176
|
var _this = this;
|
|
11177
11177
|
var meshIndex = node.mesh;
|
|
11178
11178
|
if (meshIndex === undefined) {
|
|
11179
|
-
throw new Error("Invalid mesh index in node " + node);
|
|
11179
|
+
throw new Error("Invalid mesh index in node " + node + ".");
|
|
11180
11180
|
}
|
|
11181
11181
|
var skin;
|
|
11182
11182
|
if (node.skin !== undefined) {
|
|
@@ -11512,7 +11512,7 @@ var GeometryProxy = /*#__PURE__*/ function() {
|
|
|
11512
11512
|
var attrib = this.positionAttrib;
|
|
11513
11513
|
attributes["aPos"] = this._getBufferAttrib(attrib);
|
|
11514
11514
|
} else {
|
|
11515
|
-
throw new Error("Position attribute missing");
|
|
11515
|
+
throw new Error("Position attribute missing.");
|
|
11516
11516
|
}
|
|
11517
11517
|
if (this.hasNormal) {
|
|
11518
11518
|
var attrib1 = this.normalAttrib;
|
|
@@ -12015,15 +12015,15 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12015
12015
|
_proto.processScene = function processScene(sceneData) {
|
|
12016
12016
|
var _this = this;
|
|
12017
12017
|
return _async_to_generator(function() {
|
|
12018
|
-
var sceneJSON, oldScene, binFiles, _iterator, _step, bin, _, newScene;
|
|
12018
|
+
var sceneJSON, _tmp, oldScene, binFiles, _iterator, _step, bin, _, newScene;
|
|
12019
12019
|
return __generator(this, function(_state) {
|
|
12020
12020
|
switch(_state.label){
|
|
12021
12021
|
case 0:
|
|
12022
|
-
if (!
|
|
12022
|
+
if (!isObject(sceneData)) return [
|
|
12023
12023
|
3,
|
|
12024
12024
|
1
|
|
12025
12025
|
];
|
|
12026
|
-
|
|
12026
|
+
_tmp = sceneData;
|
|
12027
12027
|
return [
|
|
12028
12028
|
3,
|
|
12029
12029
|
3
|
|
@@ -12034,9 +12034,10 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12034
12034
|
_this.loadJSON(sceneData)
|
|
12035
12035
|
];
|
|
12036
12036
|
case 2:
|
|
12037
|
-
|
|
12037
|
+
_tmp = _state.sent();
|
|
12038
12038
|
_state.label = 3;
|
|
12039
12039
|
case 3:
|
|
12040
|
+
sceneJSON = _tmp;
|
|
12040
12041
|
// @ts-expect-error
|
|
12041
12042
|
sceneJSON.textures.forEach(function(tex) {
|
|
12042
12043
|
if (tex.source === undefined) {
|
|
@@ -12225,7 +12226,7 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12225
12226
|
newComponents.push(this.createLightComponent(comp, newScene));
|
|
12226
12227
|
} else if (comp.dataType === spec.DataType.CameraComponent) {
|
|
12227
12228
|
newComponents.push(comp);
|
|
12228
|
-
console.warn("
|
|
12229
|
+
console.warn("Camera component found: " + comp + ".");
|
|
12229
12230
|
} else if (comp.dataType === spec.DataType.TreeComponent) {
|
|
12230
12231
|
var treeComp = comp;
|
|
12231
12232
|
this.createItemsFromTreeComponent(comp, newScene, oldScene);
|
|
@@ -12269,7 +12270,7 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12269
12270
|
2,
|
|
12270
12271
|
new Promise(function(resolve, reject) {
|
|
12271
12272
|
_this.downloader.downloadJSON(url, resolve, function(status, responseText) {
|
|
12272
|
-
reject(new Error("
|
|
12273
|
+
reject(new Error("Failed to load JSON from URL '" + url + "': status " + status + " - " + responseText + ". Please check the URL or network settings."));
|
|
12273
12274
|
});
|
|
12274
12275
|
})
|
|
12275
12276
|
];
|
|
@@ -12298,7 +12299,7 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12298
12299
|
_pointer_ = pointer[1], index = _pointer_[0], start = _pointer_[1], length = _pointer_[2];
|
|
12299
12300
|
bin = bins[index];
|
|
12300
12301
|
if (!bin) {
|
|
12301
|
-
throw new Error("
|
|
12302
|
+
throw new Error("Invalid bin pointer: " + JSON.stringify(pointer) + ".");
|
|
12302
12303
|
}
|
|
12303
12304
|
return [
|
|
12304
12305
|
2,
|
|
@@ -12367,7 +12368,7 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12367
12368
|
});
|
|
12368
12369
|
var geometryData = getGeometryDataFromPropsList(geometryPropsList);
|
|
12369
12370
|
if (!geometryData) {
|
|
12370
|
-
throw new Error("
|
|
12371
|
+
throw new Error("No primitives available to process.");
|
|
12371
12372
|
}
|
|
12372
12373
|
newScene.geometries.push(geometryData);
|
|
12373
12374
|
(_newScene_materials = newScene.materials).push.apply(_newScene_materials, [].concat(materialDatas));
|
|
@@ -12394,12 +12395,12 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12394
12395
|
}
|
|
12395
12396
|
}
|
|
12396
12397
|
if (parentItemId === component.item.id) {
|
|
12397
|
-
throw new Error("Can't item " + component.item);
|
|
12398
|
+
throw new Error("Can't item " + component.item + ".");
|
|
12398
12399
|
}
|
|
12399
12400
|
var treeItem = this.treeInfo.getTreeItemByNodeId(parentItemId);
|
|
12400
12401
|
var treeNodeList = this.treeInfo.getTreeNodeListByNodeId(parentItemId);
|
|
12401
12402
|
if (!treeItem || !treeNodeList) {
|
|
12402
|
-
throw new Error("
|
|
12403
|
+
throw new Error("Failed to retrieve tree node list for item with ID " + component.item.id + ". Ensure the item exists and has a valid tree structure.");
|
|
12403
12404
|
}
|
|
12404
12405
|
var rootBoneItem = this.setupBoneData(geometryData, meshOptions.skin, oldScene, treeItem, treeNodeList);
|
|
12405
12406
|
meshComponent.rootBone = {
|
|
@@ -12528,13 +12529,13 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12528
12529
|
var inputArray = typedArrayFromBinary(bins, track.input);
|
|
12529
12530
|
var outputArray = typedArrayFromBinary(bins, track.output);
|
|
12530
12531
|
if (!_instanceof1(inputArray, Float32Array)) {
|
|
12531
|
-
throw new Error("Type of inputArray should be float32, " + inputArray);
|
|
12532
|
+
throw new Error("Type of inputArray should be float32, " + inputArray + ".");
|
|
12532
12533
|
}
|
|
12533
12534
|
if (!_instanceof1(outputArray, Float32Array)) {
|
|
12534
|
-
throw new Error("Type of outputArray should be float32, " + outputArray);
|
|
12535
|
+
throw new Error("Type of outputArray should be float32, " + outputArray + ".");
|
|
12535
12536
|
}
|
|
12536
12537
|
if (track.interpolation !== "LINEAR") {
|
|
12537
|
-
throw new Error("Invalid interpolation type " + track.interpolation);
|
|
12538
|
+
throw new Error("Invalid interpolation type " + track.interpolation + ".");
|
|
12538
12539
|
}
|
|
12539
12540
|
if (track.path === "rotation") {
|
|
12540
12541
|
var points = [];
|
|
@@ -12870,7 +12871,7 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12870
12871
|
var bins = oldScene.bins;
|
|
12871
12872
|
var joints = skin.joints, skeleton = skin.skeleton, inverseBindMatrices = skin.inverseBindMatrices;
|
|
12872
12873
|
if (!inverseBindMatrices) {
|
|
12873
|
-
throw new Error("inverseBindMatrices is undefined " + skin);
|
|
12874
|
+
throw new Error("'inverseBindMatrices' is undefined for the skin configuration: " + JSON.stringify(skin) + ". Ensure 'inverseBindMatrices' is properly defined in your skin data.");
|
|
12874
12875
|
}
|
|
12875
12876
|
var bindMatrixArray = typedArrayFromBinary(bins, inverseBindMatrices);
|
|
12876
12877
|
geom.inverseBindMatrices = Array.from(bindMatrixArray);
|
|
@@ -12879,12 +12880,12 @@ var JSONConverter = /*#__PURE__*/ function() {
|
|
|
12879
12880
|
if (skeleton !== undefined) {
|
|
12880
12881
|
rootBoneItem = treeNodeList[skeleton];
|
|
12881
12882
|
} else {
|
|
12882
|
-
console.warn("Root bone is missing");
|
|
12883
|
+
console.warn("Root bone is missing for the skeleton. Defaulting to the primary tree item as the root bone.");
|
|
12883
12884
|
}
|
|
12884
12885
|
joints.forEach(function(joint) {
|
|
12885
12886
|
var node = treeNodeList[joint];
|
|
12886
12887
|
if (node !== rootBoneItem && node.parentId === rootBoneItem.parentId) {
|
|
12887
|
-
console.error("
|
|
12888
|
+
console.error("Invalid node detected for 'rootBoneItem'. Adjusting 'rootBoneItem' to the primary tree item. Please verify the tree structure.");
|
|
12888
12889
|
rootBoneItem = treeItem;
|
|
12889
12890
|
}
|
|
12890
12891
|
});
|
|
@@ -12922,12 +12923,12 @@ var TreeInfo = /*#__PURE__*/ function() {
|
|
|
12922
12923
|
_proto.add = function add(treeItem, treeNodeList) {
|
|
12923
12924
|
var _this = this;
|
|
12924
12925
|
if (this.tree2NodeList[treeItem.id]) {
|
|
12925
|
-
throw new Error("
|
|
12926
|
+
throw new Error("Duplicate treeItem ID detected: " + treeItem.id + ". Ensure each tree item has a unique ID.");
|
|
12926
12927
|
}
|
|
12927
12928
|
this.tree2NodeList[treeItem.id] = treeNodeList;
|
|
12928
12929
|
treeNodeList.forEach(function(node) {
|
|
12929
12930
|
if (_this.nodeList2Tree[node.id]) {
|
|
12930
|
-
throw new Error("
|
|
12931
|
+
throw new Error("Duplicate tree node ID found: " + node.id + ". Each node in the tree must have a unique ID.");
|
|
12931
12932
|
}
|
|
12932
12933
|
_this.nodeList2Tree[node.id] = treeItem;
|
|
12933
12934
|
_this.nodeId2Node[node.id] = node;
|
|
@@ -12956,7 +12957,7 @@ var TreeInfo = /*#__PURE__*/ function() {
|
|
|
12956
12957
|
_proto.getTreeNodeListByNodeId = function getTreeNodeListByNodeId(id) {
|
|
12957
12958
|
var treeItem = this.nodeList2Tree[id];
|
|
12958
12959
|
if (!treeItem) {
|
|
12959
|
-
throw new Error("Invalid id " + id);
|
|
12960
|
+
throw new Error("Invalid id " + id + ".");
|
|
12960
12961
|
}
|
|
12961
12962
|
return this.getTreeNodeListByTreeId(treeItem.id);
|
|
12962
12963
|
};
|
|
@@ -13170,7 +13171,7 @@ function createGeometryData(props, subMeshes) {
|
|
|
13170
13171
|
var attribData1 = props.attributes[attrib1];
|
|
13171
13172
|
var semantic = vertexBufferSemanticMap[attrib1];
|
|
13172
13173
|
if (!semantic) {
|
|
13173
|
-
throw new Error("Invalid attrib " + attrib1);
|
|
13174
|
+
throw new Error("Invalid attrib " + attrib1 + ".");
|
|
13174
13175
|
}
|
|
13175
13176
|
// @ts-expect-error
|
|
13176
13177
|
vertexCount = attribData1.data.length / attribData1.size;
|
|
@@ -13365,9 +13366,9 @@ var vertexBufferSemanticMap = {
|
|
|
13365
13366
|
|
|
13366
13367
|
registerPlugin("tree", ModelTreePlugin, VFXItem, true);
|
|
13367
13368
|
registerPlugin("model", ModelPlugin, VFXItem);
|
|
13368
|
-
var version = "2.0.0-alpha.
|
|
13369
|
-
logger.info("
|
|
13370
|
-
if (version !== version
|
|
13369
|
+
var version = "2.0.0-alpha.18";
|
|
13370
|
+
logger.info("Plugin model version: " + version + ".");
|
|
13371
|
+
if (version !== EFFECTS.version) {
|
|
13371
13372
|
console.error("注意:请统一 Model 插件与 Player 版本,不统一的版本混用会有不可预知的后果!", "\nAttention: Please ensure the Model plugin is synchronized with the Player version. Mixing and matching incompatible versions may result in unpredictable consequences!");
|
|
13372
13373
|
}
|
|
13373
13374
|
|