Permalink
Browse files

add material.clone

  • Loading branch information...
gero3 committed Aug 6, 2012
1 parent 43daa51 commit 4b962fa473f6ef7f2de90db660562f03bf38497d
@@ -4,6 +4,7 @@
THREE.Color = function ( hex ) {
if ( hex instanceof THREE.Color ) return this.clone();
if ( hex !== undefined ) this.setHex( hex );
return this;
@@ -38,3 +38,10 @@ THREE.LineBasicMaterial = function ( parameters ) {
};
THREE.LineBasicMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.LineBasicMaterial.prototype.clone = function(){
var returnValue = new THREE.LineBasicMaterial(this);
return returnValue;
};
@@ -39,4 +39,9 @@ THREE.Material = function ( parameters ) {
}
THREE.Material.prototype.clone = function(){
var returnValue = new THREE.Material(this);
return returnValue;
};
THREE.MaterialCount = 0;
@@ -66,3 +66,9 @@ THREE.MeshBasicMaterial = function ( parameters ) {
};
THREE.MeshBasicMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.MeshBasicMaterial.prototype.clone = function(){
var returnValue = new THREE.MeshBasicMaterial(this);
return returnValue;
};
@@ -27,3 +27,8 @@ THREE.MeshDepthMaterial = function ( parameters ) {
};
THREE.MeshDepthMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.MeshDepthMaterial.prototype.clone = function(){
var returnValue = new THREE.MeshDepthMaterial(this);
return returnValue;
};
@@ -7,3 +7,10 @@ THREE.MeshFaceMaterial = function ( parameters ) {
THREE.Material.call( this, parameters );
};
THREE.MeshFaceMaterial.prototype.clone = function(){
var returnValue = new THREE.MeshFaceMaterial(this);
return returnValue;
};
@@ -76,3 +76,9 @@ THREE.MeshLambertMaterial = function ( parameters ) {
};
THREE.MeshLambertMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.MeshLambertMaterial.prototype.clone = function(){
var returnValue = new THREE.MeshLambertMaterial(this);
returnValue.wrapRGB = this.wrapRGB.clone();
return returnValue;
};
@@ -27,3 +27,9 @@ THREE.MeshNormalMaterial = function ( parameters ) {
};
THREE.MeshNormalMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.MeshNormalMaterial.prototype.clone = function(){
var returnValue = new THREE.MeshNormalMaterial(this);
return returnValue;
};
@@ -83,3 +83,10 @@ THREE.MeshPhongMaterial = function ( parameters ) {
};
THREE.MeshPhongMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.MeshPhongMaterial.prototype.clone = function(){
var returnValue = new THREE.MeshPhongMaterial(this);
returnValue.wrapRGB = this.wrapRGB.clone();
return returnValue;
};
@@ -38,3 +38,8 @@ THREE.ParticleBasicMaterial = function ( parameters ) {
};
THREE.ParticleBasicMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.ParticleBasicMaterial.prototype.clone = function(){
var returnValue = new THREE.ParticleBasicMaterial(this);
return returnValue;
};
@@ -21,3 +21,8 @@ THREE.ParticleCanvasMaterial = function ( parameters ) {
};
THREE.ParticleCanvasMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.ParticleCanvasMaterial.prototype.clone = function(){
var returnValue = new THREE.ParticleCanvasMaterial(this);
return returnValue;
};
@@ -9,3 +9,9 @@ THREE.ParticleDOMMaterial = function ( domElement ) {
this.domElement = domElement;
};
THREE.ParticleDOMMaterial.prototype.clone = function(){
var returnValue = new THREE.ParticleDOMMaterial(this);
return returnValue;
};
@@ -56,3 +56,9 @@ THREE.ShaderMaterial = function ( parameters ) {
};
THREE.ShaderMaterial.prototype = Object.create( THREE.Material.prototype );
THREE.ShaderMaterial.prototype.clone = function(){
var returnValue = new THREE.ShaderMaterial(this);
return returnValue;
};

0 comments on commit 4b962fa

Please sign in to comment.