From 86a801c057fc3b0580d6130be5740c2ee503444f Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 27 Jan 2012 15:52:36 -0800 Subject: updated from old repo --- js/helper-classes/RDGE/Materials/PulseMaterial.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'js/helper-classes/RDGE/Materials/PulseMaterial.js') 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() this.getName = function() { return this._name; } this.getShaderName = function() { return this._shaderName; } - this.getTextureMap = function() { return this._texMap.slice(0); } + this.getTextureMap = function() { return this._propValues[this._propNames[0]] ? this._propValues[this._propNames[0]].slice() : null } this.setTextureMap = function(m) { this._propValues[this._propNames[0]] = m ? m.slice(0) : null; this.updateTexture(); } + this.isAnimated = function() { return true; } + /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// @@ -72,6 +74,9 @@ function PulseMaterial() // duplcate method requirde this.dup = function( world ) { + // save the world + if (world) this.setWorld( world ); + // allocate a new uber material var newMat = new PulseMaterial(); @@ -87,6 +92,9 @@ function PulseMaterial() this.init = function( world ) { + // save the world + if (world) this.setWorld( world ); + // set up the shader this._shader = new jshader(); this._shader.def = pulseMaterialDef; @@ -116,7 +124,10 @@ function PulseMaterial() if (renderer && technique) { var texMapName = this._propValues[this._propNames[0]]; - var tex = renderer.getTextureByName(texMapName, 'REPEAT'); + var wrap = 'REPEAT', mips = true; + //var tex = renderer.getTextureByName(texMapName, wrap, mips ); + //this.registerTexture( tex ); + var tex = this.loadTexture( texMapName, wrap, mips ); if (tex) technique.u_tex0.set( tex ); } -- cgit v1.2.3