1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_ParticleSceneUpdater.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_PARTICLESCENEUPDATER_H_
19 #define NW_GFX_PARTICLESCENEUPDATER_H_
20 
21 #include <nw/gfx/gfx_ISceneUpdater.h>
22 #include <nw/gfx/gfx_SkeletonUpdater.h>
23 #include <nw/gfx/gfx_WorldMatrixUpdater.h>
24 #include <nw/gfx/gfx_BillboardUpdater.h>
25 
26 namespace nw
27 {
28 namespace gfx
29 {
30 
31 class SceneContext;
32 class ParticleContext;
33 class ParticleSet;
34 
35 //---------------------------------------------------------------------------
36 //! @brief        パーティクルの更新を行うためのクラスです
37 //---------------------------------------------------------------------------
38 class ParticleSceneUpdater  : public GfxObject
39 {
40 private:
41     NW_DISALLOW_COPY_AND_ASSIGN(ParticleSceneUpdater);
42 
43 public:
44     NW_UT_RUNTIME_TYPEINFO;
45 
46     //! シーンノードの MoveArray の定義です。
47     typedef ut::MoveArray<SceneNode*> SceneNodeArray;
48 
49     //! ParticleSetの MoveArray の定義です。
50     typedef ut::MoveArray<ParticleSet*> ParticleSetArray;
51 
52     //----------------------------------------
53     //! @name 作成
54     //@{
55 
56     //! パーティクルシーンアップデータクラスを構築するためのクラスです。
57     class Builder
58     {
59     public:
60         //! @brief コンストラクタです。
Builder()61         Builder() {}
62 
63         //! @brief        シーンアップデータを生成します。
64         //!
65         //! @param[in]    allocator
66         //!
67         //! @return       生成したシーンアップデータを返します。
68         //!
69         ParticleSceneUpdater* Create(os::IAllocator* allocator);
70     };
71 
72     //@}
73 
74     //----------------------------------------
75     //! @name 更新
76     //@{
77 
78     //! @brief パーティクルの再生ステップを一括で設定します。
79     //!
80     //! @param[in] sceneContext シーンコンテキストです。
81     //! @param[in] stepFrame 設定する再生ステップです。
82     //!
83     void SetStepFrame(
84         SceneContext* sceneContext,
85         f32 stepFrame);
86 
87     //! @brief シーンコンテキストをビューに基づいて更新します。
88     //!
89     //! @param[in] sceneContext シーンコンテキストです。
90     //! @param[in] particleContext パーティクルシーンコンテキストです。
91     //! @param[in] enableSwapBuffer バッファをスワップするかを指定します。
92     //!
93     virtual void UpdateNode(
94         SceneContext* sceneContext,
95         ParticleContext* particleContext,
96         bool enableSwapBuffer = true);
97 
98     //! @brief バッファを交換します。
99     //! @details :private
100     //! @param[in] sceneContext シーンコンテキストです。
101     //!
NW_DEPRECATED_FUNCTION(virtual void SwapBuffer (SceneContext *))102     NW_DEPRECATED_FUNCTION(virtual void SwapBuffer(SceneContext* /*sceneContext*/)) {}
103 
104     //@}
105 
106 protected:
107     //----------------------------------------
108     //! @name コンストラクタ/デストラクタ
109     //@{
110 
111     //! コンストラクタです。
ParticleSceneUpdater(os::IAllocator * allocator)112     ParticleSceneUpdater(os::IAllocator* allocator)
113     : GfxObject(allocator)
114     {}
115 
116     //! デストラクタです。
~ParticleSceneUpdater()117     virtual ~ParticleSceneUpdater() {}
118 
119     //@}
120 };
121 
122 } // namespace gfx
123 } // namespace nw
124 
125 #endif // NW_GFX_SCENEUPDATER_H_
126