/*---------------------------------------------------------------------------* Project: NintendoWare File: gfx_PerspectiveProjectionUpdater.h Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Revision: 27868 $ *---------------------------------------------------------------------------*/ #ifndef NW_GFX_PERSPECTIVEPROJECTIONUPDATER_H_ #define NW_GFX_PERSPECTIVEPROJECTIONUPDATER_H_ #include #include namespace nw { namespace os { class IAllocator; } // namespace os namespace gfx { //--------------------------------------------------------------------------- //! @brief 画角を用いてプロジェクションマトリクスを更新するためのクラスです。 //--------------------------------------------------------------------------- class PerspectiveProjectionUpdater : public CameraProjectionUpdater { private: NW_DISALLOW_COPY_AND_ASSIGN(PerspectiveProjectionUpdater); public: NW_UT_RUNTIME_TYPEINFO; //---------------------------------------- //! @name 作成/破棄 //@{ //--------------------------------------------------------------------------- //! @brief プロジェクションマトリクスアップデータを生成します。 //! //! @param[in] allocator アロケータです。 //! //! @return 生成したプロジェクションのアップデータを返します。 //--------------------------------------------------------------------------- static PerspectiveProjectionUpdater* Create(os::IAllocator* allocator); //--------------------------------------------------------------------------- //! @brief リソースからプロジェクションマトリクスアップデータを生成します。 //! //! @param[in] allocator アロケータです。 //! @param[in] resUpdater アップデータのリソースです。 //! //! @return 生成したプロジェクションのアップデータを返します。 //--------------------------------------------------------------------------- static PerspectiveProjectionUpdater* Create( os::IAllocator* allocator, ResPerspectiveProjectionUpdater resUpdater); //! @details :private static void GetMemorySizeInternal( os::MemorySizeCalculator* pSize, bool isDynamicBuild) { os::MemorySizeCalculator& size = *pSize; size += sizeof(PerspectiveProjectionUpdater); if (isDynamicBuild) { size += sizeof(ResPerspectiveProjectionUpdaterData); } } //@} //---------------------------------------- //! @name プロジェクションマトリクス //@{ //--------------------------------------------------------------------------- //! @brief プロジェクションマトリクスを更新します。 //! //! @param[in] projectionMatrix 更新するプロジェクションマトリクスです。 //! @param[in] textureProjectionMatrix 更新するプロジェクションテクスチャ用射影行列です。 //--------------------------------------------------------------------------- void virtual Update(math::MTX44* projectionMatrix, math::Matrix34* textureProjectionMatrix); //@} //---------------------------------------- //! @name リソース //@{ //! プロジェクションアップデータのリソースを取得します。 virtual ResCameraProjectionUpdater GetResource() { return this->m_Resource; } //! プロジェクションアップデータのリソースを取得します。 virtual const ResCameraProjectionUpdater GetResource() const { return this->m_Resource; } //@} //! @brief ViewUpdaterの種類を取得します。 virtual anim::ResCameraAnimData::ProjectionUpdaterKind Kind() const { return anim::ResCameraAnimData::PROJECTION_UPDATER_PERSPECTIVE; } private: //---------------------------------------- //! @name コンストラクタ/デストラクタ //@{ //--------------------------------------------------------------------------- //! @brief コンストラクタです。 //--------------------------------------------------------------------------- PerspectiveProjectionUpdater( os::IAllocator* pAllocator, bool isDynamic, ResPerspectiveProjectionUpdater resUpdater); //--------------------------------------------------------------------------- //! @brief デストラクタです。 //--------------------------------------------------------------------------- virtual ~PerspectiveProjectionUpdater(); //@} ResPerspectiveProjectionUpdater m_Resource; }; } // namespace gfx } // namespace nw #endif // NW_GFX_PERSPECTIVEPROJECTIONUPDATER_H_