aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/geom-obj.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-09 14:35:44 -0700
committerValerio Virgillito2012-07-09 14:35:44 -0700
commit84b3327bd92faafab7954b5eb64c7abe24a3fe13 (patch)
tree3f56cbed2f08c5a81ea79eaf0bcb9bd031d8a627 /js/lib/geom/geom-obj.js
parentc0a42c56f768a873ba637f5b86d5f6a84d4a3312 (diff)
parent40c6eb2c06b34f65a74d59ef9687251952858bab (diff)
downloadninja-84b3327bd92faafab7954b5eb64c7abe24a3fe13.tar.gz
Merge branch 'normalize' of https://github.com/kriskowal/ninja-internal
Conflicts: js/components/gradientpicker.reel/gradientpicker.js js/components/tools-properties/text-properties.reel/text-properties.js js/document/views/base.js js/document/views/design.js js/helper-classes/3D/StageLine.js js/helper-classes/3D/draw-utils.js js/lib/drawing/world.js js/lib/geom/circle.js js/lib/geom/line.js js/lib/geom/rectangle.js js/lib/geom/shape-primitive.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/flag-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/water-material.js js/panels/Materials/materials-library-panel.reel/materials-library-panel.html js/panels/Materials/materials-library-panel.reel/materials-library-panel.js js/panels/Materials/materials-popup.reel/materials-popup.html js/panels/Materials/materials-popup.reel/materials-popup.js js/tools/LineTool.js Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/lib/geom/geom-obj.js')
-rwxr-xr-xjs/lib/geom/geom-obj.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js
index 5373c78a..d859d025 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -288,13 +288,13 @@ exports.GeomObj = Object.create(Object.prototype, {
288 this._materialArray.push(strokeMaterial); 288 this._materialArray.push(strokeMaterial);
289 this._materialTypeArray.push("stroke"); 289 this._materialTypeArray.push("stroke");
290 290
291 // don't set the value here. The material editor may set a color directly 291 // don't set the value here. The material editor may set a color directly
292 // to the material without setting this value in the obj. The following 292 // to the material without setting this value in the obj. The following
293 // lines of code will clobber the value in the material 293 // lines of code will clobber the value in the material
294 //if (this._strokeColor) 294 //if (this._strokeColor)
295 // this.setStrokeColor(this._strokeColor); 295 // this.setStrokeColor(this._strokeColor);
296 296
297 this._strokeMaterial = strokeMaterial; 297 this._strokeMaterial = strokeMaterial;
298 298
299 return strokeMaterial; 299 return strokeMaterial;
300 } 300 }
@@ -315,14 +315,14 @@ exports.GeomObj = Object.create(Object.prototype, {
315 315
316 this._materialArray.push(fillMaterial); 316 this._materialArray.push(fillMaterial);
317 this._materialTypeArray.push("fill"); 317 this._materialTypeArray.push("fill");
318 318
319 // don't set the value here. The material editor may set a color directly 319 // don't set the value here. The material editor may set a color directly
320 // to the material without setting this value in the obj. The following 320 // to the material without setting this value in the obj. The following
321 // lines of code will clobber the value in the material 321 // lines of code will clobber the value in the material
322 //if (this._fillColor) 322 //if (this._fillColor)
323 // this.setFillColor(this._fillColor); 323 // this.setFillColor(this._fillColor);
324 324
325 this._fillMaterial = fillMaterial; 325 this._fillMaterial = fillMaterial;
326 326
327 return fillMaterial; 327 return fillMaterial;
328 } 328 }
@@ -330,7 +330,7 @@ exports.GeomObj = Object.create(Object.prototype, {
330 330
331 exportMaterialsJSON: { 331 exportMaterialsJSON: {
332 value: function() { 332 value: function() {
333 MaterialsModel = require("js/models/materials-model").MaterialsModel; 333 MaterialsModel = require("js/models/materials-model").MaterialsModel;
334 334
335 var jObj; 335 var jObj;
336 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) { 336 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) {
@@ -362,7 +362,7 @@ exports.GeomObj = Object.create(Object.prototype, {
362 362
363 importMaterialsJSON: { 363 importMaterialsJSON: {
364 value: function(jObj) { 364 value: function(jObj) {
365 MaterialsModel = require("js/models/materials-model").MaterialsModel; 365 MaterialsModel = require("js/models/materials-model").MaterialsModel;
366 366
367 this._materialArray = []; 367 this._materialArray = [];
368 this._materialTypeArray = []; 368 this._materialTypeArray = [];
@@ -389,7 +389,7 @@ exports.GeomObj = Object.create(Object.prototype, {
389 case "tunnel": 389 case "tunnel":
390 case "reliefTunnel": 390 case "reliefTunnel":
391 case "squareTunnel": 391 case "squareTunnel":
392 case "flag": 392 case "flag":
393 case "twist": 393 case "twist":
394 case "fly": 394 case "fly":
395 case "julia": 395 case "julia":
@@ -399,8 +399,8 @@ exports.GeomObj = Object.create(Object.prototype, {
399 case "keleidoscope": 399 case "keleidoscope":
400 case "radialBlur": 400 case "radialBlur":
401 case "pulse": 401 case "pulse":
402 case "twistVert": 402 case "twistVert":
403 case "taper": 403 case "taper":
404 mat = MaterialsModel.getMaterialByShader(shaderName); 404 mat = MaterialsModel.getMaterialByShader(shaderName);
405 if (mat) mat = mat.dup(); 405 if (mat) mat = mat.dup();
406 break; 406 break;
@@ -454,12 +454,12 @@ exports.GeomObj = Object.create(Object.prototype, {
454 // get the normalized device coordinates (NDC) for 454 // get the normalized device coordinates (NDC) for
455 // all position and dimensions. 455 // all position and dimensions.
456 var world = this.getWorld(); 456 var world = this.getWorld();
457 var vpw = world.getViewportWidth(), vph = world.getViewportHeight(); 457 var vpw = world.getViewportWidth(), vph = world.getViewportHeight();
458 var xNDC = 2*this._xOffset/vpw, yNDC = -2*this._yOffset/vph; 458 var xNDC = 2*this._xOffset/vpw, yNDC = -2*this._yOffset/vph;
459 459
460 var aspect = world.getAspect(); 460 var aspect = world.getAspect();
461 var zn = world.getZNear(), zf = world.getZFar(); 461 var zn = world.getZNear(), zf = world.getZFar();
462 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0), 462 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0),
463 b = -t, 463 b = -t,
464 r = aspect*t, 464 r = aspect*t,
465 l = -r; 465 l = -r;
@@ -484,12 +484,12 @@ exports.GeomObj = Object.create(Object.prototype, {
484 // get the normalized device coordinates (NDC) for 484 // get the normalized device coordinates (NDC) for
485 // all position and dimensions. 485 // all position and dimensions.
486 var world = this.getWorld(); 486 var world = this.getWorld();
487 var vpw = world.getViewportWidth(), vph = world.getViewportHeight(); 487 var vpw = world.getViewportWidth(), vph = world.getViewportHeight();
488 var xNDC = 2*preViewPt[0]/vpw, yNDC = -2*preViewPt[1]/vph; 488 var xNDC = 2*preViewPt[0]/vpw, yNDC = -2*preViewPt[1]/vph;
489 489
490 var aspect = world.getAspect(); 490 var aspect = world.getAspect();
491 var zn = world.getZNear(), zf = world.getZFar(); 491 var zn = world.getZNear(), zf = world.getZFar();
492 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0), 492 var t = zn * Math.tan(world.getFOV() * Math.PI / 360.0),
493 b = -t, 493 b = -t,
494 r = aspect*t, 494 r = aspect*t,
495 l = -r; 495 l = -r;