| 349 | //----------------------------------------------------------------------------- |
| 350 | |
| 351 | void SceneManager::_renderScene( SceneRenderState* state, U32 objectMask, SceneZoneSpace* baseObject, U32 baseZone ) |
| 352 | { |
| 353 | AssertFatal( this == gClientSceneGraph, "SceneManager::_buildSceneGraph - Only the client scenegraph can support this call!" ); |
| 354 | |
| 355 | PROFILE_SCOPE( SceneGraph_batchRenderImages ); |
| 356 | |
| 357 | // In the editor, override the type mask for diffuse passes. |
| 358 | |
| 359 | if( gEditingMission && state->isDiffusePass() ) |
| 360 | objectMask = EDITOR_RENDER_TYPEMASK; |
| 361 | |
| 362 | // Update the zoning state and traverse zones. |
| 363 | |
| 364 | if( getZoneManager() ) |
| 365 | { |
| 366 | // Update. |
| 367 | |
| 368 | getZoneManager()->updateZoningState(); |
| 369 | |
| 370 | // If zone culling isn't disabled, traverse the |
| 371 | // zones now. |
| 372 | |
| 373 | if( !state->getCullingState().disableZoneCulling() ) |
| 374 | { |
| 375 | // Find the start zone if we haven't already. |
| 376 | |
| 377 | if( !baseObject ) |
| 378 | { |
| 379 | getZoneManager()->findZone( state->getCameraPosition(), baseObject, baseZone ); |
| 380 | AssertFatal( baseObject != NULL, "SceneManager::_renderScene - findZone() did not return an object" ); |
| 381 | } |
| 382 | |
| 383 | // Traverse zones starting in base object. |
| 384 | |
| 385 | SceneTraversalState traversalState( &state->getCullingState() ); |
| 386 | PROFILE_START( Scene_traverseZones ); |
| 387 | baseObject->traverseZones( &traversalState, baseZone ); |
| 388 | PROFILE_END(); |
| 389 | |
| 390 | // Set the scene render box to the area we have traversed. |
| 391 | |
| 392 | state->setRenderArea( traversalState.getTraversedArea() ); |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | // Set the query box for the container query. Never |
| 397 | // make it larger than the frustum's AABB. In the editor, |
| 398 | // always query the full frustum as that gives objects |
| 399 | // the opportunity to render editor visualizations even if |
| 400 | // they are otherwise not in view. |
| 401 | |
| 402 | if( !state->getCullingFrustum().getBounds().isOverlapped( state->getRenderArea() ) ) |
| 403 | { |
| 404 | // This handles fringe cases like flying backwards into a zone where you |
| 405 | // end up pretty much standing on a zone border and looking directly into |
| 406 | // its "walls". In that case the traversal area will be behind the frustum |
| 407 | // (remember that the camera isn't where visibility starts, it's the near |
| 408 | // distance). |
nothing calls this directly
no test coverage detected