aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/Materials/PulseMaterial.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-02-02 11:28:45 -0800
committerPushkar Joshi2012-02-02 11:28:45 -0800
commitacc500d1f1c76f4e7c93ae1cfea8d925ca95e7b9 (patch)
tree877f8ca734228c11050b037ce82fc0d1e1303193 /js/helper-classes/RDGE/Materials/PulseMaterial.js
parent4d4de64472603426a73b26cc98ba8206190949b8 (diff)
parent4222db97e353fb65fab787ba5927d16d9fa4e1f7 (diff)
downloadninja-acc500d1f1c76f4e7c93ae1cfea8d925ca95e7b9.tar.gz
Merge branch 'working' of c:/Code/github/emueller/ninja-internal/ into pentool
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 }