diff options
Diffstat (limited to 'js/lib/rdge')
19 files changed, 162 insertions, 115 deletions
diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 981edbfd..4bc5dfe8 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js | |||
@@ -22,7 +22,6 @@ var BumpMetalMaterial = function BumpMetalMaterial() { | |||
22 | this._lightDiff = [0.3, 0.3, 0.3, 1.0]; | 22 | this._lightDiff = [0.3, 0.3, 0.3, 1.0]; |
23 | 23 | ||
24 | this._diffuseTexture = "assets/images/metal.png"; | 24 | this._diffuseTexture = "assets/images/metal.png"; |
25 | //this._diffuseTexture = "texture"; | ||
26 | this._specularTexture = "assets/images/silver.png"; | 25 | this._specularTexture = "assets/images/silver.png"; |
27 | this._normalTexture = "assets/images/normalMap.png"; | 26 | this._normalTexture = "assets/images/normalMap.png"; |
28 | 27 | ||
diff --git a/js/lib/rdge/materials/deform-material.js b/js/lib/rdge/materials/deform-material.js index a7a0c178..c7f9cadc 100644 --- a/js/lib/rdge/materials/deform-material.js +++ b/js/lib/rdge/materials/deform-material.js | |||
@@ -37,13 +37,16 @@ var DeformMaterial = function DeformMaterial() { | |||
37 | // Methods | 37 | // Methods |
38 | /////////////////////////////////////////////////////////////////////// | 38 | /////////////////////////////////////////////////////////////////////// |
39 | // duplcate method requirde | 39 | // duplcate method requirde |
40 | this.dup = function (world) { | 40 | this.dup = function (world) |
41 | // allocate a new uber material | 41 | { |
42 | var newMat = new DeformMaterial(); | 42 | // get the current values; |
43 | |||
44 | // copy over the current values; | ||
45 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 43 | var propNames = [], propValues = [], propTypes = [], propLabels = []; |
46 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | 44 | this.getAllProperties(propNames, propValues, propTypes, propLabels); |
45 | |||
46 | // allocate a new material | ||
47 | var newMat = new DeformMaterial(); | ||
48 | |||
49 | // copy over the current values; | ||
47 | var n = propNames.length; | 50 | var n = propNames.length; |
48 | for (var i = 0; i < n; i++) | 51 | for (var i = 0; i < n; i++) |
49 | newMat.setProperty(propNames[i], propValues[i]); | 52 | newMat.setProperty(propNames[i], propValues[i]); |
diff --git a/js/lib/rdge/materials/flag-material.js b/js/lib/rdge/materials/flag-material.js index 8d4d1ee3..312ca1c1 100644 --- a/js/lib/rdge/materials/flag-material.js +++ b/js/lib/rdge/materials/flag-material.js | |||
@@ -5,6 +5,7 @@ | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | 7 | ||
8 | var Material = require("js/lib/rdge/materials/material").Material; | ||
8 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | 9 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; |
9 | var Texture = require("js/lib/rdge/texture").Texture; | 10 | var Texture = require("js/lib/rdge/texture").Texture; |
10 | 11 | ||
@@ -47,19 +48,21 @@ var FlagMaterial = function FlagMaterial() { | |||
47 | // Methods | 48 | // Methods |
48 | /////////////////////////////////////////////////////////////////////// | 49 | /////////////////////////////////////////////////////////////////////// |
49 | // duplcate method requirde | 50 | // duplcate method requirde |
50 | this.dup = function( world ) { | 51 | this.dup = function( world ) |
51 | // allocate a new uber material | 52 | { |
52 | var newMat = new FlagMaterial(); | 53 | // get the current values; |
54 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | ||
55 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
56 | |||
57 | // allocate a new uber material | ||
58 | var newMat = new FlagMaterial(); | ||
53 | 59 | ||
54 | // copy over the current values; | 60 | // copy over the current values; |
55 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 61 | var n = propNames.length; |
56 | this.getAllProperties( propNames, propValues, propTypes, propLabels); | 62 | for (var i = 0; i < n; i++) |
57 | var n = propNames.length; | 63 | newMat.setProperty(propNames[i], propValues[i]); |
58 | for (var i=0; i<n; i++) { | ||
59 | newMat.setProperty( propNames[i], propValues[i] ); | ||
60 | } | ||
61 | 64 | ||
62 | return newMat; | 65 | return newMat; |
63 | }; | 66 | }; |
64 | 67 | ||
65 | this.init = function( world ) | 68 | this.init = function( world ) |
@@ -68,12 +71,12 @@ var FlagMaterial = function FlagMaterial() { | |||
68 | if (world) this.setWorld( world ); | 71 | if (world) this.setWorld( world ); |
69 | 72 | ||
70 | // set up the shader | 73 | // set up the shader |
71 | this._shader = new jshader(); | 74 | this._shader = new RDGE.jshader(); |
72 | this._shader.def = flagMaterialDef; | 75 | this._shader.def = flagMaterialDef; |
73 | this._shader.init(); | 76 | this._shader.init(); |
74 | 77 | ||
75 | // set up the material node | 78 | // set up the material node |
76 | this._materialNode = createMaterialNode("flagMaterial" + "_" + world.generateUniqueNodeID()); | 79 | this._materialNode = RDGE.createMaterialNode("flagMaterial" + "_" + world.generateUniqueNodeID()); |
77 | this._materialNode.setShader(this._shader); | 80 | this._materialNode.setShader(this._shader); |
78 | 81 | ||
79 | this._time = 0; | 82 | this._time = 0; |
diff --git a/js/lib/rdge/materials/fly-material.js b/js/lib/rdge/materials/fly-material.js index 712a38ac..ca38cc83 100644 --- a/js/lib/rdge/materials/fly-material.js +++ b/js/lib/rdge/materials/fly-material.js | |||
@@ -30,18 +30,21 @@ var FlyMaterial = function FlyMaterial() { | |||
30 | // Methods | 30 | // Methods |
31 | /////////////////////////////////////////////////////////////////////// | 31 | /////////////////////////////////////////////////////////////////////// |
32 | // duplcate method requirde | 32 | // duplcate method requirde |
33 | this.dup = function( world ) { | 33 | this.dup = function( world ) |
34 | // allocate a new uber material | 34 | { |
35 | var newMat = new FlyMaterial(); | 35 | // get the current values; |
36 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | ||
37 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
38 | |||
39 | // allocate a new material | ||
40 | var newMat = new FlyMaterial(); | ||
36 | 41 | ||
37 | // copy over the current values; | 42 | // copy over the current values; |
38 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 43 | var n = propNames.length; |
39 | this.getAllProperties( propNames, propValues, propTypes, propLabels); | 44 | for (var i = 0; i < n; i++) |
40 | var n = propNames.length; | 45 | newMat.setProperty(propNames[i], propValues[i]); |
41 | for (var i=0; i<n; i++) | ||
42 | newMat.setProperty( propNames[i], propValues[i] ); | ||
43 | 46 | ||
44 | return newMat; | 47 | return newMat; |
45 | }; | 48 | }; |
46 | 49 | ||
47 | this.init = function( world ) { | 50 | this.init = function( world ) { |
diff --git a/js/lib/rdge/materials/julia-material.js b/js/lib/rdge/materials/julia-material.js index e35062a0..a06b1771 100644 --- a/js/lib/rdge/materials/julia-material.js +++ b/js/lib/rdge/materials/julia-material.js | |||
@@ -29,17 +29,19 @@ var JuliaMaterial = function JuliaMaterial() { | |||
29 | /////////////////////////////////////////////////////////////////////// | 29 | /////////////////////////////////////////////////////////////////////// |
30 | // duplcate method requirde | 30 | // duplcate method requirde |
31 | this.dup = function( world ) { | 31 | this.dup = function( world ) { |
32 | // allocate a new uber material | 32 | // get the current values; |
33 | var newMat = new JuliaMaterial(); | 33 | var propNames = [], propValues = [], propTypes = [], propLabels = []; |
34 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
35 | |||
36 | // allocate a new material | ||
37 | var newMat = new JuliaMaterial(); | ||
34 | 38 | ||
35 | // copy over the current values; | 39 | // copy over the current values; |
36 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 40 | var n = propNames.length; |
37 | this.getAllProperties( propNames, propValues, propTypes, propLabels); | 41 | for (var i = 0; i < n; i++) |
38 | var n = propNames.length; | 42 | newMat.setProperty(propNames[i], propValues[i]); |
39 | for (var i=0; i<n; i++) | ||
40 | newMat.setProperty( propNames[i], propValues[i] ); | ||
41 | 43 | ||
42 | return newMat; | 44 | return newMat; |
43 | }; | 45 | }; |
44 | 46 | ||
45 | this.init = function( world ) { | 47 | this.init = function( world ) { |
diff --git a/js/lib/rdge/materials/keleidoscope-material.js b/js/lib/rdge/materials/keleidoscope-material.js index db325eaa..e9f1b10e 100644 --- a/js/lib/rdge/materials/keleidoscope-material.js +++ b/js/lib/rdge/materials/keleidoscope-material.js | |||
@@ -38,17 +38,19 @@ var KeleidoscopeMaterial = function KeleidoscopeMaterial() { | |||
38 | /////////////////////////////////////////////////////////////////////// | 38 | /////////////////////////////////////////////////////////////////////// |
39 | // duplcate method requirde | 39 | // duplcate method requirde |
40 | this.dup = function( world ) { | 40 | this.dup = function( world ) { |
41 | // allocate a new uber material | 41 | // get the current values; |
42 | var newMat = new KeleidoscopeMaterial(); | 42 | var propNames = [], propValues = [], propTypes = [], propLabels = []; |
43 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | ||
44 | |||
45 | // allocate a new material | ||
46 | var newMat = new KeleidoscopeMaterial(); | ||
43 | 47 | ||
44 | // copy over the current values; | 48 | // copy over the current values; |
45 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 49 | var n = propNames.length; |
46 | this.getAllProperties( propNames, propValues, propTypes, propLabels); | 50 | for (var i = 0; i < n; i++) |