aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/elements/shapes-controller.js29
-rw-r--r--js/controllers/main-menu-controller.js43
-rwxr-xr-xjs/data/menu-data.js41
-rwxr-xr-xjs/data/pi/pi-data.js6
-rwxr-xr-xjs/helper-classes/RDGE/GLCircle.js3
-rwxr-xr-xjs/helper-classes/RDGE/GLLine.js70
-rwxr-xr-xjs/helper-classes/RDGE/GLMaterial.js11
-rwxr-xr-xjs/helper-classes/RDGE/GLRectangle.js162
-rwxr-xr-xjs/helper-classes/RDGE/GLWorld.js75
-rwxr-xr-xjs/helper-classes/RDGE/Materials/BrickMaterial.js231
-rwxr-xr-xjs/helper-classes/RDGE/Materials/BumpMetalMaterial.js48
-rwxr-xr-xjs/helper-classes/RDGE/Materials/FlatMaterial.js60
-rwxr-xr-xjs/helper-classes/RDGE/Materials/IridescentScalesMaterial.js215
-rwxr-xr-xjs/helper-classes/RDGE/Materials/JuliaMaterial.js150
-rwxr-xr-xjs/helper-classes/RDGE/Materials/KeleidoscopeMaterial.js149
-rwxr-xr-xjs/helper-classes/RDGE/Materials/LinearGradientMaterial.js148
-rwxr-xr-xjs/helper-classes/RDGE/Materials/MandelMaterial.js151
-rwxr-xr-xjs/helper-classes/RDGE/Materials/PlasmaMaterial.js134
-rwxr-xr-xjs/helper-classes/RDGE/Materials/PulseMaterial.js237
-rwxr-xr-xjs/helper-classes/RDGE/Materials/QuiltMaterial.js168
-rwxr-xr-xjs/helper-classes/RDGE/Materials/RadialBlurMaterial.js244
-rwxr-xr-xjs/helper-classes/RDGE/Materials/RadialGradientMaterial.js87
-rwxr-xr-xjs/helper-classes/RDGE/Materials/StitchMaterial.js119
-rwxr-xr-xjs/helper-classes/RDGE/Materials/TunnelMaterial.js133
-rwxr-xr-xjs/helper-classes/RDGE/Materials/TwistMaterial.js149
-rwxr-xr-xjs/helper-classes/RDGE/Materials/UberMaterial.js56
-rwxr-xr-xjs/helper-classes/RDGE/MaterialsLibrary.js38
-rwxr-xr-xjs/helper-classes/RDGE/rdge-compiled.js57
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/renderer.js22
-rwxr-xr-xjs/ninja.reel/ninja.html19
-rwxr-xr-xjs/panels/Materials/Materials.xml13
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.js14
-rwxr-xr-xjs/preloader/Preloader.js16
33 files changed, 651 insertions, 2447 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index b9c033aa..640119c4 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -346,19 +346,24 @@ exports.ShapesController = Montage.create(CanvasController, {
346 { 346 {
347 world = new GLWorld(el, true); 347 world = new GLWorld(el, true);
348 el.elementModel.shapeModel.GLWorld = world; 348 el.elementModel.shapeModel.GLWorld = world;
349 el.elementModel.shapeModel.GLGeomObj.setWorld(world);
350 el.elementModel.shapeModel.useWebGl = true; 349 el.elementModel.shapeModel.useWebGl = true;
350 world.import(worldData);
351 el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot();
352
351 sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); 353 sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial"));
352 fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); 354 if(sm)
353 if(sm && fm)
354 { 355 {
355 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); 356 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm);
356 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm);
357 el.elementModel.shapeModel.strokeMaterial = sm; 357 el.elementModel.shapeModel.strokeMaterial = sm;
358 }
359 fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial"));
360 // TODO - Use consts after GL code is converted to object literal notation
361// if( fm && (el.elementModel.shapeModel.GLGeomObj.geomType() !== GLGeomObj.GEOM_TYPE_LINE) )
362 if( fm && (el.elementModel.shapeModel.GLGeomObj.geomType() !== 3) )
363 {
364 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm);
358 el.elementModel.shapeModel.fillMaterial = fm; 365 el.elementModel.shapeModel.fillMaterial = fm;
359 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
360 } 366 }
361 world.import(worldData);
362 } 367 }
363 368
364 } 369 }
@@ -378,13 +383,17 @@ exports.ShapesController = Montage.create(CanvasController, {
378 world = new GLWorld(el, false); 383 world = new GLWorld(el, false);
379 el.elementModel.shapeModel.GLWorld = world; 384 el.elementModel.shapeModel.GLWorld = world;
380 el.elementModel.shapeModel.useWebGl = false; 385 el.elementModel.shapeModel.useWebGl = false;
386 world.import(worldData);
387 el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot();
381 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); 388 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null);
382 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null);
383 el.elementModel.shapeModel.strokeMaterial = null; 389 el.elementModel.shapeModel.strokeMaterial = null;
384 el.elementModel.shapeModel.fillMaterial = null; 390 // TODO - Use consts after GL code is converted to object literal notation
385 world.import(worldData); 391 if(el.elementModel.shapeModel.GLGeomObj.geomType() !== 3)
392 {
393 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null);
394 el.elementModel.shapeModel.fillMaterial = null;
395 }
386 } 396 }
387
388 } 397 }
389 } 398 }
390 399
diff --git a/js/controllers/main-menu-controller.js b/js/controllers/main-menu-controller.js
new file mode 100644
index 00000000..5e126617
--- /dev/null
+++ b/js/controllers/main-menu-controller.js
@@ -0,0 +1,43 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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
8var Montage = require("montage/core/core").Montage,
9 Component = require("montage/ui/component").Component;
10
11exports.MainMenuController = Montage.create(Component, {
12 deserializedFromTemplate:{
13 value:function () {
14 this.eventManager.addEventListener("executeHelpFAQ", this, false);
15 this.eventManager.addEventListener("executeHelpForums", this, false);
16 this.eventManager.addEventListener("executeHelpTopics", this, false);
17 this.eventManager.addEventListener("executeHelpAbout", this, false);
18 }
19 },
20
21 // Basic help menu handling methods
22 handleExecuteHelpFAQ:{
23 value:function () {
24 window.open('http://www.tetsubo.org/go/ninjafaq');
25 }
26 },
27 handleExecuteHelpForums:{
28 value:function () {
29 window.open('http://www.tetsubo.org/go/ninjaforums');
30 }
31 },
32 handleExecuteHelpTopics:{
33 value:function () {
34 window.open('http://www.tetsubo.org/go/ninjadocs');
35 }
36 },
37 handleExecuteHelpAbout:{
38 value:function () {
39 // TODO
40 console.log("Pull up the about popup");
41 }
42 }
43});
diff --git a/js/data/menu-data.js b/js/data/menu-data.js
index 683be2dc..3a065958 100755
--- a/js/data/menu-data.js
+++ b/js/data/menu-data.js
@@ -10,7 +10,7 @@ exports.MenuData = Montage.create( Montage, {
10 topLevelMenu: { 10 topLevelMenu: {
11 value: [ 11 value: [
12 { 12 {
13 "header": "FILE", 13 "header": "File",
14 "entries": [ 14 "entries": [
15 { 15 {
16 "displayText" : "New Project", 16 "displayText" : "New Project",
@@ -74,7 +74,7 @@ exports.MenuData = Montage.create( Montage, {
74 ] 74 ]
75 }, 75 },
76 { 76 {
77 "header": "EDIT", 77 "header": "Edit",
78 "entries": [ 78 "entries": [
79 { 79 {
80 "displayText" : "Undo", 80 "displayText" : "Undo",
@@ -114,7 +114,7 @@ exports.MenuData = Montage.create( Montage, {
114 ] 114 ]
115 }, 115 },
116 { 116 {
117 "header": "VIEW", 117 "header": "View",
118 "entries": [ 118 "entries": [
119 { 119 {
120 "displayText" : "Zoom In", 120 "displayText" : "Zoom In",
@@ -285,7 +285,7 @@ exports.MenuData = Montage.create( Montage, {
285 ] 285 ]
286 }, 286 },
287 { 287 {
288 "header": "WINDOW", 288 "header": "Window",
289 "entries": [ 289 "entries": [
290 { 290 {
291 "displayText" : "Tools", 291 "displayText" : "Tools",
@@ -359,41 +359,34 @@ exports.MenuData = Montage.create( Montage, {
359 ] 359 ]
360 }, 360 },
361 { 361 {
362 "header": "HELP", 362 "header": "Help",
363 "entries": [ 363 "entries": [
364 { 364 {
365 "displayText" : "About", 365 "displayText" : "Ninja FAQ",
366 "hasSubMenu" : false, 366 "hasSubMenu" : false,
367 "enabled": true 367 "enabled": true,
368 "action": "executeHelpFAQ"
368 }, 369 },
369 { 370 {
370 "displayText" : "FAQ", 371 "displayText" : "Ninja Forums",
371 "hasSubMenu" : false, 372