Revision 259,
963 bytes
checked in by mattausch, 19 years ago
(diff) |
refined measurements
|
Rev | Line | |
---|
[59] | 1 | #include "FrustumCullingManager.h" |
---|
[94] | 2 | #include <OgreLogManager.h> |
---|
[59] | 3 | |
---|
| 4 | namespace GtpVisibility { |
---|
| 5 | |
---|
| 6 | //----------------------------------------------------------------------- |
---|
| 7 | void FrustumCullingManager::RenderScene() |
---|
| 8 | { |
---|
[259] | 9 | //Ogre::LogManager::getSingleton().logMessage("Frustum Culling"); |
---|
[74] | 10 | while (!mHierarchyInterface->GetQueue()->empty()) |
---|
[59] | 11 | { |
---|
| 12 | HierarchyNode *node = mHierarchyInterface->GetQueue()->top(); |
---|
| 13 | mHierarchyInterface->GetQueue()->pop(); |
---|
| 14 | |
---|
| 15 | // interesting for visualization purpose |
---|
| 16 | mHierarchyInterface->SetNodeVisible(node, false); |
---|
| 17 | mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); |
---|
| 18 | |
---|
[74] | 19 | if (!mHierarchyInterface->CheckFrustumVisible(node)) |
---|
[147] | 20 | { |
---|
| 21 | ++ mNumFrustumCulledNodes; |
---|
[113] | 22 | |
---|
[115] | 23 | if (mVisualizeCulledNodes) |
---|
[113] | 24 | { |
---|
| 25 | mHierarchyInterface->VisualizeCulledNode(node, FRUSTUM_CULLED); |
---|
| 26 | } |
---|
[59] | 27 | } |
---|
[74] | 28 | else |
---|
[259] | 29 | { |
---|
[74] | 30 | mHierarchyInterface->SetNodeVisible(node, true); |
---|
[158] | 31 | mHierarchyInterface->TraverseNode(node); |
---|
[59] | 32 | } |
---|
| 33 | } |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | } // namespace GtpVisibility |
---|
Note: See
TracBrowser
for help on using the repository browser.