Changeset 1593


Ignore:
Timestamp:
10/09/06 22:38:07 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r1271 r1593  
    520520        // Warning: In GL since we can't go higher than the window res 
    521521        mSceneMgr->setShadowTextureSettings(1024, 2); 
    522  
    523522        mSceneMgr->setShadowColour(ColourValue(0.5, 0.5, 0.5)); 
    524523 
    525  
     524        //////////////77 
    526525        //-- terrain content setup 
    527526 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreMeshInstance.h

    r1028 r1593  
    1313{ 
    1414public: 
    15  
     15        /** The default constructor taking an entity into account. 
     16        */ 
    1617        OgreMeshInstance(Entity *ent); 
    17  
     18         
    1819        /** Returns 'mesh' associated with this instance.  
    1920        */ 
    20         Entity *GetMesh() const; 
     21        Entity *GetEntity() const; 
    2122 
    2223        /** See get. 
    2324        */ 
    24         void SetMesh(Entity *mesh); 
     25        void SetEntity(Entity *entity); 
    2526 
    2627 
     28        ///////////////////////////// 
    2729        //-- inherited functions from Intersectable 
    2830 
     
    5153protected: 
    5254         
    53         Entity *mMesh; 
     55        Entity *mEntity; 
    5456}; 
    5557 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h

    r1276 r1593  
    1616namespace Ogre { 
    1717 
     18 
    1819/** 
    1920        This class extends the terrain scene manager, 
     
    126127        /** Loads / unloads pvs of the view cell to set the visibility in the scene. 
    127128        */ 
    128         void applyViewCellPvs(GtpVisibilityPreprocessor::ViewCell *vc, const bool load); 
     129        void ApplyViewCellPvs(GtpVisibilityPreprocessor::ViewCell *vc, const bool load); 
    129130 
    130131        /** updates pvs in current frame. 
    131132        */ 
    132         void updatePvs(Camera *cam); 
     133        void UpdatePvs(Camera *cam); 
    133134 
    134135        /** Sets all objects invisible. 
     
    136137        void SetObjectsVisible(const bool visible); 
    137138 
    138          
     139        /** Creates view cells geometry from the loaded view cells. 
     140        */ 
     141        void CreateViewCellsGeometry(); 
     142 
     143 
    139144        ////////////////////////////////////////// 
    140145 
    141146        /// the interface to the scene hierarchy. 
    142147        OctreeHierarchyInterface *mHierarchyInterface; 
     148 
    143149        /// manages all visibility options 
    144150        GtpVisibility::VisibilityManager *mVisibilityManager; 
     
    175181        /// the depth pass (no lighting, just filling the depth buffer) 
    176182        Pass *mDepthPass; 
     183        /// the pass for item buffer setting a color id 
    177184        Pass *mItemBufferPass; 
    178185 
    179         int mCurrentEntityId; 
    180186        /// flag for passes which should not be deleted from queue during first traversal 
    181187        int mLeavePassesInQueue; 
    182  
    183188 
    184189        /// if transparent object are considered for item buffer visibility 
     
    190195        bool mIsHierarchicalCulling; 
    191196 
     197        /// do we use preprocessed visibility 
    192198        bool mViewCellsLoaded; 
     199 
     200        /// the view cells manager handling the preprocesor stuff 
    193201        GtpVisibilityPreprocessor::ViewCellsManager *mViewCellsManager; 
    194202 
     
    210218        // normal terrain rendering 
    211219        bool mNormalExecution; 
     220 
     221        // helper variable to provide sequential numbering for sub-entities 
     222        int mCurrentEntityId; 
     223 
     224        typedef map<int, MovableObject *> MovableObjectsMap; 
     225 
     226        /// hash table for view cells geometry 
     227    MovableObjectsMap mViewCellsGeometry; 
    212228}; 
    213229 
    214 /// Factory for VisibilityOctreeSceneManager 
     230 
     231/** Factory for VisibilityOctreeSceneManager. 
     232*/ 
    215233class OcclusionCullingSceneManagerFactory : public SceneManagerFactory 
    216234{ 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreTypeConverter.h

    r863 r1593  
    55#include "AxisAlignedBox3.h" 
    66#include "Vector3.h" 
     7//#include "ManualObject.h" 
    78 
    89 
    910namespace Ogre { 
    10   
     11 
     12class SceneManager; 
     13 
    1114/** 
    1215        Class which converts preprocessor types to OGRE types 
     
    2730        */ 
    2831        static Vector3 ConvertToOgre(const GtpVisibilityPreprocessor::Vector3 &v); 
     32 
     33        /** The Ogre object will be created from the mesh. 
     34        */ 
     35        static ManualObject *ConvertToOgre(GtpVisibilityPreprocessor::Mesh *mesh, SceneManager *sceneMgr); 
    2936}; 
    3037 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBvHierarchySceneManager.cpp

    r1320 r1593  
    13071307        { 
    13081308                OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(*it); 
    1309                 Entity *ent = omi->GetMesh(); 
     1309                Entity *ent = omi->GetEntity(); 
    13101310 
    13111311                ent->setVisible(visible); 
     
    13541354 
    13551355                OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>((*oit).first); 
    1356                 omi->GetMesh()->setVisible(load); 
     1356                omi->GetEntity()->setVisible(load); 
    13571357                //GtpVisibilityPreprocessor::Debug << "assigned id " << omi->GetId() << endl; 
    13581358        } 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTree.cpp

    r1344 r1593  
    16961696 
    16971697        if (showBoxes) 
     1698        { 
    16981699                if (mLevel == mOwner->getHiLiteLevel() || mOwner->getShowAllBoxes()) 
    16991700                        queue->addRenderable(getWireBoundingBox()); 
     1701        } 
    17001702} 
    17011703 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp

    r1495 r1593  
    13071307        { 
    13081308                OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(*it); 
    1309                 Entity *ent = omi->GetMesh(); 
     1309                Entity *ent = omi->GetEntity(); 
    13101310 
    13111311                ent->setVisible(visible); 
     
    13511351 
    13521352                OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>((*oit).first); 
    1353                 omi->GetMesh()->setVisible(load); 
     1353                omi->GetEntity()->setVisible(load); 
    13541354                //GtpVisibilityPreprocessor::Debug << "assigned id " << omi->GetId() << endl; 
    13551355        } 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreMeshInstance.cpp

    r1028 r1593  
    66 
    77        OgreMeshInstance::OgreMeshInstance(Entity *ent): 
    8         GtpVisibilityPreprocessor::Intersectable(), mMesh(ent) 
     8        GtpVisibilityPreprocessor::Intersectable(), mEntity(ent) 
    99        { 
    1010        } 
    1111 
    12         void OgreMeshInstance::SetMesh(Entity *mesh) 
     12        void OgreMeshInstance::SetEntity(Entity *entity) 
    1313        { 
    14                 mMesh = mesh; 
     14                mEntity = entity; 
    1515        } 
    1616 
    17         Entity *OgreMeshInstance::GetMesh() const 
     17        Entity *OgreMeshInstance::GetEntity() const 
    1818        {  
    19                 return mMesh;  
     19                return mEntity;  
    2020        } 
    2121         
    2222        GtpVisibilityPreprocessor::AxisAlignedBox3 OgreMeshInstance::GetBox() const 
    2323        { 
    24                 return OgreTypeConverter::ConvertFromOgre(mMesh->getWorldBoundingBox()); 
     24                return OgreTypeConverter::ConvertFromOgre(mEntity->getWorldBoundingBox()); 
    2525        } 
    2626 
     
    7171        ostream &OgreMeshInstance::Describe(ostream &s) 
    7272        { 
    73                 s << mMesh; 
     73                s << mEntity; 
    7474                return s; 
    7575        } 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp

    r1304 r1593  
    2020#include "common.h" 
    2121#include "OgreBoundingBoxConverter.h" 
     22#include <OgreManualObject.h> 
    2223 
    2324 
     
    173174                getRenderQueue()->addRenderable(*it); 
    174175        } 
    175          
     176 
     177        MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end(); 
     178/* 
     179        for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit) 
     180        { 
     181                (*mit).second->_updateRenderQueue(getRenderQueue()); 
     182        } 
     183*/       
     184 
    176185        if (mRenderNodesForViz || mRenderNodesContentForViz) 
    177186        { 
     
    198207                                //(*it)->_addBoundingBoxToQueue(getRenderQueue()); 
    199208                        } 
     209 
    200210                        // add renderables itself 
    201211                        if (mRenderNodesContentForViz)  
     
    292302        } 
    293303 
    294  
    295         //-- show visible scene nodes and octree bounding boxes from last frame 
    296304        if (mShowVisualization) 
    297305    { 
     306                ////////////// 
     307                //-- show visible scene nodes and octree bounding boxes from last frame 
     308 
    298309                PrepareVisualization(cam); 
    299310        } 
     
    314325                if (0) mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 
    315326 
    316  
     327                /////////// 
    317328                //-- apply view cell pvs 
    318                 updatePvs(cam); 
    319         } 
    320          
    321          
     329                UpdatePvs(cam); 
     330        } 
     331                 
    322332        // lists only used for visualization 
    323333        mVisible.clear(); 
     
    329339        if (mNormalExecution) 
    330340        { 
     341                // the standard octree rendering mode 
    331342                OctreeSceneManager::_renderVisibleObjects(); 
    332343                return; 
     
    339350        ColourValue savedAmbient = mAmbientLight; 
    340351 
    341         //-- apply standard rendering for some modes (e.g., visualization, shadow pass) 
     352        //////////////////// 
     353        //-- apply standard rendering for some modes  
     354        //-- (e.g., the visualization mode, the shadow pass) 
    342355 
    343356        if (mShowVisualization || 
     
    363376                mDestRenderSystem -> setLightingEnabled(false); 
    364377 
    365                 // don't render backgrounds for item buffer 
    366378                if (mUseItemBuffer) 
    367379                { 
     380                        // don't render backgrounds for item buffer 
    368381                        clearSpecialCaseRenderQueues(); 
    369382                        getRenderQueue()->clear(); 
    370383                } 
    371384 
     385                //////////////////// 
    372386                //-- hierarchical culling 
     387 
    373388                // the objects of different layers (e.g., background, scene,  
    374389                // overlay) must be identified and rendered one after another 
    375390 
    376                 //-- render all early skies 
     391                // first render all early skies 
    377392                clearSpecialCaseRenderQueues(); 
    378393                addSpecialCaseRenderQueue(RENDER_QUEUE_BACKGROUND); 
     
    387402#endif 
    388403 
     404                /////////////////// 
    389405                //-- prepare queue for visible objects (i.e., all but overlay and skies late) 
     406 
    390407                clearSpecialCaseRenderQueues(); 
    391408                addSpecialCaseRenderQueue(RENDER_QUEUE_SKIES_LATE); 
     
    394411                // exclude this queues from hierarchical rendering 
    395412                setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 
    396  
    397413 
    398414                // set all necessary parameters for  
     
    416432#endif 
    417433 
     434                ///////////// 
    418435                //-- reset parameters needed for special rendering 
    419436                 
     
    425442                mLeavePassesInQueue = 0; 
    426443                 
    427                 // add visible nodes found by the visibility culling algorithm 
    428                 if (mUseDepthPass) 
    429                 { 
     444                if (mUseDepthPass) // the shaded geometry is rendered in a second pass 
     445                { 
     446                        // add visible nodes found by the visibility culling algorithm 
    430447                        NodeList::const_iterator it, it_end = mVisible.end(); 
    431448 
     
    436453                        } 
    437454                } 
     455 
     456                ///////////// 
    438457                //-- now we can render all remaining queue objects 
    439458                //-- used for depth pass, transparents, overlay 
     
    453472        getRenderQueue()->clear(mDeleteQueueAfterRendering); 
    454473 
    455         //if (!mDeleteQueueAfterRendering) 
    456         //      getRenderQueue()->clear(true); // finally clear render queue 
    457         //else 
    458         //      OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ... 
     474        if (0) 
     475        { 
     476                if (!mDeleteQueueAfterRendering) 
     477                        getRenderQueue()->clear(true); // finally clear render queue 
     478                else 
     479                        OGRE_DELETE(mRenderQueue); // HACK: should rather only be cleared ... 
     480        } 
    459481 
    460482        if (0) WriteLog(); // write out stats 
     
    573595 
    574596                        if (mUseViewCells) 
     597                        { 
    575598                                mCurrentViewCell = mViewCellsManager->GenerateViewCell(); 
     599                        } 
    576600 
    577601                        mElementaryViewCell = NULL; 
     
    683707        renderObjects(pPriorityGrp->getSolidsBasic(), om, true); 
    684708 
    685                 // for correct rendering, transparents must be rendered after hierarchical culling 
    686                 // => do nothing 
    687  
    688         // Do transparents (always descending) 
    689                 if (mNormalExecution || !mSkipTransparents) 
    690                 { 
     709                // for correct rendering, transparents must be rendered  
     710                // after hierarchical culling => don't render them now 
     711 
     712        if (mNormalExecution || !mSkipTransparents) 
     713                { 
     714                        // Do transparents (always descending) 
    691715                        renderObjects(pPriorityGrp->getTransparents(),  
    692716                        QueuedRenderableCollection::OM_SORT_DESCENDING, true); 
     
    694718 
    695719 
    696     }// for each priority 
     720    } // for each priority 
    697721} 
    698722 
     
    770794                        if (0) 
    771795                        { 
    772                         std::stringstream d; d << "itembuffer, pass name: " <<  
    773                                 ipass->first->getParent()->getParent()->getName(); 
    774                                  
    775                         LogManager::getSingleton().logMessage(d.str()); 
     796                                std::stringstream d; d << "itembuffer, pass name: " <<  
     797                                        ipass->first->getParent()->getParent()->getName(); 
     798 
     799                                LogManager::getSingleton().logMessage(d.str()); 
    776800                        } 
    777801                         
     
    10231047        { 
    10241048                OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(*it); 
    1025                 Entity *ent = omi->GetMesh(); 
     1049                Entity *ent = omi->GetEntity(); 
    10261050                 
    10271051                ent->setVisible(visible); 
     
    10341058        SetObjectsVisible(false); 
    10351059         
    1036         const string bboxesFilename = mVisibilityManager->GetVisibilityEnvironment()->getViewCellsFileName(); 
    1037  
    10381060        // converter between view cell ids and Ogre entites  
    10391061        GtpVisibilityPreprocessor::IndexedBoundingBoxContainer iboxes; 
     
    10411063 
    10421064        // load the view cells assigning the found objects to the pvss 
     1065        const bool finalizeViewCells = true; 
    10431066        mViewCellsManager =  
    1044                 GtpVisibilityPreprocessor::ViewCellsManager::LoadViewCells(filename, &mObjects, false, &bconverter); 
     1067                GtpVisibilityPreprocessor::ViewCellsManager::LoadViewCells(filename, &mObjects, true, &bconverter); 
     1068 
     1069        if (finalizeViewCells) 
     1070        { 
     1071                CreateViewCellsGeometry(); 
     1072        } 
    10451073 
    10461074        return (mViewCellsManager != NULL); 
    10471075} 
    10481076//------------------------------------------------------------------------- 
    1049 void OcclusionCullingSceneManager::applyViewCellPvs(GtpVisibilityPreprocessor::ViewCell *vc,  
     1077void OcclusionCullingSceneManager::ApplyViewCellPvs(GtpVisibilityPreprocessor::ViewCell *vc,  
    10501078                                                                                                        const bool load) 
    1051 {       // NOTE: should not happen, rather apply view cell representing unbounded space then 
     1079{       // NOTE: should not encounter NULL view cell,  
     1080        // rather apply view cell representing unbounded space then 
    10521081        if (!vc)  
    10531082        {        
    1054                 // set everything visible for savety 
     1083                // if no there is no view cell, set everything visible 
    10551084                SetObjectsVisible(true); 
    1056  
    10571085                return; 
    10581086        } 
     
    10611089                        oit_end = vc->GetPvs().mEntries.end(); 
    10621090 
    1063         //-- PVS of view cell 
     1091        //////////// 
     1092        //-- set PVS of view cell to visible 
     1093 
    10641094        for (oit = vc->GetPvs().mEntries.begin(); oit != oit_end; ++ oit) 
    10651095        { 
     
    10671097 
    10681098                OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance *>((*oit).first); 
    1069                 omi->GetMesh()->setVisible(load); 
     1099                omi->GetEntity()->setVisible(load); 
    10701100                //GtpVisibilityPreprocessor::Debug << "assigned id " << omi->GetId() << endl; 
    10711101        } 
    10721102} 
    10731103//------------------------------------------------------------------------- 
    1074 void OcclusionCullingSceneManager::updatePvs(Camera *cam) 
     1104void OcclusionCullingSceneManager::UpdatePvs(Camera *cam) 
    10751105{ 
    10761106        if (!(mViewCellsLoaded && mUseViewCells)) 
     
    10881118 
    10891119        mElementaryViewCell = newElementary; 
    1090         //LogManager::getSingleton().logMessage("unloading"); 
     1120        LogManager::getSingleton().logMessage("unloading"); 
     1121         
     1122                std::stringstream d; 
     1123                d << "here2 " << mViewCellsGeometry.size(); 
     1124                LogManager::getSingleton().logMessage(d.str()); 
     1125 
     1126        ////////////// 
    10911127        //-- unload old pvs 
    1092         applyViewCellPvs(mCurrentViewCell, false); 
    1093  
    1094  
    1095         //-- the new view cell 
    1096                  
     1128 
     1129        ApplyViewCellPvs(mCurrentViewCell, false); 
     1130 
     1131        // set old view cell geometry to invisible 
     1132    if (mCurrentViewCell && mCurrentViewCell->GetMesh()) 
     1133        { 
     1134                const int id = mCurrentViewCell->GetId(); 
     1135                 
     1136                std::stringstream str; 
     1137                str << "id : " << id << " of " << mViewCellsGeometry.size(); 
     1138                LogManager::getSingleton().logMessage(str.str()); 
     1139 
     1140                mViewCellsGeometry[id]->setVisible(false); 
     1141        } 
     1142 
     1143        // the new view cell 
    10971144        GtpVisibilityPreprocessor::ViewCell *viewCell; 
    1098  
    10991145                 
    11001146        if (mUseVisibilityFilter) 
    1101         { 
     1147        {        
     1148                //////////// 
    11021149                //-- compute new filtered cell 
     1150 
    11031151                GtpVisibilityPreprocessor::PrVs prvs; 
    11041152                mViewCellsManager->GetPrVS(viewPoint, prvs, 5); 
     
    11071155        else 
    11081156        { 
    1109                 viewCell = newElementary; 
    1110         } 
    1111         //LogManager::getSingleton().logMessage("loading"); 
     1157                viewCell = newElementary;LogManager::getSingleton().logMessage("here55"); 
     1158        } 
     1159 
     1160        /////////////// 
    11121161        //-- load new pvs 
    1113         applyViewCellPvs(viewCell, true); 
     1162 
     1163        // set new view cell geometry to invisible 
     1164        if (viewCell && viewCell->GetMesh()) 
     1165        { 
     1166                const int id = viewCell->GetId(); 
     1167                 
     1168                std::stringstream str; 
     1169                str << "id : " << id << " of " << mViewCellsGeometry.size(); 
     1170                LogManager::getSingleton().logMessage(str.str()); 
     1171 
     1172                mViewCellsGeometry[id]->setVisible(false); 
     1173        } 
     1174 
     1175        ApplyViewCellPvs(viewCell, true); 
    11141176 
    11151177        // store pvs 
    1116         mCurrentViewCell->SetPvs(viewCell->GetPvs()); 
    1117  
    1118         // delete merge tree of filtered view cell 
    1119         if (mUseVisibilityFilter) 
    1120                 mViewCellsManager->DeleteLocalMergeTree(viewCell); 
    1121 } 
     1178        if (viewCell) 
     1179        { 
     1180                mCurrentViewCell->SetPvs(viewCell->GetPvs()); 
     1181                mCurrentViewCell->SetMesh(viewCell->GetMesh()); 
     1182                mCurrentViewCell->SetId(viewCell->GetId()); 
     1183 
     1184                // delete merge tree of filtered view cell 
     1185                if (mUseVisibilityFilter) 
     1186                        mViewCellsManager->DeleteLocalMergeTree(viewCell); 
     1187        } 
     1188} 
     1189//------------------------------------------------------------------------- 
     1190void OcclusionCullingSceneManager::CreateViewCellsGeometry() 
     1191{ 
     1192        LogManager::getSingleton().logMessage("creating view cells geometry"); 
     1193 
     1194        GtpVisibilityPreprocessor::ViewCellContainer viewCells = mViewCellsManager->GetViewCells(); 
     1195 
     1196        GtpVisibilityPreprocessor::ViewCellContainer::const_iterator it, it_end = viewCells.end(); 
     1197        for (it = viewCells.begin(); it != it_end; ++ it) 
     1198        { 
     1199                GtpVisibilityPreprocessor::ViewCell *viewCell = *it; 
     1200 
     1201                std::stringstream str; 
     1202                str << "id : " << viewCell->GetId(); 
     1203 
     1204                ManualObject *manual = OgreTypeConverter::ConvertToOgre(viewCell->GetMesh(), this); 
     1205                mViewCellsGeometry[viewCell->GetId()] = manual; 
     1206 
     1207                // attach to scene node 
     1208                getRootSceneNode()->createChildSceneNode()->attachObject(manual); 
     1209                 
     1210                // initialy set to invisible 
     1211                manual->setVisible(false); 
     1212        } 
     1213} 
     1214 
    11221215#if 0 
    11231216//------------------------------------------------------------------------- 
     
    11351228        // first test for scene node, then for octant (part of the hierarchy) 
    11361229        if (!octant->mVisibleChildren) 
     1230        { 
    11371231                octant->setVisible(false); 
     1232        } 
    11381233} 
    11391234 
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreTypeConverter.cpp

    r863 r1593  
    11#include "OgreTypeConverter.h" 
     2#include "Mesh.h" 
     3#include <OgreManualObject.h> 
     4#include <OgreSceneManager.h> 
    25 
    36 
     
    1316} 
    1417 
     18 
    1519GtpVisibilityPreprocessor::Vector3 OgreTypeConverter::ConvertFromOgre(const Vector3 &v) 
    1620{ 
    1721    return GtpVisibilityPreprocessor::Vector3(v.x, v.y, v.z); 
    1822} 
    19          
     23 
     24 
    2025AxisAlignedBox OgreTypeConverter::ConvertToOgre(const GtpVisibilityPreprocessor::AxisAlignedBox3 &box) 
    2126{ 
     
    2631} 
    2732 
     33 
    2834Vector3 OgreTypeConverter::ConvertToOgre(const GtpVisibilityPreprocessor::Vector3 &v) 
    2935{ 
    3036        return Vector3(v.getX(), v.getY(), v.getZ()); 
    3137} 
     38 
     39 
     40ManualObject *OgreTypeConverter::ConvertToOgre(GtpVisibilityPreprocessor::Mesh *mesh, SceneManager *sceneMgr) 
     41{ 
     42        char name[100]; 
     43        sprintf(name, "mesh%04d", mesh->GetId()); 
     44 
     45        ManualObject* manual = sceneMgr->createManualObject(name); 
     46        manual->begin("BaseWhiteNoLighting", RenderOperation::OT_LINE_STRIP); 
     47         
     48        // create vertices 
     49        GtpVisibilityPreprocessor::VertexContainer::const_iterator vit,  
     50                vit_end = mesh->mVertices.end(); 
     51 
     52        for (vit = mesh->mVertices.begin(); vit != vit_end; ++ vit) 
     53        { 
     54                const GtpVisibilityPreprocessor::Vector3 vtx = *vit; 
     55                manual->position(vtx.x, vtx.y, vtx.z); 
     56        } 
     57 
     58        // create faces indices 
     59        GtpVisibilityPreprocessor::FaceContainer::const_iterator fit, fit_end = mesh->mFaces.end(); 
     60 
     61        for (fit = mesh->mFaces.begin(); fit != fit_end; ++ fit) 
     62        { 
     63                GtpVisibilityPreprocessor::Face *face = *fit; 
     64                GtpVisibilityPreprocessor::VertexIndexContainer::const_iterator  
     65                        iit, iit_end = face->mVertexIndices.end(); 
     66                //GtpVisibilityPreprocessor::VertexIndexContainer::const_reverse_iterator  
     67                //      iit, iit_end = face->mVertexIndices.rend(); 
     68 
     69                for (iit = face->mVertexIndices.begin(); iit != iit_end; ++ iit) 
     70                { 
     71                        const int index = *iit; 
     72                        manual->index(index); 
     73                } 
     74        } 
     75 
     76        manual->end(); 
     77        //mSceneMgr->getRootSceneNode()->createChildSceneNode()->attachObject(manual); 
     78 
     79        return manual; 
    3280} 
     81 
     82 
     83} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1585 r1593  
    432432          cout << "loading view cells from " << buf << endl; 
    433433           
    434           // $$ does not compile -> commented out 
    435           mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, true, NULL); 
     434         mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, true, NULL); 
    436435           
    437436          if (!mViewCellsManager) 
    438                 return false; 
     437          { 
     438                  return false; 
     439          } 
    439440        } 
    440441        else 
Note: See TracChangeset for help on using the changeset viewer.