Changeset 3257
- Timestamp:
- 01/07/09 15:12:29 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3256 r3257 21 21 22 22 # if using pvs, this specifies the name of the visibility solutin 23 #visibilitySolution=vienna_full-8x3-refu24 23 visibilitySolution=vienna_full-8x3-pgv 25 24 viewCellsScaleFactor=1.0f … … 58 57 lightDirection=-0.3f 0.2f -0.7f 59 58 60 ###########################61 ## powerplant options62 63 filename=PowerPlantM64 65 keyForwardMotion=500.0f66 mouseMotion=3.0f;67 visibilitySolution=power-plant-2c-xx-1000b-pgv268 camPosition=-1320.57 -6306.34 360369 camDirection=0.292156 0.9556 0.038387870 viewCellsScaleFactor=0.05f71 59 72 60 ##################### … … 122 110 # ssao filter radius 123 111 ssaoFilterRadius=12.0f 112 113 114 ########################### 115 ## powerplant options 116 117 filename=PowerPlantM 118 119 keyForwardMotion=500.0f 120 mouseMotion=3.0f 121 visibilitySolution=power-plant-2c-xx-1000b-pgv2 122 camPosition=-1320.57 -6306.34 3603 123 camDirection=0.292156 0.9556 0.0383878 124 viewCellsScaleFactor=0.05f -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ViewCellsTree.cpp
r3256 r3257 38 38 39 39 40 bool ViewCellsTree::LoadFromFile(const std::string &filename )40 bool ViewCellsTree::LoadFromFile(const std::string &filename, float scaleFactor) 41 41 { 42 42 cout << "Loading view cells from file '" + filename + "'"; … … 50 50 } 51 51 52 bool result = _LoadFromFile(fr );52 bool result = _LoadFromFile(fr, scaleFactor); 53 53 54 54 cout << "finished loading view cells. " << endl; … … 59 59 60 60 61 bool ViewCellsTree::_LoadFromFile(FILE *fr )61 bool ViewCellsTree::_LoadFromFile(FILE *fr, float scaleFactor) 62 62 { 63 63 int buffer[256]; … … 81 81 fread(&box, sizeof(AxisAlignedBox3), 1, fr); 82 82 83 box.Scale( mScaleFactor);83 box.Scale(scaleFactor); 84 84 85 85 Vector3 v1(box.Min().x, -box.Min().z, box.Min().y); … … 124 124 fread(&mypos, sizeof(float), 1, fr); 125 125 126 mypos *= mScaleFactor;126 mypos *= scaleFactor; 127 127 128 128 // changed coordinate system must be considered also here … … 145 145 } 146 146 147 cout << "\nloaded " << numViewCells << " view cells" << " " << axes[0] << " " << axes[1] << " " << axes[2] << endl;148 147 return true; 149 148 } 150 149 151 150 152 void ViewCellsTree::SetScaleFactor(float scale)153 {154 mScaleFactor = scale;155 }156 157 151 158 152 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ViewCellsTree.h
r3256 r3257 83 83 84 84 ViewCell *GetViewCell(const Vector3 &point) const; 85 86 bool LoadFromFile(const std::string &filename); 85 87 86 /** Hack: Sometimes the scene has to be scaled, then also 88 87 the view cells must be scaled accordingly. 89 88 */ 90 void SetScaleFactor(float scale);91 89 bool LoadFromFile(const std::string &filename, float scaleFactor = 1.0f); 90 92 91 93 92 protected: 94 93 95 bool _LoadFromFile(FILE *file );94 bool _LoadFromFile(FILE *file, float scaleFactor); 96 95 97 96 … … 101 100 AxisAlignedBox3 mBox; 102 101 ViewCellsTreeNode *mRoot; 103 float mScaleFactor;104 102 }; 105 103 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp
r3245 r3257 16 16 17 17 ViewCellsTree *VisibilitySolutionLoader::Load(const std::string &filename, 18 Bvh *bvh) 18 Bvh *bvh, 19 float viewCellsScaleFactor) 19 20 { 20 21 FILE *fr = fopen(filename.c_str(), "rb"); … … 38 39 ViewCellsTree *viewCellsTree = new ViewCellsTree(); 39 40 40 bool ok = viewCellsTree->_LoadFromFile(fr );41 bool ok = viewCellsTree->_LoadFromFile(fr, viewCellsScaleFactor); 41 42 42 43 cout << "finished loading view cells" << endl; … … 226 227 } 227 228 228 cout << " #of viewcells = " << id << " " << axes[0] << " " << axes[1] << " " << axes[2]<< endl;229 } 230 231 232 } 229 cout << "loaded " << id << " view cells" << endl; 230 } 231 232 233 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.h
r3243 r3257 23 23 VisibilitySolutionLoader(): mNumNodes(0) {}; 24 24 25 ViewCellsTree *Load(const std::string &filename, Bvh *bvh );25 ViewCellsTree *Load(const std::string &filename, Bvh *bvh, float viewCellsScaleFactor = 1.0f); 26 26 27 27 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3256 r3257 1196 1196 if (!viewCellsTree) LoadVisibilitySolution(); 1197 1197 1198 if (viewCellsTree) 1199 { 1200 viewCellsTree->SetScaleFactor(viewCellsScaleFactor); 1201 LoadPvs(); 1202 } 1198 if (viewCellsTree) LoadPvs(); 1203 1199 } 1204 1200 … … 2611 2607 VisibilitySolutionLoader visLoader; 2612 2608 2613 viewCellsTree = visLoader.Load(vis_filename, bvh );2609 viewCellsTree = visLoader.Load(vis_filename, bvh, viewCellsScaleFactor); 2614 2610 2615 2611 if (!viewCellsTree)
Note: See TracChangeset
for help on using the changeset viewer.