aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorhwc4872012-03-24 14:07:58 -0700
committerhwc4872012-03-24 14:07:58 -0700
commitcca20db1f346fc9bf2ead64c83e479f5f5ebf2d2 (patch)
tree4f5c42f0a1df00dcd1a2064dd176fcff7930ba47 /js/lib
parent62f4327f9b83760e52a1f6bf1e689b1e0a780fbb (diff)
parent7ee75fef18c21275cf29740a6fdd81ea90e41f45 (diff)
downloadninja-cca20db1f346fc9bf2ead64c83e479f5f5ebf2d2.tar.gz
Merge branch 'montage-integration' of github.com:Motorola-Mobility/ninja-internal into Textures
Diffstat (limited to 'js/lib')
-rwxr-xr-xjs/lib/NJUtils.js32
-rwxr-xr-xjs/lib/drawing/world.js8
-rwxr-xr-xjs/lib/geom/geom-obj.js2
-rwxr-xr-xjs/lib/geom/rectangle.js4
4 files changed, 43 insertions, 3 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js
index 4f1082f9..904aa41e 100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -96,15 +96,45 @@ exports.NJUtils = Object.create(Object.prototype, {
96 value: function(el, selection, controller, isShape) { 96 value: function(el, selection, controller, isShape) {
97 var p3d = Montage.create(Properties3D).init(el); 97 var p3d = Montage.create(Properties3D).init(el);
98 var shapeProps = null; 98 var shapeProps = null;
99 var pi = controller + "Pi";
100
99 if(isShape) { 101 if(isShape) {
100 shapeProps = Montage.create(ShapeModel); 102 shapeProps = Montage.create(ShapeModel);
101 } 103 }
102 104
105 if(el.controller) {
106
107 var componentInfo = Montage.getInfoForObject(el.controller);
108 var componentName = componentInfo.objectName.toLowerCase();
109
110 controller = "component";
111 isShape = false;
112
113 switch(componentName) {
114 case "feedreader":
115 selection = "Feed Reader";
116 pi = "FeedReaderPi";
117 break;
118 case "map":
119 selection = "Map";
120 pi = "MapPi";
121 break;
122 case "youtubechannel":
123 selection = "Youtube Channel";
124 pi = "YoutubeChannelPi";
125 break;
126 case "picasacarousel":
127 selection = "Picasa Carousel";
128 pi = "PicasaCarouselPi";
129 break;
130 }
131 }
132
103 el.elementModel = Montage.create(ElementModel, { 133 el.elementModel = Montage.create(ElementModel, {
104 type: { value: el.nodeName}, 134 type: { value: el.nodeName},
105 selection: { value: selection}, 135 selection: { value: selection},
106 controller: { value: ControllerFactory.getController(controller)}, 136 controller: { value: ControllerFactory.getController(controller)},
107 pi: { value: controller + "Pi"}, 137 pi: { value: pi},
108 props3D: { value: p3d}, 138 props3D: { value: p3d},
109 shapeModel: { value: shapeProps} 139 shapeModel: { value: shapeProps}
110 }); 140 });
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index 4140208c..d314760b 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -118,6 +118,8 @@ var World = function GLWorld( canvas, use3D, preserveDrawingBuffer ) {
118 118
119 this.getRenderer = function() { return this.renderer; }; 119 this.getRenderer = function() { return this.renderer; };
120 120
121 // Flag to play/pause animation at authortime
122 this._previewAnimation = true;
121 //////////////////////////////////////////////////////////////////////////////////// 123 ////////////////////////////////////////////////////////////////////////////////////
122 // RDGE 124 // RDGE
123 // local variables 125 // local variables
@@ -476,6 +478,10 @@ World.prototype.restartRenderLoop = function() {
476 if (this._allMapsLoaded) { 478 if (this._allMapsLoaded) {
477 //console.log( "starting task" ); 479 //console.log( "starting task" );
478 this._canvas.task.start(); 480 this._canvas.task.start();
481 if(!this._previewAnimation) {
482 //render only once if authortime animation is turned off
483 this._canvas.task.stop();
484 }
479 } else { 485 } else {
480 //console.log( "stopping task" ); 486 //console.log( "stopping task" );
481 this._canvas.task.stop(); 487 this._canvas.task.stop();
@@ -731,6 +737,8 @@ World.prototype.getShapeFromPoint = function( offsetX, offsetY ) {
731 } 737 }
732}; 738};
733 739
740
741
734World.prototype.exportJSON = function() 742World.prototype.exportJSON = function()
735{ 743{
736 // world properties 744 // world properties
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js
index dbef4859..a87bdbf5 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -248,7 +248,7 @@ var GeomObj = function GLGeomObj() {
248 this.exportMaterialsJSON = function() 248 this.exportMaterialsJSON = function()
249 { 249 {
250 var jObj; 250 var jObj;
251 if (this._materialArray && this._materialNodeArray) 251 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL())
252 { 252 {
253 var nMats = this._materialArray.length; 253 var nMats = this._materialArray.length;
254 if (nMats > 0) 254 if (nMats > 0)
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js
index 38e428bd..e511d5f4 100755
--- a/js/lib/geom/rectangle.js
+++ b/js/lib/geom/rectangle.js
@@ -187,7 +187,8 @@ var Rectangle = function GLRectangle() {
187 /////////////////////////////////////////////////////////////////////// 187 ///////////////////////////////////////////////////////////////////////
188 // Methods 188 // Methods
189 /////////////////////////////////////////////////////////////////////// 189 ///////////////////////////////////////////////////////////////////////
190 this.export = function() { 190 /*
191 this.export = function() {
191 var rtnStr = "type: " + this.geomType() + "\n"; 192 var rtnStr = "type: " + this.geomType() + "\n";
192 193
193 ///////////////////////////////////////////////////////////////////////// 194 /////////////////////////////////////////////////////////////////////////
@@ -243,6 +244,7 @@ var Rectangle = function GLRectangle() {
243 244
244 return rtnStr; 245 return rtnStr;
245 }; 246 };
247 */
246 248
247 // JSON export 249 // JSON export
248 this.exportJSON = function() 250 this.exportJSON = function()