diff options
100 files changed, 2434 insertions, 669 deletions
diff --git a/assets/CanvasRuntime.js b/assets/CanvasRuntime.js new file mode 100644 index 00000000..5caf72ee --- /dev/null +++ b/assets/CanvasRuntime.js | |||
@@ -0,0 +1,1362 @@ | |||
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 | /////////////////////////////////////////////////////////////////////// | ||
9 | // Class ShapeRuntime | ||
10 | // Manages runtime shape display | ||
11 | /////////////////////////////////////////////////////////////////////// | ||
12 | function CanvasDataManager() | ||
13 | { | ||
14 | this.loadGLData = function(root, valueArray, assetPath ) | ||
15 | { | ||
16 | this._assetPath = assetPath.slice(); | ||
17 | |||
18 | var value = valueArray; | ||
19 | var nWorlds = value.length; | ||
20 | for (var i=0; i<nWorlds; i++) | ||
21 | { | ||
22 | var importStr = value[i]; | ||
23 | var startIndex = importStr.indexOf( "id: " ); | ||
24 | if (startIndex >= 0) | ||
25 | { | ||
26 | var endIndex = importStr.indexOf( "\n", startIndex ); | ||
27 | if (endIndex > 0) | ||
28 | { | ||
29 | var id = importStr.substring( startIndex+4, endIndex ); | ||
30 | var canvas = this.findCanvasWithID( id, root ); | ||
31 | if (canvas) | ||
32 | { | ||
33 | var rt = new GLRuntime( canvas, importStr, assetPath ); | ||
34 | } | ||
35 | } | ||
36 | } | ||
37 | } | ||
38 | } | ||
39 | |||
40 | this.collectGLData = function( elt, dataArray ) | ||
41 | { | ||
42 | if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) | ||
43 | { | ||
44 | var data = elt.elementModel.shapeModel.GLWorld.export( true ); | ||
45 | dataArray.push( data ); | ||
46 | } | ||
47 | |||
48 | if (elt.children) | ||
49 | { | ||