aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-04-04 11:51:08 -0700
committerJose Antonio Marquez2012-04-04 11:51:08 -0700
commite2ed78b699c3f2353bdf636629956c2a3ef319be (patch)
treeb9b2f9e175b710f9b37b17b470587a5af43075d2 /js/lib
parentbc04ee998de7aaadc457f4e932cc4be8327a2a03 (diff)
parent8482e23cd9b8c4700b5130f2588e5eb24d376536 (diff)
downloadninja-e2ed78b699c3f2353bdf636629956c2a3ef319be.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into Document
Diffstat (limited to 'js/lib')
-rwxr-xr-xjs/lib/drawing/world.js13
-rwxr-xr-xjs/lib/nj-base.js13
2 files changed, 6 insertions, 20 deletions
diff --git a/js/lib/drawing/world.js b/js/lib/drawing/world.js
index 5a054224..e348f5e8 100755
--- a/js/lib/drawing/world.js
+++ b/js/lib/drawing/world.js
@@ -527,7 +527,7 @@ World.prototype.clearTree = function() {
527 if (this._useWebGL) { 527 if (this._useWebGL) {
528 var root = this._rootNode; 528 var root = this._rootNode;
529 root.children = new Array(); 529 root.children = new Array();
530 g_Engine.unregisterCanvas( this._canvas.rdgeid ) 530 g_Engine.unregisterCanvas( this._canvas.rdgeid );
531 531
532 this.update( 0 ); 532 this.update( 0 );
533 this.draw(); 533 this.draw();
@@ -540,8 +540,9 @@ World.prototype.updateMaterials = function( obj, time ) {
540 var matArray = obj.getMaterialArray(); 540 var matArray = obj.getMaterialArray();
541 if (matArray) { 541 if (matArray) {
542 var n = matArray.length; 542 var n = matArray.length;
543 for (var i=0; i<n; i++) 543 for (var i=0; i<n; i++) {
544 matArray[i].update( time ); 544 matArray[i].update( time );
545 }
545 } 546 }
546 547
547 this.updateMaterials( obj.getNext(), time ); 548 this.updateMaterials( obj.getNext(), time );
@@ -553,9 +554,8 @@ World.prototype.getNDCOrigin = function() {
553 var pt = MathUtils.transformPoint( [0,0,0], this.getCameraMatInverse() ); 554 var pt = MathUtils.transformPoint( [0,0,0], this.getCameraMatInverse() );
554 var projMat = Matrix.makePerspective( this.getFOV(), this.getAspect(), this.getZNear(), this.getZFar()); 555 var projMat = Matrix.makePerspective( this.getFOV(), this.getAspect(), this.getZNear(), this.getZFar());
555 var ndcPt = MathUtils.transformHomogeneousPoint( pt, projMat ); 556 var ndcPt = MathUtils.transformHomogeneousPoint( pt, projMat );
556 var ndcOrigin = MathUtils.applyHomogeneousCoordinate( ndcPt );
557 557
558 return ndcOrigin; 558 return MathUtils.applyHomogeneousCoordinate( ndcPt );
559}; 559};
560 560
561World.prototype.worldToScreen = function(v) { 561World.prototype.worldToScreen = function(v) {
@@ -570,9 +570,8 @@ World.prototype.worldToScreen = function(v) {
570 var x = v2[0], y = v2[1], z = v2[2]; 570 var x = v2[0], y = v2[1], z = v2[2];
571 571
572 var h = this.getGLContext().viewportHeight/2.0, w = this.getGLContext().viewportWidth/2.0; 572 var h = this.getGLContext().viewportHeight/2.0, w = this.getGLContext().viewportWidth/2.0;
573 var x2 = w*(1 + x), y2 = h*( 1 - y ), z2 = z; 573 var x2 = w * (1 + x), y2 = h * ( 1 - y );
574 574 return [x2, y2, z, 1];
575 return [x2, y2, z2, 1];
576}; 575};
577 576
578World.prototype.screenToView = function( x, y ) { 577World.prototype.screenToView = function( x, y ) {
diff --git a/js/lib/nj-base.js b/js/lib/nj-base.js
deleted file mode 100755
index d1e1ff5b..00000000
--- a/js/lib/nj-base.js
+++ /dev/null
@@ -1,13 +0,0 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No 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//nj-base: Contains base class definitions to use as Ninja building blocks.
8var Montage = require("montage/core/core").Montage,
9 Component = require("montage/ui/component").Component;
10
11exports.NJComponent = Montage.create( Component, {
12
13}); \ No newline at end of file