OROCHI
 
Loading...
Searching...
No Matches
GxToolSoftbodySimulation.h
Go to the documentation of this file.
1//===========================================================================
10//===========================================================================
11#pragma once
12
13#if GX_EDITOR
14
15GX_UTILITY_NAMESPACE_BEGIN()
16//===========================================================================
18//===========================================================================
19class GxToolSoftbodySimulation : public GxToolResourceEditBase
20{
21 //-----------------------------------------------------------
23 //-----------------------------------------------------------
25public:
26 // RTTI宣言
27 GX_RTTI_CLASS_NAME_ICON(GxToolSoftbodySimulation, GxToolResourceEditBase, "ソフトボディシミュレーション編集", GxRtti::ICON_TYPE::UTILITY)
28 // 参照クラス用禁止宣言
29 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxToolSoftbodySimulation)
30
31
32 enum
33 {
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,
42 LINE_2_SPLIT_Y = 52,
43 LINE_4_SPLIT_Y = 84,
44 FORM_WIDTH = 100,
45 FORM_HEIGHT = 100,
46 };
47
49 enum GTS_TOOL_FLAG
50 {
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 ),
60
61 GTS_TOOL_FLAG_DEFAULT = (
62 GTS_TOOL_FLAG_RENDER
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
65 )
66 };
67
68 class GxFormToolData;
69 class GxFormSimulationData;
70 class GxUnitSimulation;
71
73 //-----------------------------------------------------------
75 //-----------------------------------------------------------
77
79 GxToolSoftbodySimulation(void);
80
82 b32 initialize(void) override;
84 void cleanup(void) override;
85
87 //-----------------------------------------------------------
89 //-----------------------------------------------------------
91
93 void update(void) override;
95 void setResource(GxResBase* pResrouce) override;
96
98 void createUnitSimulation(void);
100 void renderSimulationData(void);
101
103 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
104
106 //-----------------------------------------------------------
108 //-----------------------------------------------------------
110
112 void setResourceModel(GxResModel* pResourceModel);
114 void setResourceMotion(GxResMotionPackage* pResourceMotion);
115
117 virtual const GxRtti& getCreateModelRtti(void);
118
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 ); }
123
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 ); }
128
130 void getPropertyTable(GxPropertyTable* pPropertyTable);
131
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()); }
136
138 constexpr GxUnitSimulation* getUnitSimulation(void) const { return _pUnitSimulation; }
139
141 constexpr GxResSoftbodySimulation::GxSoftbodyChainData* getChainDataCurrent(void) const { return _pChainDataCurrent; }
143 constexpr void setChainDataCurrent(GxResSoftbodySimulation::GxSoftbodyChainData* pChainData) { _pChainDataCurrent = pChainData; }
144
146 constexpr GxResSoftbodySimulation::GxSoftbodyClothData* getClothDataCurrent(void) const { return _pClothDataCurrent; }
148 constexpr void setClothDataCurrent(GxResSoftbodySimulation::GxSoftbodyClothData* pClothData) { _pClothDataCurrent = pClothData; }
149
151 constexpr GxResSoftbodySimulation::GxSoftbodyChainAdditionalData* getChainAdditionalDataCurrent(void) const { return _pChainAdditionalDataCurrent; }
153 constexpr void setChainAdditionalDataCurrent(GxResSoftbodySimulation::GxSoftbodyChainAdditionalData* pChainAdditionalData) { _pChainAdditionalDataCurrent = pChainAdditionalData; }
154
156 constexpr GxResSoftbodySimulation::GxSoftbodyClothAdditionalData* getClothAdditionalDataCurrent(void) const { return _pClothAdditionalDataCurrent; }
158 constexpr void setClothAdditionalDataCurrent(GxResSoftbodySimulation::GxSoftbodyClothAdditionalData* pClothAdditionalData) { _pClothAdditionalDataCurrent = pClothAdditionalData; }
159
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 ); }
164
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; }
183
185 constexpr GxFormToolData* getFormToolData(void) const { return _pFormToolData; }
187 constexpr GxFormSimulationData* getFormSimulationData(void) const { return _pFormSimulationData; }
188
190 //-----------------------------------------------------------
192 //-----------------------------------------------------------
194protected:
195 GxGuiSplitter* _pSplitter;
196 GxFormToolData* _pFormToolData;
197 GxFormSimulationData* _pFormSimulationData;
198
199 GxUnitSimulation* _pUnitSimulation;
200 GxResModel* _pResourceModel;
201 GxResMotionPackage* _pResourceMotion;
202
205 GxResSoftbodySimulation::GxSoftbodyChainAdditionalData* _pChainAdditionalDataCurrent;
206 GxResSoftbodySimulation::GxSoftbodyClothAdditionalData* _pClothAdditionalDataCurrent;
207
208 b32 _isToolDebugRendering;
209 u32 _toolFlag;
210
212};
213
214//===========================================================================
216//===========================================================================
217class GxToolSoftbodySimulation::GxFormToolData : public GxGuiForm
218{
219 //-----------------------------------------------------------
221 //-----------------------------------------------------------
223public:
224 // RTTI 定義
225 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormToolData, GxGuiForm)
226 // ClassBaseReference 継承クラス用禁止宣言
228
229
230 //-----------------------------------------------------------
232 //-----------------------------------------------------------
234
236 GxFormToolData(void) : _pSplitter(nullptr), _pFormModelData(nullptr), _pFormMotionData(nullptr), _pTool(nullptr){}
238 GxFormToolData(GxToolSoftbodySimulation * pTool);
239
241 b32 initialize(void) override;
242
244 //-----------------------------------------------------------
246 //-----------------------------------------------------------
248
250 void onSize(const GxSize& size) override;
251
253 void createChain(void);
255 void deleteChain(void);
257 virtual void initializeChain(GxResSoftbodySimulation::GxSoftbodyChainData* pChainData);
258
260 void createCloth(void);
262 void deleteCloth(void);
264 virtual void initializeCloth(GxResSoftbodySimulation::GxSoftbodyClothData* pClothData);
265
267 void testSimulation(void);
268
270 void toggleModuleDebugRendering(void);
271
273 void toggleToolDebugRendering(void);
274
276 //-----------------------------------------------------------
278 //-----------------------------------------------------------
280
282 void setPropertyTableFormModelData(GxToolSoftbodySimulation::GxUnitSimulation* pUnitSimulation);
284 void setPropertyTableFormMotionData(GxToolSoftbodySimulation::GxUnitSimulation* pUnitSimulation);
285
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()); }
290
292 constexpr GxUnitSimulation* getUnitSimulation(void) const { return _pTool->getUnitSimulation(); }
293
295 constexpr GxResSoftbodySimulation::GxSoftbodyChainData* getChainDataCurrent(void) const { return _pTool->getChainDataCurrent(); }
297 constexpr void setChainDataCurrent(GxResSoftbodySimulation::GxSoftbodyChainData* pChainData) { return _pTool->setChainDataCurrent( pChainData ); }
298
300 constexpr GxResSoftbodySimulation::GxSoftbodyClothData* getClothDataCurrent(void) const { return _pTool->getClothDataCurrent(); }
302 constexpr void setClothDataCurrent(GxResSoftbodySimulation::GxSoftbodyClothData* pClothData) { return _pTool->setClothDataCurrent( pClothData ); }
303
305 constexpr GxResSoftbodySimulation::GxSoftbodyChainAdditionalData* getChainAdditionalDataCurrent(void) const { return _pTool->getChainAdditionalDataCurrent(); }
307 constexpr void setChainAdditionalDataCurrent(GxResSoftbodySimulation::GxSoftbodyChainAdditionalData* pChainAdditionalData) { return _pTool->setChainAdditionalDataCurrent( pChainAdditionalData ); }
308
310 constexpr GxResSoftbodySimulation::GxSoftbodyClothAdditionalData* getClothAdditionalDataCurrent(void) const { return _pTool->getClothAdditionalDataCurrent(); }
312 constexpr void setClothAdditionalDataCurrent(GxResSoftbodySimulation::GxSoftbodyClothAdditionalData* pClothAdditionalData) { return _pTool->setClothAdditionalDataCurrent( pClothAdditionalData ); }
313
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)); }
318
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)); }
323
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)); }
328
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)); }
333
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)); }
338
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)); }
343
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)); }
348
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)); }
353
355 //-----------------------------------------------------------
357 //-----------------------------------------------------------
359protected:
360 GxGuiSplitter* _pSplitter;
361 GxGuiFormProperty* _pFormModelData;
362 GxGuiFormProperty* _pFormMotionData;
363 GxToolSoftbodySimulation* _pTool;
364
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;
373
375};
376
377//===========================================================================
379//===========================================================================
380class GxToolSoftbodySimulation::GxFormSimulationData : public GxGuiForm
381{
382 //-----------------------------------------------------------
384 //-----------------------------------------------------------
386public:
387 // RTTI定義
388 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormSimulationData, GxGuiForm)
389 // ClassBaseReference 継承クラス用禁止宣言
390 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxFormSimulationData)
391
392 class GxFormChain;
393 class GxFormCloth;
394
396 //-----------------------------------------------------------
398 //-----------------------------------------------------------
400
402 GxFormSimulationData(void) : _pSplitter(nullptr), _pFormChain(nullptr), _pFormCloth(nullptr), _pTool(nullptr){}
404 GxFormSimulationData(GxToolSoftbodySimulation* pTool);
405
407 b32 initialize(void) override;
408
410 //-----------------------------------------------------------
412 //-----------------------------------------------------------
414
416 void onSize(const GxSize& size) override;
417
419 //-----------------------------------------------------------
421 //-----------------------------------------------------------
423
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()); }
428
430 constexpr GxFormChain* getFormChain(void) const { return _pFormChain; }
432 constexpr GxFormCloth* getFormCloth(void) const { return _pFormCloth; }
433
435 //-----------------------------------------------------------
437 //-----------------------------------------------------------
439protected:
440 GxGuiSplitter* _pSplitter;
441 GxFormChain* _pFormChain;
442 GxFormCloth* _pFormCloth;
443 GxToolSoftbodySimulation* _pTool;
444
446};
447
448//===========================================================================
450//===========================================================================
451class GxToolSoftbodySimulation::GxFormSimulationData::GxFormChain : public GxGuiForm
452{
453 //-----------------------------------------------------------
455 //-----------------------------------------------------------
457public:
458 // RTTI 定義
459 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormSimulationData::GxFormChain, GxGuiForm)
460 // ClassBaseReference 継承クラス用禁止宣言
462
463
464 //-----------------------------------------------------------
466 //-----------------------------------------------------------
468
470 GxFormChain(void) : _pSplitter(nullptr), _pFormChainData(nullptr), _pFormChainAdditionalData(nullptr), _pTool(nullptr){}
472 GxFormChain(GxToolSoftbodySimulation* pTool);
473
475 b32 initialize(void) override;
476
478 //-----------------------------------------------------------
480 //-----------------------------------------------------------
482
484 void update(void) override;
486 void onSize(const GxSize& size) override;
487
489 //-----------------------------------------------------------
491 //-----------------------------------------------------------
493
495 constexpr void getChainCount(void* const pValue) { *static_cast<u32*>(pValue) = getResourceSimulationXml()->getChainDataCount(); }
497 constexpr void setChainCount(const void* const /*pValue*/) {}
498
500 constexpr void getChainIndex(void* const pValue) { *static_cast<u32*>(pValue) = _chainIndex; }
502
506 void setChainIndex(const void* const pValue);
507
509 void setPropertyTableFormChainData(void);
511 void setPropertyTableFormChainDataDetail(GxPropertyTable& referenceOutputPropertyTable);
512
514 constexpr void getJointCount(void* const pValue) { *static_cast<u32*>(pValue) = getChainDataCurrent() ? getChainDataCurrent()->_jointCount + 1 : 0; }
516 constexpr void setJointCount(const void* const /*pValue*/) {}
517
519 constexpr void getJointIndex(void* const pValue) { *static_cast<u32*>(pValue) = _jointIndex; }
521
524 void setJointIndex(const void* const pValue);
525
527 void setPropertyTableFormChainAdditionalData(void);
529 void setPropertyTableFormChainAdditionalDataDetail(GxPropertyTable& referenceOutputPropertyTable);
530
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()); }
535
537 constexpr GxUnitSimulation* getUnitSimulation(void) const { return _pTool->getUnitSimulation(); }
538
540 constexpr u32 getChainCount(void) const { return getResourceSimulationXml()->getChainDataCount(); }
541
543 constexpr u32 getChainIndex(void) const { return _chainIndex; }
545 constexpr void setChainIndex(u32 index) { _chainIndex = index; }
546
548 constexpr u32 getJointIndex(void) const { return _jointIndex; }
550 constexpr void setJointIndex(u32 index) { _jointIndex = index; }
551
553 constexpr GxResSoftbodySimulation::GxSoftbodyChainData* getChainDataCurrent(void) const { return _pTool->getChainDataCurrent(); }
555 constexpr void setChainDataCurrent(GxResSoftbodySimulation::GxSoftbodyChainData* pChainData) { return _pTool->setChainDataCurrent( pChainData ); }
556
558 constexpr GxResSoftbodySimulation::GxSoftbodyChainAdditionalData* getChainAdditionalDataCurrent(void) const { return _pTool->getChainAdditionalDataCurrent(); }
560 constexpr void setChainAdditionalDataCurrent(GxResSoftbodySimulation::GxSoftbodyChainAdditionalData * pChainAdditionalData) { return _pTool->setChainAdditionalDataCurrent( pChainAdditionalData ); }
561
563 //-----------------------------------------------------------
565 //-----------------------------------------------------------
567protected:
568 GxGuiSplitter* _pSplitter;
569 GxGuiFormProperty* _pFormChainData;
570 GxGuiFormProperty* _pFormChainAdditionalData;
571 GxToolSoftbodySimulation* _pTool;
572 u32 _chainIndex;
573 u32 _jointIndex;
574
576};
577
578//===========================================================================
580//===========================================================================
581class GxToolSoftbodySimulation::GxFormSimulationData::GxFormCloth : public GxGuiForm
582{
583 //-----------------------------------------------------------
585 //-----------------------------------------------------------
587public:
588 // RTTI定義
589 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxFormSimulationData::GxFormCloth, GxGuiForm)
590 // ClassBaseReference継承クラス用禁止宣言
592
593
594 //-----------------------------------------------------------
596 //-----------------------------------------------------------
598
600 GxFormCloth(void) : _pSplitter(nullptr), _pFormClothData(nullptr), _pFormClothTailJointData(nullptr), _pFormClothAdditionalData(nullptr), _pTool(nullptr){}
602 GxFormCloth(GxToolSoftbodySimulation* pTool);
603
605 b32 initialize(void) override;
606
608 //-----------------------------------------------------------
610 //-----------------------------------------------------------
612
614 void update(void) override;
616 void onSize(const GxSize& size) override;
617
619 constexpr void initializeOldJointCount(void) { _oldJointCount = 0; }
620
622 //-----------------------------------------------------------
624 //-----------------------------------------------------------
626
628 constexpr void getClothCount(void* const pValue){ *static_cast<u32*>(pValue) = getResourceSimulationXml()->getClothDataCount(); }
630 constexpr void setClothCount(const void* const /*pValue*/) {}
631
633 constexpr void getClothIndex(void* const pValue){ *static_cast<u32*>(pValue) = _clothIndex; }
635
639 void setClothIndex(const void* const pValue);
640
642 void setPropertyTableFormClothData(void);
644 void setPropertyTableFormClothDataDetail(GxPropertyTable& referenceOutputPropertyTable);
645
647 void setPropertyTableFormClothTailJointData(void);
649 void setPropertyTableFormClothTailJointDataDetail(GxPropertyTable& referenceOutputPropertyTable);
650
652 constexpr void getJointCount(void* const pValue) { *static_cast<u32*>(pValue) = getClothDataCurrent() ? getClothDataCurrent()->_jointCount + 1 : 0; }
654 constexpr void setJointCount(const void* const /*pValue*/) {}
655
657 constexpr void getJointIndex(void* const pValue){ *static_cast<u32*>(pValue) = _jointIndex; }
659
662 void setJointIndex(const void* const pValue);
663
665 constexpr void getLineCount(void* const pValue) { *static_cast<u32*>(pValue) = getClothDataCurrent() ? getClothDataCurrent()->_lineCount : 0; }
667 constexpr void setLineCount(const void* const /*pValue*/) {}
668
670 constexpr void getLineIndex( void* const pValue){ *static_cast<u32*>(pValue) = _lineIndex; }
672
675 void setLineIndex(const void* const pValue);
676
678 void setPropertyTableFormClothAdditionalData(void);
680 void setPropertyTableFormClothAdditionalDataDetail(GxPropertyTable& referenceOutputPropertyTable);
681
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()); }
686
688 constexpr GxUnitSimulation* getUnitSimulation(void) const { return _pTool->getUnitSimulation(); }
689
691 constexpr u32 getClothCount(void) const { return getResourceSimulationXml()->getClothDataCount(); }
692
694 constexpr u32 getClothIndex(void) const { return _clothIndex; }
696 constexpr void setClothIndex(u32 index) { _clothIndex = index; }
697
699 constexpr u32 getJointIndex(void) const { return _jointIndex; }
701 constexpr void setJointIndex(u32 index) { _jointIndex = index; }
702
704 constexpr u32 getLineIndex(void) const { return _lineIndex; }
706 constexpr void setLineIndex(u32 index) { _lineIndex = index; }
707
709 constexpr GxResSoftbodySimulation::GxSoftbodyClothData* getClothDataCurrent(void) const { return _pTool->getClothDataCurrent(); }
711 constexpr void setClothDataCurrent(GxResSoftbodySimulation::GxSoftbodyClothData* pClothData) { return _pTool->setClothDataCurrent( pClothData ); }
712
714 constexpr GxResSoftbodySimulation::GxSoftbodyClothAdditionalData* getClothAdditionalDataCurrent(void) const { return _pTool->getClothAdditionalDataCurrent(); }
716 constexpr void setClothAdditionalDataCurrent(GxResSoftbodySimulation::GxSoftbodyClothAdditionalData* pClothAdditionalData) { return _pTool->setClothAdditionalDataCurrent( pClothAdditionalData ); }
717
719 //-----------------------------------------------------------
721 //-----------------------------------------------------------
723protected:
724 GxGuiSplitter* _pSplitter;
725 GxGuiFormProperty* _pFormClothData;
726 GxGuiFormProperty* _pFormClothTailJointData;
727 GxGuiFormProperty* _pFormClothAdditionalData;
728 GxToolSoftbodySimulation* _pTool;
729 u32 _clothIndex;
730 u32 _jointIndex;
731 u32 _lineIndex;
732 s32 _oldJointCount;
733
735};
736
737//===========================================================================
739//===========================================================================
740class GxToolSoftbodySimulation::GxUnitSimulation : public GxUnitModel
741{
742 //-----------------------------------------------------------
744 //-----------------------------------------------------------
746public:
747 // RTTI定義
748 GX_RTTI_CLASS(GxToolSoftbodySimulation::GxUnitSimulation, GxUnitModel)
749
750
751 //-----------------------------------------------------------
753 //-----------------------------------------------------------
755
757 GxUnitSimulation(void);
759 ~GxUnitSimulation(void) override;
760
762 //-----------------------------------------------------------
764 //-----------------------------------------------------------
766
768 void asyncUpdate(void) override;
769
771 virtual void setupSimulation(GxResSoftbodySimulationXml* pResourceXml);
772
774 b32 createMotion(GxResMotionPackage* pResource);
776 GX_FORCE_INLINE virtual GxMotionPlayer* allocateMotion(void) { return GX_NEW GxMotionPlayer; }
777
779 //-----------------------------------------------------------
781 //-----------------------------------------------------------
783
785 GX_FORCE_INLINE b32 isModuleDebugRendering(void) const { return getModule<GxModUnitSoftbody>()->isDevelopRenderSimulation(); }
787 GX_FORCE_INLINE void setModuleDebugRendering(b32 isDraw) { getModule<GxModUnitSoftbody>()->setIsDevelopRenderSimulation(isDraw); }
788
790 constexpr GxMotionPlayer* getMotion(void) const { return _pMotion; }
791
793 //-----------------------------------------------------------
795 //-----------------------------------------------------------
797protected:
798 GxMotionPlayer* _pMotion;
799
801};
802
803GX_UTILITY_NAMESPACE_END()
804#endif //GX_EDITOR
#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