1 | #ifndef _LBBCCLUSTERSVIEWMODE_H |
---|
2 | #define _LBBCCLUSTERSVIEWMODE_H |
---|
3 | |
---|
4 | #include <LBBCPrerequisites.h> |
---|
5 | #include <OBAOgreFrameListenerMode.h> |
---|
6 | |
---|
7 | namespace LBBC { |
---|
8 | |
---|
9 | class ClusterViewMode : public OBA::OgreFrameListenerMode |
---|
10 | { |
---|
11 | public: |
---|
12 | ClusterViewMode(Ogre::RenderWindow* win, unsigned int ogreFrameListenerModeHandle, bool useBufferedInputKeys = false, bool useBufferedInputMouse = false): |
---|
13 | OBA::OgreFrameListenerMode(win, ogreFrameListenerModeHandle, useBufferedInputKeys, useBufferedInputMouse) |
---|
14 | { |
---|
15 | showDebugOverlay(false); |
---|
16 | } |
---|
17 | |
---|
18 | virtual ~ClusterViewMode() |
---|
19 | { |
---|
20 | } |
---|
21 | |
---|
22 | bool frameStarted(const Ogre::FrameEvent& evt, Ogre::InputReader *inputReader) |
---|
23 | { |
---|
24 | showDebugOverlay(true); |
---|
25 | mWindow->getViewport(0)->setBackgroundColour(Ogre::ColourValue(0.0, 0.0, 0.0, 1.0)); |
---|
26 | |
---|
27 | return OgreFrameListenerMode::frameStarted(evt, inputReader); |
---|
28 | } |
---|
29 | |
---|
30 | void setEntityClustersMeshName(Ogre::String entityClustersMeshName) |
---|
31 | { |
---|
32 | mEntityClustersMeshName = entityClustersMeshName; |
---|
33 | } |
---|
34 | |
---|
35 | virtual void createScene() |
---|
36 | { |
---|
37 | mWindow->getViewport(0)->setBackgroundColour(Ogre::ColourValue(0.0, 0.0, 0.0, 1.0)); |
---|
38 | |
---|
39 | Ogre::SceneNode* sNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
|
---|
40 | Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity(mEntityClustersMeshName, mEntityClustersMeshName);
|
---|
41 | sNode->attachObject(eLeafClustersGrouped); |
---|
42 | |
---|
43 | Ogre::Entity* trunk = mSceneMgr->createEntity("acerTrunkLevel1.mesh", "acerTrunkLevel1.mesh");
|
---|
44 | sNode->attachObject(trunk); |
---|
45 | |
---|
46 | } |
---|
47 | protected: |
---|
48 | Ogre::String mEntityClustersMeshName; |
---|
49 | |
---|
50 | |
---|
51 | }; |
---|
52 | |
---|
53 | } |
---|
54 | #endif |
---|