MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / _renderScene

Method _renderScene

Engine/source/scene/sceneManager.cpp:350–512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

isDiffusePassMethod · 0.80
updateZoningStateMethod · 0.80
disableZoneCullingMethod · 0.80
getCullingStateMethod · 0.80
findZoneMethod · 0.80
setRenderAreaMethod · 0.80
findObjectListMethod · 0.80
cullObjectsMethod · 0.80
renderObjectsMethod · 0.80
getCameraObjectMethod · 0.80
setFillModeWireframeMethod · 0.80
setZReadWriteMethod · 0.80

Tested by

no test coverage detected