|
@@ -294,7 +294,9 @@
|
|
* Merges the passed VertexData into the current one.
|
|
* Merges the passed VertexData into the current one.
|
|
* Returns the modified VertexData.
|
|
* Returns the modified VertexData.
|
|
*/
|
|
*/
|
|
- public merge(other: VertexData): VertexData {
|
|
|
|
|
|
+ public merge(other: VertexData, options?: { tangentLength?: number }): VertexData {
|
|
|
|
+ options = options || {};
|
|
|
|
+
|
|
if (other.indices) {
|
|
if (other.indices) {
|
|
if (!this.indices) {
|
|
if (!this.indices) {
|
|
this.indices = [];
|
|
this.indices = [];
|
|
@@ -312,7 +314,7 @@
|
|
var count = this.positions.length / 3;
|
|
var count = this.positions.length / 3;
|
|
|
|
|
|
this.normals = this._mergeElement(this.normals, other.normals, count * 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.uvs = this._mergeElement(this.uvs, other.uvs, count * 2);
|
|
this.uvs2 = this._mergeElement(this.uvs2, other.uvs2, count * 2);
|
|
this.uvs2 = this._mergeElement(this.uvs2, other.uvs2, count * 2);
|
|
this.uvs3 = this._mergeElement(this.uvs3, other.uvs3, count * 2);
|
|
this.uvs3 = this._mergeElement(this.uvs3, other.uvs3, count * 2);
|