Changeset 409 for trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
- Timestamp:
- 11/14/05 15:59:20 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/Preprocessor.cpp
r387 r409 6 6 #include "ViewCell.h" 7 7 #include "Environment.h" 8 #include "RenderSimulator.h" 8 9 9 10 Preprocessor::Preprocessor(): 10 11 mKdTree(NULL), 11 mBspTree(NULL) 12 mBspTree(NULL), 13 mRenderSimulator(NULL) 12 14 { 13 15 } … … 20 22 DEL_PTR(mBspTree); 21 23 DEL_PTR(mKdTree); 24 25 DEL_PTR(mRenderSimulator); 22 26 } 23 27 … … 52 56 53 57 if (strcmp(viewCellsStr, "bspTree") == 0) 58 { 54 59 ViewCell::sHierarchy = ViewCell::BSP; 60 } 55 61 else if (strcmp(viewCellsStr, "kdTree") == 0) 62 { 56 63 ViewCell::sHierarchy = ViewCell::KD; 64 } 57 65 else if (strcmp(viewCellsStr, "sceneDependent") == 0) 58 66 { … … 68 76 } 69 77 78 RenderSimulator *Preprocessor::GetRenderSimulator() 79 { 80 if (mRenderSimulator) 81 return mRenderSimulator; 82 83 float objRenderCost = 0, vcOverhead = 0, moveSpeed = 0; 84 85 environment->GetFloatValue("Simulation.objRenderCost",objRenderCost); 86 environment->GetFloatValue("Simulation.vcOverhead", vcOverhead); 87 environment->GetFloatValue("Simulation.moveSpeed", moveSpeed); 88 89 if (ViewCell::sHierarchy = ViewCell::BSP) 90 mRenderSimulator = new BspViewCellRenderSimulator(objRenderCost, vcOverhead, moveSpeed, mBspTree); 91 else // KD view cells 92 mRenderSimulator = new KdViewCellRenderSimulator(objRenderCost, vcOverhead, moveSpeed, mKdTree); 93 94 return mRenderSimulator; 95 } 96 70 97 void Preprocessor::DeleteViewCells() 71 98 { 72 for (int i = 0; i < mViewCells.size(); ++ i) 73 delete mViewCells[i]->GetMesh(); 74 99 for (int i = 0; i < (int)mViewCells.size(); ++ i) 100 { 101 Mesh *mesh = mViewCells[i]->GetMesh(); 102 DEL_PTR(mesh); 103 } 75 104 CLEAR_CONTAINER(mViewCells); 76 105 }
Note: See TracChangeset
for help on using the changeset viewer.