1 | #include "OgreVisibilityOptionsManager.h"
|
---|
2 |
|
---|
3 | namespace Ogre {
|
---|
4 | //-----------------------------------------------------------------------
|
---|
5 | VisibilityOptionsManager::VisibilityOptionsManager(GtpVisibility::VisibilityManager *visManager,
|
---|
6 | GtpVisibility::HierarchyInterface *hierarchyInterface):
|
---|
7 | mVisibilityManager(visManager), mHierarchyInterface(hierarchyInterface)
|
---|
8 | {
|
---|
9 | }
|
---|
10 | //-----------------------------------------------------------------------
|
---|
11 | bool VisibilityOptionsManager::setOption( const String & key, const void * val )
|
---|
12 | {
|
---|
13 | if( key == "Algorithm" )
|
---|
14 | {
|
---|
15 | mVisibilityManager->SetCullingManager(*static_cast<const
|
---|
16 | GtpVisibility::VisibilityEnvironment::CullingManagerType *>(val));
|
---|
17 | return true;
|
---|
18 | }
|
---|
19 | if(key == "Threshold")
|
---|
20 | {
|
---|
21 | mVisibilityManager->SetVisibilityCullingThreshold(*static_cast<const int *>(val));
|
---|
22 |
|
---|
23 | return true;
|
---|
24 | }
|
---|
25 |
|
---|
26 | return false;
|
---|
27 | }
|
---|
28 | //-----------------------------------------------------------------------
|
---|
29 | bool VisibilityOptionsManager::getOption( const String & key, void *val )
|
---|
30 | {
|
---|
31 | if (key == "NumTraversedNodes")
|
---|
32 | {
|
---|
33 | * static_cast <unsigned int *>(val) =
|
---|
34 | mHierarchyInterface->GetNumTraversedNodes();
|
---|
35 | return true;
|
---|
36 | }
|
---|
37 | if (key == "NumRenderedNodes")
|
---|
38 | {
|
---|
39 | * static_cast <unsigned int *>(val) =
|
---|
40 | mHierarchyInterface->GetNumRenderedNodes();
|
---|
41 | return true;
|
---|
42 | }
|
---|
43 | if (key == "NumQueryCulledNodes")
|
---|
44 | {
|
---|
45 | * static_cast <unsigned int *>(val) =
|
---|
46 | mVisibilityManager->GetCullingManager()->GetNumQueryCulledNodes();
|
---|
47 | return true;
|
---|
48 | }
|
---|
49 | if (key == "NumFrustumCulledNodes")
|
---|
50 | {
|
---|
51 | * static_cast<unsigned int *>(val) =
|
---|
52 | mVisibilityManager->GetCullingManager()->GetNumFrustumCulledNodes();
|
---|
53 | return true;
|
---|
54 | }
|
---|
55 | return false;
|
---|
56 | }
|
---|
57 | //-----------------------------------------------------------------------
|
---|
58 | bool VisibilityOptionsManager::getOptionKeys( StringVector & refKeys )
|
---|
59 | {
|
---|
60 | refKeys.push_back( "NumRenderedNodes" ); |
---|
61 | refKeys.push_back( "NumTraversedNodes" ); |
---|
62 | refKeys.push_back( "NumQueryCulledNodes" ); |
---|
63 | refKeys.push_back( "NumFrustumCulledNodes" ); |
---|
64 |
|
---|
65 | return true;
|
---|
66 | }
|
---|
67 | } // namespace Ogre |
---|