diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2009-05-10 01:04:03 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2009-05-10 01:04:03 +0400 |
commit | 4a2341fe9a53839c4be685070c41f7b0ea980017 (patch) | |
tree | 58f70c8915209533c34911a307abfda5a5fda62e /source/gameengine/Ketsji/KX_Dome.cpp | |
parent | df01af5a1f05d03ad1464bca1fcbffe495ca0539 (diff) |
BGE Dome: Allowing FOV different from 180º for Truncated Domes
*) a small note:
In the end it turned out that we have upright and downright domes out there.
So I may rearrange the order of the gui later:
(1 = fisheye, 2 = truncated up, 3 = truncated down, 4 = envmap, 5 = spherical panoramic)
I don't plan to do a doVersion() for that, so if you are using it already keep in mind that the modes may change before 249 final release.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Dome.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Dome.cpp | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/source/gameengine/Ketsji/KX_Dome.cpp b/source/gameengine/Ketsji/KX_Dome.cpp index a302bf98cb8..429c1b84918 100644 --- a/source/gameengine/Ketsji/KX_Dome.cpp +++ b/source/gameengine/Ketsji/KX_Dome.cpp @@ -125,15 +125,24 @@ KX_Dome::KX_Dome ( m_numfaces = 6; break; default: //DOME_TRUNCATED_DOWN and DOME_TRUNCATED_UP - cubetop.resize(1); - cubebottom.resize(1); - cubeleft.resize(2); - cuberight.resize(2); + if (m_angle <= 180){ + cubetop.resize(1); + cubebottom.resize(1); + cubeleft.resize(2); + cuberight.resize(2); - m_angle = 180; - CreateMeshDome180(); - m_numfaces = 4; - break; + CreateMeshDome180(); + m_numfaces = 4; + }else if (m_angle > 180){ + cubetop.resize(2); + cubebottom.resize(2); + cubeleft.resize(2); + cubefront.resize(2); + cuberight.resize(2); + + CreateMeshDome250(); + m_numfaces = 5; + } break; } m_numimages =(warp.usemesh?m_numfaces+1:m_numfaces); @@ -1485,9 +1494,9 @@ Uses 6 cameras for angles up to 360º MT_Scalar c = cos(deg45); MT_Scalar s = sin(deg45); - if ((m_mode == DOME_FISHEYE && m_angle <= 180) + if (m_angle <= 180 && (m_mode == DOME_FISHEYE || m_mode == DOME_TRUNCATED_UP - || m_mode == DOME_TRUNCATED_DOWN){ + || m_mode == DOME_TRUNCATED_DOWN)){ m_locRot[0] = MT_Matrix3x3( // 90º - Top c, -s, 0.0, @@ -1509,7 +1518,9 @@ Uses 6 cameras for angles up to 360º 0.0, 1.0, 0.0, s, 0.0, c); - } else if ((m_mode == DOME_FISHEYE && m_angle > 180) || m_mode == DOME_ENVMAP){ + } else if (m_mode == DOME_ENVMAP || (m_angle > 180 && (m_mode == DOME_FISHEYE + || m_mode == DOME_TRUNCATED_UP + || m_mode == DOME_TRUNCATED_DOWN))){ m_locRot[0] = MT_Matrix3x3( // 90º - Top 1.0, 0.0, 0.0, |