diff options
Diffstat (limited to 'js/lib/rdge/materials/uber-material.js')
-rwxr-xr-x | js/lib/rdge/materials/uber-material.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/lib/rdge/materials/uber-material.js b/js/lib/rdge/materials/uber-material.js index 347e45d3..97adf310 100755 --- a/js/lib/rdge/materials/uber-material.js +++ b/js/lib/rdge/materials/uber-material.js | |||
@@ -62,6 +62,23 @@ var UberMaterial = function UberMaterial() { | |||
62 | this._propValues[this._propNames[7]] = this._environmentMapOb['texture']; | 62 | this._propValues[this._propNames[7]] = this._environmentMapOb['texture']; |
63 | this._propValues[this._propNames[8]] = this._environmentMapOb['envReflection']; | 63 | this._propValues[this._propNames[8]] = this._environmentMapOb['envReflection']; |
64 | 64 | ||
65 | this.resetToDefault = function() | ||
66 | { | ||
67 | this._propValues[this._propNames[0]] = this._ambientColor.slice(0); | ||
68 | this._propValues[this._propNames[1]] = this._diffuseColor.slice(0); | ||
69 | this._propValues[this._propNames[2]] = this._specularColor.slice(0); | ||
70 | this._propValues[this._propNames[3]] = this._specularPower; | ||
71 | this._propValues[this._propNames[4]] = this._diffuseMapOb['texture']; | ||
72 | this._propValues[this._propNames[5]] = this._normalMapOb['texture']; | ||
73 | this._propValues[this._propNames[6]] = this._specularMapOb['texture']; | ||
74 | this._propValues[this._propNames[7]] = this._environmentMapOb['texture']; | ||
75 | this._propValues[this._propNames[8]] = this._environmentMapOb['envReflection']; | ||
76 | |||
77 | var nProps = this._propNames.length; | ||
78 | for (var i=0; i<nProps; i++) | ||
79 | this.setProperty( this._propNames[i], this._propValues[this._propNames[i]] ); | ||
80 | }; | ||
81 | |||
65 | this.setProperty = function (prop, value) { | 82 | this.setProperty = function (prop, value) { |
66 | if (prop == "color") prop = "ambientColor"; | 83 | if (prop == "color") prop = "ambientColor"; |
67 | var valid = this.validateProperty(prop, value); | 84 | var valid = this.validateProperty(prop, value); |