Changeset 24 for trunk/VUT/OcclusionCullingSceneManager/src
- Timestamp:
- 03/22/05 01:23:09 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneManager.cpp
r23 r24 5 5 #include "OgreCamera.h" 6 6 #include "OgreHardwareOcclusionQuery.h" 7 #include "OgreWireBoundingBox.h" 7 //#include "OgreWireBoundingBox.h" 8 #include "OgreSolidBoundingBox.h" 8 9 9 10 #include <windows.h> … … 173 174 { 174 175 // change state so the bounding box gets not actually rendered on the screen 175 setRenderingMode(MODE_ RENDER);176 setRenderingMode(MODE_QUERY); 176 177 177 178 // get next available test id … … 181 182 query->beginOcclusionQuery(); 182 183 183 WireBoundingBox box; 184 box.setupBoundingBox(node->_getWorldAABB()); 185 186 //HACK: too slow 187 184 SolidBoundingBox boxHalf[2]; 185 boxHalf[1].mIsFirstHalf = false; 186 188 187 /* 189 188 static RenderOperation ro; 190 189 191 192 static Matrix4 xform[256];193 unsigned short numMatrices;194 195 //node->_addBoundingBoxToQueue(getRenderQueue());196 //SceneManager::_renderVisibleObjects();197 //getRenderQueue()->clear();198 199 // Set world transformation200 /*box.getWorldTransforms(xform);201 numMatrices = box.getNumWorldTransforms();202 if (numMatrices > 1)203 {204 mDestRenderSystem->_setWorldMatrices(xform, numMatrices);205 }206 else207 {208 mDestRenderSystem->_setWorldMatrix(*xform);209 }210 */211 190 // Issue view / projection changes if any 212 /*useRenderableViewProjMode(&box);191 useRenderableViewProjMode(&box); 213 192 214 193 box.getRenderOperation(ro); 215 194 ro.srcRenderable = &box; 216 195 mDestRenderSystem->_render(ro);*/ 217 setPass(box.getTechnique()->getPass(0)); setRenderingMode(MODE_QUERY); 218 SceneManager::renderSingleObject(&box, box.getTechnique()->getPass(0), false); 196 for(int i = 0; i < 2; i++) 197 { 198 boxHalf[i].setupBoundingBox(node->_getWorldAABB()); 199 //setPass(boxHalf[i].getTechnique()->getPass(0)); //setRenderingMode(MODE_QUERY); 200 SceneManager::renderSingleObject(&boxHalf[i], boxHalf[i].getTechnique()->getPass(0), false); 201 } 219 202 220 203 query->endOcclusionQuery();
Note: See TracChangeset
for help on using the changeset viewer.