aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-09 13:41:45 -0800
committerValerio Virgillito2012-02-09 13:41:45 -0800
commitf5193cd04a2597051d88fced878efbc4802ea64c (patch)
treedc343dc98fa9f99133d9882bd9b92cfe81296d1a /js
parente2539230b8a297fa972af6d53fe9de3ef2ad43fa (diff)
parent666ae3e9119410cbf7fa974274d95336aaff091c (diff)
downloadninja-f5193cd04a2597051d88fced878efbc4802ea64c.tar.gz
Merge branch 'refs/heads/master' into components
Diffstat (limited to 'js')
-rw-r--r--js/components/tools-properties/pen-properties.reel/pen-properties.html22
-rw-r--r--js/components/tools-properties/pen-properties.reel/pen-properties.js18
-rw-r--r--js/controllers/elements/shapes-controller.js25
-rw-r--r--js/helper-classes/3D/math-utils.js115
-rw-r--r--js/helper-classes/3D/snap-manager.js17
-rw-r--r--js/helper-classes/RDGE/GLAnchorPoint.js239
-rw-r--r--js/helper-classes/RDGE/GLBrushStroke.js7
-rw-r--r--js/helper-classes/RDGE/GLCircle.js10
-rw-r--r--js/helper-classes/RDGE/GLGeomObj.js3
-rw-r--r--js/helper-classes/RDGE/GLLine.js29
-rw-r--r--js/helper-classes/RDGE/GLMaterial.js31
-rw-r--r--js/helper-classes/RDGE/GLRectangle.js150
-rw-r--r--js/helper-classes/RDGE/GLSubpath.js2317
-rw-r--r--js/helper-classes/RDGE/GLWorld.js229
-rw-r--r--js/helper-classes/RDGE/Materials/BumpMetalMaterial.js76
-rw-r--r--js/helper-classes/RDGE/Materials/FlatMaterial.js70
-rw-r--r--js/helper-classes/RDGE/Materials/IridescentScalesMaterial.js5
-rw-r--r--js/helper-classes/RDGE/Materials/JuliaMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/KeleidoscopeMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/LinearGradientMaterial.js4
-rw-r--r--js/helper-classes/RDGE/Materials/MandelMaterial.js4
-rw-r--r--js/helper-classes/RDGE/Materials/PlasmaMaterial.js2
-rw-r--r--js/helper-classes/RDGE/Materials/PulseMaterial.js15
-rw-r--r--js/helper-classes/RDGE/Materials/RadialBlurMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/RadialGradientMaterial.js188
-rw-r--r--js/helper-classes/RDGE/Materials/TunnelMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/TwistMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/UberMaterial.js31
-rw-r--r--js/helper-classes/RDGE/MaterialsLibrary.js2
-rw-r--r--js/helper-classes/RDGE/rdge-compiled.js102
-rw-r--r--js/helper-classes/RDGE/src/core/script/engine.js18
-rw-r--r--js/helper-classes/RDGE/src/core/script/init_state.js7
-rw-r--r--js/helper-classes/RDGE/src/core/script/jshader.js6
-rw-r--r--js/helper-classes/RDGE/src/core/script/renderer.js14
-rw-r--r--js/helper-classes/RDGE/src/core/script/run_state.js10
-rw-r--r--js/helper-classes/RDGE/src/core/script/runtime.js2
-rw-r--r--js/ninja.reel/ninja.js3
-rw-r--r--js/panels/Materials/Materials.xml10
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.html12
-rw-r--r--js/panels/properties/sections/three-d-view.reel/three-d-view.js3
-rwxr-xr-xjs/preloader/Preloader.js1
-rw-r--r--js/tools/PenTool.js554
-rw-r--r--js/tools/Rotate3DToolBase.js2
-rw-r--r--js/tools/RotateStage3DTool.js2
-rw-r--r--js/tools/SelectionTool.js40
-rw-r--r--js/tools/modifier-tool-base.js35
46 files changed, 2101 insertions, 2344 deletions
diff --git a/js/components/tools-properties/pen-properties.reel/pen-properties.html b/js/components/tools-properties/pen-properties.reel/pen-properties.html
index 7af35a03..74a3a747 100644
--- a/js/components/tools-properties/pen-properties.reel/pen-properties.html
+++ b/js/components/tools-properties/pen-properties.reel/pen-properties.html
@@ -12,12 +12,25 @@
12 <script type="text/montage-serialization"> 12 <script type="text/montage-serialization">
13 { 13 {
14 14
15 "strokeSizeHT": {
16 "module": "js/components/hottextunit.reel",
17 "name": "HotTextUnit",
18 "properties": {
19 "element": {"#": "strokeSize"},
20 "minValue": 1,
21 "maxValue": 100,
22 "value": 1,
23 "decimalPlace": 10,
24 "acceptableUnits" : ["px", "pt"]
25 }
26 },
27
15 "owner": { 28 "owner": {
16 "module": "js/components/tools-properties/pen-properties.reel", 29 "module": "js/components/tools-properties/pen-properties.reel",
17 "name": "PenProperties", 30 "name": "PenProperties",
18 "properties": { 31 "properties": {
19 "element": {"#": "penProperties"}, 32 "element": {"#": "penProperties"},
20 "reset": {"#": "resetPenTool"} 33 "_strokeSize": {"@": "strokeSizeHT"}
21 } 34 }
22 } 35 }
23 } 36 }
@@ -26,9 +39,12 @@
26 </head> 39 </head>
27 40
28 <body> 41 <body>
29 <div id="penProperties" class="subToolHolderPanel"> 42 <div id="penProperties" class="subToolHolderPanel">
30 <button id="resetPenTool" tabindex="0" class="montage-button" aria-role="button" aria-busy="false">Reset</button> 43 <div id="strokesContainer" class="leftLabel" style="margin-left:25px; padding-top: 3px;">
44 <label class="label"> Stroke:</label>
45 <div id="strokeSize" class="label"></div>
31 </div> 46 </div>
47 </div>
32 </body> 48 </body>
33 49
34</html> \ No newline at end of file 50</html> \ No newline at end of file
diff --git a/js/components/tools-properties/pen-properties.reel/pen-properties.js b/js/components/tools-properties/pen-properties.reel/pen-properties.js
index ec8efa69..b57f9a6f 100644
--- a/js/components/tools-properties/pen-properties.reel/pen-properties.js
+++ b/js/components/tools-properties/pen-properties.reel/pen-properties.js
@@ -5,24 +5,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
5</copyright> */ 5</copyright> */
6 6
7var Montage = require("montage/core/core").Montage; 7var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component;
9var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager;
10var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; 8var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties;
11 9
12exports.PenProperties = Montage.create(ToolProperties, { 10exports.PenProperties = Montage.create(ToolProperties, {
13 reset: { value: null }, 11 strokeSize: {
14 12 get: function() { return this._strokeSize; }
15 _subPrepare: {
16 value: function() {
17 this.reset.addEventListener("click", this, false);
18 }
19 },
20
21 handleClick: {
22 value: function(event) {
23 var newEvent = document.createEvent( "CustomEvent" );
24 newEvent.initCustomEvent( "resetPenTool", false, true );
25 defaultEventManager.dispatchEvent( newEvent );
26 }
27 } 13 }
28}); \ No newline at end of file 14}); \ No newline at end of file
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index e764de4e..b9c033aa 100644
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -63,11 +63,11 @@ exports.ShapesController = Montage.create(CanvasController, {
63 canvas.height = el.height; 63 canvas.height = el.height;
64 this.application.ninja.elementMediator.replaceElement(el, canvas); 64 this.application.ninja.elementMediator.replaceElement(el, canvas);
65 NJevent("elementDeleted", el); 65 NJevent("elementDeleted", el);
66 this.application.ninja.selectionController.selectElement(canvas);
67 el = canvas; 66 el = canvas;
68 this.toggleWebGlMode(el, value); 67 this.toggleWebGlMode(el, value);
69 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 68 el.elementModel.shapeModel.GLWorld.render();
70 break; 69 this.application.ninja.selectionController.selectElement(el);
70 return;
71 case "strokeMaterial": 71 case "strokeMaterial":
72 var sm = Object.create(MaterialsLibrary.getMaterial(value)); 72 var sm = Object.create(MaterialsLibrary.getMaterial(value));
73 if(sm) 73 if(sm)
@@ -338,13 +338,26 @@ exports.ShapesController = Montage.create(CanvasController, {
338 { 338 {
339 return; 339 return;
340 } 340 }
341 var world, 341 var sm,
342 fm,
343 world,
342 worldData = el.elementModel.shapeModel.GLWorld.export(); 344 worldData = el.elementModel.shapeModel.GLWorld.export();
343 if(worldData) 345 if(worldData)
344 { 346 {
345 world = new GLWorld(el, true); 347 world = new GLWorld(el, true);
346 el.elementModel.shapeModel.GLWorld = world; 348 el.elementModel.shapeModel.GLWorld = world;
349 el.elementModel.shapeModel.GLGeomObj.setWorld(world);
347 el.elementModel.shapeModel.useWebGl = true; 350 el.elementModel.shapeModel.useWebGl = true;
351 sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial"));
352 fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial"));
353 if(sm && fm)
354 {
355 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm);
356 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm);
357 el.elementModel.shapeModel.strokeMaterial = sm