Changeset 3256


Ignore:
Timestamp:
01/07/09 14:22:34 (15 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3253 r3256  
    2323#visibilitySolution=vienna_full-8x3-refu 
    2424visibilitySolution=vienna_full-8x3-pgv 
    25  
    26 useSkylightForIllum=! 
     25viewCellsScaleFactor=1.0f 
     26useSkylightForIllum=1 
    2727 
    2828 
     
    6161## powerplant options 
    6262 
    63 #filename=PowerPlantM 
     63filename=PowerPlantM 
    6464 
    65 #keyForwardMotion=500.0f 
    66 #mouseMotion=3.0f; 
    67 #visibilitySolution=power-plant-2c-xx-1000b-pgv2 
    68 #camPosition=-1320.57 -6306.34 3603 
    69 #camDirection=0.292156 0.9556 0.0383878 
    70  
     65keyForwardMotion=500.0f 
     66mouseMotion=3.0f; 
     67visibilitySolution=power-plant-2c-xx-1000b-pgv2 
     68camPosition=-1320.57 -6306.34 3603 
     69camDirection=0.292156 0.9556 0.0383878 
     70viewCellsScaleFactor=0.05f 
    7171 
    7272##################### 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ViewCellsTree.cpp

    r3251 r3256  
    1313 
    1414#define VIEWCELLS_VERSION 1.0f 
    15  
    16 // hack: this has to be set to 0.05f for powerplant, to 1 otherwise 
    17 //static const float sScale = 0.05f; 
    18 static const float sScale = 1.0f; 
    1915 
    2016 
     
    8581        fread(&box, sizeof(AxisAlignedBox3), 1, fr); 
    8682 
    87         box.Scale(sScale); 
     83        box.Scale(mScaleFactor); 
    8884 
    8985        Vector3 v1(box.Min().x, -box.Min().z, box.Min().y); 
     
    128124                        fread(&mypos, sizeof(float), 1, fr); 
    129125 
    130                         mypos *= sScale; 
     126                        mypos *= mScaleFactor; 
    131127 
    132128                        // changed coordinate system must be considered also here 
     
    154150 
    155151 
     152void ViewCellsTree::SetScaleFactor(float scale) 
     153{ 
     154        mScaleFactor = scale; 
    156155} 
     156 
     157 
     158} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ViewCellsTree.h

    r3244 r3256  
    8585 
    8686        bool LoadFromFile(const std::string &filename); 
     87        /** Hack: Sometimes the scene has to be scaled, then also 
     88                the view cells must be scaled accordingly. 
     89        */ 
     90        void SetScaleFactor(float scale); 
    8791 
    8892 
     
    97101        AxisAlignedBox3 mBox; 
    98102        ViewCellsTreeNode *mRoot; 
     103        float mScaleFactor; 
    99104}; 
    100105 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3252 r3256  
    265265 
    266266int sCurrentMrtSet = 0; 
    267  
    268267static Matrix4x4 invTrafo = IdentityMatrix(); 
    269  
    270268float mouseMotion = 0.2f; 
     269 
     270float viewCellsScaleFactor = 1.0f; 
    271271 
    272272 
     
    457457 
    458458                env.GetBoolParam(string("usePvs"), usePvs); 
    459  
    460459                env.GetBoolParam(string("useSkylightForIllum"), useSkylightForIllum); 
     460                env.GetFloatParam(string("viewCellsScaleFactor"), viewCellsScaleFactor); 
    461461 
    462462                //env.GetStringParam(string("modelPath"), model_path); 
     
    492492                cout << "use PVSs: " << usePvs << endl; 
    493493                cout << "visibility solution: " << visibilitySolution << endl; 
     494                cout << "view cells scale factor: " << viewCellsScaleFactor << endl; 
    494495                cout << "use skylight for illumination: " << useSkylightForIllum << endl; 
    495496 
     
    523524 
    524525        SceneEntity::SetUseLODs(useLODs); 
     526 
    525527 
    526528        if (!useFullScreen) 
     
    11921194        if (1 && usePvs) 
    11931195        { 
    1194                 if (!viewCellsTree) LoadVisibilitySolution(); 
    1195                 LoadPvs(); 
     1196                if (!viewCellsTree)     LoadVisibilitySolution(); 
     1197 
     1198                if (viewCellsTree) 
     1199                { 
     1200                        viewCellsTree->SetScaleFactor(viewCellsScaleFactor); 
     1201                        LoadPvs(); 
     1202                } 
    11961203        } 
    11971204 
Note: See TracChangeset for help on using the changeset viewer.