1 /*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: gfx_FrustumProjectionUpdater.h 4 5 Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain proprietary 8 information of Nintendo and/or its licensed developers and are protected by 9 national and international copyright laws. They may not be disclosed to third 10 parties or copied or duplicated in any form, in whole or in part, without the 11 prior written consent of Nintendo. 12 13 The content herein is highly confidential and should be handled accordingly. 14 15 $Revision: 31311 $ 16 *---------------------------------------------------------------------------*/ 17 18 #ifndef NW_GFX_FRUSTUMPROJECTIONUPDATER_H_ 19 #define NW_GFX_FRUSTUMPROJECTIONUPDATER_H_ 20 21 #include <nw/gfx/gfx_CameraProjectionUpdater.h> 22 #include <nw/ut/ut_Preprocessor.h> 23 24 namespace nw 25 { 26 namespace os 27 { 28 class IAllocator; 29 } // namespace os 30 namespace gfx 31 { 32 33 //--------------------------------------------------------------------------- 34 //! @brief 視錐台を用いて射影行列を更新するためのクラスです。 35 //--------------------------------------------------------------------------- 36 class FrustumProjectionUpdater : public CameraProjectionUpdater 37 { 38 private: 39 NW_DISALLOW_COPY_AND_ASSIGN(FrustumProjectionUpdater); 40 41 public: 42 NW_UT_RUNTIME_TYPEINFO; 43 44 //---------------------------------------- 45 //! @name 作成/破棄 46 //@{ 47 48 //--------------------------------------------------------------------------- 49 //! @brief プロジェクションマトリクスアップデータを生成します。 50 //! 51 //! @param[in] allocator アロケータです。 52 //! 53 //! @return 生成したプロジェクションのアップデータを返します。 54 //--------------------------------------------------------------------------- 55 static FrustumProjectionUpdater* Create(os::IAllocator* allocator); 56 57 //--------------------------------------------------------------------------- 58 //! @brief リソースからプロジェクションマトリクスアップデータを生成します。 59 //! 60 //! @param[in] allocator アロケータです。 61 //! @param[in] resUpdater アップデータのリソースです。 62 //! 63 //! @return 生成したプロジェクションのアップデータを返します。 64 //--------------------------------------------------------------------------- 65 static FrustumProjectionUpdater* Create( 66 os::IAllocator* allocator, 67 ResFrustumProjectionUpdater resUpdater); 68 69 //! @details :private GetMemorySizeInternal(os::MemorySizeCalculator * pSize,bool isDynamicBuild)70 static void GetMemorySizeInternal( 71 os::MemorySizeCalculator* pSize, 72 bool isDynamicBuild) 73 { 74 os::MemorySizeCalculator& size = *pSize; 75 76 size += sizeof(FrustumProjectionUpdater); 77 if (isDynamicBuild) 78 { 79 size += sizeof(ResFrustumProjectionUpdaterData); 80 } 81 } 82 83 //@} 84 85 //---------------------------------------- 86 //! @name プロジェクションマトリクス 87 //@{ 88 89 //--------------------------------------------------------------------------- 90 //! @brief プロジェクションマトリクスを更新します。 91 //! 92 //! @param[in] projectionMatrix 更新するプロジェクションマトリクスです。 93 //! @param[in] textureProjectionMatrix 更新するプロジェクションテクスチャ用射影行列です。 94 //--------------------------------------------------------------------------- 95 void virtual Update(math::MTX44* projectionMatrix, math::Matrix34* textureProjectionMatrix); 96 97 //@} 98 99 //---------------------------------------- 100 //! @name リソース 101 //@{ 102 103 //! プロジェクションアップデータのリソースを取得します。 GetResource()104 virtual ResCameraProjectionUpdater GetResource() 105 { 106 return this->m_Resource; 107 } 108 109 //! プロジェクションアップデータのリソースを取得します。 GetResource()110 virtual const ResCameraProjectionUpdater GetResource() const 111 { 112 return this->m_Resource; 113 } 114 115 //@} 116 117 //! @brief プロジェクションアップデータの種類を取得します。 Kind()118 virtual anim::ResCameraAnimData::ProjectionUpdaterKind Kind() const 119 { 120 return anim::ResCameraAnimData::PROJECTION_UPDATER_FRUSTUM; 121 } 122 123 private: 124 //---------------------------------------- 125 //! @name コンストラクタ/デストラクタ 126 //@{ 127 //--------------------------------------------------------------------------- 128 //! @brief コンストラクタです。 129 //--------------------------------------------------------------------------- 130 FrustumProjectionUpdater( 131 os::IAllocator* pAllocator, 132 bool isDynamic, 133 ResFrustumProjectionUpdater resUpdater); 134 135 //--------------------------------------------------------------------------- 136 //! @brief デストラクタです。 137 //--------------------------------------------------------------------------- 138 virtual ~FrustumProjectionUpdater(); 139 //@} 140 141 ResFrustumProjectionUpdater m_Resource; 142 }; 143 144 } // namespace gfx 145 } // namespace nw 146 147 #endif // NW_GFX_FRUSTUMPROJECTIONUPDATER_H_ 148