diff options
author | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-11-23 13:10:21 +0300 |
---|---|---|
committer | Kester Maddock <Christopher.Maddock.1@uni.massey.ac.nz> | 2004-11-23 13:10:21 +0300 |
commit | f8c2ce93b978dbcb1e197fa30a0557c405856fcc (patch) | |
tree | 9a8dd3272b136cc4a06f6a3a7c3d1ca6c4cefab0 /source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | |
parent | 88b556fd57701b6b6cfc5b47ab1c4f31676ade85 (diff) |
Fix for bug 1800: mouse over sensor doesn't work for ortho cameras.
The camera -> world transform wasn't being calculated properly for 'ortho' cameras: getOrigin()[2] should be scaled by 100 (like the render transform in KX_KetsjiEngine)
Diffstat (limited to 'source/gameengine/Ketsji/KX_MouseFocusSensor.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 9380ef6f2fa..0e30e324e87 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -207,7 +207,13 @@ bool KX_MouseFocusSensor::ParentObjectHasFocus(void) ); /* camera to world */ - MT_Matrix4x4 camcs_wcs_matrix = MT_Matrix4x4(cam->GetCameraToWorld()); + MT_Transform wcs_camcs_tranform = cam->GetWorldToCamera(); + if (!cam->GetCameraData()->m_perspective) + wcs_camcs_tranform.getOrigin()[2] *= 100.0; + MT_Transform cams_wcs_transform; + cams_wcs_transform.invert(wcs_camcs_tranform); + + MT_Matrix4x4 camcs_wcs_matrix = MT_Matrix4x4(cams_wcs_transform); /* badly defined, the first time round.... I wonder why... I might * want to guard against floating point errors here.*/ |