diff options
author | Nivesh Rajbhandari | 2012-03-06 14:09:44 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-06 14:09:44 -0800 |
commit | 792793cd3991032b4840ade67f98ae8eae2d30a0 (patch) | |
tree | 69d3df003d2bb58fa1ab562fbd1058ff91851f01 /js/tools/drawing-tool-base.js | |
parent | 2346d8ab9db06573d8672c64988c46b6c672e015 (diff) | |
parent | 1cd89d4d06e3a8f2c221628b19cf26a2c69f5d3f (diff) | |
download | ninja-792793cd3991032b4840ade67f98ae8eae2d30a0.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/tools/drawing-tool-base.js')
-rwxr-xr-x | js/tools/drawing-tool-base.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index cd895102..8d87605c 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js | |||
@@ -205,11 +205,11 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
205 | thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); | 205 | thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); |
206 | } else { | 206 | } else { |
207 | var vec = vecUtils.vecSubtract(3, s1, s0 ); | 207 | var vec = vecUtils.vecSubtract(3, s1, s0 ); |
208 | var yAxis = Vector.create([0,1,0]); | 208 | var yAxis = [0,1,0]; |
209 | var tmp = vecUtils.vecCross( 3, vec, yAxis ); | 209 | var tmp = vecUtils.vecCross( 3, vec, yAxis ); |
210 | var mag = vecUtils.vecMag(3, tmp); | 210 | var mag = vecUtils.vecMag(3, tmp); |
211 | if (MathUtils.fpSign(mag) === 0) { | 211 | if (MathUtils.fpSign(mag) === 0) { |
212 | thePlane = Vector.create( [0,0,1] ); | 212 | thePlane = [0,0,1]; |
213 | thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); | 213 | thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); |
214 | } else { | 214 | } else { |
215 | var xAxis = vecUtils.vecCross( 3, yAxis, tmp ); | 215 | var xAxis = vecUtils.vecCross( 3, yAxis, tmp ); |
@@ -336,12 +336,12 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
336 | else | 336 | else |
337 | { | 337 | { |
338 | var vec = vecUtils.vecSubtract(3, s1, s0 ); | 338 | var vec = vecUtils.vecSubtract(3, s1, s0 ); |
339 | var yAxis = Vector.create([0,1,0]); | 339 | var yAxis = [0,1,0]; |
340 | var tmp = vecUtils.vecCross( 3, vec, yAxis ); | 340 | var tmp = vecUtils.vecCross( 3, vec, yAxis ); |
341 | var mag = vecUtils.vecMag(3, tmp); | 341 | var mag = vecUtils.vecMag(3, tmp); |
342 | if (MathUtils.fpSign(mag) === 0) | 342 | if (MathUtils.fpSign(mag) === 0) |
343 | { | 343 | { |
344 | thePlane = Vector.create( [0,0,1] ); | 344 | thePlane = [0,0,1]; |
345 | thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); | 345 | thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); |
346 | } | 346 | } |
347 | else | 347 | else |
@@ -379,7 +379,7 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
379 | 379 | ||
380 | } | 380 | } |
381 | 381 | ||
382 | var localPt = Vector.create([p0[0], p0[1], 0.0, 1.0]); | 382 | var localPt = [p0[0], p0[1], 0.0, 1.0]; |
383 | s0 = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt ); | 383 | s0 = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt ); |
384 | s0 = vecUtils.vecAdd(3, viewUtils.viewToScreen( MathUtils.transformPoint(s0, stageMat) ), offset ); | 384 | s0 = vecUtils.vecAdd(3, viewUtils.viewToScreen( MathUtils.transformPoint(s0, stageMat) ), offset ); |
385 | 385 | ||
@@ -513,8 +513,8 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
513 | var z = p0[2]; | 513 | var z = p0[2]; |
514 | 514 | ||
515 | // fill in the other 2 points on the plane to complete the 4 points | 515 | // fill in the other 2 points on the plane to complete the 4 points |
516 | var p1 = Vector.create( [p0[0], p2[1], z] ), | 516 | var p1 = [p0[0], p2[1], z], |
517 | p3 = Vector.create( [p2[0], p0[1], z] ); | 517 | p3 = [p2[0], p0[1], z]; |
518 | 518 | ||
519 | // convert back to 3D space | 519 | // convert back to 3D space |
520 | s0 = MathUtils.transformPoint( p0, planeMat ); | 520 | s0 = MathUtils.transformPoint( p0, planeMat ); |
@@ -633,8 +633,8 @@ exports.DrawingToolBase = Montage.create(Montage, { | |||
633 | var pt0 = ptArr[0], pt2 = ptArr[1]; | 633 | var pt0 = ptArr[0], pt2 = ptArr[1]; |
634 | z = pt0[2]; | 634 | z = pt0[2]; |
635 | pt0[2] = z; pt2[2] = z; | 635 | pt0[2] = z; pt2[2] = z; |
636 | var pt1 = Vector.create( [pt0[0], pt2[1], z] ), | 636 | var pt1 = [pt0[0], pt2[1], z], |
637 | pt3 = Vector.create( [pt2[0], pt0[1], z] ); | 637 | pt3 = [pt2[0], pt0[1], z]; |
638 | 638 | ||
639 | // | 639 | // |
640 | ptArr = [pt0, pt1, pt2, pt3]; | 640 | ptArr = [pt0, pt1, pt2, pt3]; |