15GX_UTILITY_NAMESPACE_BEGIN()
19class GxToolSoftbodySimulation : public GxToolResourceEditBase
34 SIMULATION_TOOL_POSITION_X = 60,
35 SIMULATION_TOOL_POSITION_Y = 2,
36 SIMULATION_TOOL_WIDTH = 400,
37 SIMULATION_TOOL_HEIGHT = 720 - SIMULATION_TOOL_POSITION_Y * 2,
38 SIMULATION_TOOL_SPLIT_Y = 196,
39 TOOL_DATA_FORM_SPLIT_X = 196,
40 MODEL_DATA_FORM_SPLIT_Y = 52,
41 SIMULATION_DATA_FORM_SPLIT_X = 196,
51 GTS_TOOL_FLAG_RENDER = ( 1 << 0 ),
52 GTS_TOOL_FLAG_RENDER_CHAIN_DATA = ( 1 << 1 ),
53 GTS_TOOL_FLAG_RENDER_ONLY_SELECTED_CHAIN_DATA = ( 1 << 2 ),
54 GTS_TOOL_FLAG_RENDER_CHAIN_TAIL_JOINT_BONE = ( 1 << 3 ),
55 GTS_TOOL_FLAG_RENDER_CHAIN_TAIL_JOINT_OFFSET = ( 1 << 4 ),
56 GTS_TOOL_FLAG_RENDER_CLOTH_DATA = ( 1 << 5 ),
57 GTS_TOOL_FLAG_RENDER_ONLY_SELECTED_CLOTH_DATA = ( 1 << 6 ),
58 GTS_TOOL_FLAG_RENDER_CLOTH_TAIL_JOINT_BONE = ( 1 << 7 ),
59 GTS_TOOL_FLAG_RENDER_CLOTH_TAIL_JOINT_OFFSET = ( 1 << 8 ),
61 GTS_TOOL_FLAG_DEFAULT = (
63 | GTS_TOOL_FLAG_RENDER_CHAIN_DATA | GTS_TOOL_FLAG_RENDER_CHAIN_TAIL_JOINT_BONE | GTS_TOOL_FLAG_RENDER_CHAIN_TAIL_JOINT_OFFSET
64 | GTS_TOOL_FLAG_RENDER_CLOTH_DATA | GTS_TOOL_FLAG_RENDER_CLOTH_TAIL_JOINT_BONE | GTS_TOOL_FLAG_RENDER_CLOTH_TAIL_JOINT_OFFSET
69 class GxFormSimulationData;
70 class GxUnitSimulation;
79 GxToolSoftbodySimulation(
void);
82 b32 initialize(
void)
override;
84 void cleanup(
void)
override;
93 void update(
void)
override;
95 void setResource(
GxResBase* pResrouce)
override;
98 void createUnitSimulation(
void);
100 void renderSimulationData(
void);
112 void setResourceModel(
GxResModel* pResourceModel);
117 virtual const GxRtti& getCreateModelRtti(
void);
120 constexpr void getPropertyResourceModel(
void*
const pValue) { *
static_cast<GxResModel**
>(pValue) = _pResourceModel; }
122 GX_FORCE_INLINE
void setPropertyResourceModel(
const void*
const pValue) {
auto* pResourceModel = *
static_cast<GxResModel**
>(
const_cast<void*
>(pValue)); setResourceModel( pResourceModel ); }
125 constexpr void getPropertyResourceMotion(
void*
const pValue) { *
static_cast<GxResMotionPackage**
>(pValue) = _pResourceMotion; }
127 GX_FORCE_INLINE
void setPropertyResourceMotion(
const void*
const pValue) {
auto* pResourceMotion = *
static_cast<GxResMotionPackage**
>(
const_cast<void*
>(pValue)); setResourceMotion( pResourceMotion ); }
133 constexpr GxResSoftbodySimulationXml* getResourceSimulationXml(
void) {
return static_cast<GxResSoftbodySimulationXml*
>(getResource()); }
135 GX_FORCE_INLINE
const GxResSoftbodySimulationXml* getResourceSimulationXml(
void)
const {
return static_cast<const GxResSoftbodySimulationXml*
>(getResource()); }
138 constexpr GxUnitSimulation* getUnitSimulation(
void)
const {
return _pUnitSimulation; }
161 GX_FORCE_INLINE
b32 isToolDebugRendering(
void)
const {
return isDataRendering(); }
163 GX_FORCE_INLINE
void setToolDebugRendering(
b32 is) { ( _isToolDebugRendering = is ) ? ( _toolFlag |= GTS_TOOL_FLAG_RENDER ) : ( _toolFlag &= ~GTS_TOOL_FLAG_RENDER ); }
166 GX_FORCE_INLINE
b32 isDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER ) ? true :
false; }
168 GX_FORCE_INLINE
b32 isChainDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_CHAIN_DATA ) ? true :
false; }
170 GX_FORCE_INLINE
b32 isSelectedChainDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_ONLY_SELECTED_CHAIN_DATA ) ? true :
false; }
172 GX_FORCE_INLINE
b32 isChainTailJointIndexDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_CHAIN_TAIL_JOINT_BONE ) ? true :
false; }
174 GX_FORCE_INLINE
b32 isChainTailJointOffsetDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_CHAIN_TAIL_JOINT_OFFSET ) ? true :
false; }
176 GX_FORCE_INLINE
b32 isClothDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_CLOTH_DATA ) ? true :
false; }
178 GX_FORCE_INLINE
b32 isSelectedClothDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_ONLY_SELECTED_CLOTH_DATA ) ? true :
false; }
180 GX_FORCE_INLINE
b32 isClothTailJointIndexDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_CLOTH_TAIL_JOINT_BONE ) ? true :
false; }
182 GX_FORCE_INLINE
b32 isClothTailJointOffsetDataRendering(
void)
const {
return ( _toolFlag & GTS_TOOL_FLAG_RENDER_CLOTH_TAIL_JOINT_OFFSET ) ? true :
false; }
185 constexpr GxFormToolData* getFormToolData(
void)
const {
return _pFormToolData; }
187 constexpr GxFormSimulationData* getFormSimulationData(
void)
const {
return _pFormSimulationData; }
195 GxGuiSplitter* _pSplitter;
196 GxFormToolData* _pFormToolData;
197 GxFormSimulationData* _pFormSimulationData;
199 GxUnitSimulation* _pUnitSimulation;
208 b32 _isToolDebugRendering;
217class GxToolSoftbodySimulation::GxFormToolData :
public GxGuiForm
225 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormToolData, GxGuiForm)
236 GxFormToolData(
void) : _pSplitter(nullptr), _pFormModelData(nullptr), _pFormMotionData(nullptr), _pTool(nullptr){}
238 GxFormToolData(GxToolSoftbodySimulation * pTool);
241 b32 initialize(
void)
override;
250 void onSize(
const GxSize& size)
override;
253 void createChain(
void);
255 void deleteChain(
void);
260 void createCloth(
void);
262 void deleteCloth(
void);
267 void testSimulation(
void);
270 void toggleModuleDebugRendering(
void);
273 void toggleToolDebugRendering(
void);
282 void setPropertyTableFormModelData(GxToolSoftbodySimulation::GxUnitSimulation* pUnitSimulation);
284 void setPropertyTableFormMotionData(GxToolSoftbodySimulation::GxUnitSimulation* pUnitSimulation);
287 constexpr GxResSoftbodySimulationXml* getResourceSimulationXml(
void) {
return static_cast<GxResSoftbodySimulationXml*
>(_pTool->getResource()); }
289 GX_FORCE_INLINE
const GxResSoftbodySimulationXml* getResourceSimulationXml(
void)
const {
return static_cast<GxResSoftbodySimulationXml*
>(_pTool->getResource()); }
292 constexpr GxUnitSimulation* getUnitSimulation(
void)
const {
return _pTool->getUnitSimulation(); }
315 constexpr void getWindForce(
void*
const pValue)
const { *
static_cast<f32*
>(pValue) = _windForce; }
317 constexpr void setWindForce(
const void*
const pValue) { _windForce = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
320 constexpr void getWindDirectionX(
void*
const pValue)
const { *
static_cast<f32*
>(pValue) = _windDirectionX; }
322 constexpr void setWindDirectionX(
const void*
const pValue) { _windDirectionX = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
325 constexpr void getWindDirectionY(
void*
const pValue)
const { *
static_cast<f32*
>(pValue) = _windDirectionY; }
327 constexpr void setWindDirectionY(
const void*
const pValue) { _windDirectionY = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
330 constexpr void getWindDirectionZ(
void *
const pValue)
const { *
static_cast<f32*
>(pValue) = _windDirectionZ; }
332 constexpr void setWindDirectionZ(
const void *
const pValue) { _windDirectionZ = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
335 constexpr void getGravityForce(
void *
const pValue)
const { *
static_cast<f32*
>(pValue) = _gravityForce; }
337 constexpr void setGravityForce(
const void *
const pValue) { _gravityForce = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
340 constexpr void getGravityDirectionX(
void *
const pValue)
const { *
static_cast<f32*
>(pValue) = _gravityDirectionX; }
342 constexpr void setGravityDirectionX(
const void *
const pValue) { _gravityDirectionX = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
345 constexpr void getGravityDirectionY(
void *
const pValue)
const { *
static_cast<f32*
>(pValue) = _gravityDirectionY; }
347 constexpr void setGravityDirectionY(
const void *
const pValue) { _gravityDirectionY = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
350 constexpr void getGravityDirectionZ(
void *
const pValue)
const { *
static_cast<f32*
>(pValue) = _gravityDirectionZ; }
352 constexpr void setGravityDirectionZ(
const void *
const pValue) { _gravityDirectionZ = *
static_cast<f32*
>(
const_cast<void*
>(pValue)); }
360 GxGuiSplitter* _pSplitter;
361 GxGuiFormProperty* _pFormModelData;
362 GxGuiFormProperty* _pFormMotionData;
363 GxToolSoftbodySimulation* _pTool;
365 static f32 _windForce;
366 static f32 _windDirectionX;
367 static f32 _windDirectionY;
368 static f32 _windDirectionZ;
369 static f32 _gravityForce;
370 static f32 _gravityDirectionX;
371 static f32 _gravityDirectionY;
372 static f32 _gravityDirectionZ;
380class GxToolSoftbodySimulation::GxFormSimulationData :
public GxGuiForm
388 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormSimulationData, GxGuiForm)
402 GxFormSimulationData(
void) : _pSplitter(nullptr), _pFormChain(nullptr), _pFormCloth(nullptr), _pTool(nullptr){}
404 GxFormSimulationData(GxToolSoftbodySimulation* pTool);
407 b32 initialize(
void)
override;
416 void onSize(
const GxSize& size)
override;
425 constexpr GxResSoftbodySimulationXml* getResourceSoftbodySimulationXml(
void) {
return static_cast<GxResSoftbodySimulationXml *
>(_pTool->getResource()); }
427 GX_FORCE_INLINE
const GxResSoftbodySimulationXml* getResourceSoftbodySimulationXml(
void)
const {
return static_cast<GxResSoftbodySimulationXml *
>(_pTool->getResource()); }
430 constexpr GxFormChain* getFormChain(
void)
const {
return _pFormChain; }
432 constexpr GxFormCloth* getFormCloth(
void)
const {
return _pFormCloth; }
440 GxGuiSplitter* _pSplitter;
441 GxFormChain* _pFormChain;
442 GxFormCloth* _pFormCloth;
443 GxToolSoftbodySimulation* _pTool;
451class GxToolSoftbodySimulation::GxFormSimulationData::GxFormChain :
public GxGuiForm
459 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormSimulationData::GxFormChain, GxGuiForm)
470 GxFormChain(
void) : _pSplitter(nullptr), _pFormChainData(nullptr), _pFormChainAdditionalData(nullptr), _pTool(nullptr){}
472 GxFormChain(GxToolSoftbodySimulation* pTool);
475 b32 initialize(
void)
override;
484 void update(
void)
override;
486 void onSize(
const GxSize& size)
override;
495 constexpr void getChainCount(
void*
const pValue) { *
static_cast<u32*
>(pValue) = getResourceSimulationXml()->getChainDataCount(); }
497 constexpr void setChainCount(
const void*
const ) {}
500 constexpr void getChainIndex(
void*
const pValue) { *
static_cast<u32*
>(pValue) = _chainIndex; }
506 void setChainIndex(
const void*
const pValue);
509 void setPropertyTableFormChainData(
void);
511 void setPropertyTableFormChainDataDetail(
GxPropertyTable& referenceOutputPropertyTable);
514 constexpr void getJointCount(
void*
const pValue) { *
static_cast<u32*
>(pValue) = getChainDataCurrent() ? getChainDataCurrent()->_jointCount + 1 : 0; }
516 constexpr void setJointCount(
const void*
const ) {}
519 constexpr void getJointIndex(
void*
const pValue) { *
static_cast<u32*
>(pValue) = _jointIndex; }
524 void setJointIndex(
const void*
const pValue);
527 void setPropertyTableFormChainAdditionalData(
void);
529 void setPropertyTableFormChainAdditionalDataDetail(
GxPropertyTable& referenceOutputPropertyTable);
532 constexpr GxResSoftbodySimulationXml* getResourceSimulationXml(
void) {
return static_cast<GxResSoftbodySimulationXml*
>(_pTool->getResource()); }
534 GX_FORCE_INLINE
const GxResSoftbodySimulationXml* getResourceSimulationXml(
void)
const {
return static_cast<GxResSoftbodySimulationXml*
>(_pTool->getResource()); }
537 constexpr GxUnitSimulation* getUnitSimulation(
void)
const {
return _pTool->getUnitSimulation(); }
540 constexpr u32 getChainCount(
void)
const {
return getResourceSimulationXml()->getChainDataCount(); }
543 constexpr u32 getChainIndex(
void)
const {
return _chainIndex; }
545 constexpr void setChainIndex(u32 index) { _chainIndex = index; }
548 constexpr u32 getJointIndex(
void)
const {
return _jointIndex; }
550 constexpr void setJointIndex(u32 index) { _jointIndex = index; }
568 GxGuiSplitter* _pSplitter;
569 GxGuiFormProperty* _pFormChainData;
570 GxGuiFormProperty* _pFormChainAdditionalData;
571 GxToolSoftbodySimulation* _pTool;
581class GxToolSoftbodySimulation::GxFormSimulationData::GxFormCloth :
public GxGuiForm
589 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormSimulationData::GxFormCloth, GxGuiForm)
600 GxFormCloth(
void) : _pSplitter(nullptr), _pFormClothData(nullptr), _pFormClothTailJointData(nullptr), _pFormClothAdditionalData(nullptr), _pTool(nullptr){}
602 GxFormCloth(GxToolSoftbodySimulation* pTool);
605 b32 initialize(
void)
override;
614 void update(
void)
override;
616 void onSize(
const GxSize& size)
override;
619 constexpr void initializeOldJointCount(
void) { _oldJointCount = 0; }
628 constexpr void getClothCount(
void*
const pValue){ *
static_cast<u32*
>(pValue) = getResourceSimulationXml()->getClothDataCount(); }
630 constexpr void setClothCount(
const void*
const ) {}
633 constexpr void getClothIndex(
void*
const pValue){ *
static_cast<u32*
>(pValue) = _clothIndex; }
639 void setClothIndex(
const void*
const pValue);
642 void setPropertyTableFormClothData(
void);
644 void setPropertyTableFormClothDataDetail(
GxPropertyTable& referenceOutputPropertyTable);
647 void setPropertyTableFormClothTailJointData(
void);
649 void setPropertyTableFormClothTailJointDataDetail(
GxPropertyTable& referenceOutputPropertyTable);
652 constexpr void getJointCount(
void*
const pValue) { *
static_cast<u32*
>(pValue) = getClothDataCurrent() ? getClothDataCurrent()->_jointCount + 1 : 0; }
654 constexpr void setJointCount(
const void*
const ) {}
657 constexpr void getJointIndex(
void*
const pValue){ *
static_cast<u32*
>(pValue) = _jointIndex; }
662 void setJointIndex(
const void*
const pValue);
665 constexpr void getLineCount(
void*
const pValue) { *
static_cast<u32*
>(pValue) = getClothDataCurrent() ? getClothDataCurrent()->_lineCount : 0; }
667 constexpr void setLineCount(
const void*
const ) {}
670 constexpr void getLineIndex(
void*
const pValue){ *
static_cast<u32*
>(pValue) = _lineIndex; }
675 void setLineIndex(
const void*
const pValue);
678 void setPropertyTableFormClothAdditionalData(
void);
680 void setPropertyTableFormClothAdditionalDataDetail(
GxPropertyTable& referenceOutputPropertyTable);
683 constexpr GxResSoftbodySimulationXml* getResourceSimulationXml(
void) {
return static_cast<GxResSoftbodySimulationXml *
>(_pTool->getResource()); }
685 GX_FORCE_INLINE
const GxResSoftbodySimulationXml* getResourceSimulationXml(
void)
const {
return static_cast<const GxResSoftbodySimulationXml *
>(_pTool->getResource()); }
688 constexpr GxUnitSimulation* getUnitSimulation(
void)
const {
return _pTool->getUnitSimulation(); }
691 constexpr u32 getClothCount(
void)
const {
return getResourceSimulationXml()->getClothDataCount(); }
694 constexpr u32 getClothIndex(
void)
const {
return _clothIndex; }
696 constexpr void setClothIndex(u32 index) { _clothIndex = index; }
699 constexpr u32 getJointIndex(
void)
const {
return _jointIndex; }
701 constexpr void setJointIndex(u32 index) { _jointIndex = index; }
704 constexpr u32 getLineIndex(
void)
const {
return _lineIndex; }
706 constexpr void setLineIndex(u32 index) { _lineIndex = index; }
724 GxGuiSplitter* _pSplitter;
725 GxGuiFormProperty* _pFormClothData;
726 GxGuiFormProperty* _pFormClothTailJointData;
727 GxGuiFormProperty* _pFormClothAdditionalData;
728 GxToolSoftbodySimulation* _pTool;
740class GxToolSoftbodySimulation::GxUnitSimulation :
public GxUnitModel
748 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxUnitSimulation,
GxUnitModel)
757 GxUnitSimulation(
void);
759 ~GxUnitSimulation(
void)
override;
771 virtual void setupSimulation(GxResSoftbodySimulationXml* pResourceXml);
790 constexpr GxMotionPlayer* getMotion(
void)
const {
return _pMotion; }
803GX_UTILITY_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
void GxTypedObject
その他
Definition GxDefine.h:213
モーション再生クラス
Definition GxMotionPlayer.h:22
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
リソース基底クラス
Definition GxResBase.h:23
モデルリソースクラス
Definition GxResModel.h:20
モーションパッケージリソース
Definition GxResMotionPackage.h:20
鎖用追加データ(質点個別データ)
Definition GxResSoftbodySimulation.h:322
鎖データクラス
Definition GxResSoftbodySimulation.h:137
布用追加データ(質点個別データ)
Definition GxResSoftbodySimulation.h:424
布データクラス
Definition GxResSoftbodySimulation.h:196
実行時型情報クラス
Definition GxRtti.h:154
T * getModule(void) const
モジュールを取得
Definition GxUnitBase.h:246
void asyncUpdate(void) override
並列更新
Definition GxUnitLocate.cpp:122
モデルクラス
Definition GxUnitModel.h:19
サイズ
Definition GxStruct.h:730
32bitブーリアン
Definition GxDefine.h:173