aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D
diff options
context:
space:
mode:
authorhwc4872012-07-09 09:31:09 -0700
committerhwc4872012-07-09 09:31:09 -0700
commite95aadc605cfe57067e98a247d4e2fd6e2d76895 (patch)
tree7f68e1076cb9d047e78734fd0b4bf5e2d6c9d722 /js/helper-classes/3D
parent05801f02d46ad2b4b6bf2a800b5c2ae8058c04c7 (diff)
downloadninja-e95aadc605cfe57067e98a247d4e2fd6e2d76895.tar.gz
fix for grid drawing.
Diffstat (limited to 'js/helper-classes/3D')
-rwxr-xr-xjs/helper-classes/3D/StageLine.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/helper-classes/3D/StageLine.js b/js/helper-classes/3D/StageLine.js
index 12efb140..e4394650 100755
--- a/js/helper-classes/3D/StageLine.js
+++ b/js/helper-classes/3D/StageLine.js
@@ -9,6 +9,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
9// The line class represents a line intersected with all planes on the scene 9// The line class represents a line intersected with all planes on the scene
10/////////////////////////////////////////////////////////////////////// 10///////////////////////////////////////////////////////////////////////
11var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; 11var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils;
12var viewUtils = require( "js/helper-classes/3D/view-utils").ViewUtils;
12var LinePlaneIntersectRec = require("js/helper-classes/3D/LinePlaneIntersectRec").LinePlaneIntersectRec; 13var LinePlaneIntersectRec = require("js/helper-classes/3D/LinePlaneIntersectRec").LinePlaneIntersectRec;
13 14
14var StageLine = exports.StageLine = Object.create(Object.prototype, { 15var StageLine = exports.StageLine = Object.create(Object.prototype, {
@@ -109,6 +110,7 @@ var StageLine = exports.StageLine = Object.create(Object.prototype, {
109 // determine if the intersection is on a front side (no intersection) of the polygons 110 // determine if the intersection is on a front side (no intersection) of the polygons
110 //var ctr = [ 0.5*(boundaryPts[0][0] + boundaryPts[2][0]), 0.5*(boundaryPts[0][1] + boundaryPts[2][1]), 0.5*(boundaryPts[0][2] + boundaryPts[2][2]) ]; 111 //var ctr = [ 0.5*(boundaryPts[0][0] + boundaryPts[2][0]), 0.5*(boundaryPts[0][1] + boundaryPts[2][1]), 0.5*(boundaryPts[0][2] + boundaryPts[2][2]) ];
111 //var vec = vecUtils.vecSubtract(3, pt, ctr ); 112 //var vec = vecUtils.vecSubtract(3, pt, ctr );
113 this.edgeIsFrontFacing2( plane );
112 if ( !this.edgeIsFrontFacing(boundaryPts, planeEq, plane.isBackFacing(), onEdge[0], onEdge[1]) ) 114 if ( !this.edgeIsFrontFacing(boundaryPts, planeEq, plane.isBackFacing(), onEdge[0], onEdge[1]) )
113 { 115 {
114 // take the dot product between the line and the normal to the plane 116 // take the dot product between the line and the normal to the plane
@@ -190,6 +192,15 @@ var StageLine = exports.StageLine = Object.create(Object.prototype, {
190 } 192 }
191 }, 193 },
192 194
195 edgeIsFrontFacing2:
196 {
197 value: function( plane )
198 {
199 var elt = plane._elt;
200 var bounds = viewUtils.getElementViewBounds3D( elt );
201 }
202 },
203
193 edgeIsFrontFacing: 204 edgeIsFrontFacing:
194 { 205 {
195 value: function(boundaryPts, planeNormal, backfacing, iEdge, t) 206 value: function(boundaryPts, planeNormal, backfacing, iEdge, t)