@galacean/engine-loader 2.0.0-alpha.34 → 2.0.0-alpha.35
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 +5 -25
- package/dist/main.js.map +1 -1
- package/dist/module.js +6 -26
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/gltf/parser/GLTFSceneParser.d.ts +1 -1
package/dist/main.js
CHANGED
|
@@ -4974,35 +4974,15 @@ exports.GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4974
4974
|
if (rootBoneIndex !== -1) {
|
|
4975
4975
|
engineMath.BoundingBox.transform(mesh.bounds, inverseBindMatrices[rootBoneIndex], skinnedMeshRenderer.localBounds);
|
|
4976
4976
|
} else {
|
|
4977
|
-
//
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
if (subRootBoneCount !== 0) {
|
|
4982
|
-
engineMath.Matrix.multiplyScalar(approximateBindMatrix, 1.0 / subRootBoneCount, approximateBindMatrix);
|
|
4983
|
-
engineMath.BoundingBox.transform(mesh.bounds, approximateBindMatrix, skinnedMeshRenderer.localBounds);
|
|
4984
|
-
} else {
|
|
4985
|
-
skinnedMeshRenderer.localBounds.copyFrom(mesh.bounds);
|
|
4986
|
-
}
|
|
4987
|
-
}
|
|
4988
|
-
};
|
|
4989
|
-
_proto._computeApproximateBindMatrix = function _computeApproximateBindMatrix(jointEntities, inverseBindMatrices, rootEntity, approximateBindMatrix) {
|
|
4990
|
-
var subRootBoneCount = 0;
|
|
4991
|
-
var children = rootEntity.children;
|
|
4992
|
-
for(var i = 0, n = children.length; i < n; i++){
|
|
4993
|
-
var rootChild = children[i];
|
|
4994
|
-
var index = jointEntities.indexOf(rootChild);
|
|
4995
|
-
if (index !== -1) {
|
|
4996
|
-
engineMath.Matrix.add(approximateBindMatrix, inverseBindMatrices[index], approximateBindMatrix);
|
|
4997
|
-
subRootBoneCount++;
|
|
4998
|
-
} else {
|
|
4999
|
-
subRootBoneCount += this._computeApproximateBindMatrix(jointEntities, inverseBindMatrices, rootChild, approximateBindMatrix);
|
|
5000
|
-
}
|
|
4977
|
+
// rootBone can be outside skin.joints, so it has no inverse bind matrix
|
|
4978
|
+
var inverseRootBoneWorld = GLTFSceneParser._tempMatrix;
|
|
4979
|
+
engineMath.Matrix.invert(rootBone.transform.worldMatrix, inverseRootBoneWorld);
|
|
4980
|
+
engineMath.BoundingBox.transform(mesh.bounds, inverseRootBoneWorld, skinnedMeshRenderer.localBounds);
|
|
5001
4981
|
}
|
|
5002
|
-
return subRootBoneCount;
|
|
5003
4982
|
};
|
|
5004
4983
|
return GLTFSceneParser;
|
|
5005
4984
|
}(GLTFParser);
|
|
4985
|
+
exports.GLTFSceneParser._tempMatrix = new engineMath.Matrix();
|
|
5006
4986
|
exports.GLTFSceneParser = __decorate([
|
|
5007
4987
|
registerGLTFParser(GLTFParserType.Scene)
|
|
5008
4988
|
], exports.GLTFSceneParser);
|