1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_SkeletonUpdater.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: 18106 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_GFX_SKELETONUPDATER_H_
17 #define NW_GFX_SKELETONUPDATER_H_
18 
19 #include <nw/gfx/gfx_GfxObject.h>
20 #include <nw/gfx/gfx_CalculatedTransform.h>
21 
22 namespace nw
23 {
24 namespace os
25 {
26 class IAllocator;
27 } // namesapce os
28 
29 namespace gfx
30 {
31 
32 class Skeleton;
33 class WorldMatrixUpdater;
34 class BillboardUpdater;
35 class Camera;
36 
37 //---------------------------------------------------------------------------
38 //! @brief        スケルトン内のボーンの情報を更新するためのクラスです。
39 //---------------------------------------------------------------------------
40 class SkeletonUpdater : public GfxObject
41 {
42 private:
43     NW_DISALLOW_COPY_AND_ASSIGN(SkeletonUpdater);
44 
45 public:
46     //---------------------------------------------------------------------------
47     //! @brief        スケルトンアップデータクラスを構築するためのクラスです。
48     //---------------------------------------------------------------------------
49     class Builder
50     {
51     public:
52         //! コンストラクタです。
Builder()53         Builder() {}
54 
55         //---------------------------------------------------------------------------
56         //! @brief        スケルトンアップデータを生成します。
57         //!
58         //! @param[in]    allocator アロケータです。
59         //!
60         //! @return       生成したスケルトンアップデータを返します。
61         //---------------------------------------------------------------------------
62         SkeletonUpdater* Create(os::IAllocator* allocator);
63     };
64 
65     //---------------------------------------------------------------------------
66     //! @brief        スケルトンを更新します。
67     //!
68     //! @param[in]    skeleton 更新するスケルトンです。
69     //! @param[in]    worldMatrixUpdater 更新に用いるアップデータです。
70     //---------------------------------------------------------------------------
71     void UpdateWorld(
72         Skeleton* skeleton,
73         const WorldMatrixUpdater& worldMatrixUpdater) const;
74 
75     //---------------------------------------------------------------------------
76     //! @brief        カメラを用いてスケルトンを更新します。
77     //!
78     //! @param[in]    skeleton 更新するスケルトンです。
79     //! @param[in]    billboardUpdater 更新に用いるビルボードアップデータです。
80     //! @param[in]    camera 更新に用いるカメラです。
81     //---------------------------------------------------------------------------
82     void UpdateView(
83         Skeleton* skeleton,
84         const BillboardUpdater& billboardUpdater,
85         const Camera& camera) const;
86 
87 private:
88     //! コンストラクタです。
89     SkeletonUpdater(os::IAllocator* allocator);
90 
91     //! デストラクタです。
92     virtual ~SkeletonUpdater();
93 };
94 
95 } // namespace gfx
96 } // namespace nw
97 
98 #endif // NW_GFX_SKELETONUPDATER_H_
99