1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_SkeletonUpdater.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NW_GFX_SKELETONUPDATER_H_
19 #define NW_GFX_SKELETONUPDATER_H_
20 
21 #include <nw/gfx/gfx_GfxObject.h>
22 #include <nw/gfx/gfx_CalculatedTransform.h>
23 
24 namespace nw
25 {
26 namespace os
27 {
28 class IAllocator;
29 } // namesapce os
30 
31 namespace gfx
32 {
33 
34 class Skeleton;
35 class WorldMatrixUpdater;
36 class BillboardUpdater;
37 class Camera;
38 
39 //---------------------------------------------------------------------------
40 //! @brief        スケルトン内のボーンの情報を更新するためのクラスです。
41 //---------------------------------------------------------------------------
42 class SkeletonUpdater : public GfxObject
43 {
44 private:
45     NW_DISALLOW_COPY_AND_ASSIGN(SkeletonUpdater);
46 
47 public:
48     //---------------------------------------------------------------------------
49     //! @brief        スケルトンアップデータクラスを構築するためのクラスです。
50     //---------------------------------------------------------------------------
51     class Builder
52     {
53     public:
54         //! コンストラクタです。
Builder()55         Builder() {}
56 
57         //---------------------------------------------------------------------------
58         //! @brief        スケルトンアップデータを生成します。
59         //!
60         //! @param[in]    allocator アロケータです。
61         //!
62         //! @return       生成したスケルトンアップデータを返します。
63         //---------------------------------------------------------------------------
64         SkeletonUpdater* Create(os::IAllocator* allocator);
65     };
66 
67     //---------------------------------------------------------------------------
68     //! @brief        スケルトンを更新します。
69     //!
70     //! @param[in]    skeleton 更新するスケルトンです。
71     //! @param[in]    worldMatrixUpdater 更新に用いるアップデータです。
72     //---------------------------------------------------------------------------
73     void UpdateWorld(
74         Skeleton* skeleton,
75         const WorldMatrixUpdater& worldMatrixUpdater) const;
76 
77     //---------------------------------------------------------------------------
78     //! @brief        カメラを用いてスケルトンを更新します。
79     //!
80     //! @param[in]    skeleton 更新するスケルトンです。
81     //! @param[in]    billboardUpdater 更新に用いるビルボードアップデータです。
82     //! @param[in]    camera 更新に用いるカメラです。
83     //---------------------------------------------------------------------------
84     void UpdateView(
85         Skeleton* skeleton,
86         const BillboardUpdater& billboardUpdater,
87         const Camera& camera) const;
88 
89 private:
90     //! コンストラクタです。
91     SkeletonUpdater(os::IAllocator* allocator);
92 
93     //! デストラクタです。
94     virtual ~SkeletonUpdater();
95 };
96 
97 } // namespace gfx
98 } // namespace nw
99 
100 #endif // NW_GFX_SKELETONUPDATER_H_
101