Browse Source

Fixed broken syntax for new material triplet.

alteredq 14 years ago
parent
commit
25d8237283

+ 3 - 3
src/materials/MeshBasicMaterial.js

@@ -13,7 +13,7 @@
 
 THREE.MeshBasicMaterial = function ( params ) {
 
-    this.id = THREE.MeshBasicMaterial.value ++;
+    this.id = THREE.MeshBasicMaterialCounter.value ++;
     
     this.params = this.setDefaultParams( params );
 
@@ -29,7 +29,7 @@ THREE.MeshBasicMaterial = function ( params ) {
 
 };
 
-THREE.MeshBasicMaterial.setDefaultParams = function ( override ) {
+THREE.MeshBasicMaterial.prototype.setDefaultParams = function ( override ) {
     
     var params = {
         color: new THREE.Color( 0xeeeeee ),
@@ -54,4 +54,4 @@ THREE.MeshBasicMaterial.setDefaultParams = function ( override ) {
     
 };
 
-THREE.MeshBasicMaterial = { value: 0 };
+THREE.MeshBasicMaterialCounter = { value: 0 };

+ 3 - 3
src/materials/MeshLambertMaterial.js

@@ -14,7 +14,7 @@
 
 THREE.MeshLambertMaterial = function ( params ) {
 
-	this.id = THREE.MeshLambertMaterial.value ++;
+	this.id = THREE.MeshLambertMaterialCounter.value ++;
 	
 	this.params = this.setDefaultParams( params );
 	
@@ -31,7 +31,7 @@ THREE.MeshLambertMaterial = function ( params ) {
 
 };
 
-THREE.MeshLambertMaterial.setDefaultParams = function ( override ) {
+THREE.MeshLambertMaterial.prototype.setDefaultParams = function ( override ) {
 	
 	var params = {
 		diffuse: new THREE.Color( 0xeeeeee ),
@@ -58,4 +58,4 @@ THREE.MeshLambertMaterial.setDefaultParams = function ( override ) {
 	
 };
 
-THREE.MeshLambertMaterial = { value: 0 };
+THREE.MeshLambertMaterialCounter = { value: 0 };

+ 4 - 4
src/materials/MeshPhongMaterial.js

@@ -18,7 +18,7 @@
 
 THREE.MeshPhongMaterial = function ( ambient, diffuse, specular, shininess, opacity ) {
 
-	this.id = THREE.MeshPhongMaterial.value ++;
+	this.id = THREE.MeshPhongMaterialCounter.value ++;
 	
 	this.params = this.setDefaultParams( params );
 	
@@ -31,14 +31,14 @@ THREE.MeshPhongMaterial = function ( ambient, diffuse, specular, shininess, opac
 				+ ', <br/>alpha: ' + this.params.alpha
 				+ ', <br/>shading: ' + this.params.shading
 				+ ', <br/>wireframe: ' + this.params.wireframe
-				+ ', <br/>id: ' + this.params.id        
+				+ ', <br/>id: ' + this.id        
 				+ ')';
 
 	};
 
 };
 
-THREE.MeshPhongMaterial.setDefaultParams = function ( override ) {
+THREE.MeshPhongMaterial.prototype.setDefaultParams = function ( override ) {
 	
 	var params = {
 		ambient: new THREE.Color( 0x050505 ),
@@ -75,4 +75,4 @@ THREE.MeshPhongMaterial.setDefaultParams = function ( override ) {
 	
 };
 
-THREE.MeshPhongMaterial = { value: 0 };
+THREE.MeshPhongMaterialCounter = { value: 0 };