aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib')
-rwxr-xr-xjs/lib/drawing/world.js9
-rwxr-xr-xjs/lib/geom/geom-obj.js67
2 files changed, 32 insertions, 44 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index 4b117242..0ee66abe 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -754,7 +754,14 @@ World.prototype.exportJSON = function()
754 // convert the object to a string 754 // convert the object to a string
755 var jStr = JSON.stringify( worldObj ); 755 var jStr = JSON.stringify( worldObj );
756 756
757 // the RDGE export function corrupts the data. 757 // prepend some version information to the string.
758 // this string is also used to differentiate between JSON
759 // and pre-JSON versions of fileIO.
760 // the ending ';' in the version string is necessary
761 jStr = "v1.0;" + jStr;
762
763 // You would think that the RDGE export function
764 // would not change the data. You would be wrong...
758 // rebuild the tree 765 // rebuild the tree
759 var root = this._rootNode; 766 var root = this._rootNode;
760 root.children = new Array(); 767 root.children = new Array();
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js
index a4813326..63f71955 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -5,28 +5,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
5</copyright> */ 5</copyright> */
6 6
7var MaterialsModel = require("js/models/materials-model").MaterialsModel; 7var MaterialsModel = require("js/models/materials-model").MaterialsModel;
8/*
9var FlatMaterial = require("js/lib/rdge/materials/flat-material").FlatMaterial;
10var LinearGradientMaterial = require("js/lib/rdge/materials/linear-gradient-material").LinearGradientMaterial;
11var RadialGradientMaterial = require("js/lib/rdge/materials/radial-gradient-material").RadialGradientMaterial;
12var BumpMetalMaterial = require("js/lib/rdge/materials/bump-metal-material").BumpMetalMaterial;
13var UberMaterial = require("js/lib/rdge/materials/uber-material").UberMaterial;
14var RadialBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").RadialBlurMaterial;
15var PlasmaMaterial = require("js/lib/rdge/materials/plasma-material").PlasmaMaterial;
16var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial;
17var TunnelMaterial = require("js/lib/rdge/materials/tunnel-material").TunnelMaterial;
18var ReliefTunnelMaterial = require("js/lib/rdge/materials/relief-tunnel-material").ReliefTunnelMaterial;
19var SquareTunnelMaterial = require("js/lib/rdge/materials/square-tunnel-material").SquareTunnelMaterial;
20var FlyMaterial = require("js/lib/rdge/materials/fly-material").FlyMaterial;
21var WaterMaterial = require("js/lib/rdge/materials/water-material").WaterMaterial;
22var ZInvertMaterial = require("js/lib/rdge/materials/z-invert-material").ZInvertMaterial;
23var DeformMaterial = require("js/lib/rdge/materials/deform-material").DeformMaterial;
24var StarMaterial = require("js/lib/rdge/materials/star-material").StarMaterial;
25var TwistMaterial = require("js/lib/rdge/materials/twist-material").TwistMaterial;
26var JuliaMaterial = require("js/lib/rdge/materials/julia-material").JuliaMaterial;
27var KeleidoscopeMaterial = require("js/lib/rdge/materials/keleidoscope-material").KeleidoscopeMaterial;
28var MandelMaterial = require("js/lib/rdge/materials/mandel-material").MandelMaterial;
29*/
30 8
31/////////////////////////////////////////////////////////////////////// 9///////////////////////////////////////////////////////////////////////
32// Class GLGeomObj 10// Class GLGeomObj
@@ -335,7 +313,7 @@ var GeomObj = function GLGeomObj() {
335 break; 313 break;
336 314
337 default: 315 default:
338 console.log( "material type: " + materialType + " is not supported" ); 316 console.log( "material type: " + shaderName + " is not supported" );
339 break; 317 break;
340 } 318 }
341 319
@@ -375,26 +353,29 @@ var GeomObj = function GLGeomObj() {
375 var materialType = this.getPropertyFromString( "material: ", importStr ); 353 var materialType = this.getPropertyFromString( "material: ", importStr );
376 switch (materialType) 354 switch (materialType)
377 { 355 {
378 case "flat": mat = new FlatMaterial(); break; 356 case "flat":
379 case "radialGradient": mat = new RadialGradientMaterial(); break; 357 case "radialGradient":
380 case "linearGradient": mat = new LinearGradientMaterial(); break; 358 case "linearGradient":
381 case "bumpMetal": mat = new BumpMetalMaterial(); break; 359 case "bumpMetal":
382 case "uber": mat = new UberMaterial(); break; 360 case "uber":
383 case "plasma": mat = new PlasmaMaterial(); break; 361 case "plasma":
384 case "deform": mat = new DeformMaterial(); break; 362 case "deform":
385 case "water": mat = new WaterMaterial(); break; 363 case "water":
386 case "tunnel": mat = new TunnelMaterial(); break; 364 case "tunnel":
387 case "reliefTunnel": mat = new ReliefTunnelMaterial(); break; 365 case "reliefTunnel":
388 case "squareTunnel": mat = new SquareTunnelMaterial(); break; 366 case "squareTunnel":
389 case "twist": mat = new TwiseMaterial(); break; 367 case "twist":
390 case "fly": mat = new FlyMaterial(); break; 368 case "fly":
391 case "julia": mat = new JuliaMaterial(); break; 369 case "julia":
392 case "mandel": mat = new MandelMaterial(); break; 370 case "mandel":
393 case "star": mat = new StarMaterial(); break; 371 case "star":
394 case "zinvert": mat = new ZInvertMaterial(); break; 372 case "zinvert":
395 case "keleidoscope": mat = new KeleidoscopeMaterial(); break; 373 case "keleidoscope":
396 case "radialBlur": mat = new RadialBlurMaterial(); break; 374 case "radialBlur":
397 case "pulse": mat = new PulseMaterial(); break; 375 case "pulse":
376 mat = MaterialsModel.getMaterialByShader( materialType );
377 if (mat) mat = mat.dup();
378 break;
398 379
399 default: 380 default:
400 console.log( "material type: " + materialType + " is not supported" ); 381 console.log( "material type: " + materialType + " is not supported" );