From 98a02c1ac6f189aba93d7cce64ba5bdbc0617f6c Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 20 Mar 2012 16:26:52 -0700 Subject: Bug Fixes for Canvas & WebGL File IO --- js/lib/rdge/materials/water-material.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'js/lib/rdge/materials/water-material.js') diff --git a/js/lib/rdge/materials/water-material.js b/js/lib/rdge/materials/water-material.js index cac5a249..565055a1 100644 --- a/js/lib/rdge/materials/water-material.js +++ b/js/lib/rdge/materials/water-material.js @@ -18,6 +18,7 @@ var WaterMaterial = function WaterMaterial() { this._shaderName = "water"; this._texMap = 'assets/images/rocky-normal.jpg'; + //this._texMap = 'assets/images/powderblue.png'; this._time = 0.0; this._dTime = 0.01; @@ -27,6 +28,7 @@ var WaterMaterial = function WaterMaterial() { /////////////////////////////////////////////////////////////////////// // all defined in parent PulseMaterial.js // load the local default value + this._propValues = []; this._propValues[ this._propNames[0] ] = this._texMap.slice(0); /////////////////////////////////////////////////////////////////////// @@ -115,6 +117,29 @@ var waterMaterialDef = } }; +/* +var ParisMaterial = function ParisMaterial() +{ + // initialize the inherited members + this.inheritedFrom = WaterMaterial; + this.inheritedFrom(); + + this._name = "ParisMaterial"; + this._shaderName = "water"; + + this._texMap = 'assets/images/paris.png'; + this._propValues[ this._propNames[0] ] = this._texMap.slice(0); + + this._diffuseColor = [0.5, 0.5, 0.5, 0.5]; + this._propValues[ this._propNames[1] ] = this._diffuseColor.slice(); +} +ParisMaterial.prototype = new PulseMaterial(); +if (typeof exports === "object") { + exports.ParisMaterial = ParisMaterial; +} +*/ + + WaterMaterial.prototype = new PulseMaterial(); if (typeof exports === "object") { -- cgit v1.2.3 From 31e924e1b8b8da8342b3ff2341c8284915486c0b Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 22 Mar 2012 15:32:19 -0700 Subject: Added Paris and Raiders materials --- js/lib/rdge/materials/water-material.js | 84 +++++++++++++++++++++++++++++++-- 1 file changed, 81 insertions(+), 3 deletions(-) (limited to 'js/lib/rdge/materials/water-material.js') diff --git a/js/lib/rdge/materials/water-material.js b/js/lib/rdge/materials/water-material.js index 565055a1..b7413f55 100644 --- a/js/lib/rdge/materials/water-material.js +++ b/js/lib/rdge/materials/water-material.js @@ -117,7 +117,6 @@ var waterMaterialDef = } }; -/* var ParisMaterial = function ParisMaterial() { // initialize the inherited members @@ -125,19 +124,98 @@ var ParisMaterial = function ParisMaterial() this.inheritedFrom(); this._name = "ParisMaterial"; - this._shaderName = "water"; + this._shaderName = "paris"; this._texMap = 'assets/images/paris.png'; this._propValues[ this._propNames[0] ] = this._texMap.slice(0); this._diffuseColor = [0.5, 0.5, 0.5, 0.5]; this._propValues[ this._propNames[1] ] = this._diffuseColor.slice(); + + // duplcate method requirde + this.dup = function( world ) { + // allocate a new uber material + var newMat = new ParisMaterial(); + + // copy over the current values; + var propNames = [], propValues = [], propTypes = [], propLabels = []; + this.getAllProperties( propNames, propValues, propTypes, propLabels); + var n = propNames.length; + for (var i=0; i