1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_RotateViewUpdater.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: 22890 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_GFX_ROTATEVIEWUPDATER_H_
17 #define NW_GFX_ROTATEVIEWUPDATER_H_
18 
19 #include <nw/gfx/gfx_CameraViewUpdater.h>
20 #include <nw/ut/ut_Preprocessor.h>
21 
22 namespace nw
23 {
24 namespace os
25 {
26 class IAllocator;
27 } // namespace os
28 namespace gfx
29 {
30 
31 //---------------------------------------------------------------------------
32 //! @brief        カメラの回転角度を用いてビューマトリクスを更新するクラスです。
33 //---------------------------------------------------------------------------
34 class RotateViewUpdater : public CameraViewUpdater
35 {
36 private:
37     NW_DISALLOW_COPY_AND_ASSIGN(RotateViewUpdater);
38 
39 public:
40     NW_UT_RUNTIME_TYPEINFO;
41 
42     //----------------------------------------
43     //! @name 作成/破棄
44     //@{
45 
46     //---------------------------------------------------------------------------
47     //! @brief        ビューマトリクスのアップデータを生成します。
48     //!
49     //! @param[in]    allocator   アロケータです。
50     //!
51     //! @return       生成したビューマトリクスのアップデータです。
52     //---------------------------------------------------------------------------
53     static RotateViewUpdater* Create(os::IAllocator* allocator);
54 
55     //---------------------------------------------------------------------------
56     //! @brief        ビューマトリクスのアップデータを生成します。
57     //!
58     //! @param[in]    allocator   アロケータです。
59     //! @param[in]    resUpdater アップデータのリソースです。
60     //!
61     //! @return       生成したビューマトリクスのアップデータです。
62     //---------------------------------------------------------------------------
63     static RotateViewUpdater* Create(
64         os::IAllocator* allocator,
65         ResRotateViewUpdater resUpdater);
66     //@}
67 
68     //----------------------------------------
69     //! @name ビューマトリクス
70     //@{
71 
72     //---------------------------------------------------------------------------
73     //! @brief        ビューマトリクスを更新します。
74     //!
75     //! @param[out]   viewMatrix      更新するビューマトリクスです。
76     //! @param[in]    worldMatrix     カメラのワールドマトリクスです。
77     //! @param[in]    cameraPosition  カメラ位置です。
78     //---------------------------------------------------------------------------
79     void virtual Update(
80         math::MTX34* viewMatrix,
81         const math::MTX34& worldMatrix,
82         const math::VEC3& cameraPosition);
83 
84     //@}
85 
86     //----------------------------------------
87     //! @name リソース
88     //@{
89 
90     //! ビューアップデータのリソースを取得します。
GetResource()91     virtual ResCameraViewUpdater GetResource()
92     {
93         return this->m_Resource;
94     }
95 
96     //! ビューアップデータのリソースを取得します。
GetResource()97     virtual const ResCameraViewUpdater GetResource() const
98     {
99         return this->m_Resource;
100     }
101 
102     //@}
103 
104 private:
105     //----------------------------------------
106     //! @name コンストラクタ/デストラクタ
107     //@{
108     //---------------------------------------------------------------------------
109     //! @brief        コンストラクタです。
110     //---------------------------------------------------------------------------
111     RotateViewUpdater(
112         os::IAllocator* pAllocator,
113         bool isDynamic,
114         ResRotateViewUpdater resUpdater);
115 
116     //---------------------------------------------------------------------------
117     //! @brief        デストラクタです。
118     //---------------------------------------------------------------------------
119     virtual ~RotateViewUpdater();
120     //@}
121 
122     ResRotateViewUpdater m_Resource;
123 };
124 
125 } // namespace gfx
126 } // namespace nw
127 
128 #endif // NW_GFX_ROTATEVIEWUPDATER_H_
129