Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2015-10-13 00:18:18 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2015-10-13 00:18:18 +0300
commit9d18fd1188e1a3e2d5a58fada0a26ae4107dcfe7 (patch)
tree92fa891b35de3f0c9b3797ad6027d12855fe4c46 /source/gameengine/Ketsji/KX_Dome.cpp
parentc36f08d573a4c867cf196ac56fa3949ddaecd880 (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/Ketsji/KX_Dome.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_Dome.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp
index 07bed647b29..2220430dba9 100644
--- a/source/gameengine/Ketsji/KX_Dome.cpp
+++ b/source/gameengine/Ketsji/KX_Dome.cpp
@@ -1601,7 +1601,7 @@ void KX_Dome::RotateCamera(KX_Camera* cam, int i)
MT_Transform camtrans(cam->GetWorldToCamera());
MT_Matrix4x4 viewmat(camtrans);
- m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->GetCameraData()->m_perspective);
+ m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->NodeGetLocalScaling(), cam->GetCameraData()->m_perspective);
cam->SetModelviewMatrix(viewmat);
// restore the original orientation
@@ -2036,7 +2036,7 @@ void KX_Dome::RenderDomeFrame(KX_Scene* scene, KX_Camera* cam, int i)
MT_Transform camtrans(cam->GetWorldToCamera());
MT_Matrix4x4 viewmat(camtrans);
- m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), 1.0);
+ m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), cam->NodeGetLocalScaling(), 1.0);
cam->SetModelviewMatrix(viewmat);
// restore the original orientation