| 148 | //----------------------------------------------------------------------------- |
| 149 | |
| 150 | void SceneManager::renderScene( ScenePassType passType, U32 objectMask ) |
| 151 | { |
| 152 | SceneCameraState cameraState = SceneCameraState::fromGFX(); |
| 153 | |
| 154 | // Handle frustum locking. |
| 155 | |
| 156 | const bool lockedFrustum = ( smLockDiffuseFrustum && passType == SPT_Diffuse ); |
| 157 | if( lockedFrustum ) |
| 158 | cameraState = smLockedDiffuseCamera; |
| 159 | else if( passType == SPT_Diffuse ) |
| 160 | { |
| 161 | // Store the camera state so if we lock, this will become the |
| 162 | // locked state. |
| 163 | smLockedDiffuseCamera = cameraState; |
| 164 | } |
| 165 | |
| 166 | // Create the render state. |
| 167 | |
| 168 | SceneRenderState renderState( this, passType, cameraState ); |
| 169 | |
| 170 | // If we have locked the frustum, reset the view transform |
| 171 | // on the render pass which the render state has just set |
| 172 | // to the view matrix corresponding to the locked frustum. For |
| 173 | // rendering, however, we need the true view matrix from the |
| 174 | // GFX state. |
| 175 | |
| 176 | if( lockedFrustum ) |
| 177 | { |
| 178 | RenderPassManager* rpm = renderState.getRenderPass(); |
| 179 | rpm->assignSharedXform( RenderPassManager::View, GFX->getWorldMatrix() ); |
| 180 | } |
| 181 | |
| 182 | // Render. |
| 183 | |
| 184 | renderScene( &renderState, objectMask ); |
| 185 | } |
| 186 | |
| 187 | //----------------------------------------------------------------------------- |
| 188 |
no test coverage detected