1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     SmSceneCtrl.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 1 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef SM_SCENE_CTRL_H_
17 #define SM_SCENE_CTRL_H_
18 
19 
20 #include <nw/gfx.h>
21 #include "../include/SmBase.h"
22 
23 //------------------------------------------------------------------------------
24 // シーン機能をまとめるたクラスです。
25 class SmSceneCtrl : public SmBase
26 {
27 public:
28     //----------------------------------------
29     // コンストラクタ
30     SmSceneCtrl( nw::gfx::RenderContext* renderContext );
31 
32     //----------------------------------------
33     // デストラクタ
34     ~SmSceneCtrl();
35 
36     //----------------------------------------
37     // シーンを初期化します。
38     void InitializeScene(nw::gfx::SceneNode* sceneRoot);
39 
40     //----------------------------------------
41     void TraverseScene(nw::gfx::SceneNode* sceneRoot);
42 
43     //----------------------------------------
44     void SetSceneEnvironmentSetting( nw::gfx::SceneEnvironmentSetting* sceneEnvironmentSetting );
45 
46     //----------------------------------------
47     // シーンを更新します。
48     void UpdateScene();
49 
50     //----------------------------------------
51     // カメラの視界に基づいてシーンを更新し、描画キューを構築します。
52     void SubmitView( nw::gfx::Camera* currentCamera );
53 #if 0
54     //----------------------------------------
55     // 描画環境をセットする
56     void SetEnvironment( s32 cameraIndex );
57 #endif
58     //----------------------------------------
59     // 描画を行います。
60     void Render();
61 
62     //----------------------------------------
63     // シーンコンテキストを取得します。
GetSceneContext()64     nw::gfx::SceneContext*   GetSceneContext() { return m_SceneContext; }
65 
66 private:
67     nw::gfx::SceneContext*              m_SceneContext;
68     nw::gfx::SceneTraverser*            m_SceneTraverser;
69     nw::gfx::SceneUpdater*              m_SceneUpdater;
70     nw::gfx::SceneInitializer*          m_SceneInitializer;
71 
72     nw::gfx::RenderContext*             m_RenderContext;
73     nw::gfx::RenderKeyFactory*          m_PriorMaterialRenderKeyFactory;
74     nw::gfx::RenderKeyFactory*          m_PriorDepthRenderKeyFactory;
75     nw::gfx::RenderQueue*               m_RenderQueue;
76     nw::gfx::MeshRenderer*              m_MeshRenderer;
77 };
78 
79 
80 #endif // SM_SCENE_CTRL_H_
81