aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D
diff options
context:
space:
mode:
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});