diff options
author | Nivesh Rajbhandari | 2012-04-09 16:04:24 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-09 16:04:24 -0700 |
commit | 952e0b2c28af081041fa8987c3e865b931d052fa (patch) | |
tree | 51a2d9a210cc89b8df8edd120d78c4fbd2480b06 /js/helper-classes/3D/hit-record.js | |
parent | c62c5c4287a1ee8a276b32dc61f06abbc24818ec (diff) | |
download | ninja-952e0b2c28af081041fa8987c3e865b931d052fa.tar.gz |
Single perspective fix.
Note that rotating multiple objects when the stage is rotated still doesn't work and flatten still doesn't work.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/helper-classes/3D/hit-record.js')
-rwxr-xr-x | js/helper-classes/3D/hit-record.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/js/helper-classes/3D/hit-record.js b/js/helper-classes/3D/hit-record.js index 2c60adc6..265bf2a4 100755 --- a/js/helper-classes/3D/hit-record.js +++ b/js/helper-classes/3D/hit-record.js | |||
@@ -232,7 +232,15 @@ var HitRecord = exports.HitRecord = Object.create(Object.prototype, | |||
232 | var elt = this.getElt(); | 232 | var elt = this.getElt(); |
233 | viewUtils.pushViewportObj( elt ); | 233 | viewUtils.pushViewportObj( elt ); |
234 | var viewPt = viewUtils.screenToView( scrPt[0], scrPt[1], scrPt[2] ); | 234 | var viewPt = viewUtils.screenToView( scrPt[0], scrPt[1], scrPt[2] ); |
235 | var eyePt = viewUtils.getEyePoint(); | 235 | var eyePt; |
236 | if(viewUtils.getPerspectiveDistFromElement(elt)) | ||
237 | { | ||
238 | eyePt = viewUtils.getEyePoint(); | ||
239 | } | ||
240 | else | ||
241 | { | ||
242 | eyePt = [viewPt[0], viewPt[1], 1400]; | ||
243 | } | ||
236 | var projPt = MathUtils.vecIntersectPlane( eyePt, MathUtils.vecSubtract(viewPt,eyePt), plane ); | 244 | var projPt = MathUtils.vecIntersectPlane( eyePt, MathUtils.vecSubtract(viewPt,eyePt), plane ); |
237 | 245 | ||
238 | return projPt; | 246 | return projPt; |