diff options
Diffstat (limited to 'js')
78 files changed, 10813 insertions, 14030 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js index 42a7d537..e96c9943 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js | |||
@@ -212,7 +212,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
212 | { | 212 | { |
213 | /* | 213 | /* |
214 | // Use this code to test the runtime version of WebGL | 214 | // Use this code to test the runtime version of WebGL |
215 | var cdm = new CanvasDataManager(); | 215 | var cdm = new NinjaCvsRt.CanvasDataManager(); |
216 | cdm.loadGLData(elt, value, null ); | 216 | cdm.loadGLData(elt, value, null ); |
217 | */ | 217 | */ |
218 | 218 | ||
@@ -276,13 +276,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
276 | var world = new GLWorld( canvas, useWebGL ); | 276 | var world = new GLWorld( canvas, useWebGL ); |
277 | world.importJSON( jObj ); | 277 | world.importJSON( jObj ); |
278 | } | 278 | } |
279 | else | ||
280 | { | ||
281 | var index = importStr.indexOf( "webGL: " ); | ||
282 | var useWebGL = (index >= 0); | ||
283 | var world = new GLWorld( canvas, useWebGL ); | ||
284 | world.import( importStr ); | ||
285 | } | ||
286 | 279 | ||
287 | this.buildShapeModel( canvas.elementModel, world ); | 280 | this.buildShapeModel( canvas.elementModel, world ); |
288 | } | 281 | } |
@@ -432,7 +425,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
432 | if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) | 425 | if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) |
433 | { | 426 | { |
434 | var data = elt.elementModel.shapeModel.GLWorld.exportJSON(); | 427 | var data = elt.elementModel.shapeModel.GLWorld.exportJSON(); |
435 | //var data = elt.elementModel.shapeModel.GLWorld.export(); | ||
436 | dataArray.push( data ); | 428 | dataArray.push( data ); |
437 | } | 429 | } |
438 | 430 | ||
@@ -877,11 +869,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
877 | //TODO: Add logic to handle save before preview | 869 | //TODO: Add logic to handle save before preview |
878 | this.application.ninja.documentController.handleExecuteSaveAll(null); | 870 | this.application.ninja.documentController.handleExecuteSaveAll(null); |
879 | //Temp check for webGL Hack | 871 | //Temp check for webGL Hack |
880 | if (this.application.ninja.documentController.activeDocument.glData.length && this.application.ninja.documentController.activeDocument.glData.length > 1) {//TODO: Should be 0, temp hack fix | 872 | window.open(this.application.ninja.coreIoApi.rootUrl + this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); |
881 | setTimeout(function () {window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);}.bind(this), 3500); | ||
882 | } else { | ||
883 | window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]); | ||
884 | } | ||
885 | //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); | 873 | //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); |
886 | } | 874 | } |
887 | }, | 875 | }, |
diff --git a/js/helper-classes/RDGE/precompiled.js b/js/helper-classes/RDGE/precompiled.js deleted file mode 100755 index 7932444c..00000000 --- a/js/helper-classes/RDGE/precompiled.js +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | /* | ||
8 | * A list of shared parameters that all shaders can support (the engine always try to bind these uniforms) | ||
9 | * These parameters are compiled into all jshaders and can be set from any jshader | ||
10 | * with a call to jshader.global.u_matDiffuse.set([1,0,0,1]) if the jshader depends on that parameter. | ||
11 | * To set directly call rdgeGlobalParameters.'param'.set(x), for example rdgeGlobalParameters.u_lightPos.set([1,1,1]) | ||
12 | * The values can be added to a jshaders params list - this will creating local jshader memory that binds to the parameter | ||
13 | * this parameter can be used to set the value for that shader but will not override the global setting | ||
14 | * The values set here are the default global values. | ||
15 | * note: the rdge_lights substructure can be ignored, the final parameter list contains only the uniform objects | ||
16 | */ | ||
17 | |||
diff --git a/js/helper-classes/RDGE/rdge-compiled.js b/js/helper-classes/RDGE/rdge-compiled.js index caf58147..0bbcb05b 100755 --- a/js/helper-classes/RDGE/rdge-compiled.js +++ b/js/helper-classes/RDGE/rdge-compiled.js | |||
@@ -1,452 +1,329 @@ | |||
1 | vec2={string:function(a){return"{ "+a[0]+", "+a[1]+" }"},verify:function(a){return a==void 0||a.length==void 0||a.length<2?!1:typeof a[0]!="number"||typeof a[1]!="number"?!1:!0},copy:function(a){return a.length==void 0?[a,a]:[a[0],a[1]]},inplace_copy:function(a,b){a[0]=b[0];a[1]=b[1]},zero:function(){return[0,0]},up:function(){return[0,1]},right:function(){return[1,0]},add:function(a,b){return[a[0]+b[0],a[1]+b[1]]},sub:function(a,b){return[a[0]-b[0],a[1]-b[1]]},mul:function(a,b){return[a[0]*b[0], | 1 | var RDGE=RDGE||{};RDGE.vec2={};RDGE.vec2.string=function(a){return"{ "+a[0]+", "+a[1]+" }"};RDGE.vec2.verify=function(a){return void 0==a||void 0==a.length||2>a.length||"number"!=typeof a[0]||"number"!=typeof a[1]?!1:!0};RDGE.vec2.copy=function(a){return void 0==a.length?[a,a]:[a[0],a[1]]};RDGE.vec2.inplace_copy=function(a,b){a[0]=b[0];a[1]=b[1]};RDGE.vec2.zero=function(){return[0,0]};RDGE.vec2.up=function(){return[0,1]};RDGE.vec2.right=function(){return[1,0]}; |
2 | a[1]*b[1]]},addMul:function(a,b,f){return f.length!=void 0&&f.length>=2?[a[0]+b[0]*f[0],a[1]+b[1]*f[1]]:[a[0]+b[0]*f,a[1]+b[1]*f]},scale:function(a,b){return b.length!=void 0&&b.length>=2?[a[0]*b[0],a[1]*b[1]]:[a[0]*b,a[1]*b]},negate:function(a){return[-a[0],-a[1]]},normalize:function(a){var b=Math.sqrt(a[0]*a[0],a[1]*a[1]);return Math.abs(1-b)>1.0E-4?(b=1/b,[a[0]*b,a[1]*b]):a},dot:function(a,b){return a[0]*b[0]+a[1]*b[1]},perp:function(a){return[a[1],-a[0]]},lengthSq:function(a){return a[0]*a[0]+ | 2 | RDGE.vec2.add=function(a,b){return[a[0]+b[0],a[1]+b[1]]};RDGE.vec2.sub=function(a,b){return[a[0]-b[0],a[1]-b[1]]};RDGE.vec2.mul=function(a,b){return[a[0]*b[0],a[1]*b[1]]};RDGE.vec2.addMul=function(a,b,c){return void 0!=c |