Ignore:
Timestamp:
02/17/07 22:48:12 (17 years ago)
Author:
mattausch
Message:

worded on obj loading in Ogre

Location:
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include
Files:
2 edited

Legend:

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

    r2115 r2123  
    217217 
    218218                        // we are only interested in scene entities 
    219                         if (mo->getMovableType() != "Entity") 
     219                        if ((mo->getMovableType() != "Entity") && 
     220                                (mo->getMovableType() != "ManualObject")) 
    220221                                continue; 
    221222                         
     
    237238} 
    238239 
     240static void AddToObjects(EntityContainer *entites,  
     241                                                 GtpVisibilityPreprocessor::ObjectContainer &objects, 
     242                                                 const int id) 
     243{ 
     244        // TODO: can actually just put single objects into pvs with same id,  
     245        // this can be sorted out later!! 
     246#if 0 
     247        EntityContainer::const_iterator eit, eit_end = entryObjects.end(); 
     248 
     249        for (eit = entryObjects.begin(); eit != eit_end; ++ eit) 
     250        { 
     251                Entity *ent = *eit; 
     252 
     253        // warning: multiple ids possible 
     254                OgreMeshInstance *omi = new OgreMeshInstance(ent); 
     255                omi->SetId(id); 
     256                objects.push_back(omi); 
     257        } 
     258 
     259        delete entryObjects; 
     260 
     261#else 
     262 
     263        EngineIntersectable *entry = new EngineIntersectable(entites); 
     264 
     265        entry->SetId(id); 
     266        objects.push_back(entry); 
     267#endif 
     268} 
     269 
    239270#if USE_KD_PVS 
    240271//------------------------------------------------------------------------- 
     
    255286                        OgreTypeConverter::ConvertToOgre(pbox); 
    256287                 
    257                 EntityContainer entryObjects; 
     288                EntityContainer *entryObjects = new EntityContainer(); 
    258289 
    259290                // find all objects that intersect the bounding box 
    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 
    277                 EngineIntersectable *entry =  
    278                         new EngineIntersectable(entryObjects); 
    279  
    280                 entry->SetId(id); 
    281                 objects.push_back(entry); 
    282 #endif 
     291                FindIntersectingObjects(box, *entryObjects); 
     292 
     293                AddToObjects(entryObjects, objects, id); 
    283294        } 
    284295 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h

    r2119 r2123  
    1414#include "ViewCellsManager.h" 
    1515 
     16 
     17namespace GtpVisibilityPreprocessor { 
     18class Intersectable; 
     19} 
     20 
     21class ObjReader; 
     22 
    1623namespace Ogre { 
    1724 
     
    2431{ 
    2532public: 
    26         OcclusionCullingSceneManager(const String& name, GtpVisibility::VisibilityManager *visManager); 
     33        OcclusionCullingSceneManager(const String& name,  
     34                                                                 GtpVisibility::VisibilityManager *visManager); 
    2735        ~OcclusionCullingSceneManager(); 
    2836 
     
    7078        */ 
    7179        bool validatePassForRendering(Pass* pass); 
     80 
    7281#ifdef ITEM_BUFFER 
    7382        void RenderItemBuffer(RenderPriorityGroup* pGroup); 
    7483        void RenderSingleObjectForItemBuffer(Renderable *rend, Pass *pass); 
    7584#endif // ITEM_BUFFER 
     85 
    7686        void _renderQueueGroupObjects(RenderQueueGroup* pGroup, 
    77                 QueuedRenderableCollection::OrganisationMode om); 
    78  
    79         /** Override from SceneManager so that sub entities can be assigned an id for item buffer. 
     87                                                                  QueuedRenderableCollection::OrganisationMode om); 
     88 
     89        /** Override from SceneManager so that sub entities can be assigned  
     90                an id for item buffer. 
    8091        */ 
    8192        Entity* createEntity(const String& entityName, const String& meshName); 
     
    93104        void endFrame(); 
    94105 
    95         void renderAdditiveStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup, 
    96                 QueuedRenderableCollection::OrganisationMode om); 
    97         void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup, 
    98                 QueuedRenderableCollection::OrganisationMode om); 
     106        void renderAdditiveStencilShadowedQueueGroupObjects( 
     107                                RenderQueueGroup* pGroup, 
     108                                QueuedRenderableCollection::OrganisationMode om); 
     109        void renderModulativeStencilShadowedQueueGroupObjects( 
     110                                RenderQueueGroup* pGroup, 
     111                                QueuedRenderableCollection::OrganisationMode om); 
    99112         
    100113        /** Override standard function so octree boxes are always of equal side length. 
     
    113126protected: 
    114127         
     128        void MailPvsObjects(); 
     129        void RenderPvsEntry(GtpVisibilityPreprocessor::Intersectable *obj); 
     130        void SetObjectVisible(GtpVisibilityPreprocessor::Intersectable *entry,  
     131                                                  const bool visible); 
     132        void ShowViewCellsGeometry(); 
     133 
    115134        /** Creates material for depth pass, e.g., a pass that only fills the depth buffer.  
    116135        */ 
     
    254273 
    255274        bool mShowTerrain; 
     275 
     276        ObjReader *mObjReader; 
    256277}; 
    257278 
Note: See TracChangeset for help on using the changeset viewer.