Ver código fonte

Optimising THREE.Path::splineThru

Nicholas Kinsey 14 anos atrás
pai
commit
c36a538104
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      src/extras/core/Path.js

+ 1 - 1
src/extras/core/Path.js

@@ -125,7 +125,7 @@ THREE.Path.prototype.splineThru = function( pts /*Array of Vector*/ ) {
 	var y0 = lastargs[ lastargs.length - 1 ];
 	var y0 = lastargs[ lastargs.length - 1 ];
 //---
 //---
 	var npts = [ new THREE.Vector2( x0, y0 ) ];
 	var npts = [ new THREE.Vector2( x0, y0 ) ];
-	npts =  npts.concat( pts );
+	Array.prototype.push.apply( npts, pts );
 
 
 	var curve = new THREE.SplineCurve( npts );
 	var curve = new THREE.SplineCurve( npts );
 	this.curves.push( curve );
 	this.curves.push( curve );