diff options
author | Jonathan Duran | 2012-03-15 13:46:53 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-03-15 13:46:53 -0700 |
commit | cc57a3dff8f504526bbf41a8b01c412c4788424a (patch) | |
tree | 9127331e952ef1da6faa331ec0bb49ea3acfb980 /js/helper-classes/backup-delete/GLGeomObj.js | |
parent | 0893ba7f5d1f03099c7b5f8c53ce750e412023cd (diff) | |
parent | e6bfd7fb3d3324bea5dbc05350832a9e25c6c00d (diff) | |
download | ninja-cc57a3dff8f504526bbf41a8b01c412c4788424a.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Conflicts:
js/controllers/selection-controller.js
js/helper-classes/RDGE/src/tools/rdge-compiled.js
js/helper-classes/backup-delete/GLBrushStroke.js
js/helper-classes/backup-delete/GLCircle.js
js/helper-classes/backup-delete/GLGeomObj.js
js/helper-classes/backup-delete/GLRectangle.js
js/helper-classes/backup-delete/GLSubpath.js
js/helper-classes/backup-delete/GLWorld.js
js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js
js/helper-classes/backup-delete/Materials/DeformMaterial.js
js/helper-classes/backup-delete/Materials/FlatMaterial.js
js/helper-classes/backup-delete/Materials/FlyMaterial.js
js/helper-classes/backup-delete/Materials/JuliaMaterial.js
js/helper-classes/backup-delete/Materials/KeleidoscopeMaterial.js
js/helper-classes/backup-delete/Materials/LinearGradientMaterial.js
js/helper-classes/backup-delete/Materials/MandelMaterial.js
js/helper-classes/backup-delete/Materials/PlasmaMaterial.js
js/helper-classes/backup-delete/Materials/PulseMaterial.js
js/helper-classes/backup-delete/Materials/RadialBlurMaterial.js
js/helper-classes/backup-delete/Materials/RadialGradientMaterial.js
js/helper-classes/backup-delete/Materials/ReliefTunnelMaterial.js
js/helper-classes/backup-delete/Materials/SquareTunnelMaterial.js
js/helper-classes/backup-delete/Materials/StarMaterial.js
js/helper-classes/backup-delete/Materials/TaperMaterial.js
js/helper-classes/backup-delete/Materials/TunnelMaterial.js
js/helper-classes/backup-delete/Materials/TwistMaterial.js
js/helper-classes/backup-delete/Materials/TwistVertMaterial.js
js/helper-classes/backup-delete/Materials/UberMaterial.js
js/helper-classes/backup-delete/Materials/WaterMaterial.js
js/helper-classes/backup-delete/Materials/ZInvertMaterial.js
js/lib/drawing/world.js
js/preloader/Preloader.js
js/stage/layout.js
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/helper-classes/backup-delete/GLGeomObj.js')
-rwxr-xr-x | js/helper-classes/backup-delete/GLGeomObj.js | 324 |
1 files changed, 0 insertions, 324 deletions
diff --git a/js/helper-classes/backup-delete/GLGeomObj.js b/js/helper-classes/backup-delete/GLGeomObj.js deleted file mode 100755 index 54933590..00000000 --- a/js/helper-classes/backup-delete/GLGeomObj.js +++ /dev/null | |||
@@ -1,324 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | /////////////////////////////////////////////////////////////////////// | ||
8 | // Class GLGeomObj | ||
9 | // Super class for all geometry classes | ||
10 | /////////////////////////////////////////////////////////////////////// | ||
11 | function GLGeomObj() | ||
12 | { | ||
13 | /////////////////////////////////////////////////////////////////////// | ||
14 | // Constants | ||
15 | /////////////////////////////////////////////////////////////////////// | ||
16 | this.GEOM_TYPE_RECTANGLE = 1; | ||
17 | this.GEOM_TYPE_CIRCLE = 2; | ||
18 | this.GEOM_TYPE_LINE = 3; | ||
19 | this.GEOM_TYPE_PATH = 4; | ||
20 | this.GEOM_TYPE_CUBIC_BEZIER = 5; | ||
21 | this.GEOM_TYPE_UNDEFINED = -1; | ||
22 | |||
23 | // Needed for calculating dashed/dotted strokes | ||
24 | this.DASH_LENGTH = 0.15; | ||
25 | this.DOT_LENGTH = 0.05; | ||
26 | this.GAP_LENGTH = 0.05; | ||
27 | |||
28 | /////////////////////////////////////////////////////////////////////// | ||
29 | // Instance variables | ||
30 | /////////////////////////////////////////////////////////////////////// | ||
31 | this._matrix = Matrix.I(4); | ||
32 | |||
33 | this._next = undefined; | ||
34 | this._prev = undefined; | ||
35 | this._child = undefined; | ||
36 | this._parent = undefined; | ||
37 | |||
38 | this.m_world = null; | ||
39 | |||
40 | // stroke and fill colors | ||
41 | this._strokeColor = [0,0,0,0]; | ||
42 | this._fillColor = [0,0,0,0]; | ||
43 | |||
44 | // stroke and fill materials | ||
45 | this._fillMaterial = null; | ||
46 | this._strokeMaterial = null; | ||
47 | |||
48 | // array of primitives - used in RDGE | ||
49 | this._primArray = []; | ||
50 | this._materialNodeArray = []; | ||
51 | this._materialArray = []; | ||
52 | this._materialTypeArray = []; | ||
53 | |||
54 | // the transform node used by RDGE | ||
55 | this._trNode = null; | ||
56 | |||
57 | |||
58 | /////////////////////////////////////////////////////////////////////// | ||
59 | // Property accessors | ||
60 | /////////////////////////////////////////////////////////////////////// | ||
61 | this.setWorld = function( world ) { this.m_world = world; } | ||
62 | this.getWorld = function() { return this.m_world; } | ||
63 | |||
64 | this.getMatrix = function() { return this._matrix.slice(0); } | ||
65 | this.setMatrix = function(m) { this._matrix = m.slice(0); } | ||
66 | |||
67 | this.setNext = function( next ) { this._next = next; } | ||
68 | this.getNext = function() { return this._next; } | ||
69 | this.setPrev = function( prev ) { this._prev = prev; } | ||
70 | this.getPrev = function() { return this._prev; } | ||
71 | this.setChild = function( child ) { this._child = child; } | ||
72 | this.getChild = function() { return this._child; } | ||
73 | this.setParent = function( parent ) { this._parent = parent; } | ||
74 | this.getParent = function() { return this._parent; } | ||
75 | |||
76 | this.geomType = function() { return this.GEOM_TYPE_UNDEFINED; } | ||
77 | |||
78 | this.getPrimitiveArray = function() { return this._primArray; } | ||
79 | this.getMaterialNodeArray = function() { return this._materialNodeArray; } | ||
80 | this.getMaterialArray = function() { return this._materialArray; } | ||
81 | |||
82 | this.getTransformNode = function() { return this._trNode; } | ||
83 | this.setTransformNode = function(t) { this._trNode = t; } | ||
84 | |||
85 | /////////////////////////////////////////////////////////////////////// | ||
86 | // Methods | ||
87 | /////////////////////////////////////////////////////////////////////// | ||
88 | this.setMaterialColor = function(c, type) | ||
89 | { | ||
90 | if (type == "fill") | ||
91 | this._fillColor = c.slice(0); | ||
92 | else | ||
93 | this._strokeColor = c.slice(0); | ||
94 | if (this._materialArray && this._materialTypeArray) | ||
95 | { | ||
96 | var nMats = this._materialArray.length; | ||
97 | if (nMats === this._materialTypeArray.length) | ||
98 | { | ||
99 | for (var i=0; i<nMats; i++) | ||
100 | { | ||
101 | if (this._materialTypeArray[i] == type) | ||
102 | this._materialArray[i].setProperty( "color", c.slice(0) ); | ||
103 | } | ||
104 | } | ||
105 | } | ||
106 | |||
107 | var world = this.getWorld(); | ||
108 | if (world) world.restartRenderLoop(); | ||
109 | } | ||
110 | |||
111 | this.setFillColor = function(c) { this.setMaterialColor(c, "fill"); } | ||
112 | this.setStrokeColor = function(c) { this.setMaterialColor(c, "stroke"); } | ||
113 | |||
114 | this.makeStrokeMaterial = function() | ||
115 | { | ||
116 | var strokeMaterial; | ||
117 | if (this.getStrokeMaterial()) | ||
118 | strokeMaterial = this.getStrokeMaterial().dup(); | ||
119 | else | ||
120 | strokeMaterial = new FlatMaterial(); | ||
121 | |||
122 | if (strokeMaterial) | ||
123 | { | ||
124 | strokeMaterial.init( this.getWorld() ); | ||
125 | if(this._strokeColor) | ||
126 | { | ||
127 | strokeMaterial.setProperty("color", this._strokeColor); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | this._materialArray.push( strokeMaterial ); | ||
132 | this._materialTypeArray.push( "stroke" ); | ||
133 | |||
134 | return strokeMaterial; | ||
135 | } | ||
136 | |||
137 | this.makeFillMaterial = function() | ||
138 | { | ||
139 | var fillMaterial; | ||
140 | if (this.getFillMaterial()) | ||
141 | fillMaterial = this.getFillMaterial().dup(); | ||
142 | else | ||
143 | fillMaterial = new FlatMaterial(); | ||
144 | |||
145 | if (fillMaterial) | ||
146 | { | ||
147 | fillMaterial.init( this.getWorld() ); | ||
148 | //if(!this.getFillMaterial() && this._fillColor) | ||
149 | if (this._fillColor) | ||
150 | { | ||
151 | fillMaterial.setProperty("color", this._fillColor); | ||
152 | } | ||
153 | } | ||
154 | |||
155 | this._materialArray.push( fillMaterial ); | ||
156 | this._materialTypeArray.push( "fill" ); | ||
157 | |||
158 | return fillMaterial; | ||
159 | } | ||
160 | |||
161 | this.exportMaterials = function() | ||
162 | { | ||
163 | var rtnStr = ""; | ||
164 | if (this._materialArray && this._materialNodeArray) | ||
165 | { | ||
166 | var nMats = this._materialArray.length; | ||
167 | rtnStr += "nMaterials: " + nMats + "\n"; | ||
168 | for (var i=0; i<nMats; i++) | ||
169 | { | ||
170 | var matNode = this._materialNodeArray[i]; | ||
171 | rtnStr += "materialNodeName: " + matNode.name + "\n"; | ||
172 | |||
173 | var material = this._materialArray[i]; | ||
174 | rtnStr += material.export(); | ||
175 | } | ||
176 | } | ||
177 | else | ||
178 | rtnStr += "nMaterials: 0\n" ; | ||
179 | |||
180 | return rtnStr; | ||
181 | } | ||
182 | |||
183 | this.importMaterials = function(importStr) | ||
184 | { | ||
185 | var nMaterials = Number( this.getPropertyFromString( "nMaterials: ", importStr ) ); | ||
186 | for (var i=0; i<nMaterials; i++) | ||
187 | { | ||
188 | var mat; | ||
189 | var materialType = this.getPropertyFromString( "material: ", importStr ); | ||
190 | switch (materialType) | ||
191 | { | ||
192 | case "flat": mat = new FlatMaterial(); break; | ||
193 | |||
194 | default: | ||
195 | console.log( "material type: " + materialType + " is not supported" ); | ||
196 | break; | ||
197 | } | ||
198 | |||
199 | if (mat) | ||
200 | mat.import( importStr ); | ||
201 | |||
202 | var endIndex = importStr.indexOf( "endMaterial\n" ); | ||
203 | if (endIndex < 0) break; | ||
204 | importStr = importStr.substr( endIndex ); | ||
205 | } | ||
206 | } | ||
207 | |||