diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2015-06-29 16:45:27 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2015-06-29 16:45:27 +0300 |
commit | f12b1790a0f4bb26d99ca151f8794a179e151987 (patch) | |
tree | 39bb3cf3c85fbd8c91df5e867e38a477958004d9 /source/gameengine/Ketsji/KX_Camera.cpp | |
parent | 3d12d4b94f9bff6ea810179e22a5e3e018541f31 (diff) |
Fix 73841 : Game Engine - Camera Lens Shift
This is essential for video projection, and the alternative until now was to manually change the projection matrix via Python.
( http://www.blender.org/manual/game_engine/camera/introduction.html#camera-lens-shift
- this page will be removed as soon as I commit this)
Also this is working for perspective and orto cameras BUT if the sensor is not AUTO it will only look correct in blenderplayer (this is an unrelated bug, but just in case someone runs into it while testing this, now you know why you got the issue).
Kudos for the BlenderVR project for supporting this feature development.
Differential Revision: https://developer.blender.org/D1379
Diffstat (limited to 'source/gameengine/Ketsji/KX_Camera.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 4456345e1d9..70bcf505f2e 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -224,6 +224,22 @@ short KX_Camera::GetSensorFit() const return m_camdata.m_sensor_fit; } +/** + * Gets the horizontal shift of the sensor - for camera matching. + */ +float KX_Camera::GetShiftHorizontal() const +{ + return m_camdata.m_shift_x; +} + +/** + * Gets the vertical shift of the sensor - for camera matching. + */ +float KX_Camera::GetShiftVertical() const +{ + return m_camdata.m_shift_y; +} + float KX_Camera::GetCameraNear() const { return m_camdata.m_clipstart; |