13GX_UTILITY_NAMESPACE_BEGIN()
30 static const f32 _ktDefault;
32 static const f32 _ksDefault;
34 static const f32 _kbDefault;
59 GxCell(
void) : _defW(0.0f), _defH(0.0f), _defDl(0.0f), _defDr(0.0f), _isEnableLink(true){}
86 void cleanup(
void)
override;
95 b32 setup(
void)
override;
99 b32 isWarp(
void)
override;
102 void updateInitialize(
void)
override;
105 void updateForce(f32 updateRatio, f32 updateRatioOld)
override;
112 virtual void interpolatePosition(f32 updateRatio, f32 updateRatioOld);
115 virtual void calculateNormalVector(
void);
121 virtual void calculateExternalForce(
GxVector3& windDirect);
127 virtual void calculateInternalForce(
void);
130 void calculateHitBackForce(f32 updateRatio, f32 updateRatioOld)
override;
133 void updateCell(
void)
override;
141 void updateConstraint(
void)
override;
145 void developRender(
void)
override;
155 constexpr f32
kT(f32 ks)
const {
return (ks < 0.0f) ? (0.5f * _kt * ks) : (_kt * ks); }
157 constexpr f32
kS(f32 ks)
const {
return (ks < 0.0f) ? (0.5f * _ks * ks) : (_ks * ks); }
159 constexpr f32
kB(f32 ks)
const {
return (ks < 0.0f) ? (0.5f * _kb * ks) : (_kb * ks); }
162 constexpr f32
getKT(
void)
const {
return _kt; }
164 constexpr void setKT(f32 kt) { _kt = kt; }
167 constexpr f32
getKS(
void)
const {
return _ks; }
169 constexpr void setKS(f32 ks) { _ks = ks; }
172 constexpr f32
getKB(
void)
const {
return _kb; }
174 constexpr void setKB(f32 kb) { _kb = kb; }
180 GX_FORCE_INLINE
const GxVector3&
getPosition(u32 pointIndex, u32 lineIndex)
const {
return _ppCell[lineIndex][pointIndex]._position; }
182 GX_FORCE_INLINE
void setPosition(u32 pointIndex, u32 lineIndex,
const GxVector3 &position) { _ppCell[lineIndex][pointIndex]._position = position; }
185 GX_FORCE_INLINE
const GxVector3&
getNormal(u32 pointIndex, u32 lineIndex)
const {
return _ppCell[lineIndex][pointIndex]._normal; }
187 GX_FORCE_INLINE
void setNormal(u32 pointIndex, u32 lineIndex,
const GxVector3 & normal) { _ppCell[lineIndex][pointIndex]._normal = normal; }
190 GX_FORCE_INLINE
b32 isFixed(u32 pointIndex, u32 lineIndex)
const {
return _ppCell[lineIndex][pointIndex]._isFixed; }
192 GX_FORCE_INLINE
void setFixed(u32 pointIndex, u32 lineIndex,
b32 isFixed) { _ppCell[lineIndex][pointIndex]._isFixed = isFixed; }
195 b32 analyseEnableLink(u32 pointIndex, u32 lineIndex);
213GX_UTILITY_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
基準布クラス
Definition GxUnitClothBase.h:18
constexpr f32 getKS(void) const
せん断力の取得
Definition GxUnitClothBase.h:167
GX_FORCE_INLINE b32 isFixed(u32 pointIndex, u32 lineIndex) const
質点固定情報取得
Definition GxUnitClothBase.h:190
f32 _kb
バネ定数 - 曲げにくさ係数
Definition GxUnitClothBase.h:206
GX_FORCE_INLINE const GxVector3 & getPosition(u32 pointIndex, u32 lineIndex) const
質点位置取得
Definition GxUnitClothBase.h:180
b32 _isSkirt
スカート(端と端が繋がっているか)かどうか
Definition GxUnitClothBase.h:207
constexpr f32 getKB(void) const
曲げにくさの取得
Definition GxUnitClothBase.h:172
f32 _kt
バネ定数 - 伸びにくさ係数
Definition GxUnitClothBase.h:204
constexpr f32 kT(f32 ks) const
ばね関数 - 伸びにくさ係数取得
Definition GxUnitClothBase.h:155
GX_FORCE_INLINE void setFixed(u32 pointIndex, u32 lineIndex, b32 isFixed)
質点固定情報設定
Definition GxUnitClothBase.h:192
GX_FORCE_INLINE const GxVector3 & getNormal(u32 pointIndex, u32 lineIndex) const
質点の法線取得
Definition GxUnitClothBase.h:185
GX_FORCE_INLINE void setNormal(u32 pointIndex, u32 lineIndex, const GxVector3 &normal)
質点の法線設定
Definition GxUnitClothBase.h:187
u32 _id
任意ID
Definition GxUnitClothBase.h:208
GX_FORCE_INLINE void * getCellPointer(void) const override
質点データ取得
Definition GxUnitClothBase.h:177
f32 _ks
バネ定数 - せん断力係数
Definition GxUnitClothBase.h:205
constexpr void setKS(f32 ks)
せん断力の設定
Definition GxUnitClothBase.h:169
constexpr void setKB(f32 kb)
曲げにくさの設定
Definition GxUnitClothBase.h:174
GX_FORCE_INLINE void setPosition(u32 pointIndex, u32 lineIndex, const GxVector3 &position)
質点位置設定
Definition GxUnitClothBase.h:182
GxCell ** _ppCell
質点データ
Definition GxUnitClothBase.h:203
constexpr void setKT(f32 kt)
伸びにくさの設定
Definition GxUnitClothBase.h:164
constexpr f32 getKT(void) const
伸びにくさの取得
Definition GxUnitClothBase.h:162
constexpr f32 kB(f32 ks) const
ばね関数 - 曲げにくさ係数取得
Definition GxUnitClothBase.h:159
constexpr f32 kS(f32 ks) const
ばね関数 - せん断力係数取得
Definition GxUnitClothBase.h:157
ソフトボディユニット基底クラス
Definition GxUnitSoftbodyBase.h:19
基準布型セルクラス
Definition GxUnitClothBase.h:43
f32 _defW
右のセルとの基準距離
Definition GxUnitClothBase.h:67
f32 _defH
下のセルとの基準距離
Definition GxUnitClothBase.h:68
f32 _defDl
左下セルとの基準距離
Definition GxUnitClothBase.h:69
b32 _isEnableLink
列間の質点で繋がり(拘束)があるかどうか
Definition GxUnitClothBase.h:71
f32 _defDr
右下セルとの基準距離
Definition GxUnitClothBase.h:70
GxCell(void)
デフォルトコンストラクタ
Definition GxUnitClothBase.h:59
3次元ベクトル
Definition GxVector.h:245
32bitブーリアン
Definition GxDefine.h:173