1 | #include "OgreOcclusionCullingSceneManager.h"
|
---|
2 | #include "OgreMath.h"
|
---|
3 | #include "OgreIteratorWrappers.h"
|
---|
4 | #include "OgreRenderSystem.h"
|
---|
5 | #include "OgreCamera.h"
|
---|
6 | #include "OgreHardwareOcclusionQuery.h"
|
---|
7 | //#include "OgreWireBoundingBox.h"
|
---|
8 | #include "OgreSolidHalfBoundingBox.h"
|
---|
9 |
|
---|
10 | #include <windows.h>
|
---|
11 |
|
---|
12 | namespace Ogre {
|
---|
13 |
|
---|
14 | //-----------------------------------------------------------------------
|
---|
15 | OcclusionCullingSceneManager::OcclusionCullingSceneManager()
|
---|
16 | {
|
---|
17 | mOcclusionCullingSceneTraverser = new OcclusionCullingSceneTraverser(this, mDestRenderSystem);
|
---|
18 | }
|
---|
19 | //-----------------------------------------------------------------------
|
---|
20 | OcclusionCullingSceneManager::~OcclusionCullingSceneManager()
|
---|
21 | {
|
---|
22 | delete mOcclusionCullingSceneTraverser;
|
---|
23 | }
|
---|
24 | //-----------------------------------------------------------------------
|
---|
25 | void OcclusionCullingSceneManager::_findVisibleObjects( Camera* cam, bool onlyShadowCasters )
|
---|
26 | {
|
---|
27 | // empty because we have to find objects in _renderVisibleObjects
|
---|
28 | }
|
---|
29 | //-----------------------------------------------------------------------
|
---|
30 | void OcclusionCullingSceneManager::_renderVisibleObjects( void )
|
---|
31 | {
|
---|
32 | mOcclusionCullingSceneTraverser->renderScene(mCameraInProgress, mSceneRoot);
|
---|
33 | }
|
---|
34 | //-----------------------------------------------------------------------
|
---|
35 | /*void OcclusionCullingSceneManager::renderZPass()
|
---|
36 | {
|
---|
37 | traverseNode(mSceneRoot);
|
---|
38 | }*/
|
---|
39 | //-----------------------------------------------------------------------
|
---|
40 | void OcclusionCullingSceneManager::_updateSceneGraph( Camera* cam )
|
---|
41 | {
|
---|
42 | mOcclusionCullingSceneTraverser->setNumSceneNodes(mSceneNodes.size());
|
---|
43 | mOcclusionCullingSceneTraverser->preprocess();
|
---|
44 |
|
---|
45 | SceneManager::_updateSceneGraph(cam);
|
---|
46 | }
|
---|
47 | //-----------------------------------------------------------------------
|
---|
48 | bool OcclusionCullingSceneManager::setOption( const String & key, const void * val )
|
---|
49 | {
|
---|
50 | mOcclusionCullingSceneTraverser->setOption(key, val);
|
---|
51 |
|
---|
52 | return SceneManager::setOption( key, val );
|
---|
53 | }
|
---|
54 | //-----------------------------------------------------------------------
|
---|
55 | bool OcclusionCullingSceneManager::getOption( const String & key, void *val )
|
---|
56 | {
|
---|
57 | mOcclusionCullingSceneTraverser->getOption(key, val);
|
---|
58 |
|
---|
59 | return SceneManager::getOption( key, val );
|
---|
60 | }
|
---|
61 | //-----------------------------------------------------------------------
|
---|
62 | bool OcclusionCullingSceneManager::getOptionValues( const String & key, StringVector &refValueList )
|
---|
63 | {
|
---|
64 | return SceneManager::getOptionValues( key, refValueList );
|
---|
65 | }
|
---|
66 | //-----------------------------------------------------------------------
|
---|
67 | bool OcclusionCullingSceneManager::getOptionKeys( StringVector & refKeys )
|
---|
68 | {
|
---|
69 | SceneManager::getOptionKeys( refKeys );
|
---|
70 |
|
---|
71 | mOcclusionCullingSceneTraverser->getOptionKeys( refKeys );
|
---|
72 |
|
---|
73 | return true;
|
---|
74 | }
|
---|
75 | }
|
---|