OROCHI
 
Loading...
Searching...
No Matches
GxResMotionInterpolationSettings.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_MOTION_NAMESPACE_BEGIN()
14
15//===========================================================================
17//===========================================================================
19{
20 //-----------------------------------------------------------
22 //-----------------------------------------------------------
24public:
25 // RTTI定義
26 GX_RTTI_RESOURCE_NAME(GxResMotionInterpolationSettings, GxResBase, "モーション補間設定リソース");
27 // GxClassBaseReference継承クラス用禁止宣言
29
30
31 class Filter : public GxClassBase
32 {
33 //-----------------------------------------------------------
35 //-----------------------------------------------------------
37
39 // RTTI定義
40 GX_RTTI_CLASS(Filter, GxClassBase)
41 // アロケータ指定
42 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::RESOURCE)
43
44
45 //-----------------------------------------------------------
47 //-----------------------------------------------------------
49
51 Filter(void);
53 ~Filter(void);
55 Filter& operator= (Filter const& other);
56
58 //-----------------------------------------------------------
60 //-----------------------------------------------------------
62
64 void addMotion(u32 motion);
66 void deleteMotion(u32 motion);
67 public:
69 b32 containsMotion(u32 motionNumber);
70
72 //-----------------------------------------------------------
74 //-----------------------------------------------------------
76
78 GX_FORCE_INLINE GxString getName(void) const { return _name; }
80 constexpr u32 getMotionCount(void) const { return _motionCount;}
82 constexpr u32 getMotionNumber(u32 index) const { return _pMotionsArray[index];}
83 private:
85 void getPropertyMotion(void* pValue, u32 index);
87 void setPropertyMotion(const void* pValue, u32 index );
89 u32 getPropertyMotionsCount(void);
91 void setPropertyMotionsCount(u32 settingsCount);
92
94 //-----------------------------------------------------------
96 //-----------------------------------------------------------
98
99 GxString _name;
100 u32 _motionCount;
101 u32* _pMotionsArray;
102
104 };
105
107 static const s32 FILTER_NOT_FOUND = -1;
108private:
110 static const s32 NO_SETTING_FOUND = -1;
111
113 //-----------------------------------------------------------
115 //-----------------------------------------------------------
117public:
120
122 void cleanup(void) override;
123
125 //-----------------------------------------------------------
127 //-----------------------------------------------------------
129public:
131 b32 load(GxStream& stream, u32 /*dataSize*/);
132#if GX_DEVELOP
134 b32 save(GxStream& stream);
135#endif //GX_DEVELOP
136
138 GxMotionInterpolationSetting* createInterpolationSetting(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode, b32 isAcceptSameSetting = false);
140 void removeInterpolationSetting(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode);
141
143 void addFilter(GxString name, b32 isAcceptSameName = false);
145 s32 getFilterIndex(GxString name);
147 s32 getFilterIndex(Filter* pFilter);
149 void deleteFilter(u32 filterNumber, b32 replaceSettings);
151 void deleteFilter(GxString name, b32 replaceSettings);
153 void deleteMotionFromFilter(u32 motionNumber, u32 filterNumber, b32 replaceSettings);
155 void addMotionToFilter(u32 motionNumber, u32 filterNumber, b32 isCopy = true);
156
158 s32 checkMotionNumberFromFilter(u32 motionNumber) const;
159private:
161 s32 getInterpolationSettingIndex(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode) const;
162
164 //-----------------------------------------------------------
166 //-----------------------------------------------------------
168public:
170 constexpr u32 getFilterCount(void) const { return _filtersCount; }
172 GX_FORCE_INLINE Filter& getFilter(u32 index) { return _pFiltersArray[index]; }
173
175 GxMotionInterpolationSetting* getInterpolationSetting(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode);
177 GxMotionInterpolationSetting const* getInterpolationSetting(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode) const;
183 constexpr void setMotionCount(u32 motionCount) { _motionCount = motionCount;}
187 constexpr u32 getMotionInterpolationSetting(void){ return _settingsCount; }
188
189private:
191 void getPropertyInterpolationSetting(void* pValue, u32 index);
193 void setPropertyInterpolationSetting(const void* pValue, u32 index);
195 u32 getPropertySettingsCount(void);
197 void setPropertySettingsCount(u32 settingsCount);
198
200 void getPropertyFilter(void* pValue, u32 index);
202 void setPropertyFilter(const void* pValue, u32 index );
204 u32 getPropertyFiltersCount(void);
206 void setPropertyFiltersCount(u32 settingsCount);
207
209 //-----------------------------------------------------------
211 //-----------------------------------------------------------
213protected:
215protected:
219
222
224};
225
226#if GX_DEVELOP
227//===========================================================================
229//===========================================================================
230class GxResMotionInterpolationSettingsXml : public GxResMotionInterpolationSettings
231{
232 //-----------------------------------------------------------
234 //-----------------------------------------------------------
236public:
237 // RTTI定義
238 GX_RTTI_RESOURCE_NAME(GxResMotionInterpolationSettingsXml, GxResMotionInterpolationSettings, "モーション補間設定XMLリソース");
239 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP);
240 // GxClassBaseReference継承クラス用禁止宣言
241 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResMotionInterpolationSettingsXml)
242
243
244 //-----------------------------------------------------------
246 //-----------------------------------------------------------
248public:
250 GxResMotionInterpolationSettingsXml(void);
252 void initialize(u32 motionCount);
253
255 //-----------------------------------------------------------
257 //-----------------------------------------------------------
259protected:
261 b32 load(GxStream& in, u32 /*dataSize*/);
263 b32 save(GxStream& out);
264
266};
267
268#endif // GX_DEVELOP
269
270GX_MOTION_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
オブジェクト基底クラス
Definition GxBase.h:88
constexpr GxClassBaseReference & operator=(const GxClassBaseReference &base)
代入演算子
Definition GxBase.h:301
モーションの補間設定を保管するクラス
Definition GxMotionInterpolationSetting.h:19
MODE
モード
Definition GxMotionInterpolationSetting.h:41
リソース基底クラス
Definition GxResBase.h:23
フィルター
Definition GxResMotionInterpolationSettings.h:32
constexpr u32 getMotionCount(void) const
モーション数を取得
Definition GxResMotionInterpolationSettings.h:80
constexpr u32 getMotionNumber(u32 index) const
モーション番号を取得
Definition GxResMotionInterpolationSettings.h:82
GX_FORCE_INLINE GxString getName(void) const
名前を取得
Definition GxResMotionInterpolationSettings.h:78
モーション補間設定リソースクラス
Definition GxResMotionInterpolationSettings.h:19
static const s32 FILTER_NOT_FOUND
不明フィルター値
Definition GxResMotionInterpolationSettings.h:107
GxResMotionInterpolationSettings(void)
コンストラクタ
Definition GxResMotionInterpolationSettings.cpp:198
u32 _settingsCount
補間設定行列のサイズ
Definition GxResMotionInterpolationSettings.h:217
u32 _motionCount
モーション数
Definition GxResMotionInterpolationSettings.h:214
GxMotionInterpolationSetting * createInterpolationSetting(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode, b32 isAcceptSameSetting=false)
補間設定行列の要素を作成
Definition GxResMotionInterpolationSettings.cpp:253
u32 _filtersCount
フィルター数
Definition GxResMotionInterpolationSettings.h:220
constexpr u32 getMotionInterpolationSetting(void)
モーション補間オブジェクト数を取得
Definition GxResMotionInterpolationSettings.h:187
void addMotionToFilter(u32 motionNumber, u32 filterNumber, b32 isCopy=true)
モーションを追加
Definition GxResMotionInterpolationSettings.cpp:445
Filter * _pFiltersArray
フィルター配列
Definition GxResMotionInterpolationSettings.h:221
void deleteFilter(u32 filterNumber, b32 replaceSettings)
フィルターを削除
Definition GxResMotionInterpolationSettings.cpp:592
GxMotionInterpolationSetting * _pSettingsArray
補間設定行列
Definition GxResMotionInterpolationSettings.h:218
GxMotionInterpolationSetting _defaultSetting
デフォールトの補間設定
Definition GxResMotionInterpolationSettings.h:216
s32 checkMotionNumberFromFilter(u32 motionNumber) const
指定したモーションナンバーがフィルターに含まれているか判定
Definition GxResMotionInterpolationSettings.cpp:524
GX_FORCE_INLINE Filter & getFilter(u32 index)
フィルターを取得
Definition GxResMotionInterpolationSettings.h:172
void deleteMotionFromFilter(u32 motionNumber, u32 filterNumber, b32 replaceSettings)
モーションを削除
Definition GxResMotionInterpolationSettings.cpp:382
GX_FORCE_INLINE GxMotionInterpolationSetting * getMotionInterpolationSetting(u32 index)
モーション補間オブジェクトを取得
Definition GxResMotionInterpolationSettings.h:185
GxMotionInterpolationSetting * getDefaultInterpolationSetting(void)
デフォールト補間設定行列の要素を取得
Definition GxResMotionInterpolationSettings.cpp:777
s32 getFilterIndex(GxString name)
フィルターインデックスを取得
Definition GxResMotionInterpolationSettings.cpp:544
constexpr u32 getFilterCount(void) const
フィルター数を取得
Definition GxResMotionInterpolationSettings.h:170
void addFilter(GxString name, b32 isAcceptSameName=false)
フィルター追加
Definition GxResMotionInterpolationSettings.cpp:354
b32 load(GxStream &stream, u32)
Definition GxResMotionInterpolationSettings.cpp:229
GxMotionInterpolationSetting * getInterpolationSetting(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode)
補間設定行列の要素を取得
Definition GxResMotionInterpolationSettings.cpp:751
void cleanup(void) override
解放
Definition GxResMotionInterpolationSettings.cpp:210
void removeInterpolationSetting(u32 startMotionNumber, u32 targetMotionNumber, GxMotionInterpolationSetting::MODE mode)
補間設定行列の要素を削除
Definition GxResMotionInterpolationSettings.cpp:324
constexpr void setMotionCount(u32 motionCount)
モーション数を設定
Definition GxResMotionInterpolationSettings.h:183
ストリーム基礎クラス
Definition GxStream.h:20
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173