diff options
author | John Mayhew | 2012-04-02 16:28:39 -0700 |
---|---|---|
committer | John Mayhew | 2012-04-02 16:28:39 -0700 |
commit | b4155fb4c33675a8a7cd37473513718043fdf0ba (patch) | |
tree | 3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/helper-classes | |
parent | 5ba9aeac94c86049423fd5d4b37b277263939c13 (diff) | |
parent | c6de22bf42be90b403491b5f87b1818d9020310c (diff) | |
download | ninja-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')
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++) |