LightsExplorer.cc

Go to the documentation of this file.
00001 #include <esg/explorer/LightsExplorer.h>
00002 
00003 using namespace esg;
00004 
00005 bool LightsExplorer::_process_leaf(SceneGraphObject& obj)
00006 {
00007     if (_freePosition >= LightArray::MAX_LIGHTS) return false;
00008 
00009     Emittance * pEmittance = obj.emittance();
00010     if (!pEmittance) return false;
00011 
00012     if (!_pLights) {
00013         _pLights = new LightArray(_caches);
00014         _freePosition = 0;
00015     }
00016 
00017     _pLights->setEmittance(_freePosition, pEmittance);
00018     _pLights->setGeometry(_freePosition, obj.geometry());
00019     _pLights->setOID(_freePosition, obj.getOID());
00020     if (!_trStack.empty())
00021         _pLights->setTransformation(_freePosition, *_trStack.top());
00022 
00023     _pLights->_set |= (1<<_freePosition);
00024     _pLights->_on  |= (1<<_freePosition);
00025     
00026     _freePosition++;
00027 
00028     return true;
00029 }
00030 
00031 

Generated on Wed Jun 28 12:24:31 2006 for esg by  doxygen 1.4.6