ソフトボディユニット基底クラス More...
#include <GxUnitSoftbodyBase.h>
Classes | |
struct | GxCell |
質点クラス More... | |
Public Member Functions | |
アクセサ | |
virtual void * | getCellPointer (void) const =0 |
質点データ取得 | |
constexpr GxUnitSoftbodyCollision * | getCollision (void) const |
コリジョンユニット取得 | |
constexpr void | setCollision (GxUnitSoftbodyCollision *pCollision) |
コリジョンユニット設定 | |
constexpr u32 | getPointCount (void) const |
シミュレート点数の取得 | |
constexpr u32 | getLineCount (void) const |
シミュレート線数の取得 | |
constexpr f32 | getMass (void) const |
質量取得 : 途中変更無効 | |
constexpr f32 | getAirDamping (void) const |
空気抵抗取得 | |
constexpr void | setAirDamping (f32 damping) |
空気抵抗設定 | |
constexpr f32 | getWindForce (void) const |
風力取得 | |
constexpr void | setWindForce (f32 windForce) |
風力設定 | |
GX_FORCE_INLINE const GxVector3 & | getWindDirection (void) const |
風向取得 | |
GX_FORCE_INLINE void | setWindDirection (const GxVector3 &windDirection) |
風向設定 | |
constexpr f32 | getHitBackForceDamper (void) const |
当たり抵抗定数取得 | |
constexpr void | setHitBackForceDamper (f32 damper) |
当たり抵抗定数設定 | |
constexpr f32 | getUpdateDelta (void) const |
更新間隔取得 | |
constexpr void | setUpdateDelta (f32 delta) |
更新間隔設定 | |
constexpr u32 | getMoveStrength (u32 index) const |
平行移動伝播率の取得 [ 0 ~ 100 ] | |
constexpr void | setMoveStrength (u32 strength, u32 index) |
平行移動伝播率の設定 [ 0 ~ 100 ] | |
constexpr f32 | getWarpLengthSquare (void) const |
瞬間移動検出距離(の二乗)取得 | |
constexpr void | setWarpLengthSquare (f32 length) |
瞬間移動検出距離(の二乗)設定 | |
GX_FORCE_INLINE const GxVector3 & | getWarpPosition (void) const |
瞬間移動検出参照位置取得 : 自動更新、変更禁止 | |
GX_FORCE_INLINE void | setExtraLoop (f32 time=1.0f) |
空ループ(シミュレーションが落ち着くまで待つ)設定 : 時間も一緒に決める(デフォルト 1秒) | |
GX_FORCE_INLINE b32 | isUpdateExtraLoop (void) const |
空ループする(シミュレーションが落ち着くまで待つ)かどうか取得 | |
GX_FORCE_INLINE void | setIsUpdateExtraLoop (void) |
空ループする(シミュレーションが落ち着くまで待つ)よう設定 | |
constexpr f32 | getExtraLoopTime (void) const |
空ループする時間を取得 [ sec ] | |
constexpr void | setExtraLoopTime (f32 time) |
空ループする時間を設定 [ sec ] | |
constexpr f32 | getGravityForce (void) const |
重力取得 | |
constexpr void | setGravityForce (f32 force) |
重力設定 | |
constexpr f32 | getAdjustGravityBlendRate (void) const |
ローカル重力方向と補整重力方向のブレンド率を取得 | |
constexpr void | setAdjustGravityBlendRate (f32 blandRate) |
ローカル重力方向と補整重力方向のブレンド率を設定 | |
GX_FORCE_INLINE const GxVector3 & | getGravityDirection (void) const |
ローカル重力方向取得 | |
GX_FORCE_INLINE void | setGravityDirection (const GxVector3 &direction) |
ローカル重力方向設定 | |
GX_FORCE_INLINE const GxVector3 & | getAdjustGravityDirection (void) const |
補整重力方向取得 | |
GX_FORCE_INLINE void | setAdjustGravityDirection (const GxVector3 &direction) |
補整重力方向設定 | |
![]() | |
GxUnitBase (void) | |
コンストラクタ | |
constexpr f32 | getDeltaTimeFactor (void) const |
デルタタイム係数を取得 | |
constexpr void | setDeltaTimeFactor (f32 deltaTimeFactor) |
デルタタイム係数を設定 | |
constexpr f32 | getDeltaTime (void) const |
デルタタイムを取得 | |
constexpr void | setDeltaTime (f32 deltaTime) |
デルタタイムを設定 | |
constexpr f32 | getDeltaTimeRatio (void) const |
デルタタイムレート(通常のフレームレートの何倍か)を取得 | |
constexpr void | setDeltaTimeRatio (f32 deltaTimeRatio) |
デルタタイムレート(通常のフレームレートの何倍か)を設定 | |
constexpr STATE | getState (void) const |
状態を取得 | |
constexpr void | setState (STATE state) |
状態を設定(ユーザーは使用してはならない内部使用) | |
GX_FORCE_INLINE b32 | isEnable (void) const |
有効か判定 | |
constexpr u32 | getAttribute (void) const |
属性を取得 | |
GX_FORCE_INLINE b32 | isAttribute (ATTRIBUTE attribute) const |
属性を判定 | |
GX_FORCE_INLINE void | setAttribute (ATTRIBUTE attribute, b32 enable) |
属性を設定 | |
GX_FORCE_INLINE b32 | isRender (void) const |
描画フラグ判定 | |
void | setRender (b32 enable, b32 withChildren=false) |
描画フラグを設定 | |
GX_FORCE_INLINE GxFlag32Index< RENDER_VIEW > | getRenderViewFlag (void) const |
描画するビューフラグを取得 | |
GX_FORCE_INLINE b32 | isRenderView (RENDER_VIEW view) const |
描画するビューを判定 | |
GX_FORCE_INLINE void | setRenderView (RENDER_VIEW view, b32 enable) |
描画するビューを設定 | |
GX_FORCE_INLINE b32 | isRenderSubView (RENDER_SUB_VIEW subView) const |
描画するサブビューを判定 | |
GX_FORCE_INLINE void | setRenderSubView (RENDER_SUB_VIEW subView, b32 enable) |
描画するサブビューを設定 | |
GX_FORCE_INLINE b32 | isUpdateEnable (UPDATE_TYPE updateType) const |
更新を呼ぶかを判定 | |
GX_FORCE_INLINE void | setUpdateEnable (UPDATE_TYPE updateType, b32 enable) |
更新を呼ぶかを設定 | |
GX_FORCE_INLINE void | getPropertyAttributeUpdate (void *const pValue) |
プロパティ用:更新処理の属性を取得 | |
GX_FORCE_INLINE void | setPropertyAttributeUpdate (const void *const pValue) |
プロパティ用:更新処理の属性を設定 | |
template<typename T > | |
T * | getModule (void) const |
モジュールを取得 | |
constexpr u32 | getChildCount (void) const |
子ユニット数を取得 | |
constexpr GxUnitBase * | getChild (u32 index) const |
子ユニットを取得 | |
constexpr GxUnitBase * | getParent (void) const |
親ユニットを取得 | |
void | setParent (GxUnitBase *pParent) |
親ユニットを設定 | |
constexpr GxResUnitInstance * | getResUnitInstance (void) const |
ユニットインスタンスリソースを取得 | |
void | setResUnitInstance (GxResUnitInstance *pResUnitInstance) |
ユニットインスタンスリソースを設定 | |
constexpr void | getPropertyResUnitInstance (void *const pValue) |
ユニットインスタンスリソースプロパティの取得 | |
void | setPropertyResUnitInstance (const void *const pValue) |
ユニットインスタンスリソースプロパティの設定 | |
GX_FORCE_INLINE const GxTypedObject * | getDefaultObject (void) override |
デフォルトオブジェクトを取得 | |
constexpr GxUnitBase * | getDefaultUnit (void) const |
デフォルトユニットを取得 | |
void | setDefaultUnit (GxUnitBase *pDefaultUnit) |
デフォルトユニットを設定 | |
void | sleep (f32 time) |
スリープ(スクリプト用) | |
template<typename T > | |
T * | createAndAddChild (u32 listProcessNumber=U32_MAX, u32 listKindNumber=U32_MAX, b32 isSerialize=false, const GxRtti *pRtti=nullptr) |
子ユニットを追加作成 | |
virtual void | kill (void) |
消去リクエスト | |
![]() | |
GxClassBaseReference (void) | |
コンストラクタ | |
GxClassBaseReference (const GxClassBaseReference &base) | |
コピーコンストラクタ | |
~GxClassBaseReference (void) override | |
デストラクタ | |
constexpr GxClassBaseReference & | operator= (const GxClassBaseReference &base) |
代入演算子 | |
virtual s32 | addReference (void) |
参照カウンタを加算 | |
virtual s32 | release (void) |
解放 | |
virtual s32 | getReferenceCount (void) const |
参照カウンタを取得 | |
constexpr void | setDelayReleaseCount (s32 count) |
遅延解放カウンタを設定 | |
void | setDelayReleaseCountInfinity (b32 on) |
無限解放待ちの設定 | |
![]() | |
constexpr | GxClassBaseRoot (void) |
コンストラクタ | |
constexpr | GxClassBaseRoot (const GxClassBaseRoot &) |
コピーコンストラクタ | |
virtual | ~GxClassBaseRoot (void) |
デストラクタ | |
constexpr GxClassBaseRoot & | operator= (const GxClassBaseRoot &) |
代入演算子 | |
virtual GxRtti & | getRtti (void) const =0 |
Rttiの取得 | |
GX_FORCE_INLINE b32 | isDefaultObject (void) |
デフォルトオブジェクト判定 | |
Static Public Attributes | |
定義 | |
static const GxVector3 | _gravityDefault = GxVector3( 0.0f, -9.8f, 0.0f ) |
重力初期値 [ m/s^2 ] | |
static const GxVector3 | _gravityDirectionDefault = GxVector3( 0.0f, -1.0f, 0.0f ) |
重力方向初期値 [ m/s^2 ] | |
static const f32 | _gravityForceDefault = 9.80f |
重力大きさ初期値 [ m/s^2 ] | |
static const f32 | _airDampingDefault = 0.2f |
空気抵抗初期値 [ 正数 ] | |
static const f32 | _windForceDefault = 0.0f |
風力初期値 [ 正数 ] | |
static const GxVector3 | _windDirectionDefault = GxVector3(1.0f,0.0f,0.0f) |
風向初期値 [ Normalized ] | |
static const f32 | _massDefault = 0.1f |
質量初期値 [ kg ] | |
static const f32 | _updateDeltaDefault = 0.01f |
更新間隔初期値 [ 秒 ] | |
static const f32 | _hitbackForceDamperDefault = 0.3f |
跳ね返り力初期値 [ 0.0 - 1.0 ] | |
static const f32 | _warpLengthSquareDefault = 1.0f*1.0f |
瞬間移動検出距離(の二乗)初期値 [ m^2 ] | |
![]() | |
static constexpr s32 | DELAY_RELEASE_COUNT_INFINITY = -1 |
遅延解放の無限待ち定義 | |
Protected Member Functions | |
操作 | |
void | postAsyncUpdate (void) override |
非同期更新 | |
void | render (void) override |
描画 | |
virtual b32 | isWarp (void)=0 |
ワープの条件を記述、true が返るフレームではシミュレーションしない | |
virtual void | updateInitialize (void)=0 |
毎フレーム初期化 | |
virtual void | updateForce (f32 updateRatio, f32 updateRatioOld)=0 |
各質点にかかる力の算出 | |
virtual void | updateCell (void)=0 |
各質点情報を更新 | |
virtual void | updateConstraint (void)=0 |
制約を更新 | |
virtual void | calculateHitBackForce (f32 updateRatio, f32 updateRatioOld)=0 |
ヒットバックを更新 | |
![]() | |
virtual b32 | setup (void) |
セットアップ(初回にasyncUpdate前に一回呼ばれる) | |
virtual void | preAsyncUpdate (void) |
並列更新(asyncUpdateの前に実行される) | |
virtual void | asyncUpdate (void) |
並列更新 | |
virtual void | sequentialUpdate (void) |
逐次更新 | |
virtual void | forceAsyncUpdate (void) |
強制並列更新(pause中も実行) | |
virtual b32 | setRenderMaterial (GxRenderMaterial *pMaterial, const GxResModel::GxMeshGroup *pMeshGroup) |
マテリアルの描画設定 | |
template<typename T > | |
T * | addModule (void) |
モジュールを作成 | |
template<typename T > | |
void | removeModule (void) |
モジュールを削除 | |
Protected Attributes | |
メンバ変数 | |
GxUnitSoftbodyCollision * | _pCollision |
コリジョンデータ | |
GxUnitSoftbodyCollision * | _pCollisionOld |
1フレーム前のコリジョンデータ | |
b32 * | _pIsUpdateCollision |
シミュレーション後にコリジョンデータを更新するかどうか | |
u32 | _pointCount |
点の数 | |
u32 | _lineCount |
線の数 | |
u32 | _planeCount |
面の数 // 三次元拡張時 | |
f32 | _mass |
全体重さ | |
f32 | _airDamping |
空気抵抗定数 | |
f32 | _windForce |
風の大きさ的な | |
GxVector3 | _windDirection |
風の向き的な | |
f32 | _hitBackForceDamper |
当たり反発位置修正ダンパ [ 0.0f - 1.0f ] | |
f32 | _updateDelta |
1 シミュレート時間 | |
u32 | _moveStrength [2] |
固定位置の移動を下位に伝える強さ [ 0 ~ 100 ] | |
f32 | _moveStrengthCoefficient |
Y軸平行移動量への係数 | |
GxVector3 | _warpPosition |
ワープを検出するときの位置 | |
f32 | _warpLengthSquare |
ワープとみなす閾値(長さの二乗値 | |
b32 | _isExtraLoop |
このフラグがオンのフレームは安定動作のために空ループする | |
f32 | _extraLoopTime |
空ループを回す時間 [ sec ] | |
f32 | _gravityForce |
重力大きさ | |
GxVector3 | _gravityDirection |
ローカル重力方向 | |
GxVector3 | _adjustGravityDirection |
補整重力方向 | |
f32 | _adjustGravityBlendRate |
ローカル重力と補整重力のブレンド率(デフォルトは0.0fで、ローカル重力のみ利用) | |
b32 | _isRandom |
乱数を使用するかフラグ | |
b32 | _isLocalWind |
風向きを親ユニットのローカルで扱うかフラグ | |
b32 | _excludeTailJointSkin |
末端以外のジョイントをシミュレーションするフラグ | |
![]() | |
s32 | _referenceCount |
参照カウンタ | |
s32 | _delayReleaseCount |
遅延解放カウンタ | |
初期化 | |
GxUnitSoftbodyBase (void) | |
デフォルトコンストラクタ | |
void | cleanup (void) override |
解放処理 | |
Additional Inherited Members | |
![]() | |
enum class | STATE { SETUP , RUNNING , DELETE_ } |
状態 More... | |
enum | ATTRIBUTE { ATTRIBUTE_UPDATE = (1 << 0) , ATTRIBUTE_SELECTED = (1 << 1) , ATTRIBUTE_LOCK = (1 << 2) , ATTRIBUTE_SLOW = (1 << 3) , ATTRIBUTE_NOSERIALIZE = (1 << 4) } |
属性 More... | |
![]() | |
static void | initializeDelayRelease (void) |
遅延解放リストの初期化 | |
static void | terminateDelayRelease (void) |
遅延解放リストの終了 | |
static void | updateDelayRelease (void) |
遅延解放リストの更新 | |
static b32 | isDelayReleaseEnable (void) |
遅延解放システムの有効判定 | |
static u32 | getDelayReleaseListCount (void) |
遅延解放待ちの数を取得 | |
![]() | |
static GX_FORCE_INLINE GxRtti & | __getStaticRtti (void) |
Rttiの取得 | |
ソフトボディユニット基底クラス
|
protectedpure virtual |
ヒットバックを更新
Implemented in GxUnitChainBase, GxUnitChainModel, GxUnitClothBase, and GxUnitClothModel.
|
overridevirtual |
解放処理
Reimplemented from GxUnitBase.
|
pure virtual |
質点データ取得
このクラスは抽象クラスであり、この関数に実体を持たせたクラスがシミュレーションユニットとなる
また、質点の実体(ポインタ変数)は、各派生クラスで宣言する(ポインタの次元が変わるため)
Implemented in GxUnitChainBase, and GxUnitClothBase.
|
inlineconstexpr |
シミュレート線数の取得
以前は COLUMN という名前だったが、わかりにくいので変更
一次元配列(鎖)の数なので、LINE
二次元配列(布)は、一次元配列の集合として考える
|
inlineconstexpr |
シミュレート点数の取得
以前は ROW という名前だったが、わかりにくいので変更
一次元配列(鎖)の要素点なので、POINT
|
protectedpure virtual |
ワープの条件を記述、true が返るフレームではシミュレーションしない
Implemented in GxUnitChainBase, GxUnitChainModel, GxUnitClothBase, and GxUnitClothModel.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
描画
Reimplemented from GxUnitBase.
|
inlineconstexpr |
平行移動伝播率の設定 [ 0 ~ 100 ]
平行移動伝播率は、固定関節(モデルに追従する質点)の平行移動地を、下位の関節へ伝える割合 [ % ]
0番 と 1番があり、0 が最上位関節(固定関節)、1 が末端関節として、間は線形補間
ともに 100 を与えると、完璧に平行移動に追従するため、ほとんどシミュレーションしない
|
protectedpure virtual |
各質点情報を更新
Implemented in GxUnitChainBase, and GxUnitClothBase.
|
protectedpure virtual |
制約を更新
Implemented in GxUnitChainBase, GxUnitChainModel, GxUnitClothBase, and GxUnitClothModel.
|
protectedpure virtual |
各質点にかかる力の算出
Implemented in GxUnitChainBase, and GxUnitClothBase.
|
protectedpure virtual |
毎フレーム初期化
Implemented in GxUnitChainBase, GxUnitChainModel, GxUnitClothBase, and GxUnitClothModel.