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/radial-blur-material.js | 2 - js/lib/rdge/materials/water-material.js | 84 ++++++++++++++++++++++++++- 2 files changed, 81 insertions(+), 5 deletions(-) (limited to 'js/lib/rdge/materials') diff --git a/js/lib/rdge/materials/radial-blur-material.js b/js/lib/rdge/materials/radial-blur-material.js index 91eebcff..f4a4baa2 100644 --- a/js/lib/rdge/materials/radial-blur-material.js +++ b/js/lib/rdge/materials/radial-blur-material.js @@ -275,7 +275,6 @@ var radialBlurMaterialDef = }; -/* var RaidersMaterial = function RaidersMaterial() { // initialize the inherited members @@ -295,7 +294,6 @@ if (typeof exports === "object") { exports.RaidersMaterial = RaidersMaterial; } -*/ RadialBlurMaterial.prototype = new Material(); 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