/*---------------------------------------------------------------------------* Project: NintendoWare File: gfx_CameraProjectionUpdater.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: 27365 $ *---------------------------------------------------------------------------*/ #ifndef NW_GFX_CAMERAPROJECTIONUPDATER_H_ #define NW_GFX_CAMERAPROJECTIONUPDATER_H_ #include #include namespace nw { namespace math { struct VEC2; struct Transform3; struct MTX34; } namespace ut { struct Rect; } namespace gfx { //--------------------------------------------------------------------------- //! @brief プロジェクションマトリクスを更新するインタフェースです。 //! //! ICameraProjectionUpdater は廃止され CameraProjectionUpdater に変更されました。 //--------------------------------------------------------------------------- class CameraProjectionUpdater : public GfxObject { private: NW_DISALLOW_COPY_AND_ASSIGN(CameraProjectionUpdater); public: NW_UT_RUNTIME_TYPEINFO; //---------------------------------------- //! @name プロジェクションマトリクス //@{ //--------------------------------------------------------------------------- //! @brief プロジェクションマトリクスを更新します。 //! //! @param[in] projectionMatrix 更新するプロジェクションマトリクスです。 //! @param[in] textureProjectionMatrix 更新するプロジェクションテクスチャ用射影行列です。 //--------------------------------------------------------------------------- virtual void Update(math::MTX44* projectionMatrix, math::Matrix34* textureProjectionMatrix) = 0; //@} //---------------------------------------- //! @name ピボット //@{ //! @brief 画面の上方向を設定します。 //! //! @param[in] pivot 画面の上方向です。 void SetPivotDirection( math::PivotDirection pivot) { this->m_Pivot = pivot; } //! @brief 画面の上方向を取得します。 //! //! @return 画面の上方向です。 math::PivotDirection GetPivotDirection() const { return this->m_Pivot; } //@} //! 動的に生成されたアップデータかどうかのフラグを取得します。 bool IsDynamic() { return this->m_IsDynamic; } //---------------------------------------- //! @name リソース //@{ //! プロジェクションアップデータのリソースを取得します。 virtual ResCameraProjectionUpdater GetResource() = 0; //! プロジェクションアップデータのリソースを取得します。 virtual const ResCameraProjectionUpdater GetResource() const = 0; //@} //---------------------------------------- //! @name テクスチャ //@{ //! @brief テクスチャのスケールを取得します。 math::VEC2& TextureScale() { return m_TextureScale; } //! @brief テクスチャのスケールを取得します。 const math::VEC2& TextureScale() const { return m_TextureScale; } //! @brief テクスチャの平行移動を取得します。 math::VEC2& TextureTranslate() { return m_TextureTranslate; } //! @brief テクスチャの平行移動を取得します。 const math::VEC2& TextureTranslate() const { return m_TextureTranslate; } //@} //! @brief ProjectionUpdaterの種類を取得します。 virtual anim::ResCameraAnimData::ProjectionUpdaterKind Kind() const = 0; protected: //! @brief コンストラクタです。 CameraProjectionUpdater(os::IAllocator* allocator, bool isDynamic) : GfxObject(allocator), m_Pivot(math::PIVOT_NONE), m_IsDynamic(isDynamic), m_TextureScale(0.5f, 0.5f), m_TextureTranslate(0.5f, 0.5f) {} //! @brief デストラクタです。 virtual ~CameraProjectionUpdater(){} private: math::PivotDirection m_Pivot; bool m_IsDynamic; math::VEC2 m_TextureScale; math::VEC2 m_TextureTranslate; protected: //! ニアクリップのデフォルト値です。 static const float PROJECTION_NEAR_CLIP; //! ファークリップのデフォルト値です。 static const float PROJECTION_FAR_CLIP; //! FOVのY方向のデフォルト値です。 static const float PROJECTION_FOVY_RADIAN; //! アスペクト比のデフォルト値です。 static const float PROJECTION_ASPECT_RATIO; //! ニアクリップ面での中心座標のデフォルト値です。 static const math::VEC2 PROJECTION_CENTER; //! ニアクリップ面での高さのデフォルト値です。 static const float PROJECTION_HEIGHT; //! ニアクリップ面での表示矩形のデフォルト値です。 static const ResProjectionRect PROJECTION_RECT; }; } // namespace gfx } // namespace nw #endif // NW_GFX_CAMERAPROJECTIONUPDATER_H_