Browse Source

Geometry2: Simpler code. See #4509.

Mr.doob 11 years ago
parent
commit
84aaddc48b
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/core/Geometry2.js

+ 6 - 6
src/core/Geometry2.js

@@ -6,13 +6,13 @@ THREE.Geometry2 = function ( size ) {
 
 
 	THREE.BufferGeometry.call( this );
 	THREE.BufferGeometry.call( this );
 
 
-	this.addAttribute( 'position', new Float32Array( size * 3 ), 3 );
-	this.addAttribute( 'normal', new Float32Array( size * 3 ), 3 );
-	this.addAttribute( 'uv', new Float32Array( size * 2 ), 2 );
+	this.vertices = new Float32Array( size * 3 );
+	this.normals = new Float32Array( size * 3 );
+	this.uvs = new Float32Array( size * 2 );
 
 
-	this.vertices = this.getAttribute( 'position' ).array;
-	this.normals = this.getAttribute( 'normal' ).array;
-	this.uvs = this.getAttribute( 'uv' ).array;
+	this.addAttribute( 'position', this.vertices, 3 );
+	this.addAttribute( 'normal', this.normals, 3 );
+	this.addAttribute( 'uv', this.uvs, 2 );
 
 
 	this.boundingBox = null;
 	this.boundingBox = null;
 	this.boundingSphere = null;
 	this.boundingSphere = null;