1 /*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: gfx_CameraViewUpdater.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_CAMERAVIEWUPDATER_H_ 17 #define NW_GFX_CAMERAVIEWUPDATER_H_ 18 19 #include <nw/gfx/gfx_GfxObject.h> 20 #include <nw/gfx/res/gfx_ResCamera.h> 21 22 namespace nw 23 { 24 25 namespace math 26 { 27 struct VEC3; 28 struct MTX34; 29 } 30 31 namespace gfx 32 { 33 34 //--------------------------------------------------------------------------- 35 //! @brief ビューマトリクスを更新するインタフェースです。 36 //! 37 //! ICameraViewUpdater は廃止され CameraViewUpdater に変更されました。 38 //--------------------------------------------------------------------------- 39 class CameraViewUpdater : public GfxObject 40 { 41 private: 42 NW_DISALLOW_COPY_AND_ASSIGN(CameraViewUpdater); 43 44 public: 45 NW_UT_RUNTIME_TYPEINFO; 46 47 //---------------------------------------- 48 //! @name ビューマトリクス 49 //@{ 50 51 //--------------------------------------------------------------------------- 52 //! @brief ビューマトリクスを更新します。 53 //! 54 //! @param[out] viewMatrix 更新するビューマトリクスです。 55 //! @param[in] worldMatrix カメラの親ノードのワールドマトリクスです。 56 //! @param[in] cameraPosition カメラ位置です。 57 //--------------------------------------------------------------------------- 58 void virtual Update( 59 math::MTX34* viewMatrix, 60 const math::MTX34& worldMatrix, 61 const math::VEC3& cameraPosition) = 0; 62 63 //@} 64 65 //! 動的に生成されたアップデータかどうかのフラグを取得します。 IsDynamic()66 bool IsDynamic() 67 { 68 return this->m_IsDynamic; 69 } 70 71 //---------------------------------------- 72 //! @name リソース 73 //@{ 74 75 //! ビューアップデータのリソースを取得します。 76 virtual ResCameraViewUpdater GetResource() = 0; 77 78 //! ビューアップデータのリソースを取得します。 79 virtual const ResCameraViewUpdater GetResource() const = 0; 80 81 //@} 82 83 protected: 84 85 //! @brief コンストラクタです。 CameraViewUpdater(os::IAllocator * allocator,bool isDynamic)86 CameraViewUpdater(os::IAllocator* allocator, bool isDynamic) 87 : GfxObject(allocator), 88 m_IsDynamic(isDynamic) 89 {} 90 91 protected: 92 //! カメラターゲットのデフォルト値です。 93 static const math::VEC3 VIEW_TARGET_POSITION; 94 //! カメラアップベクトルのデフォルト値です。 95 static const math::VEC3 VIEW_UPWARD_VECTOR; 96 //! カメラ回転のデフォルト値です。 97 static const math::VEC3 VIEW_VIEW_ROTATE; 98 //! カメラツイストのデフォルト値です。 99 static const float VIEW_TWIST; 100 101 private: 102 bool m_IsDynamic; 103 }; 104 105 } // namespace gfx 106 } // namespace nw 107 108 #endif // NW_GFX_CAMERAVIEWUPDATER_H_ 109