|
@@ -27331,7 +27331,8 @@ var BABYLON;
|
|
|
* Merges the passed VertexData into the current one.
|
|
|
* Returns the modified VertexData.
|
|
|
*/
|
|
|
- VertexData.prototype.merge = function (other) {
|
|
|
+ VertexData.prototype.merge = function (other, options) {
|
|
|
+ options = options || {};
|
|
|
if (other.indices) {
|
|
|
if (!this.indices) {
|
|
|
this.indices = [];
|
|
@@ -27345,7 +27346,7 @@ var BABYLON;
|
|
|
this.positions = this._mergeElement(this.positions, other.positions);
|
|
|
var count = this.positions.length / 3;
|
|
|
this.normals = this._mergeElement(this.normals, other.normals, count * 3);
|
|
|
- this.tangents = this._mergeElement(this.tangents, other.tangents, count * 4);
|
|
|
+ this.tangents = this._mergeElement(this.tangents, other.tangents, count * (options.tangentLength || 4));
|
|
|
this.uvs = this._mergeElement(this.uvs, other.uvs, count * 2);
|
|
|
this.uvs2 = this._mergeElement(this.uvs2, other.uvs2, count * 2);
|
|
|
this.uvs3 = this._mergeElement(this.uvs3, other.uvs3, count * 2);
|
|
@@ -76582,7 +76583,7 @@ var BABYLON;
|
|
|
var vertexData = new BABYLON.VertexData();
|
|
|
for (var _i = 0, _a = mesh.primitives; _i < _a.length; _i++) {
|
|
|
var primitive = _a[_i];
|
|
|
- vertexData.merge(primitive.targetsVertexData[index]);
|
|
|
+ vertexData.merge(primitive.targetsVertexData[index], { tangentLength: 3 });
|
|
|
}
|
|
|
var target = morphTargetManager.getTarget(index);
|
|
|
target.setNormals(vertexData.normals);
|