Browse Source

Updated CircleGeometry and PlaneGeometry.

Mr.doob 11 years ago
parent
commit
4eff8b74bb
2 changed files with 4 additions and 14 deletions
  1. 2 7
      src/extras/geometries/CircleGeometry.js
  2. 2 7
      src/extras/geometries/PlaneGeometry.js

+ 2 - 7
src/extras/geometries/CircleGeometry.js

@@ -5,8 +5,6 @@
 
 THREE.CircleGeometry = function ( radius, segments, thetaStart, thetaLength ) {
 
-	THREE.BufferGeometry.call( this );
-
 	this.parameters = {
 		radius: radius,
 		segments: segments,
@@ -58,13 +56,10 @@ THREE.CircleGeometry = function ( radius, segments, thetaStart, thetaLength ) {
 
 	}
 
-	this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
-	this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
-	this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
-	this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };
+	THREE.IndexedGeometry2.call( this, indices, vertices, normals, uvs );
 
 	this.boundingSphere = new THREE.Sphere( new THREE.Vector3(), radius );
 
 };
 
-THREE.CircleGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
+THREE.CircleGeometry.prototype = Object.create( THREE.IndexedGeometry2.prototype );

+ 2 - 7
src/extras/geometries/PlaneGeometry.js

@@ -5,8 +5,6 @@
 
 THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments ) {
 
-	THREE.BufferGeometry.call( this );
-
 	this.parameters = {
 		width: width,
 		height: height,
@@ -83,11 +81,8 @@ THREE.PlaneGeometry = function ( width, height, widthSegments, heightSegments )
 
 	}
 
-	this.attributes[ 'index' ] = { array: indices, itemSize: 1 };
-	this.attributes[ 'position' ] = { array: vertices, itemSize: 3 };
-	this.attributes[ 'normal' ] = { array: normals, itemSize: 3 };
-	this.attributes[ 'uv' ] = { array: uvs, itemSize: 2 };
+	THREE.IndexedGeometry2.call( this, indices, vertices, normals, uvs );
 
 };
 
-THREE.PlaneGeometry.prototype = Object.create( THREE.BufferGeometry.prototype );
+THREE.PlaneGeometry.prototype = Object.create( THREE.IndexedGeometry2.prototype );