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