diff options
author | hwc487 | 2012-04-19 13:01:43 -0700 |
---|---|---|
committer | hwc487 | 2012-04-19 13:01:43 -0700 |
commit | e6a20fe64574763483dc602bd759278ccf5e5e68 (patch) | |
tree | 69defe7200206f0257fe90697136fadef59d521e /js/lib/rdge/materials/linear-gradient-material.js | |
parent | ae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff) | |
parent | 9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff) | |
download | ninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts:
js/lib/drawing/world.js
js/lib/geom/geom-obj.js
js/lib/rdge/materials/cloud-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/lib/rdge/materials/linear-gradient-material.js')
-rwxr-xr-x | js/lib/rdge/materials/linear-gradient-material.js | 426 |
1 files changed, 178 insertions, 248 deletions
diff --git a/js/lib/rdge/materials/linear-gradient-material.js b/js/lib/rdge/materials/linear-gradient-material.js index 0db6fc90..51a7430c 100755 --- a/js/lib/rdge/materials/linear-gradient-material.js +++ b/js/lib/rdge/materials/linear-gradient-material.js | |||
@@ -11,36 +11,36 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
11 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
12 | // Instance variables | 12 | // Instance variables |
13 | /////////////////////////////////////////////////////////////////////// | 13 | /////////////////////////////////////////////////////////////////////// |
14 | this._name = "LinearGradientMaterial"; | 14 | this._name = "LinearGradientMaterial"; |
15 | this._shaderName = "linearGradient"; | 15 | this._shaderName = "linearGradient"; |
16 | 16 | ||
17 | this._color1 = [1,0,0,1]; | 17 | this._color1 = [1, 0, 0, 1]; |
18 | this._color2 = [0,1,0,1]; | 18 | this._color2 = [0, 1, 0, 1]; |
19 | this._color3 = [0,0,1,1]; | 19 | this._color3 = [0, 0, 1, 1]; |
20 | this._color4 = [0,1,1,1]; | 20 | this._color4 = [0, 1, 1, 1]; |
21 | this._colorStop1 = 0.0; | 21 | this._colorStop1 = 0.0; |
22 | this._colorStop2 = 0.3; | 22 | this._colorStop2 = 0.3; |
23 | this._colorStop3 = 0.6; | 23 | this._colorStop3 = 0.6; |
24 | this._colorStop4 = 1.0; | 24 | this._colorStop4 = 1.0; |
25 | // this._colorCount = 4; | 25 | // this._colorCount = 4; |
26 | this._angle = 0.0; // the shader takes [cos(a), sin(a)] | 26 | this._angle = 0.0; // the shader takes [cos(a), sin(a)] |
27 | 27 | ||
28 | /////////////////////////////////////////////////////////////////////// | 28 | /////////////////////////////////////////////////////////////////////// |
29 | // Property Accessors | 29 | // Property Accessors |
30 | /////////////////////////////////////////////////////////////////////// | 30 | /////////////////////////////////////////////////////////////////////// |
31 | this.getShaderName = function() { | 31 | this.getShaderName = function () { |
32 | return this._shaderName; | 32 | return this._shaderName; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | this.getName = function() { | 35 | this.getName = function () { |
36 | return this._name; | 36 | return this._name; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | this.getColor1 = function() { | 39 | this.getColor1 = function () { |
40 | return this._color1; | 40 | return this._color1; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | this.setColor1 = function(c) { | 43 | this.setColor1 = function (c) { |
44 | this._color1 = c.slice(); | 44 | this._color1 = c.slice(); |
45 | 45 | ||
46 | if (this._shader && this._shader['default']) { | 46 | if (this._shader && this._shader['default']) { |
@@ -48,11 +48,11 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
48 | } | 48 | } |
49 | }; | 49 | }; |
50 | 50 | ||
51 | this.getColor2 = function() { | 51 | this.getColor2 = function () { |
52 | return this._color2; | 52 | return this._color2; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | this.setColor2 = function(c) { | 55 | this.setColor2 = function (c) { |
56 | this._color2 = c.slice(); | 56 | this._color2 = c.slice(); |
57 | 57 | ||
58 | if (this._shader && this._shader['default']) { | 58 | if (this._shader && this._shader['default']) { |
@@ -60,23 +60,23 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
60 | } | 60 | } |
61 | }; | 61 | }; |
62 | 62 | ||
63 | this.getColor3 = function() { | 63 | this.getColor3 = function () { |
64 | return this._color3; | 64 | return this._color3; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | this.setColor3 = function(c) { | 67 | this.setColor3 = function (c) { |
68 | this._color3 = c.slice(); | 68 | this._color3 = c.slice(); |
69 | 69 | ||
70 | if (this._shader && this._shader['default']) { | 70 | if (this._shader && this._shader['default']) { |
71 | this._shader['default'].u_color3.set(c); | 71 | this._shader['default'].u_color3.set(c); |
72 | } | 72 | } |
73 | }; | 73 | }; |
74 | 74 | ||
75 | this.getColor4 = function() { | 75 | this.getColor4 = function () { |
76 | return this._color4; | 76 | return this._color4; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | this.setColor4 = function(c) { | 79 | this.setColor4 = function (c) { |
80 | this._color4 = c.slice(); | 80 | this._color4 = c.slice(); |
81 | 81 | ||
82 | if (this._shader && this._shader['default']) { | 82 | if (this._shader && this._shader['default']) { |
@@ -84,11 +84,11 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
84 | } | 84 | } |
85 | }; | 85 | }; |
86 | 86 | ||
87 | this.getColorStop1 = function() { | 87 | this.getColorStop1 = function () { |
88 | return this._colorStop1; | 88 | return this._colorStop1; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | this.setColorStop1 = function(s) { | 91 | this.setColorStop1 = function (s) { |
92 | this._colorStop1 = s; | 92 | this._colorStop1 = s; |
93 | 93 | ||
94 | if (this._shader && this._shader['default']) { | 94 | if (this._shader && this._shader['default']) { |
@@ -96,11 +96,11 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
96 | } | 96 | } |
97 | }; | 97 | }; |
98 | 98 | ||
99 | this.getColorStop2 = function() { | 99 | this.getColorStop2 = function () { |
100 | return this._colorStop2; | 100 | return this._colorStop2; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | this.setColorStop2 = function(s) { | 103 | this.setColorStop2 = function (s) { |
104 | this._colorStop2 = s; | 104 | this._colorStop2 = s; |
105 | 105 | ||
106 | if (this._shader && this._shader['default']) { | 106 | if (this._shader && this._shader['default']) { |
@@ -108,23 +108,23 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
108 | } | 108 | } |
109 | }; | 109 | }; |
110 | 110 | ||
111 | this.getColorStop3 = function() { | 111 | this.getColorStop3 = function () { |
112 | return this._colorStop3; | 112 | return this._colorStop3; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | this.setColorStop3 = function(s) { | 115 | this.setColorStop3 = function (s) { |
116 | this._colorStop3 = s; | 116 | this._colorStop3 = s; |
117 | 117 | ||
118 | if (this._shader && this._shader['default']) { | 118 | if (this._shader && this._shader['default']) { |
119 | this._shader['default'].u_colorStop3.set([s]); | 119 | this._shader['default'].u_colorStop3.set([s]); |
120 | } | 120 | } |
121 | } | 121 | }; |
122 | 122 | ||
123 | this.getColorStop4 = function() { | 123 | this.getColorStop4 = function () { |
124 | return this._colorStop4; | 124 | return this._colorStop4; |
125 | }; | 125 | }; |
126 | 126 | ||
127 | this.setColorStop4 = function(s) { | 127 | this.setColorStop4 = function (s) { |
128 | this._colorStop4 = s; | 128 | this._colorStop4 = s; |
129 | 129 | ||
130 | if (this._shader && this._shader['default']) { | 130 | if (this._shader && this._shader['default']) { |
@@ -132,17 +132,17 @@ var LinearGradientMaterial = function LinearGradientMaterial() { | |||
132 | } | 132 | } |
133 | }; | 133 | }; |
134 | 134 | ||
135 | // this.getColorCount = function() { return this._colorCount; }; | 135 | // this.getColorCount = function() { return this._colorCount; }; |
136 | // this.setColorCount = function(c) { this._colorCount = c; | 136 | // this.setColorCount = function(c) { this._colorCount = c; |
137 | // if (this._shader && this._shader['default']) | 137 | // if (this._shader && this._shader['default']) |
138 | // this._shader['default'].u_colorCount.set([c]); | 138 | // this._shader['default'].u_colorCount.set([c]); |
139 | // }; | 139 | // }; |
140 | 140 | ||
141 | this.getAngle = function() { | 141 | this.getAngle = function () { |
142 | return this._angle; | 142 | return this._angle; |
143 | }; | 143 | }; |
144 | 144 | ||