diff options
author | Nivesh Rajbhandari | 2012-02-22 11:36:19 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-02-22 11:36:19 -0800 |
commit | f775fb752cac57a0c1f6c42c8c60f5ff329eab32 (patch) | |
tree | 62ef5c4e57ed4fe3601eb90d8881b94053df8f3d /js/helper-classes | |
parent | eb8223a286e3703a0b7995f5472aaec8dcffd7f8 (diff) | |
download | ninja-f775fb752cac57a0c1f6c42c8c60f5ff329eab32.tar.gz |
Revert "Integrating canvas-2d drawing and WebGL fixes, including adding back WebGL materials."
This reverts commit 96a0a8c916533eb5625816192ed38488f639326d.
Diffstat (limited to 'js/helper-classes')
29 files changed, 435 insertions, 3650 deletions
diff --git a/js/helper-classes/RDGE/GLCircle.js b/js/helper-classes/RDGE/GLCircle.js index 5b32547e..08057778 100755 --- a/js/helper-classes/RDGE/GLCircle.js +++ b/js/helper-classes/RDGE/GLCircle.js | |||
@@ -400,10 +400,7 @@ function GLCircle() | |||
400 | ctx.lineWidth = 0; | 400 | ctx.lineWidth = 0; |
401 | ctx.fillStyle = "#990000"; | 401 | ctx.fillStyle = "#990000"; |
402 | if (this._fillColor) | 402 | if (this._fillColor) |
403 | { | 403 | ctx.fillStyle = MathUtils.colorToHex( this._fillColor ); |
404 | var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")"; | ||
405 | ctx.fillStyle = c; | ||
406 | } | ||
407 | 404 | ||
408 | // draw the fill | 405 | // draw the fill |
409 | ctx.beginPath(); | 406 | ctx.beginPath(); |
@@ -463,10 +460,7 @@ function GLCircle() | |||
463 | ctx.lineWidth = lineWidth; | 460 | ctx.lineWidth = lineWidth; |
464 | ctx.strokeStyle = "#0000ff"; | 461 | ctx.strokeStyle = "#0000ff"; |
465 | if (this._strokeColor) | 462 | if (this._strokeColor) |
466 | { | 463 | ctx.strokeStyle = MathUtils.colorToHex( this._strokeColor ); |
467 | var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")"; | ||
468 | ctx.strokeStyle = c; | ||
469 | } | ||
470 | 464 | ||
471 | // draw the stroke | 465 | // draw the stroke |
472 | p = MathUtils.transformPoint( bezPts[0], mat ); | 466 | p = MathUtils.transformPoint( bezPts[0], mat ); |
diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js index 0d815145..5ec51230 100755 --- a/js/helper-classes/RDGE/GLLine.js +++ b/js/helper-classes/RDGE/GLLine.js | |||
@@ -11,74 +11,74 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
11 | /////////////////////////////////////////////////////////////////////// | 11 | /////////////////////////////////////////////////////////////////////// |
12 | function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj) | 12 | function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj) |
13 | { | 13 | { |
14 | /////////////////////////////////////////////////////////////////////// | 14 | /////////////////////////////////////////////////////////////////////// |
15 | // Instance variables | 15 | // Instance variables |
16 | /////////////////////////////////////////////////////////////////////// | 16 | /////////////////////////////////////////////////////////////////////// |
17 | this._width = 2.0; | 17 | this._width = 2.0; |
18 | this._height = 2.0; | 18 | this._height = 2.0; |
19 | this._xOffset = 0; | 19 | this._xOffset = 0; |
20 | this._yOffset = 0; | 20 | this._yOffset = 0; |
21 | |||
22 | // If line doesn't fit in canvas world, we had to grow the canvas by this much on either side | ||
23 | this._xAdj = 0; | ||
24 | this._yAdj = 0; | ||
25 | |||
26 | this._slope = 0; | ||
27 | 21 | ||
28 | this._strokeWidth = 0.25; | 22 | // If line doesn't fit in canvas world, we had to grow the canvas by this much on either side |
23 | this._xAdj = 0; | ||
24 | this._yAdj = 0; | ||
25 | |||
26 | this._slope = 0; | ||
29 | 27 | ||
30 | this._strokeStyle = "Solid"; | 28 | this._strokeWidth = 0.25; |
31 | this._scaleX = 1.0; | ||
32 | this._scaleY = 1.0; | ||
33 | 29 | ||
34 | if (arguments.length > 0) | 30 | this._strokeStyle = "Solid"; |
35 | { | 31 | this._scaleX = 1.0; |
36 | this._width = width; | 32 | this._scaleY = 1.0; |
37 | this._height = height; | ||
38 | this._xOffset = xOffset; | ||
39 | this._yOffset = yOffset; | ||
40 | 33 | ||
41 | this._xAdj = xAdj; | 34 | if (arguments.length > 0) |
42 | this._yAdj = yAdj; | 35 | { |
36 | this._width = width; | ||
37 | this._height = height; | ||
38 | this._xOffset = xOffset; | ||
39 | this._yOffset = yOffset; | ||
43 | 40 | ||
44 | this._slope = slope; | 41 | this._xAdj = xAdj; |
45 | this._strokeWidth = strokeSize; | 42 | this._yAdj = yAdj; |
46 | this._strokeColor = strokeColor; | ||
47 | 43 | ||
48 | this._strokeStyle = strokeStyle; | 44 | this._slope = slope; |
49 | this._scaleX = (world.getViewportWidth())/(world.getViewportHeight()); | 45 | this._strokeWidth = strokeSize; |
50 | } | 46 | this._strokeColor = strokeColor; |
51 | 47 | ||
52 | this._strokeVerticesLen = 0; | 48 | this._strokeStyle = strokeStyle; |
49 | this._scaleX = (world.getViewportWidth())/(world.getViewportHeight()); | ||
50 | } | ||
53 | 51 | ||
54 | this.m_world = world; | 52 | this._strokeVerticesLen = 0; |
53 | |||
54 | this.m_world = world; | ||
55 | 55 | ||
56 | this._materialAmbient = [0.2, 0.2, 0.2, 1.0]; | 56 | this._materialAmbient = [0.2, 0.2, 0.2, 1.0]; |
57 | this._materialDiffuse = [0.4, 0.4, 0.4, 1.0]; | 57 | this._materialDiffuse = [0.4, 0.4, 0.4, 1.0]; |
58 | this._materialSpecular = [0.4, 0.4, 0.4, 1.0]; | 58 | this._materialSpecular = [0.4, 0.4, 0.4, 1.0]; |
59 | 59 | ||
60 | // initialize the inherited members | 60 | // initialize the inherited members |
61 | this.inheritedFrom = GLGeomObj; | 61 | this.inheritedFrom = GLGeomObj; |
62 | this.inheritedFrom(); | 62 | this.inheritedFrom(); |
63 | 63 | ||
64 | if(strokeMaterial) | 64 | if(strokeMaterial) |
65 | { | 65 | { |
66 | this._strokeMaterial = strokeMaterial; | 66 | this._strokeMaterial = strokeMaterial; |
67 | } | 67 | } |
68 | 68 | ||
69 | /////////////////////////////////////////////////////////////////////// | 69 | /////////////////////////////////////////////////////////////////////// |
70 | // Property Accessors | 70 | // Property Accessors |
71 | /////////////////////////////////////////////////////////////////////// | 71 | /////////////////////////////////////////////////////////////////////// |
72 | this.getStrokeWidth = function() { return this._strokeWidth; } | 72 | this.getStrokeWidth = function() { return this._strokeWidth; } |
73 | this.setStrokeWidth = function(w) { this._strokeWidth = w; } | 73 | this.setStrokeWidth = function(w) { this._strokeWidth = w; } |
74 | 74 | ||
75 | this.getStrokeMaterial = function() { return this._strokeMaterial; } | 75 | this.getStrokeMaterial = function() { return this._strokeMaterial; } |
76 | this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } | 76 | this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } |
77 | 77 | ||
78 | this.getStrokeColor = function() { return this._strokeColor; } | 78 | this.getStrokeColor = function() { return this._strokeColor; } |
79 | //this.setStrokeColor = function(c) { this._strokeColor = c; } | 79 | //this.setStrokeColor = function(c) { this._strokeColor = c; } |
80 | 80 | ||
81 | this.getStrokeStyle = function() { return this._strokeStyle; } | 81 | this.getStrokeStyle = function() { return this._strokeStyle; } |
82 | this.setStrokeStyle = function(s) { this._strokeStyle = s; } | 82 | this.setStrokeStyle = function(s) { this._strokeStyle = s; } |
83 | 83 | ||
84 | this.getFillMaterial = function() { return null; } | 84 | this.getFillMaterial = function() { return null; } |
@@ -86,24 +86,24 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro | |||
86 | this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } | 86 | this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } |
87 | this.getStrokeMaterial = function() { return this._strokeMaterial; } | 87 | this.getStrokeMaterial = function() { return this._strokeMaterial; } |
88 | 88 | ||
89 | this.getWidth = function() { return this._width; } | 89 | this.getWidth = function() { return this._width; } |
90 | this.setWidth = function(w) { this._width = w; } | 90 | this.setWidth = function(w) { this._width = w; } |
91 | 91 | ||
92 | this.getHeight = function() { return this._height; } | 92 | this.getHeight = function() { return this._height; } |
93 | this.setHeight = function(h) { this._height = h; } | 93 | this.setHeight = function(h) { this._height = h; } |
94 | 94 | ||
95 | this.getXAdj = function() { return this._xAdj; } | 95 | this.getXAdj = function() { return this._xAdj; }< |