diff options
author | hwc487 | 2012-03-26 11:31:23 -0700 |
---|---|---|
committer | hwc487 | 2012-03-26 11:31:23 -0700 |
commit | 2f66a9ab38f761b7796800bb37f8146f140db40b (patch) | |
tree | 50010b3fa2f12f811f85ea3dcdb47355e4dcf314 /js/lib/rdge/materials/bump-metal-material.js | |
parent | cca20db1f346fc9bf2ead64c83e479f5f5ebf2d2 (diff) | |
download | ninja-2f66a9ab38f761b7796800bb37f8146f140db40b.tar.gz |
WebGL & Canvas as data for texture maps.
Diffstat (limited to 'js/lib/rdge/materials/bump-metal-material.js')
-rwxr-xr-x | js/lib/rdge/materials/bump-metal-material.js | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 9c9a189a..a3ef9d37 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js | |||
@@ -146,33 +146,10 @@ var BumpMetalMaterial = function BumpMetalMaterial() { | |||
146 | var world = this.getWorld(); | 146 | var world = this.getWorld(); |
147 | var tex = new Texture( world ); | 147 | var tex = new Texture( world ); |
148 | this._diffuseTextureObj = tex; | 148 | this._diffuseTextureObj = tex; |
149 | tex.loadFromCanvas( world.getCanvas() ); | 149 | tex.loadFromCanvas( this._diffuseWorld.getCanvas() ); |
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | this.findWorld = function( id, elt ) | ||
154 | { | ||
155 | if (elt.id && elt.id === id) | ||
156 | { | ||
157 | if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) | ||
158 | { | ||
159 | var world = elt.elementModel.shapeModel.GLWorld; | ||
160 | return world; | ||
161 | } | ||
162 | } | ||
163 | |||
164 | if (elt.children) | ||
165 | { | ||
166 | var nKids = elt.children.length; | ||
167 | for (var i=0; i<nKids; i++) | ||
168 | { | ||
169 | var child = elt.children[i]; | ||
170 | var world = this.findWorld( id, child ); | ||
171 | if (world) return world; | ||
172 | } | ||
173 | } | ||
174 | } | ||
175 | |||
176 | this.updateTexture = function( index ) | 153 | this.updateTexture = function( index ) |
177 | { | 154 | { |
178 | var material = this._materialNode; | 155 | var material = this._materialNode; |