@galacean/engine-loader 0.9.0-beta.81 → 0.9.0-beta.82
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 +16 -4
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +16 -4
- package/dist/module.js +16 -4
- package/dist/module.js.map +1 -1
- package/package.json +5 -5
- package/types/GLTFLoader.d.ts +4 -1
package/dist/main.js
CHANGED
|
@@ -1820,6 +1820,8 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
|
|
|
1820
1820
|
var vertexElements = new Array();
|
|
1821
1821
|
var vertexCount;
|
|
1822
1822
|
var bufferBindIndex = 0;
|
|
1823
|
+
var positions;
|
|
1824
|
+
keepMeshData && (positions = new Array(vertexCount));
|
|
1823
1825
|
for(var attribute in attributes){
|
|
1824
1826
|
var accessor = accessors[attributes[attribute]];
|
|
1825
1827
|
var accessorBuffer = GLTFUtil.getAccessorBuffer(context, gltf, accessor);
|
|
@@ -1861,16 +1863,24 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
|
|
|
1861
1863
|
if (accessor.min && accessor.max) {
|
|
1862
1864
|
min.copyFromArray(accessor.min);
|
|
1863
1865
|
max.copyFromArray(accessor.max);
|
|
1866
|
+
if (keepMeshData) {
|
|
1867
|
+
var stride1 = vertices.length / attributeCount;
|
|
1868
|
+
for(var j = 0; j < attributeCount; j++){
|
|
1869
|
+
var offset = j * stride1;
|
|
1870
|
+
positions[j] = new engineMath.Vector3(vertices[offset], vertices[offset + 1], vertices[offset + 2]);
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1864
1873
|
} else {
|
|
1865
1874
|
var position = MeshParser._tempVector3;
|
|
1866
1875
|
min.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
|
|
1867
1876
|
max.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
|
|
1868
|
-
var
|
|
1869
|
-
for(var
|
|
1870
|
-
var
|
|
1871
|
-
position.copyFromArray(vertices,
|
|
1877
|
+
var stride2 = vertices.length / attributeCount;
|
|
1878
|
+
for(var j1 = 0; j1 < attributeCount; j1++){
|
|
1879
|
+
var offset1 = j1 * stride2;
|
|
1880
|
+
position.copyFromArray(vertices, offset1);
|
|
1872
1881
|
engineMath.Vector3.min(min, position, min);
|
|
1873
1882
|
engineMath.Vector3.max(max, position, max);
|
|
1883
|
+
keepMeshData && (positions[j1] = position.clone());
|
|
1874
1884
|
}
|
|
1875
1885
|
}
|
|
1876
1886
|
if (accessor.normalized) {
|
|
@@ -1893,6 +1903,8 @@ var MeshParser = /*#__PURE__*/ function(Parser1) {
|
|
|
1893
1903
|
// BlendShapes
|
|
1894
1904
|
targets && this._createBlendShape(mesh, gltfMesh, targets, getBlendShapeData);
|
|
1895
1905
|
mesh.uploadData(!keepMeshData);
|
|
1906
|
+
//@ts-ignore
|
|
1907
|
+
mesh._positions = positions;
|
|
1896
1908
|
return Promise.resolve(mesh);
|
|
1897
1909
|
};
|
|
1898
1910
|
_proto._createBlendShape = function _createBlendShape(mesh, glTFMesh, glTFTargets, getBlendShapeData) {
|