aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/document/html-document.js127
-rwxr-xr-xjs/helper-classes/3D/math-utils.js5
-rw-r--r--js/helper-classes/RDGE/runtime/CanvasDataManager.js33
-rw-r--r--js/helper-classes/RDGE/runtime/GLRuntime.js303
-rw-r--r--js/helper-classes/RDGE/runtime/RuntimeGeomObj.js611
-rw-r--r--js/helper-classes/RDGE/runtime/RuntimeMaterial.js282
-rwxr-xr-xjs/helper-classes/backup-delete/GLCircle.js3
-rwxr-xr-xjs/helper-classes/backup-delete/GLGeomObj.js46
-rwxr-xr-xjs/helper-classes/backup-delete/GLRectangle.js2
-rwxr-xr-xjs/helper-classes/backup-delete/GLWorld.js71
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/BumpMetalMaterial.js39
-rw-r--r--js/helper-classes/backup-delete/Materials/DeformMaterial.js2
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/FlatMaterial.js34
-rw-r--r--js/helper-classes/backup-delete/Materials/FlyMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/JuliaMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/KeleidoscopeMaterial.js2
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/LinearGradientMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/MandelMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/PlasmaMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/PulseMaterial.js5
-rw-r--r--js/helper-classes/backup-delete/Materials/RadialBlurMaterial.js2
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/RadialGradientMaterial.js6
-rw-r--r--js/helper-classes/backup-delete/Materials/ReliefTunnelMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/SquareTunnelMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/StarMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/TaperMaterial.js4
-rw-r--r--js/helper-classes/backup-delete/Materials/TunnelMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/TwistMaterial.js2
-rw-r--r--js/helper-classes/backup-delete/Materials/TwistVertMaterial.js2
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/UberMaterial.js73
-rw-r--r--js/helper-classes/backup-delete/Materials/WaterMaterial.js4
-rw-r--r--js/helper-classes/backup-delete/Materials/ZInvertMaterial.js2
-rwxr-xr-xjs/lib/NJUtils.js34
-rw-r--r--js/panels/Timeline/Collapser.js26
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js138
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html19
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js124
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js116
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js10
-rwxr-xr-xjs/preloader/Preloader.js2
40 files changed, 1853 insertions, 294 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 536fca47..8592a445 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -185,13 +185,113 @@ exports.HTMLDocument = Montage.create(TextDocument, {
185 var elt = this.documentRoot; 185 var elt = this.documentRoot;
186 if (elt) 186 if (elt)
187 { 187 {
188 console.log( "load canvas data: " , value ); 188 var loadForRuntime = false;
189 var cdm = new CanvasDataManager(); 189 if (loadForRuntime)
190 cdm.loadGLData(elt, value); 190 {
191 //console.log( "load canvas data: " , value );
192 var cdm = new CanvasDataManager();
193 cdm.loadGLData(elt, value, NJUtils);
194 }
195 else
196 {
197 var nWorlds= value.length;
198 for (var i=0; i<nWorlds; i++)
199 {
200 var importStr = value[i];
201 var startIndex = importStr.indexOf( "id: " );
202 if (startIndex >= 0)
203 {
204 var endIndex = importStr.indexOf( "\n", startIndex );
205 if (endIndex > 0)
206 {
207 var id = importStr.substring( startIndex+4, endIndex );
208 if (id)
209 {
210 var canvas = this.findCanvasWithID( id, elt );
211 if (canvas)
212 {
213 if (!canvas.elementModel)
214 {
215 NJUtils.makeElementModel(canvas, "Canvas", "shape", true);
216 }
217
218 if (canvas.elementModel)
219 {
220 if (canvas.elementModel.shapeModel.GLWorld)
221 canvas.elementModel.shapeModel.GLWorld.clearTree();
222
223 var index = importStr.indexOf( "webGL: " );
224 var useWebGL = (index >= 0)
225 var world = new GLWorld( canvas, useWebGL );
226 world.import( importStr );
227 canvas.elementModel.shapeModel.GLWorld = world;
228
229 this.buildShapeModel( canvas.elementModel, world );
230 }
231 }
232 }
233 }
234 }
235 }
236 }
191 } 237 }
192 } 238 }
193 }, 239 },
194 240
241 buildShapeModel:
242 {
243 value: function( elementModel, world )
244 {
245 var shapeModel = elementModel.shapeModel;
246 shapeModel.shapeCount = 1; // for now...
247 shapeModel.useWebGl = world._useWebGL;
248 shapeModel.GLWorld = world;
249 var root = world.getGeomRoot();
250 if (root)
251 {
252 shapeModel.GLGeomObj = root;
253 shapeModel.strokeSize = root._strokeWidth;
254 shapeModel.stroke = root._strokeColor.slice();
255 shapeModel.strokeMaterial = root._strokeMaterial.dup();
256 shapeModel.strokeStyle = "solid";
257 //shapeModel.strokeStyleIndex
258 //shapeModel.border
259 //shapeModel.background
260 switch (root.geomType())
261 {
262 case root.GEOM_TYPE_RECTANGLE:
263 elementModel.selection = "Rectangle";
264 elementModel.pi = "RectanglePi";
265 shapeModel.fill = root._fillColor.slice();
266 shapeModel.fillMaterial = root._fillMaterial.dup();
267 shapeModel.tlRadius = root._tlRadius;
268 shapeModel.trRadius = root._trRadius;
269 shapeModel.blRadius = root._blRadius;
270 shapeModel.brRadius = root._brRadius;
271 break;
272
273 case root.GEOM_TYPE_CIRCLE:
274 elementModel.selection = "Oval";
275 elementModel.pi = "OvalPi";
276 shapeModel.fill = root._fillColor.slice();
277 shapeModel.fillMaterial = root._fillMaterial.dup();
278 shapeModel.innerRadius = root._innerRadius;
279 break;
280
281 case root.GEOM_TYPE_LINE:
282 elementModel.selection = "Line";
283 elementModel.pi = "LinePi";
284 shapeModel.slope = root._slope;
285 break;
286
287 default:
288 console.log( "geometry type not supported for file I/O, " + root.geomType());
289 break;
290 }
291 }
292 }
293 },
294
195 zoomFactor: { 295 zoomFactor: {
196 get: function() { return this._zoomFactor; }, 296 get: function() { return this._zoomFactor; },
197 set: function(value) { this._zoomFactor = value; } 297 set: function(value) { this._zoomFactor = value; }
@@ -219,6 +319,27 @@ exports.HTMLDocument = Montage.create(TextDocument, {
219 } 319 }
220 } 320 }
221 }, 321 },
322
323 /**
324 * search the DOM tree to find a canvas with the given id
325 */
326 findCanvasWithID: {
327 value: function( id, elt ) {
328 var cid = elt.getAttribute( "data-RDGE-id" );
329 if (cid == id) return elt;
330
331 if (elt.children)
332 {
333 var nKids = elt.children.length;
334 for (var i=0; i<nKids; i++)
335 {
336 var child = elt.children[i];
337 var foundElt = this.findCanvasWithID( id, child );
338 if (foundElt) return foundElt;
339 }
340 }
341 }