aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/Materials/PulseMaterial.js
diff options
context:
space:
mode:
authorhwc4872012-01-27 15:52:36 -0800
committerhwc4872012-01-27 15:52:36 -0800
commit86a801c057fc3b0580d6130be5740c2ee503444f (patch)
tree8b014e981273464afde4e0603cdf70c6e90eee48 /js/helper-classes/RDGE/Materials/PulseMaterial.js
parent302e3eb01037ff550bc93547cb8d5d0a0780b312 (diff)
downloadninja-86a801c057fc3b0580d6130be5740c2ee503444f.tar.gz
updated from old repo
Diffstat (limited to 'js/helper-classes/RDGE/Materials/PulseMaterial.js')
-rw-r--r--js/helper-classes/RDGE/Materials/PulseMaterial.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/js/helper-classes/RDGE/Materials/PulseMaterial.js b/js/helper-classes/RDGE/Materials/PulseMaterial.js
index 5bee818e..3d6107fb 100644
--- a/js/helper-classes/RDGE/Materials/PulseMaterial.js
+++ b/js/helper-classes/RDGE/Materials/PulseMaterial.js
@@ -33,9 +33,11 @@ function PulseMaterial()
33 this.getName = function() { return this._name; } 33 this.getName = function() { return this._name; }
34 this.getShaderName = function() { return this._shaderName; } 34 this.getShaderName = function() { return this._shaderName; }
35 35
36 this.getTextureMap = function() { return this._texMap.slice(0); } 36 this.getTextureMap = function() { return this._propValues[this._propNames[0]] ? this._propValues[this._propNames[0]].slice() : null }
37 this.setTextureMap = function(m) { this._propValues[this._propNames[0]] = m ? m.slice(0) : null; this.updateTexture(); } 37 this.setTextureMap = function(m) { this._propValues[this._propNames[0]] = m ? m.slice(0) : null; this.updateTexture(); }
38 38
39 this.isAnimated = function() { return true; }
40
39 /////////////////////////////////////////////////////////////////////// 41 ///////////////////////////////////////////////////////////////////////
40 // Material Property Accessors 42 // Material Property Accessors
41 /////////////////////////////////////////////////////////////////////// 43 ///////////////////////////////////////////////////////////////////////
@@ -72,6 +74,9 @@ function PulseMaterial()
72 // duplcate method requirde 74 // duplcate method requirde
73 this.dup = function( world ) 75 this.dup = function( world )
74 { 76 {
77 // save the world
78 if (world) this.setWorld( world );
79
75 // allocate a new uber material 80 // allocate a new uber material
76 var newMat = new PulseMaterial(); 81 var newMat = new PulseMaterial();
77 82
@@ -87,6 +92,9 @@ function PulseMaterial()
87 92
88 this.init = function( world ) 93 this.init = function( world )
89 { 94 {
95 // save the world
96 if (world) this.setWorld( world );
97
90 // set up the shader 98 // set up the shader
91 this._shader = new jshader(); 99 this._shader = new jshader();
92 this._shader.def = pulseMaterialDef; 100 this._shader.def = pulseMaterialDef;
@@ -116,7 +124,10 @@ function PulseMaterial()
116 if (renderer && technique) 124 if (renderer && technique)
117 { 125 {
118 var texMapName = this._propValues[this._propNames[0]]; 126 var texMapName = this._propValues[this._propNames[0]];
119 var tex = renderer.getTextureByName(texMapName, 'REPEAT'); 127 var wrap = 'REPEAT', mips = true;
128 //var tex = renderer.getTextureByName(texMapName, wrap, mips );
129 //this.registerTexture( tex );
130 var tex = this.loadTexture( texMapName, wrap, mips );
120 if (tex) 131 if (tex)
121 technique.u_tex0.set( tex ); 132 technique.u_tex0.set( tex );
122 } 133 }