diff options
93 files changed, 2236 insertions, 913 deletions
diff --git a/js/helper-classes/RDGE/runtime/CanvasDataManager.js b/assets/CanvasDataManager.js index 4985fc9a..8afc9de0 100644 --- a/js/helper-classes/RDGE/runtime/CanvasDataManager.js +++ b/assets/CanvasDataManager.js | |||
@@ -5,14 +5,18 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | 7 | ||
8 | var GeomObj = require("js/lib/geom/geom-obj").GeomObj; | ||
9 | var ShapePrimitive = require("js/lib/geom/shape-primitive").ShapePrimitive; | ||
10 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; | ||
11 | var GLRuntime = require("js/lib/rdge/runtime/GLRuntime").GLRuntime; | ||
8 | 12 | ||
9 | /////////////////////////////////////////////////////////////////////// | 13 | /////////////////////////////////////////////////////////////////////// |
10 | // Class ShapeRuntime | 14 | // Class ShapeRuntime |
11 | // Manages runtime shape display | 15 | // Manages runtime shape display |
12 | /////////////////////////////////////////////////////////////////////// | 16 | /////////////////////////////////////////////////////////////////////// |
13 | function CanvasDataManager() | 17 | var CanvasDataManager = function CanvasDataManager() |
14 | { | 18 | { |
15 | this.loadGLData = function(root, valueArray) | 19 | this.loadGLData = function(root, valueArray ) |
16 | { | 20 | { |
17 | var value = valueArray; | 21 | var value = valueArray; |
18 | var nWorlds = value.length; | 22 | var nWorlds = value.length; |
@@ -29,31 +33,7 @@ function CanvasDataManager() | |||
29 | var canvas = this.findCanvasWithID( id, root ); | 33 | var canvas = this.findCanvasWithID( id, root ); |
30 | if (canvas) | 34 | if (canvas) |
31 | { | 35 | { |
32 | var loadForAuthoring = true; | 36 | var rt = new GLRuntime( canvas, importStr ); |
33 | var index = importStr.indexOf( "scenedata: " ); | ||
34 | if (index >= 0) loadForAuthoring = false; | ||
35 | |||
36 | if (loadForAuthoring) | ||
37 | { | ||
38 | if (!canvas.elementModel) | ||
39 | { | ||
40 | NJUtils.makeElementModel(canvas, "Canvas", "shape", true); | ||
41 | } | ||
42 | |||
43 | if (canvas.elementModel) | ||
44 | { | ||
45 | if (canvas.elementModel.shapeModel.GLWorld) | ||
46 | canvas.elementModel.shapeModel.GLWorld.clearTree(); | ||
47 | |||
48 | var world = new GLWorld( canvas ); | ||
49 | canvas.elementModel.shapeModel.GLWorld = world; | ||
50 | world.import( importStr ); | ||
51 | } | ||
52 | } | ||
53 | else | ||
54 | { |