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