From 22cbc9644b79df60b3f6336f9563debd47fb3ea1 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 28 Jun 2012 11:44:15 -0700 Subject: Added capability to split a mesh into multiiple parts to avoid buffer overflow situations. --- js/lib/rdge/materials/uber-material.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'js/lib/rdge/materials/uber-material.js') 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() { this._propValues[this._propNames[7]] = this._environmentMapOb['texture']; this._propValues[this._propNames[8]] = this._environmentMapOb['envReflection']; + this.resetToDefault = function() + { + this._propValues[this._propNames[0]] = this._ambientColor.slice(0); + this._propValues[this._propNames[1]] = this._diffuseColor.slice(0); + this._propValues[this._propNames[2]] = this._specularColor.slice(0); + this._propValues[this._propNames[3]] = this._specularPower; + this._propValues[this._propNames[4]] = this._diffuseMapOb['texture']; + this._propValues[this._propNames[5]] = this._normalMapOb['texture']; + this._propValues[this._propNames[6]] = this._specularMapOb['texture']; + this._propValues[this._propNames[7]] = this._environmentMapOb['texture']; + this._propValues[this._propNames[8]] = this._environmentMapOb['envReflection']; + + var nProps = this._propNames.length; + for (var i=0; i