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

Method _renderScene

Engine/source/scene/sceneManager.cpp:351–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349//-----------------------------------------------------------------------------
350
351void 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).

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