OROCHI
 
Loading...
Searching...
No Matches
GxResMotionIK.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_MOTION_NAMESPACE_BEGIN()
13
14//===========================================================================
16//===========================================================================
18{
19 //-----------------------------------------------------------
21 //-----------------------------------------------------------
23public:
24 // RTTI定義
25 GX_RTTI_RESOURCE_NAME(GxResMotionIK, GxResBase, "モーションIKリソース");
26 // GxClassBaseReference継承クラス用禁止宣言
28
30 class IKParam : public GxClassBase
31 {
32 //-----------------------------------------------------------
34 //-----------------------------------------------------------
36 public:
37 GX_RTTI_CLASS(IKParam, GxClassBase);
38
40 //-----------------------------------------------------------
42 //-----------------------------------------------------------
44
46 IKParam(void);
48 IKParam& operator= (IKParam const& other);
49
51 //-----------------------------------------------------------
53 //-----------------------------------------------------------
55
56 u32 _id;
63
65 };
66
68 class IKAttribute : public GxClassBase
69 {
70 //-----------------------------------------------------------
72 //-----------------------------------------------------------
74 public:
75 GX_RTTI_CLASS(IKAttribute, GxClassBase);
76
77#if GX_DEVELOP
79 static GxMotionNamesList* pMotionNameList;
80#endif //GX_DEVELOP
81
83 //-----------------------------------------------------------
85 //-----------------------------------------------------------
87
89 IKAttribute(void);
90
92 //-----------------------------------------------------------
94 //-----------------------------------------------------------
96
97#if GX_DEVELOP
99 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
100#endif //GX_DEVELOP
101
103 //-----------------------------------------------------------
105 //-----------------------------------------------------------
107
108 u32 _id;
111
113 };
115
116 //-----------------------------------------------------------
118 //-----------------------------------------------------------
120public:
122 GxResMotionIK(void);
124 void cleanup(void) override;
125
127 //-----------------------------------------------------------
129 //-----------------------------------------------------------
131public:
133 b32 load(GxStream& stream, u32 /*dataSize*/);
134#if GX_DEVELOP
136 b32 save(GxStream& stream);
137#endif //GX_DEVELOP
138
140 //-----------------------------------------------------------
142 //-----------------------------------------------------------
144public:
146 constexpr IKParam* getIKParam(u32 index) const { return _ppIKParam[index]; }
148 constexpr u32 getIKParamMax(void) const { return _ikParamMax; }
150 constexpr IKAttribute* getIKAttribute(u32 index) const { return _ppIKAttribute[index]; }
152 constexpr u32 getIKAttributeMax(void) const { return _ikAttributeMax; }
154 constexpr s32 getWaistJointNumber(void) const { return _waistJointNumber; }
156 constexpr INTERPOLATE getWaistJointCurveType(void) const { return _waistJointCurveType; }
158 constexpr f32 getWaistJointCurveTargetFrameCount(void) const { return _waistJointCurveTargetFraneCnt; }
160 constexpr f32 getWaistJointCurvature(void) const { return _waistJointCurvature; }
162 constexpr f32 getWaistJointAcceptDegree(void) const { return _waistJointAcceptDegree; }
164 constexpr f32 getHeightOfSole(void) const { return _heightOfSole; }
165
166private:
168 void getPropertyIKParam(void* pValue, u32 index);
170 void setPropertyIKParam(const void* pValue, u32 index );
172 u32 getPropertyIKParamCount(void);
174 void setPropertyIKParamCount(u32 ikParamMax);
176 void getPropertyIKAttribute(void* pValue, u32 index);
178 void setPropertyIKAttribute(const void* pValue, u32 index );
180 u32 getPropertyIKAttributeCount(void);
182 void setPropertyIKAttributeCount(u32 ikAttributeMax);
183
185 //-----------------------------------------------------------
187 //-----------------------------------------------------------
189protected:
200
202};
203
204#if GX_DEVELOP
205
206//===========================================================================
208//===========================================================================
209class GxResMotionIKXml : public GxResMotionIK
210{
211 //-----------------------------------------------------------
213 //-----------------------------------------------------------
215public:
216 // RTTI定義
217 GX_RTTI_RESOURCE_NAME(GxResMotionIKXml, GxResMotionIK, "モーションIKXMLリソース");
218 // GxClassBaseReference継承クラス用禁止宣言
219 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResMotionIKXml);
220
222 //-----------------------------------------------------------
224 //-----------------------------------------------------------
226public:
228 GxResMotionIKXml(void);
229
231 //-----------------------------------------------------------
233 //-----------------------------------------------------------
235public:
237 GxResMotionIK::IKParam* addIKParam(void);
239 b32 deleteIKParam(IKParam* pDeleteObject);
241 GxResMotionIK::IKAttribute* addIKAttribute(void);
243 b32 deleteIKAttribute(IKAttribute* pDeleteObject);
245 constexpr void setWaistJointNumber (s32 waistJointNumber ){ _waistJointNumber = waistJointNumber; }
247 constexpr void setWaistJointCurveType (INTERPOLATE waistJointCurveType ){ _waistJointCurveType = waistJointCurveType; }
249 constexpr void setWaistJointCurveTargetFrameCount(f32 waistJointCurveTargetFrameCount) { _waistJointCurveTargetFraneCnt = waistJointCurveTargetFrameCount; }
251 constexpr void setWaistJointCurvature (f32 waistJointCurvature ){ _waistJointCurvature = waistJointCurvature; }
253 constexpr void setWaistJointAcceptDegree(f32 waistJointAcceptDegree){_waistJointAcceptDegree = waistJointAcceptDegree;}
255 constexpr void setHeightOfSole(f32 heightOfSole){_heightOfSole = heightOfSole;}
256
258 //-----------------------------------------------------------
260 //-----------------------------------------------------------
262protected:
264 b32 load(GxStream& in, u32 /*dataSize*/);
266 b32 save(GxStream& out);
267
269};
270
271#endif // GX_DEVELOP
272
273GX_MOTION_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
void GxTypedObject
その他
Definition GxDefine.h:213
INTERPOLATE
補間タイプ
Definition GxMotionDefine.h:17
オブジェクト基底クラス
Definition GxBase.h:88
プロパティクラス
Definition GxProperty.h:48
リソース基底クラス
Definition GxResBase.h:23
IK用属性
Definition GxResMotionIK.h:69
u32 _id
パラメータID
Definition GxResMotionIK.h:108
f32 _maxWaistJointDrop
最大腰落とし量
Definition GxResMotionIK.h:110
s32 _useIKMotionNumber
IKを使用するモーション番号
Definition GxResMotionIK.h:109
IK用パラメーター
Definition GxResMotionIK.h:31
s32 _endIKJointNumber
IK終了関節ナンバー
Definition GxResMotionIK.h:58
f32 _maxEndIKJointUp
IK終了関節の最大上げ量
Definition GxResMotionIK.h:59
f32 _curvature
曲率
Definition GxResMotionIK.h:62
INTERPOLATE _curveType
曲線タイプ
Definition GxResMotionIK.h:60
u32 _id
パラメータID
Definition GxResMotionIK.h:56
b32 _isWaistDrop
腰を落とす処理に影響を与えるか判定
Definition GxResMotionIK.h:57
f32 _curveTargetFraneCnt
補間のフレーム数
Definition GxResMotionIK.h:61
モーションIKリソースクラス
Definition GxResMotionIK.h:18
f32 _waistJointAcceptDegree
腰下げ許容角度
Definition GxResMotionIK.h:198
constexpr IKParam * getIKParam(u32 index) const
IKパラメータを取得
Definition GxResMotionIK.h:146
constexpr f32 getWaistJointCurvature(void) const
腰関節の曲率を取得
Definition GxResMotionIK.h:160
constexpr f32 getWaistJointCurveTargetFrameCount(void) const
腰関節の補間フレーム数を取得
Definition GxResMotionIK.h:158
constexpr f32 getHeightOfSole(void) const
靴底の高さを取得
Definition GxResMotionIK.h:164
f32 _waistJointCurvature
腰関節の曲率
Definition GxResMotionIK.h:197
IKParam ** _ppIKParam
IKパラメーター配列
Definition GxResMotionIK.h:190
IKAttribute ** _ppIKAttribute
IK属性配列
Definition GxResMotionIK.h:192
f32 _waistJointCurveTargetFraneCnt
腰関節の補間フレーム数
Definition GxResMotionIK.h:196
s32 _waistJointNumber
腰関節の番号
Definition GxResMotionIK.h:194
constexpr INTERPOLATE getWaistJointCurveType(void) const
腰関節の曲線タイプを取得
Definition GxResMotionIK.h:156
INTERPOLATE _waistJointCurveType
腰関節の曲線タイプ
Definition GxResMotionIK.h:195
constexpr f32 getWaistJointAcceptDegree(void) const
腰下げ許容角度を取得
Definition GxResMotionIK.h:162
constexpr s32 getWaistJointNumber(void) const
腰関節の番号を取得
Definition GxResMotionIK.h:154
u32 _ikAttributeMax
IK属性配列のサイズ
Definition GxResMotionIK.h:193
constexpr IKAttribute * getIKAttribute(u32 index) const
IK属性を取得
Definition GxResMotionIK.h:150
constexpr u32 getIKParamMax(void) const
IKパラメータ配列のサイズを取得
Definition GxResMotionIK.h:148
f32 _heightOfSole
靴底の高さ
Definition GxResMotionIK.h:199
b32 load(GxStream &stream, u32)
リソース読み込み
Definition GxResMotionIK.cpp:176
u32 _ikParamMax
IKパラメーター配列のサイズ
Definition GxResMotionIK.h:191
constexpr u32 getIKAttributeMax(void) const
IK属性配列のサイズを取得
Definition GxResMotionIK.h:152
実行時型情報クラス
Definition GxRtti.h:154
ストリーム基礎クラス
Definition GxStream.h:20
32bitブーリアン
Definition GxDefine.h:173