Ignore:
Timestamp:
07/05/05 18:35:47 (19 years ago)
Author:
mattausch
Message:

added node traversal interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/src/OgreItemBufferQueryManager.cpp

    r154 r155  
    3232        SceneManager *sm = pfHierarchyInterface->GetSceneManager(); 
    3333 
    34         //-- Render scene as item buffer (e.g., color coded objects) 
     34        // ---- Render scene as item buffer (i.e., objects with their id as color codes) 
    3535 
    3636        // const_cast allowed because camera is not changed in renderScene 
     
    4949        mViewport->setBackgroundColour(ColourValue(0, 0, 0, 0)); 
    5050 
    51         //pfHierarchyInterface->GetRenderSystem()->clearFrameBuffer(FBT_COLOUR); 
    52         // render item buffer 
     51 
     52        // --- render item buffer 
    5353        pfHierarchyInterface->GetSceneManager()->_renderScene(pCam, mViewport, false); 
    5454         
     55 
     56 
    5557        // reset old overlay status 
    5658        mViewport->setOverlaysEnabled(overlayEnabled); 
     
    8486                        ((*visibleGeometry)[id]).AddVisibility(1, 1); 
    8587                } 
    86                 /*else {        std::stringstream d;  
    87                         d << "adding pixel to geometry with id: " << id << ", buf 1: " << (int)buf[idx] << ", buf 2: " << (int)buf[idx + 1] << ", buf 3: " << (int)buf[idx + 2]; 
    88                         LogManager::getSingleton().logMessage(d.str()); }*/ 
    8988        } 
    9089 
     
    101100                return; 
    102101 
     102 
    103103        mWasInitialised = true; 
    104104 
    105         SceneManager::EntityIterator it =  
    106                 dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface)-> 
    107                 GetSceneManager()->getEntityIterator(); 
     105        SceneManager *sm =  
     106                dynamic_cast<PlatformHierarchyInterface *>(mHierarchyInterface)->GetSceneManager(); 
     107 
     108        SceneManager::EntityIterator it = sm->getEntityIterator(); 
    108109 
    109110        // TODO: make this more efficient 
     
    115116                visibleGeometry->push_back(GtpVisibility::MeshInfo(it.getNext(), 0, 0)); 
    116117        } 
     118 
     119        // -- initialise hierarchy interface for simple node traversal 
     120        mHierarchyInterface->InitTraversal(false); 
     121 
     122        GtpVisibility::HierarchyNode *node = NULL; 
     123         
     124        while (node = mHierarchyInterface->GetNextNode()) 
     125        { 
     126                visibleNodes->push_back(GtpVisibility::NodeInfo(node, 0, 0)); 
     127        } 
    117128} 
     129 
    118130} // namespace Ogre 
Note: See TracChangeset for help on using the changeset viewer.