1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_PerspectiveProjectionUpdater.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: 20134 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_GFX_PERSPECTIVEPROJECTIONUPDATER_H_
17 #define NW_GFX_PERSPECTIVEPROJECTIONUPDATER_H_
18 
19 #include <nw/gfx/gfx_CameraProjectionUpdater.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 PerspectiveProjectionUpdater : public CameraProjectionUpdater
35 {
36 private:
37     NW_DISALLOW_COPY_AND_ASSIGN(PerspectiveProjectionUpdater);
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 PerspectiveProjectionUpdater* Create(os::IAllocator* allocator);
54 
55     //---------------------------------------------------------------------------
56     //! @brief        リソースからプロジェクションマトリクスアップデータを生成します。
57     //!
58     //! @param[in]    allocator   アロケータです。
59     //! @param[in]    resUpdater  アップデータのリソースです。
60     //!
61     //! @return       生成したプロジェクションのアップデータを返します。
62     //---------------------------------------------------------------------------
63     static PerspectiveProjectionUpdater* Create(
64         os::IAllocator* allocator,
65         ResPerspectiveProjectionUpdater resUpdater);
66 
67     //@}
68 
69     //----------------------------------------
70     //! @name プロジェクションマトリクス
71     //@{
72 
73     //---------------------------------------------------------------------------
74     //! @brief        プロジェクションマトリクスを更新します。
75     //!
76     //! @param[in]    projectionMatrix  更新するプロジェクションマトリクスです。
77     //! @param[in]    textureProjectionMatrix 更新するプロジェクションテクスチャ用射影行列です。
78     //---------------------------------------------------------------------------
79     void virtual Update(math::MTX44* projectionMatrix, math::Matrix34* textureProjectionMatrix);
80 
81     //@}
82 
83     //----------------------------------------
84     //! @name リソース
85     //@{
86 
87     //! プロジェクションアップデータのリソースを取得します。
GetResource()88     virtual ResCameraProjectionUpdater GetResource()
89     {
90         return this->m_Resource;
91     }
92 
93     //! プロジェクションアップデータのリソースを取得します。
GetResource()94     virtual const ResCameraProjectionUpdater GetResource() const
95     {
96         return this->m_Resource;
97     }
98 
99     //@}
100 
101 private:
102     //----------------------------------------
103     //! @name コンストラクタ/デストラクタ
104     //@{
105 
106     //---------------------------------------------------------------------------
107     //! @brief        コンストラクタです。
108     //---------------------------------------------------------------------------
109     PerspectiveProjectionUpdater(
110         os::IAllocator* pAllocator,
111         bool isDynamic,
112         ResPerspectiveProjectionUpdater resUpdater);
113 
114     //---------------------------------------------------------------------------
115     //! @brief        デストラクタです。
116     //---------------------------------------------------------------------------
117     virtual ~PerspectiveProjectionUpdater();
118     //@}
119 
120     ResPerspectiveProjectionUpdater m_Resource;
121 };
122 
123 } // namespace gfx
124 } // namespace nw
125 
126 #endif // NW_GFX_PERSPECTIVEPROJECTIONUPDATER_H_
127