aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D
diff options
context:
space:
mode:
authorhwc4872012-04-11 16:01:33 -0700
committerhwc4872012-04-11 16:01:33 -0700
commitf522ce09d98bbb2812ed25bb942597d854d71a1c (patch)
treea186dce4bdd589ba6dd102b758f1670a3e1e61ba /js/helper-classes/3D
parent2d21b01d6dd64af643f5f38818b57fcace05ea0b (diff)
downloadninja-f522ce09d98bbb2812ed25bb942597d854d71a1c.tar.gz
Rotate3D tool changes
Diffstat (limited to 'js/helper-classes/3D')
-rwxr-xr-xjs/helper-classes/3D/hit-record.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/js/helper-classes/3D/hit-record.js b/js/helper-classes/3D/hit-record.js
index 96f87c24..6094dae1 100755
--- a/js/helper-classes/3D/hit-record.js
+++ b/js/helper-classes/3D/hit-record.js
@@ -320,13 +320,22 @@ var HitRecord = exports.HitRecord = Object.create(Object.prototype,
320 var globalToLocal = glmat4.inverse( localToGlobal, [] ); 320 var globalToLocal = glmat4.inverse( localToGlobal, [] );
321 var test3 = MathUtils.transformAndDivideHomogeneousPoint( globalPt, globalToLocal ); 321 var test3 = MathUtils.transformAndDivideHomogeneousPoint( globalPt, globalToLocal );
322 dist = vecUtils.vecDist(3, test3, localPt); 322 dist = vecUtils.vecDist(3, test3, localPt);
323 if (MathUtils.fpSign( vecUtils.vecDist(3, test3, localPt)) != 0) 323 if (MathUtils.fpSign(dist) != 0)
324 { 324 {
325 err = true; 325 err = true;
326 console.log( "**** transform error 3 ***** " + dist + ", localPt: " + localPt ); 326 console.log( "**** transform error 3 ***** " + dist + ", localPt: " + localPt );
327 } 327 }
328 328
329 if (!err) console.log( "no hitRecord error" ); 329 var objToStageWorld = viewUtils.getObjToStageWorldMatrix( elt, true );
330 var test4 = MathUtils.transformAndDivideHomogeneousPoint( localPt, objToStageWorld );
331 dist = vecUtils.vecDist(3, test4, stageWorldPt);
332 if (MathUtils.fpSign(dist) != 0)
333 {
334 err = true;
335 console.log( "**** transform error 4 ***** " + dist + ", localPt: " + localPt );
336 }
337
338 //if (!err) console.log( "no hitRecord error" );
330 } 339 }
331 } 340 }
332}); 341});