OROCHI
 
Loading...
Searching...
No Matches
GxResMotionPackage.h
Go to the documentation of this file.
1//===========================================================================
11//===========================================================================
12#pragma once
13
14GX_MOTION_NAMESPACE_BEGIN()
15
16//===========================================================================
18//===========================================================================
20{
21 //-----------------------------------------------------------
23 //-----------------------------------------------------------
25public:
26 // RTTI定義
27 GX_RTTI_RESOURCE_NAME(GxResMotionPackage, GxResBase, "モーションパッケージリソース")
28 // ClassBaseReference継承クラス用禁止宣言
30
31
32 //-------------------------------------------------------------
34 //-------------------------------------------------------------
36
40 void cleanup(void) override;
41
43 //-------------------------------------------------------------
45 //-------------------------------------------------------------
47
49 b32 load(GxStream& stream, u32 dataSize);
50#if GX_DEVELOP
52 b32 save(GxStream& stream);
54 static b32 isModified(GxStream& stream, u64 lastWriteTime, GX_CSTR resourcePath);
55#endif //GX_DEVELOP
56
58 //-------------------------------------------------------------
60 //-------------------------------------------------------------
62
64 constexpr void* getResource(void) const { return _pReadBuffer; }
66 constexpr u32 getResourceSize(void) const { return _fileSize; }
68 static void getReplaceOriginalPath(GxString& dst, GX_CSTR src);
70 static void getFinalPath(GxString& dst, GX_CSTR src);
72 void getHeaderPath(GxString& path);
73
74#if GX_DEVELOP
76 GX_FORCE_INLINE GxMotionNamesList& getMotionNamesList(void){ return _motionNamesList; }
77#endif //GX_DEVELOP
78
80 //-------------------------------------------------------------
82 //-------------------------------------------------------------
84protected:
87#if GX_DEVELOP
88 GxMotionNamesList _motionNamesList;
89#endif //GX_DEVELOP
90
92};
93
94#if GX_DEVELOP
95//===========================================================================
97//===========================================================================
98class GxResMotionPackageGmp : public GxResMotionPackage
99{
100 //-----------------------------------------------------------
102 //-----------------------------------------------------------
104public:
105 // RTTI定義
106 GX_RTTI_RESOURCE(GxResMotionPackageGmp, GxResMotionPackage)
107 // ClassBaseReference継承クラス用禁止宣言
108 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResMotionPackageGmp)
109
110
111 //-----------------------------------------------------------
113 //-----------------------------------------------------------
115
117 GxResMotionPackageGmp(void){}
118
120 //-----------------------------------------------------------
122 //-----------------------------------------------------------
124
126 b32 load(GxStream& stream, u32 /*dataSize*/);
128 b32 save(GxStream& stream);
130 b32 finalize(void);
131
133};
134
135//===========================================================================
137//===========================================================================
138class GxResMotionPackageXml : public GxResMotionPackage
139{
140 //-----------------------------------------------------------
142 //-----------------------------------------------------------
144public:
145 // RTTI定義
146 GX_RTTI_RESOURCE(GxResMotionPackageXml, GxResMotionPackage)
147 // ClassBaseReference継承クラス用禁止宣言
148 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResMotionPackageXml)
149
150
151 static constexpr u32 MOTION_NUM_MAX = 128;
152
154 class GxMotionConvertParam : public GxClassBase
155 {
156 //-------------------------------------------------------------
158 //-------------------------------------------------------------
160 public:
161 // RTTI定義
162 GX_RTTI_CLASS(GxMotionConvertParam, GxClassBase)
163 // ClassBase継承クラス用禁止宣言
164 GX_PROHIBIT_CLASS_BASE(GxMotionConvertParam)
165
166
167 //-----------------------------------------------------------
169 //-----------------------------------------------------------
171
173 GxMotionConvertParam(void);
175 virtual ~GxMotionConvertParam(void){}
176
178 //-----------------------------------------------------------
180 //-----------------------------------------------------------
182 public:
184 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
185
187 //-------------------------------------------------------------
189 //-------------------------------------------------------------
191 public:
193 GX_FORCE_INLINE b32 getOutputIsNotFoundAnimationJointSetBasepose(void) const { return _outputIsNotFoundAnimationJointSetBasepose; }
195 GX_FORCE_INLINE void setOutputIsNotFoundAnimationJointSetBasepose(b32 value) { _outputIsNotFoundAnimationJointSetBasepose = value; }
197 GX_FORCE_INLINE b32 getOutputIsLocatorRotationMaya(void) const { return _outputIsLocatorRotationMaya; }
199 GX_FORCE_INLINE void setOutputIsLocatorRotationMaya(b32 value) { _outputIsLocatorRotationMaya = value; }
200
202 GX_FORCE_INLINE b32 getCompress(void) const { return _isCompress; }
204 GX_FORCE_INLINE void setCompress(b32 value) { _isCompress = value; }
206 constexpr s32 getCompressBitWithTranslate(void) const { return _compressBitWithTranslate; }
208 constexpr void setCompressBitWithTranslate(s32 value) { _compressBitWithTranslate = value; }
210 constexpr s32 getCompressBitWithRotate(void) const { return _compressBitWithRotate; }
212 constexpr void setCompressBitWithRotate(s32 value) { _compressBitWithRotate = value; }
214 constexpr s32 getCompressBitWithScale(void) const { return _compressBitWithScale; }
216 constexpr void setCompressBitWithScale(s32 value) { _compressBitWithScale = value; }
218 GX_FORCE_INLINE GxString& getAttributeFaceName(void) { return _attributeFaceName; }
220 GX_FORCE_INLINE void setAttributeFaceName(const GxString& name) { _attributeFaceName = name; }
222 GX_FORCE_INLINE GxString& getAttributeUpperBodyName(void) { return _attributeUpperBodyName; }
224 GX_FORCE_INLINE void setAttributeUppderBodyName(const GxString& name) { _attributeUpperBodyName = name; }
226 GX_FORCE_INLINE GxString& getAttributeLowerBodyName(void) { return _attributeLowerBodyName; }
228 GX_FORCE_INLINE void setAttributeLowerBodyName(const GxString& name) { _attributeLowerBodyName = name; }
229
231 //-------------------------------------------------------------
233 //-------------------------------------------------------------
235 private:
236 b32 _outputIsNotFoundAnimationJointSetBasepose;
237 b32 _outputIsLocatorRotationMaya;
238
239 b32 _isCompress;
240 s32 _compressBitWithTranslate;
241 s32 _compressBitWithRotate;
242 s32 _compressBitWithScale;
243 GxString _attributeFaceName;
244 GxString _attributeUpperBodyName;
245 GxString _attributeLowerBodyName;
246
248 };
249
251 //-----------------------------------------------------------
253 //-----------------------------------------------------------
255
257 GxResMotionPackageXml(void);
259 void cleanup(void) override;
260
262 //-----------------------------------------------------------
264 //-----------------------------------------------------------
266
268 b32 load(GxStream& stream, u32 /*dataSize*/);
270 b32 save(GxStream& stream);
272 b32 finalize(void);
273
275 void initializeConvert(void);
277 void terminateConvert(void);
278
280 //-----------------------------------------------------------
282 //-----------------------------------------------------------
284public:
285#if GX_EDITOR
287 void getToolRtti( GxArray& arrayTool ) const override;
288#endif //GX_EDITOR
289
291 GX_FORCE_INLINE GxString& getBaseMotionPath(void) { return _baseMotionPath; }
293 GX_FORCE_INLINE void setBaseMotionPath( const GxString& value ) { _baseMotionPath = value; }
295 GX_FORCE_INLINE GxString& getMotionPath(u32 index) { return _motionPathArray[index]; }
297 GX_FORCE_INLINE void setMotionPath( u32 index, const GxString& value ) { _motionPathArray[index] = value; }
299 constexpr GxMotionConvertParam* getMotionConvertParam(void) { return _pMotionConvertParam; }
300
302 //-----------------------------------------------------------
304 //-----------------------------------------------------------
306private:
307 GxString _baseMotionPath;
308 GxString _motionPathArray[MOTION_NUM_MAX];
309
310 GxMotionConvertParam* _pMotionConvertParam;
311
313};
314
315#endif //GX_DEVELOP
316
317GX_MOTION_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
void GxTypedObject
その他
Definition GxDefine.h:213
#define GX_RTTI_RESOURCE(__THIS__, __BASE__)
リソースクラス型情報宣言
Definition GxRttiResource.h:102
配列クラス
Definition GxArray.h:18
オブジェクト基底クラス
Definition GxBase.h:88
プロパティクラス
Definition GxProperty.h:48
リソース基底クラス
Definition GxResBase.h:23
モーションパッケージリソース
Definition GxResMotionPackage.h:20
void cleanup(void) override
解放
Definition GxResMotionPackage.cpp:39
u32 _fileSize
ファイルサイズ
Definition GxResMotionPackage.h:86
constexpr u32 getResourceSize(void) const
リソースのサイズを取得
Definition GxResMotionPackage.h:66
b32 load(GxStream &stream, u32 dataSize)
ロード関数 (loads .gmp file entirely)
Definition GxResMotionPackage.cpp:51
void * _pReadBuffer
読み込みバッファ
Definition GxResMotionPackage.h:85
constexpr void * getResource(void) const
モデルリソースへのアクセサを取得
Definition GxResMotionPackage.h:64
実行時型情報クラス
Definition GxRtti.h:154
ストリーム基礎クラス
Definition GxStream.h:20
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173