BGE: fix for [#20684] Game Render blanks screen on Anaglyph Stereo view

The problem was: the Blender default camera has DOF distance as 0.0. Since we are using this as Focal Length for the stereo calculation we had terrible stereo by default.

Fix: whenever DOF == 0.0 we use focal length as eye separation * 30.0 (known to be a reasonable value)
This commit is contained in:
Dalai Felinto 2010-02-01 15:13:05 +00:00
parent 7bd3d1213a
commit 90e2b22fee

@ -904,7 +904,9 @@ MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix(
// if Rasterizer.setFocalLength is not called we use the camera focallength
if (!m_setfocallength)
m_focallength = focallength;
// if focallength is null we use a value known to be reasonable
m_focallength = (focallength == 0.f) ? m_eyeseparation * 30.0
: focallength;
near_div_focallength = frustnear / m_focallength;
offset = 0.5 * m_eyeseparation * near_div_focallength;