Ignore:
Timestamp:
02/12/07 19:00:37 (17 years ago)
Author:
mattausch
Message:

changed pvs loading: loading objects in a first pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreBoundingBoxConverter.h

    r2113 r2115  
    3939}; 
    4040 
     41 
    4142/**     Class which converts preprocessor types to OGRE types 
    4243*/ 
     
    121122 
    122123        list<SceneNode *>::const_iterator sit, sit_end = sceneNodeList.end(); 
     124 
    123125        // find the bbox which is closest to the current bbox 
    124126        for (sit = sceneNodeList.begin(); sit != sit_end; ++ sit) 
     
    247249        for (iit = iboxes.begin(); iit != iit_end; ++ iit) 
    248250        { 
     251                const GtpVisibilityPreprocessor::AxisAlignedBox3 pbox = (*iit).second; 
     252                const int id = (*iit).first; 
     253 
    249254                const AxisAlignedBox box =  
    250                         OgreTypeConverter::ConvertToOgre((*iit).second); 
    251                  
    252                 EntityContainer *entryObjects = new EntityContainer(); 
     255                        OgreTypeConverter::ConvertToOgre(pbox); 
     256                 
     257                EntityContainer entryObjects; 
    253258 
    254259                // find all objects that intersect the bounding box 
    255                 FindIntersectingObjects(box, *entryObjects); 
    256  
     260                FindIntersectingObjects(box, entryObjects); 
     261 
     262                // TODO: can actually just put single objects into pvs with same id,  
     263                // this can be sorted out later!! 
     264#if 1 
     265                EntityContainer::const_iterator eit, eit_end = entryObjects.end(); 
     266 
     267                for (eit = entryObjects.begin(); eit != eit_end; ++ eit) 
     268                { 
     269                        Entity *ent = *eit; 
     270 
     271            // warning: multiple ids possible 
     272                        OgreMeshInstance *omi = new OgreMeshInstance(ent); 
     273                        omi->SetId(id); 
     274                        objects.push_back(omi); 
     275                } 
     276#else 
    257277                EngineIntersectable *entry =  
    258278                        new EngineIntersectable(entryObjects); 
    259279 
    260                 entry->SetId((*iit).first); 
    261  
     280                entry->SetId(id); 
    262281                objects.push_back(entry); 
     282#endif 
    263283        } 
    264284 
    265285        return true; 
    266286} 
     287 
    267288#else 
     289 
    268290//------------------------------------------------------------------------- 
    269291template<typename T> 
Note: See TracChangeset for help on using the changeset viewer.