OROCHI
 
Loading...
Searching...
No Matches
GxResSoftbodyCollision.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_UTILITY_NAMESPACE_BEGIN()
14//===========================================================================
16//===========================================================================
18{
19 //-----------------------------------------------------------
21 //-----------------------------------------------------------
23public:
24 // RTTI宣言
25 GX_RTTI_RESOURCE_NAME(GxResSoftbodyCollision, GxResBase, "ソフトボディコリジョンリソース");
26 // GxClassBaseReference 継承クラス用禁止宣言
28
29
30 enum class OBJECT_TYPE
31 {
32 NONE = 0,
33 SPHERE,
34 CAPSULE,
35 CAPSULE2,
36 CAPSULE3,
37 MAX,
38 };
39#if GX_DEVELOP
41 GX_ENUM_TABLE(OBJECT_TYPE)
42#endif //GX_DEVELOP
43
45 //-----------------------------------------------------------
47 //-----------------------------------------------------------
49
51
55 class GxSoftbodyCollisionData : public gx::core::GxClassBase
56 {
57 //-----------------------------------------------------------
59 //-----------------------------------------------------------
61 public:
62 // RTTI宣言
63 GX_RTTI_CLASS( GxSoftbodyCollisionData, GxClassBase )
64
65
66 static constexpr u32 HIT_JOINT_MAX = GxMath::VALUE_8;
68 static constexpr s32 UNENABLE_JOINT_INDEX = -1;
70 enum class OPERATION_TYPE
71 {
72 ALL_JOINT_HIT,
73 SPECIFICATION_JOINT_HIT,
74 SPECIFICATION_JOINT_NOHIT,
75 MAX,
76 };
77#if GX_DEVELOP
79 GX_ENUM_TABLE_MAX(OPERATION_TYPE)
80#endif //GX_DEVELOP
81
83 //-----------------------------------------------------------
85 //-----------------------------------------------------------
87
90
92 //-----------------------------------------------------------
94 //-----------------------------------------------------------
96
98 u32 _jointIndex[2];
99 GxVector3 _offset[2];
101 f32 _radius[2];
105 s32 _hitJointIndex[HIT_JOINT_MAX];
106 u32 _id;
107
109 };
110
112 //-----------------------------------------------------------
114 //-----------------------------------------------------------
116
120 void cleanup(void) override;
121
123 //-----------------------------------------------------------
125 //-----------------------------------------------------------
127
128protected:
130 b32 load(GxStream& in, u32 dataSize);
131#if GX_DEVELOP
133 b32 save(GxStream& out);
134#endif // GX_DEVELOP
135
137 //-----------------------------------------------------------
139 //-----------------------------------------------------------
141public:
143 constexpr u32 getCollisionDataCount(void) const { return _collisionDataArray.getCount(); }
145 GxSoftbodyCollisionData* getCollisionData(u32 index);
147 GX_FORCE_INLINE GxArrayClassBase& getCollisionDataArray(void){ return _collisionDataArray; }
148
150 //-----------------------------------------------------------
152 //-----------------------------------------------------------
154protected:
156
158};
159
160#if GX_DEVELOP
161class GxResSoftbodySimulationXml;
162//===========================================================================
164//===========================================================================
165class GxResSoftbodyCollisionXml : public GxResSoftbodyCollision
166{
167 //-----------------------------------------------------------
169 //-----------------------------------------------------------
171public:
172 // RTTI宣言
173 GX_RTTI_RESOURCE(GxResSoftbodyCollisionXml, GxResSoftbodyCollision)
174 // GxClassBaseReference 継承クラス用禁止宣言
175 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResSoftbodyCollisionXml)
176
177
178 //-----------------------------------------------------------
180 //-----------------------------------------------------------
182
184 GxResSoftbodyCollisionXml(void);
185
187 //-----------------------------------------------------------
189 //-----------------------------------------------------------
191protected:
193 b32 load(GxStream& in, u32 dataSize);
195 b32 save(GxStream& out);
196
197public:
198#if GX_EDITOR
200 void getToolRtti(GxArray& arrayTool) const override;
201#endif //GX_EDITOR
202
204 //-----------------------------------------------------------
206 //-----------------------------------------------------------
208
210 constexpr GxResModel* getResModelCollision(void) const { return _pResModelCollision; }
212 constexpr void setResModelCollision(GxResModel* pResModel) { _pResModelCollision = pResModel; }
214 constexpr GxResMotionPackage* getResMotionPackageCollision(void) const { return _pResMotionPackageCollision; }
216 constexpr void setResMotionPackageCollision(GxResMotionPackage* pResMotionPackage) { _pResMotionPackageCollision = pResMotionPackage; }
217
219 constexpr GxResModel* getResModelSimulation(void) const { return _pResModelSimulation; }
221 constexpr void setResModelSimulation(GxResModel* pResModel) { _pResModelSimulation = pResModel; }
223 constexpr GxResMotionPackage* getResMotionPackageSimulation(void) const { return _pResMotionPackageSimulation; }
225 constexpr void setResMotionPackageSimulation(GxResMotionPackage* pResMotionPackage) { _pResMotionPackageSimulation = pResMotionPackage; }
226
228 constexpr GxResSoftbodySimulationXml* getResSoftbodySimulationXml(void) const { return _pResSoftbodySimulationXml; }
230 constexpr void setResSoftbodySimulationXml(GxResSoftbodySimulationXml* pResSoftbodySimulationXml) { _pResSoftbodySimulationXml = pResSoftbodySimulationXml; }
231
233 //-----------------------------------------------------------
235 //-----------------------------------------------------------
237protected:
238 GxResModel* _pResModelCollision;
239 GxResMotionPackage* _pResMotionPackageCollision;
240
241 GxResModel* _pResModelSimulation;
242 GxResMotionPackage* _pResMotionPackageSimulation;
243
244 GxResSoftbodySimulationXml* _pResSoftbodySimulationXml;
245
247};
248#endif // GX_DEVELOP
249
250GX_UTILITY_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
@ MAX
定義数
@ NONE
何もしない
#define GX_RTTI_RESOURCE(__THIS__, __BASE__)
リソースクラス型情報宣言
Definition GxRttiResource.h:102
配列クラス
Definition GxArrayClassBase.h:18
配列クラス
Definition GxArray.h:18
オブジェクト基底クラス
Definition GxBase.h:88
算術演算クラス
Definition GxMath.h:84
リソース基底クラス
Definition GxResBase.h:23
モデルリソースクラス
Definition GxResModel.h:20
モーションパッケージリソース
Definition GxResMotionPackage.h:20
コリジョンデータクラス
Definition GxResSoftbodyCollision.h:56
OPERATION_TYPE _hitOperationType
衝突時の振る舞い
Definition GxResSoftbodyCollision.h:104
OBJECT_TYPE _objectType
オブジェクトタイプ
Definition GxResSoftbodyCollision.h:97
GxVector3 _xyz
サイズ
Definition GxResSoftbodyCollision.h:100
b32 _isUsetailJointId
末端関節番号でIDを使用するか
Definition GxResSoftbodyCollision.h:103
u32 _id
ID.
Definition GxResSoftbodyCollision.h:106
OPERATION_TYPE
衝突時の振る舞い
Definition GxResSoftbodyCollision.h:71
b32 _enable
有効無効
Definition GxResSoftbodyCollision.h:102
モデル対応コリジョンリソースクラス
Definition GxResSoftbodyCollision.h:18
b32 load(GxStream &in, u32 dataSize)
リソースのロード
Definition GxResSoftbodyCollision.cpp:61
GxArrayClassBase _collisionDataArray
コリジョン管理配列
Definition GxResSoftbodyCollision.h:155
GX_FORCE_INLINE GxArrayClassBase & getCollisionDataArray(void)
コリジョン管理配列取得
Definition GxResSoftbodyCollision.h:147
OBJECT_TYPE
オブジェクトタイプ
Definition GxResSoftbodyCollision.h:31
constexpr u32 getCollisionDataCount(void) const
コリジョンデータ数取得
Definition GxResSoftbodyCollision.h:143
ストリーム基礎クラス
Definition GxStream.h:20
3次元ベクトル
Definition GxVector.h:245
32bitブーリアン
Definition GxDefine.h:173