diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2015-10-13 00:18:18 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2015-10-13 00:18:18 +0300 |
commit | 9d18fd1188e1a3e2d5a58fada0a26ae4107dcfe7 (patch) | |
tree | 92fa891b35de3f0c9b3797ad6027d12855fe4c46 /source/gameengine/VideoTexture | |
parent | c36f08d573a4c867cf196ac56fa3949ddaecd880 (diff) |
BGE: support camera scale, can be negative.
Camera scale was previously ignored in the BGE.
It is now injected in the modelview matrix as a scale of the scene
coordinates in the camera local reference. This is equivalent to a zoom:
A scale of 2 multiplies the coordinates by 2 => only the points with
coordinates less then 0.5 before the scale will fall in the frustrum =>
equivalent to a zoom.
Anisotropic scale is supported (different scale in x, y, z)
Negative scale is also supported. As an odd number of negative scale flips the
normals of the objects, the OGL front face setting is also flipped to compensate.
A Y negative scale of -1 produces a vertical flip at OGL level.
Diffstat (limited to 'source/gameengine/VideoTexture')
-rw-r--r-- | source/gameengine/VideoTexture/ImageRender.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index c4b3722fa8c..9db9a1a5f85 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -330,7 +330,7 @@ bool ImageRender::Render() MT_Transform camtrans(m_camera->GetWorldToCamera()); MT_Matrix4x4 viewmat(camtrans); - m_rasterizer->SetViewMatrix(viewmat, m_camera->NodeGetWorldOrientation(), m_camera->NodeGetWorldPosition(), m_camera->GetCameraData()->m_perspective); + m_rasterizer->SetViewMatrix(viewmat, m_camera->NodeGetWorldOrientation(), m_camera->NodeGetWorldPosition(), m_camera->NodeGetLocalScaling(), m_camera->GetCameraData()->m_perspective); m_camera->SetModelviewMatrix(viewmat); // restore the stereo mode now that the matrix is computed m_rasterizer->SetStereoMode(stereomode); |