From facf7ff0397e71a80d7b0303df2cf3a5bea20f70 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Fri, 12 Nov 2010 04:37:36 +0000 Subject: [PATCH] * Starting the materials refactoring (testing branching too) --- src/materials/LineBasicMaterial.js | 24 +++++++++++++++++++ src/materials/LineColorMaterial.js | 20 ---------------- ...orFillMaterial.js => MeshBasicMaterial.js} | 0 src/materials/MeshBitmapMaterial.js | 21 ---------------- src/materials/MeshColorStrokeMaterial.js | 17 ------------- src/materials/MeshLambertMaterial.js | 15 ++++++++++++ ...apMaterial.js => ParticleBasicMaterial.js} | 0 7 files changed, 39 insertions(+), 58 deletions(-) create mode 100644 src/materials/LineBasicMaterial.js delete mode 100644 src/materials/LineColorMaterial.js rename src/materials/{MeshColorFillMaterial.js => MeshBasicMaterial.js} (100%) delete mode 100644 src/materials/MeshBitmapMaterial.js delete mode 100644 src/materials/MeshColorStrokeMaterial.js create mode 100644 src/materials/MeshLambertMaterial.js rename src/materials/{ParticleBitmapMaterial.js => ParticleBasicMaterial.js} (100%) diff --git a/src/materials/LineBasicMaterial.js b/src/materials/LineBasicMaterial.js new file mode 100644 index 00000000..1e301891 --- /dev/null +++ b/src/materials/LineBasicMaterial.js @@ -0,0 +1,24 @@ +/** + * @author mr.doob / http://mrdoob.com/ + * + * params = { + * color: new THREE.Color(), + * line_width: [ 0 - 100 ] + * } + */ + +THREE.LineColorMaterial = function ( params ) { + + this.params = params; + +}; + +THREE.LineColorMaterial.prototype = { + + toString: function () { + + return 'THREE.LineColorMaterial ( params: ' + this.params + ' )'; + + } + +}; diff --git a/src/materials/LineColorMaterial.js b/src/materials/LineColorMaterial.js deleted file mode 100644 index 617cdbaa..00000000 --- a/src/materials/LineColorMaterial.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.LineColorMaterial = function ( hex, opacity, lineWidth ) { - - this.lineWidth = lineWidth || 1; - this.color = new THREE.Color( ( opacity !== undefined ? opacity : 1 ) * 0xff << 24 ^ hex ); - -}; - -THREE.LineColorMaterial.prototype = { - - toString: function () { - - return 'THREE.LineColorMaterial ( color: ' + this.color + ', lineWidth: ' + this.lineWidth + ' )'; - - } - -}; diff --git a/src/materials/MeshColorFillMaterial.js b/src/materials/MeshBasicMaterial.js similarity index 100% rename from src/materials/MeshColorFillMaterial.js rename to src/materials/MeshBasicMaterial.js diff --git a/src/materials/MeshBitmapMaterial.js b/src/materials/MeshBitmapMaterial.js deleted file mode 100644 index d811281f..00000000 --- a/src/materials/MeshBitmapMaterial.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.MeshBitmapMaterial = function ( bitmap, mode ) { - - this.id = THREE.MeshBitmapMaterialCounter.value ++; - - this.bitmap = bitmap; - this.mode = mode || THREE.MeshBitmapMaterialMode.UVMAPPING; - - this.toString = function () { - - return 'THREE.MeshBitmapMaterial ( bitmap: ' + this.bitmap + ', mode: ' + this.mode + ', id: ' + this.id + ' )'; - - }; - -}; - -THREE.MeshBitmapMaterialCounter = { value: 0 }; -THREE.MeshBitmapMaterialMode = { UVMAPPING: 0 }; diff --git a/src/materials/MeshColorStrokeMaterial.js b/src/materials/MeshColorStrokeMaterial.js deleted file mode 100644 index 8628baf5..00000000 --- a/src/materials/MeshColorStrokeMaterial.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.MeshColorStrokeMaterial = function ( hex, opacity, lineWidth ) { - - this.lineWidth = lineWidth || 1; - - this.color = new THREE.Color( ( opacity !== undefined ? opacity : 1 ) * 0xff << 24 ^ hex ); - - this.toString = function () { - - return 'THREE.MeshColorStrokeMaterial ( lineWidth: ' + this.lineWidth + ', color: ' + this.color + ' )'; - - }; - -}; diff --git a/src/materials/MeshLambertMaterial.js b/src/materials/MeshLambertMaterial.js new file mode 100644 index 00000000..d58211a5 --- /dev/null +++ b/src/materials/MeshLambertMaterial.js @@ -0,0 +1,15 @@ +/** + * @author mr.doob / http://mrdoob.com/ + */ + +THREE.MeshColorFillMaterial = function ( hex, opacity ) { + + this.color = new THREE.Color( ( opacity !== undefined ? opacity : 1 ) * 0xff << 24 ^ hex ); + + this.toString = function () { + + return 'THREE.MeshColorFillMaterial ( color: ' + this.color + ' )'; + + }; + +}; diff --git a/src/materials/ParticleBitmapMaterial.js b/src/materials/ParticleBasicMaterial.js similarity index 100% rename from src/materials/ParticleBitmapMaterial.js rename to src/materials/ParticleBasicMaterial.js