/*---------------------------------------------------------------------------* Project: NintendoWare File: gfx_BillboardUpdater.h Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo and/or its licensed developers and are protected by national and international copyright laws. 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. The content herein is highly confidential and should be handled accordingly. $Revision: 31311 $ *---------------------------------------------------------------------------*/ #ifndef NW_GFX_BILLBOARDUPDATER_H_ #define NW_GFX_BILLBOARDUPDATER_H_ #include #include namespace nw { namespace os { class IAllocator; } // namesapce os namespace gfx { class Matrix34; //--------------------------------------------------------------------------- //! @brief ビルボードを計算するためのクラスです。 //--------------------------------------------------------------------------- class BillboardUpdater : public GfxObject { private: NW_DISALLOW_COPY_AND_ASSIGN(BillboardUpdater); public: //--------------------------------------------------------------------------- //! @brief ビルボードアップデータを生成します。 //! //! @param[in] allocator アロケータです。 //! //! @return 生成したビルボードアップデータを返します。 //--------------------------------------------------------------------------- static BillboardUpdater* Create(os::IAllocator* allocator); //--------------------------------------------------------------------------- //! @brief ビルボード計算を行い、ワールドマトリクスを更新します。 //! //! @param[out] worldMatrix 更新するワールドマトリクスです。 //! @param[in] viewMatrix ビューマトリクスです。 //! @param[in] inverseViewMatrix ビューマトリクスの逆行列です。 //! @param[in] cameraPosition カメラ座標です。 //! @param[in] worldTransform ボーンのワールドトランスフォームです。 //! @param[in] localTransform ボーンのローカルトランスフォームです。 //! @param[in] billboardMode 適応するビルボードの種類です。 //--------------------------------------------------------------------------- void Update( math::MTX34* worldMatrix, const math::MTX34& viewMatrix, const math::MTX34& inverseViewMatrix, const math::VEC3& cameraPosition, const CalculatedTransform& worldTransform, const CalculatedTransform& localTransform, ResBone::BillboardMode billboardMode) const; private: //! コンストラクタです。 BillboardUpdater(os::IAllocator* allocator); //! デストラクタです。 virtual ~BillboardUpdater(); void CalculateLocalMatrix( math::MTX34* localMatrix, const CalculatedTransform& transform, math::VEC3 zAxis, bool recalculateYAxis = true) const; void CalculateScreenLocalMatrix( math::MTX34* localMatrix, const CalculatedTransform& transform, const math::MTX34& inverseViewMatrix, math::VEC3 yAxis, math::VEC3& zAxis) const; }; } // namespace gfx } // namespace nw #endif // NW_GFX_BILLBOARDUPDATER_H_