diff options
author | hwc487 | 2012-03-16 15:17:53 -0700 |
---|---|---|
committer | hwc487 | 2012-03-16 15:17:53 -0700 |
commit | 55b2231d7badec16990b63ef1b6c770ef1e6fc25 (patch) | |
tree | 62d555dc627d30be8d7aec49e36935baca4e7fc3 /js/lib/geom | |
parent | 2ac5db3bb1bcee887d6dd742e6c0273abb5366bd (diff) | |
download | ninja-55b2231d7badec16990b63ef1b6c770ef1e6fc25.tar.gz |
Supporting new and old GL data formats.
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-x | js/lib/geom/geom-obj.js | 67 |
1 files changed, 24 insertions, 43 deletions
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 | ||
7 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; | 7 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; |
8 | /* | ||
9 | var FlatMaterial = require("js/lib/rdge/materials/flat-material").FlatMaterial; | ||
10 | var LinearGradientMaterial = require("js/lib/rdge/materials/linear-gradient-material").LinearGradientMaterial; | ||
11 | var RadialGradientMaterial = require("js/lib/rdge/materials/radial-gradient-material").RadialGradientMaterial; | ||
12 | var BumpMetalMaterial = require("js/lib/rdge/materials/bump-metal-material").BumpMetalMaterial; | ||
13 | var UberMaterial = require("js/lib/rdge/materials/uber-material").UberMaterial; | ||
14 | var RadialBlurMaterial = require("js/lib/rdge/materials/radial-blur-material").RadialBlurMaterial; | ||
15 | var PlasmaMaterial = require("js/lib/rdge/materials/plasma-material").PlasmaMaterial; | ||
16 | var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; | ||
17 | var TunnelMaterial = require("js/lib/rdge/materials/tunnel-material").TunnelMaterial; | ||
18 | var ReliefTunnelMaterial = require("js/lib/rdge/materials/relief-tunnel-material").ReliefTunnelMaterial; | ||
19 | var SquareTunnelMaterial = require("js/lib/rdge/materials/square-tunnel-material").SquareTunnelMaterial; | ||
20 | var FlyMaterial = require("js/lib/rdge/materials/fly-material").FlyMaterial; | ||
21 | var WaterMaterial = require("js/lib/rdge/materials/water-material").WaterMaterial; | ||
22 | var ZInvertMaterial = require("js/lib/rdge/materials/z-invert-material").ZInvertMaterial; | ||
23 | var DeformMaterial = require("js/lib/rdge/materials/deform-material").DeformMaterial; | ||
24 | var StarMaterial = require("js/lib/rdge/materials/star-material").StarMaterial; | ||
25 | var TwistMaterial = require("js/lib/rdge/materials/twist-material").TwistMaterial; | ||
26 | var JuliaMaterial = require("js/lib/rdge/materials/julia-material").JuliaMaterial; | ||
27 | var KeleidoscopeMaterial = require("js/lib/rdge/materials/keleidoscope-material").KeleidoscopeMaterial; | ||
28 | var 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" ); |