diff options
author | hwc487 | 2012-07-09 09:31:09 -0700 |
---|---|---|
committer | hwc487 | 2012-07-09 09:31:09 -0700 |
commit | e95aadc605cfe57067e98a247d4e2fd6e2d76895 (patch) | |
tree | 7f68e1076cb9d047e78734fd0b4bf5e2d6c9d722 /js | |
parent | 05801f02d46ad2b4b6bf2a800b5c2ae8058c04c7 (diff) | |
download | ninja-e95aadc605cfe57067e98a247d4e2fd6e2d76895.tar.gz |
fix for grid drawing.
Diffstat (limited to 'js')
-rwxr-xr-x | js/helper-classes/3D/StageLine.js | 11 |
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 | /////////////////////////////////////////////////////////////////////// |
11 | var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; | 11 | var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; |
12 | var viewUtils = require( "js/helper-classes/3D/view-utils").ViewUtils; | ||
12 | var LinePlaneIntersectRec = require("js/helper-classes/3D/LinePlaneIntersectRec").LinePlaneIntersectRec; | 13 | var LinePlaneIntersectRec = require("js/helper-classes/3D/LinePlaneIntersectRec").LinePlaneIntersectRec; |
13 | 14 | ||
14 | var StageLine = exports.StageLine = Object.create(Object.prototype, { | 15 | var 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) |