aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-02 16:28:39 -0700
committerJohn Mayhew2012-04-02 16:28:39 -0700
commitb4155fb4c33675a8a7cd37473513718043fdf0ba (patch)
tree3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/helper-classes
parent5ba9aeac94c86049423fd5d4b37b277263939c13 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/helper-classes/RDGE/rdge-compiled.js js/helper-classes/RDGE/runtime/GLRuntime.js js/helper-classes/RDGE/src/core/script/MeshManager.js js/helper-classes/RDGE/src/core/script/engine.js js/helper-classes/RDGE/src/core/script/fx/ssao.js js/helper-classes/RDGE/src/core/script/init_state.js js/helper-classes/RDGE/src/core/script/run_state.js js/helper-classes/RDGE/src/core/script/scenegraphNodes.js js/helper-classes/RDGE/src/core/script/utilities.js js/helper-classes/RDGE/src/tools/compile-rdge-core.bat js/helper-classes/RDGE/src/tools/compile-rdge-core.sh js/helper-classes/RDGE/src/tools/rdge-compiled.js js/lib/drawing/world.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/linear-gradient-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-blur-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js js/preloader/Preloader.js
Diffstat (limited to 'js/helper-classes')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js140
-rwxr-xr-xjs/helper-classes/3D/math-utils.js5
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js35
-rwxr-xr-xjs/helper-classes/3D/vec-utils.js71
-rwxr-xr-xjs/helper-classes/3D/view-utils.js13
-rw-r--r--js/helper-classes/RDGE/runtime/CanvasDataManager.js98
-rw-r--r--js/helper-classes/RDGE/runtime/GLRuntime.js159
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/MeshManager.js116
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/engine.js290
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/fx/ssao.js90
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/init_state.js298
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/jshader.js8
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/renderer.js1
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/run_state.js416
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/scenegraphNodes.js543
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/utilities.js152
-rw-r--r--js/helper-classes/RDGE/src/tools/compile-rdge-core.bat4
-rw-r--r--js/helper-classes/RDGE/src/tools/compile-rdge-core.sh3
-rw-r--r--js/helper-classes/RDGE/src/tools/compiler.jarbin4927265 -> 0 bytes
-rwxr-xr-xjs/helper-classes/backup-delete/GLAnchorPoint.js168
-rwxr-xr-xjs/helper-classes/backup-delete/GLBrushStroke.js397
-rwxr-xr-xjs/helper-classes/backup-delete/GLCircle.js710
-rwxr-xr-xjs/helper-classes/backup-delete/GLGeomObj.js278
-rwxr-xr-xjs/helper-classes/backup-delete/GLLight.js30
-rwxr-xr-xjs/helper-classes/backup-delete/GLLine.js507
-rwxr-xr-xjs/helper-classes/backup-delete/GLMaterial.js308
-rwxr-xr-xjs/helper-classes/backup-delete/GLPath.js232
-rwxr-xr-xjs/helper-classes/backup-delete/GLRectangle.js1236
-rwxr-xr-xjs/helper-classes/backup-delete/GLSubpath.js1185
-rwxr-xr-xjs/helper-classes/backup-delete/GLWorld.js1014
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/BumpMetalMaterial.js302
-rw-r--r--js/helper-classes/backup-delete/Materials/DeformMaterial.js133
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/FlatMaterial.js161
-rw-r--r--js/helper-classes/backup-delete/Materials/FlyMaterial.js133
-rw-r--r--js/helper-classes/backup-delete/Materials/JuliaMaterial.js150
-rw-r--r--js/helper-classes/backup-delete/Materials/KeleidoscopeMaterial.js149
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/LinearGradientMaterial.js379
-rw-r--r--js/helper-classes/backup-delete/Materials/MandelMaterial.js151
-rw-r--r--js/helper-classes/backup-delete/Materials/PlasmaMaterial.js134
-rw-r--r--js/helper-classes/backup-delete/Materials/PulseMaterial.js263
-rw-r--r--js/helper-classes/backup-delete/Materials/RadialBlurMaterial.js257
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/RadialGradientMaterial.js303
-rw-r--r--js/helper-classes/backup-delete/Materials/ReliefTunnelMaterial.js133
-rw-r--r--js/helper-classes/backup-delete/Materials/SquareTunnelMaterial.js133
-rw-r--r--js/helper-classes/backup-delete/Materials/StarMaterial.js133
-rw-r--r--js/helper-classes/backup-delete/Materials/TaperMaterial.js223
-rw-r--r--js/helper-classes/backup-delete/Materials/TunnelMaterial.js133
-rw-r--r--js/helper-classes/backup-delete/Materials/TwistMaterial.js149
-rw-r--r--js/helper-classes/backup-delete/Materials/TwistVertMaterial.js248
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/UberMaterial.js673
-rw-r--r--js/helper-classes/backup-delete/Materials/WaterMaterial.js133
-rw-r--r--js/helper-classes/backup-delete/Materials/ZInvertMaterial.js133
-rwxr-xr-xjs/helper-classes/backup-delete/MaterialsLibrary.js230
-rwxr-xr-xjs/helper-classes/backup-delete/ParseUtils.js84
-rwxr-xr-xjs/helper-classes/backup-delete/glUtils.js319
55 files changed, 1123 insertions, 12623 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index 63e7799a..d6334e6c 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -139,8 +139,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
139 handleCloseDocument:{ 139 handleCloseDocument:{
140 value: function() { 140 value: function() {
141 if(this.application.ninja.documentController._documents.length === 0){ 141 if(this.application.ninja.documentController._documents.length === 0){
142 this._eltArray = []; 142 this._eltArray.length = 0;
143 this._planesArray = []; 143 this._planesArray.length = 0;
144 } 144 }
145 } 145 }
146 }, 146 },
@@ -721,8 +721,17 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
721 drawSelectionBounds : { 721 drawSelectionBounds : {
722 value: function( eltArray ) { 722 value: function( eltArray ) {
723 this._selectionCtr = null; 723 this._selectionCtr = null;
724 var len = eltArray.length,
725 i,
726 j,
727 bounds,
728 bounds3D,
729 pt,
730 tmpPt,
731 ssMat,
732 elt;
724 733
725 if (eltArray.length == 0) return; 734 if (len === 0) return;
726 var context = this._drawingContext; 735 var context = this._drawingContext;
727 if (!context) return; 736 if (!context) return;
728 737
@@ -731,18 +740,19 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
731 context.lineWidth = 2; 740 context.lineWidth = 2;
732 741
733 // handle the single element case 742 // handle the single element case
734 if (eltArray.length == 1) 743 // TODO - Currently, the stage draws its own selection bounds for single selection case
744 if (len === 1)
735 { 745 {
736 // single selection case 746 // single selection case
737 //console.log( "single selection" ); 747 //console.log( "single selection" );
738 748
739 var elt = eltArray[0]; 749 elt = eltArray[0];
740 750
741 this.viewUtils.pushViewportObj( elt ); 751 this.viewUtils.pushViewportObj( elt );
742 752
743 // get the element bounds in world space 753 // get the element bounds in world space
744 var bounds3D = this.viewUtils.getElementViewBounds3D( elt ); 754 bounds3D = this.viewUtils.getElementViewBounds3D( elt );
745 for (var j=0; j<4; j++) { 755 for (j=0; j<4; j++) {
746 bounds3D[j] = this.viewUtils.localToGlobal( bounds3D[j], elt ); 756 bounds3D[j] = this.viewUtils.localToGlobal( bounds3D[j], elt );
747 } 757 }
748 758
@@ -766,19 +776,12 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
766 } 776 }
767 else 777 else
768 { 778 {
769 // the multiple selection case.
770 //console.log( "multiple selection" );
771
772 // we set the root to "the world".
773 var saveRoot = this.viewUtils.getRootElement();
774 this.viewUtils.setRootElement( this.viewUtils.getStageElement() );
775
776 // get the plane from the first element to compare against the other elements 779 // get the plane from the first element to compare against the other elements
777 var flat = true; 780 var flat = true;
778 var plane = this.viewUtils.getElementPlane( eltArray[0] ); 781 var plane = this.viewUtils.getElementPlane( eltArray[0] );
779 for (var i=1; i<eltArray.length; i++) 782 for (i=1; i<len; i++)
780 { 783 {
781 var elt = eltArray[i]; 784 elt = eltArray[i];
782 var plane2 = this.viewUtils.getElementPlane( elt ); 785 var plane2 = this.viewUtils.getElementPlane( elt );
783 var dot = MathUtils.dot3(plane,plane2); 786 var dot = MathUtils.dot3(plane,plane2);
784 if (MathUtils.fpCmp(dot, 1) != 0) 787 if (MathUtils.fpCmp(dot, 1) != 0)
@@ -796,34 +799,23 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
796 } 799 }
797 } 800 }
798 801
799 // construct a matrix from world space to 'plane' space
800 var ptOnPlane = this.viewUtils.localToGlobal( [0,0,0], eltArray[0]);
801 var planeToWorld = this.getPlaneToWorldMatrix( plane, ptOnPlane );
802 //var worldToPlane = planeToWorld.inverse();
803 var worldToPlane = glmat4.inverse(planeToWorld, []);
804
805 var ssMat = this.viewUtils.getLocalToGlobalMatrix( this._sourceSpaceElt );
806 // if all the elements share the same plane, draw the 2D rectangle 802 // if all the elements share the same plane, draw the 2D rectangle
807 if (flat) 803 if (flat)
808 { 804 {
809 // make a 2D rectangle on the plane 805 // make a 2D rectangle on the plane
810 var rect; 806 var rect;
811 for (var i=0; i<eltArray.length; i++)