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

Method light

Engine/source/lighting/common/sceneLighting.cpp:467–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467bool SceneLighting::light(BitSet32 flags)
468{
469 if(!mSceneManager)
470 return(false);
471
472 mStartTime = Platform::getRealMilliseconds();
473
474 // Register static lights
475 if (!LIGHTMGR)
476 return false; // This world doesn't need lighting.
477
478 LIGHTMGR->registerGlobalLights(NULL,true);
479
480 // Notify each system factory that we are beginning to light
481 for(SceneLightingInterface** sitr = mLightingInterfaces->mAvailableSystemInterfaces.begin(); sitr != mLightingInterfaces->mAvailableSystemInterfaces.end(); sitr++)
482 {
483 SceneLightingInterface* si = (*sitr);
484 si->processLightingBegin();
485 }
486
487 // grab all the lights
488 mLights.clear();
489 LIGHTMGR->getAllUnsortedLights(&mLights);
490 LIGHTMGR->unregisterAllLights();
491
492 if(!mLights.size())
493 return(false);
494
495 // get all the objects and create proxy's for them
496 SimpleQueryList objects;
497 gClientContainer.findObjects(mLightingInterfaces->mAvailableObjectTypes, &SimpleQueryList::insertionCallback, &objects);
498
499 for(SceneObject ** itr = objects.mList.begin(); itr != objects.mList.end(); itr++)
500 {
501 ObjectProxy * proxy = NULL;
502 SceneObject* obj = *itr;
503 if (!obj)
504 continue;
505
506 // Create the right chunk for the system
507 for(SceneLightingInterface** sitr = mLightingInterfaces->mAvailableSystemInterfaces.begin();
508 sitr != mLightingInterfaces->mAvailableSystemInterfaces.end() && proxy == NULL; sitr++)
509 {
510 SceneLightingInterface* si = (*sitr);
511 proxy = si->createObjectProxy(obj, &mSceneObjects);
512 }
513
514 if (proxy)
515 {
516 if(!proxy->calcValidation())
517 {
518 Con::errorf(ConsoleLogEntry::General, "Failed to calculate validation info for object. Skipped.");
519 delete proxy;
520 continue;
521 }
522
523 if(!proxy->loadResources())
524 {

Callers

nothing calls this directly

Calls 15

dSprintfFunction · 0.85
getVariableFunction · 0.85
dStrstrFunction · 0.85
printfFunction · 0.85
TouchFunction · 0.85
getTargetTimeFunction · 0.85
registerGlobalLightsMethod · 0.80
processLightingBeginMethod · 0.80
getAllUnsortedLightsMethod · 0.80
findObjectsMethod · 0.80
createObjectProxyMethod · 0.80
calcValidationMethod · 0.80

Tested by

no test coverage detected