Line | |
---|
1 | #include "FrustumCullingManager.h" |
---|
2 | #include <OgreLogManager.h> |
---|
3 | |
---|
4 | namespace GtpVisibility { |
---|
5 | |
---|
6 | //----------------------------------------------------------------------- |
---|
7 | void FrustumCullingManager::RenderScene() |
---|
8 | { |
---|
9 | if (0) Ogre::LogManager::getSingleton().logMessage("Frustum Culling"); |
---|
10 | while (!mHierarchyInterface->GetQueue()->empty()) |
---|
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 | |
---|
19 | if (!mHierarchyInterface->CheckFrustumVisible(node)) |
---|
20 | { |
---|
21 | ++ mNumFrustumCulledNodes; |
---|
22 | |
---|
23 | if (mVisualizeCulledNodes) |
---|
24 | { |
---|
25 | mHierarchyInterface->VisualizeCulledNode(node, FRUSTUM_CULLED); |
---|
26 | } |
---|
27 | } |
---|
28 | else |
---|
29 | { |
---|
30 | mHierarchyInterface->SetNodeVisible(node, true); |
---|
31 | mHierarchyInterface->TraverseNode(node); |
---|
32 | } |
---|
33 | } |
---|
34 | } |
---|
35 | |
---|
36 | } // namespace GtpVisibility |
---|
Note: See
TracBrowser
for help on using the repository browser.