Parcourir la source

make Geometry.mergeVertices 2x faster.

Ben Houston il y a 12 ans
Parent
commit
f96b8b94df
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/core/Geometry.js

+ 1 - 1
src/core/Geometry.js

@@ -620,7 +620,7 @@ THREE.Geometry.prototype = {
 		for ( i = 0, il = this.vertices.length; i < il; i ++ ) {
 
 			v = this.vertices[ i ];
-			key = [ Math.round( v.x * precision ), Math.round( v.y * precision ), Math.round( v.z * precision ) ].join( '_' );
+			key = (( v.x * precision ) | 0 ) + '_' + (( v.y * precision ) | 0 ) + '_' + (( v.z * precision ) | 0 );
 
 			if ( verticesMap[ key ] === undefined ) {