Browse Source

Clean up.

Mr.doob 9 years ago
parent
commit
574e06f4be
2 changed files with 8 additions and 6 deletions
  1. 7 5
      src/core/BufferGeometry.js
  2. 1 1
      src/core/Geometry.js

+ 7 - 5
src/core/BufferGeometry.js

@@ -353,9 +353,11 @@ Object.assign( THREE.BufferGeometry.prototype, THREE.EventDispatcher.prototype,
 
 		}
 
+		var attribute;
+
 		if ( geometry.verticesNeedUpdate === true ) {
 
-			var attribute = this.attributes.position;
+			attribute = this.attributes.position;
 
 			if ( attribute !== undefined ) {
 
@@ -370,7 +372,7 @@ Object.assign( THREE.BufferGeometry.prototype, THREE.EventDispatcher.prototype,
 
 		if ( geometry.normalsNeedUpdate === true ) {
 
-			var attribute = this.attributes.normal;
+			attribute = this.attributes.normal;
 
 			if ( attribute !== undefined ) {
 
@@ -385,7 +387,7 @@ Object.assign( THREE.BufferGeometry.prototype, THREE.EventDispatcher.prototype,
 
 		if ( geometry.colorsNeedUpdate === true ) {
 
-			var attribute = this.attributes.color;
+			attribute = this.attributes.color;
 
 			if ( attribute !== undefined ) {
 
@@ -400,7 +402,7 @@ Object.assign( THREE.BufferGeometry.prototype, THREE.EventDispatcher.prototype,
 
 		if ( geometry.uvsNeedUpdate ) {
 
-			var attribute = this.attributes.uv;
+			attribute = this.attributes.uv;
 
 			if ( attribute !== undefined ) {
 
@@ -415,7 +417,7 @@ Object.assign( THREE.BufferGeometry.prototype, THREE.EventDispatcher.prototype,
 
 		if ( geometry.lineDistancesNeedUpdate ) {
 
-			var attribute = this.attributes.lineDistance;
+			attribute = this.attributes.lineDistance;
 
 			if ( attribute !== undefined ) {
 

+ 1 - 1
src/core/Geometry.js

@@ -34,8 +34,8 @@ THREE.Geometry = function () {
 
 	// update flags
 
-	this.verticesNeedUpdate = false;
 	this.elementsNeedUpdate = false;
+	this.verticesNeedUpdate = false;
 	this.uvsNeedUpdate = false;
 	this.normalsNeedUpdate = false;
 	this.colorsNeedUpdate = false;