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/taper-material.js | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'js/lib/rdge/materials/taper-material.js') diff --git a/js/lib/rdge/materials/taper-material.js b/js/lib/rdge/materials/taper-material.js index f6aa782c..595f5064 100644 --- a/js/lib/rdge/materials/taper-material.js +++ b/js/lib/rdge/materials/taper-material.js @@ -38,6 +38,8 @@ var TaperMaterial = function TaperMaterial() this._hasVertexDeformation = true; this._vertexDeformationTolerance = 0.02; // should be a property + this.getVertexDeformationTolerance = function() { return this._propValues[this._propNames[7]]; }; + /////////////////////////////////////////////////////////////////////// // Methods /////////////////////////////////////////////////////////////////////// @@ -62,13 +64,30 @@ var TaperMaterial = function TaperMaterial() this.setShaderValues(); }; + this.resetToDefault = function() + { + this._propValues[this._propNames[0]] = 0.25; + this._propValues[this._propNames[1]] = 0.50; + this._propValues[this._propNames[2]] = 0.75; + this._propValues[this._propNames[3]] = -1; + this._propValues[this._propNames[4]] = 1; + this._propValues[this._propNames[5]] = 0.0; + this._propValues[this._propNames[6]] = 0.9; + this._propValues[this._propNames[7]] = this._vertexDeformationTolerance; + this._propValues[this._propNames[8]] = 1.0; + + var nProps = this._propNames.length; + for (var i=0; i