OROCHI
 
Loading...
Searching...
No Matches
GxUnitChainBase Class Reference

鎖基底ユニット More...

#include <GxUnitChainBase.h>

Inheritance diagram for GxUnitChainBase:
Collaboration diagram for GxUnitChainBase:

Classes

struct  GxCell
 基準鎖型セルクラス More...
 

Public Member Functions

初期化
 GxUnitChainBase (void)
 デフォルトコンストラクタ
 
void cleanup (void) override
 解放処理
 
- Public Member Functions inherited from GxUnitSoftbodyBase
constexpr GxUnitSoftbodyCollisiongetCollision (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 GxVector3getWindDirection (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 GxVector3getWarpPosition (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 GxVector3getGravityDirection (void) const
 ローカル重力方向取得
 
GX_FORCE_INLINE void setGravityDirection (const GxVector3 &direction)
 ローカル重力方向設定
 
GX_FORCE_INLINE const GxVector3getAdjustGravityDirection (void) const
 補整重力方向取得
 
GX_FORCE_INLINE void setAdjustGravityDirection (const GxVector3 &direction)
 補整重力方向設定
 
void cleanup (void) override
 解放処理
 
- Public Member Functions inherited from GxUnitBase
 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_VIEWgetRenderViewFlag (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 GxUnitBasegetChild (u32 index) const
 子ユニットを取得
 
constexpr GxUnitBasegetParent (void) const
 親ユニットを取得
 
void setParent (GxUnitBase *pParent)
 親ユニットを設定
 
constexpr GxResUnitInstancegetResUnitInstance (void) const
 ユニットインスタンスリソースを取得
 
void setResUnitInstance (GxResUnitInstance *pResUnitInstance)
 ユニットインスタンスリソースを設定
 
constexpr void getPropertyResUnitInstance (void *const pValue)
 ユニットインスタンスリソースプロパティの取得
 
void setPropertyResUnitInstance (const void *const pValue)
 ユニットインスタンスリソースプロパティの設定
 
GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void) override
 デフォルトオブジェクトを取得
 
constexpr GxUnitBasegetDefaultUnit (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)
 消去リクエスト
 
- Public Member Functions inherited from GxClassBaseReference
 GxClassBaseReference (void)
 コンストラクタ
 
 GxClassBaseReference (const GxClassBaseReference &base)
 コピーコンストラクタ
 
 ~GxClassBaseReference (void) override
 デストラクタ
 
constexpr GxClassBaseReferenceoperator= (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)
 無限解放待ちの設定
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

Static Public Attributes

定義
static const f32 _ktDefault = 1.0f
 バネ定数 - 伸びにくさ係数
 
static const f32 _kbDefault = 0.1f
 バネ定数 - 曲げにくさ係数
 
- Static Public Attributes inherited from GxUnitSoftbodyBase
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 Public Attributes inherited from GxClassBaseReference
static constexpr s32 DELAY_RELEASE_COUNT_INFINITY = -1
 遅延解放の無限待ち定義
 

Protected Member Functions

操作
b32 setup (void) override
 セットアップ ( update 開始直前によばれる)
 
b32 isWarp (void) override
 参照モデルがワープしているとみなすかどうか取得
 
void updateInitialize (void) override
 毎フレームの初期化
 
void updateForce (f32 updateRatio, f32 updateRatioOld) override
 各質点にかかる力の算出
 
virtual void interpolatePosition (f32 updateRatio, f32 updateRatioOld)
 更新時間に応じた固定質点位置補間
 
virtual void calculateBaseVector (void)
 各点の法線基準を算出
 
virtual void calculateExternalForce (GxVector3 &windDirect)
 各点にかかる外力の算出
 
virtual void calculateInternalForce (void)
 各点にかかる内力の算出
 
void calculateHitBackForce (f32 updateRatio, f32 updateRatioOld) override
 参照しているコリジョンデータと各質点の当たり判定
 
void updateCell (void) override
 各質点情報を更新
 
void updateConstraint (void) override
 制約を更新
 
アクセサ
constexpr f32 kT (f32 ks) const
 バネ定数 - 伸びにくさ係数を取得
 
constexpr f32 kB (f32 ks) const
 バネ定数 - 曲げにくさ係数を取得
 
constexpr f32 getKT (void) const
 伸びにくさの取得
 
constexpr void setKT (f32 kt)
 伸びにくさの設定
 
constexpr f32 getKB (void) const
 曲げにくさの取得
 
constexpr void setKB (f32 kb)
 曲げにくさの設定
 
GX_FORCE_INLINE void * getCellPointer (void) const override
 質点データ取得
 
GX_FORCE_INLINE const GxVector3getPosition (u32 index) const
 質点位置取得
 
GX_FORCE_INLINE void setPosition (u32 index, const GxVector3 &position)
 質点位置設定
 
GX_FORCE_INLINE b32 isFixed (u32 index) const
 質点固定情報取得
 
GX_FORCE_INLINE void setFixed (u32 index, b32 isFix)
 質点固定情報設定
 
- Protected Member Functions inherited from GxUnitSoftbodyBase
void postAsyncUpdate (void) override
 非同期更新
 
void render (void) override
 描画
 
 GxUnitSoftbodyBase (void)
 デフォルトコンストラクタ
 
- Protected Member Functions inherited from GxUnitBase
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

メンバ変数
GxCell_pCell
 質点データ
 
f32 _kt
 バネ定数 - 伸びにくさ係数
 
f32 _kb
 バネ定数 - 曲げにくさ係数
 
u32 _id
 任意ID
 
- Protected Attributes inherited from GxUnitSoftbodyBase
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
 末端以外のジョイントをシミュレーションするフラグ
 
- Protected Attributes inherited from GxClassBaseReference
s32 _referenceCount
 参照カウンタ
 
s32 _delayReleaseCount
 遅延解放カウンタ
 

Additional Inherited Members

- Public Types inherited from GxUnitBase
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 Public Member Functions inherited from GxClassBaseReference
static void initializeDelayRelease (void)
 遅延解放リストの初期化
 
static void terminateDelayRelease (void)
 遅延解放リストの終了
 
static void updateDelayRelease (void)
 遅延解放リストの更新
 
static b32 isDelayReleaseEnable (void)
 遅延解放システムの有効判定
 
static u32 getDelayReleaseListCount (void)
 遅延解放待ちの数を取得
 
- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 

Detailed Description

鎖基底ユニット

Member Function Documentation

◆ calculateBaseVector()

void GxUnitChainBase::calculateBaseVector ( void )
protectedvirtual

各点の法線基準を算出

鎖は隣接質点から法線が求められないため、前後の質点を基に平均傾斜を求め、
それを各質点の基準ベクトルとする

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateExternalForce()

void GxUnitChainBase::calculateExternalForce ( GxVector3 & windDirect)
protectedvirtual

各点にかかる外力の算出

外力とはすなわち重力、風力、空気抵抗のこと

Parameters
windDirect[in] 風の方向

Reimplemented in GxUnitChainModel.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateHitBackForce()

void GxUnitChainBase::calculateHitBackForce ( f32 updateRatio,
f32 updateRatioOld )
overrideprotectedvirtual

参照しているコリジョンデータと各質点の当たり判定

Parameters
updateRatio[in] 更新比率
updateRatioOld[in] 前回の更新比率

Implements GxUnitSoftbodyBase.

Reimplemented in GxUnitChainModel.

Here is the call graph for this function:

◆ calculateInternalForce()

void GxUnitChainBase::calculateInternalForce ( void )
protectedvirtual

各点にかかる内力の算出

内力とは、近傍質点から引っ張られる、押される力

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanup()

void GxUnitChainBase::cleanup ( void )
overridevirtual

解放処理

Reimplemented from GxUnitBase.

Reimplemented in GxUnitChainModel.

◆ getCellPointer()

GX_FORCE_INLINE void * GxUnitChainBase::getCellPointer ( void ) const
inlineoverrideprotectedvirtual

質点データ取得

Implements GxUnitSoftbodyBase.

Here is the caller graph for this function:

◆ interpolatePosition()

void GxUnitChainBase::interpolatePosition ( f32 updateRatio,
f32 updateRatioOld )
protectedvirtual

更新時間に応じた固定質点位置補間

固定質点の現在位置情報を、過去と現在のモデルの位置情報を基に、現在の更新時間位置へ設定
1フレームに複数回更新するため、より詳細な位置を線形補間で設定する

Parameters
updateRatio[in] 更新比率
updateRatioOld[in] 前回の更新比率(未使用)

Reimplemented in GxUnitChainModel.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isWarp()

b32 GxUnitChainBase::isWarp ( void )
overrideprotectedvirtual

参照モデルがワープしているとみなすかどうか取得

Implements GxUnitSoftbodyBase.

Reimplemented in GxUnitChainModel.

◆ setup()

b32 GxUnitChainBase::setup ( void )
overrideprotectedvirtual

セットアップ ( update 開始直前によばれる)

Reimplemented from GxUnitBase.

Reimplemented in GxUnitChainModel.

◆ updateCell()

void GxUnitChainBase::updateCell ( void )
overrideprotectedvirtual

各質点情報を更新

Implements GxUnitSoftbodyBase.

Here is the call graph for this function:

◆ updateConstraint()

void GxUnitChainBase::updateConstraint ( void )
overrideprotectedvirtual

制約を更新

現状、鎖基礎クラスの制約は 1% 以上の伸びを認めないこと
kT100702、縮みもを認めない様、修正

Implements GxUnitSoftbodyBase.

Reimplemented in GxUnitChainModel.

Here is the call graph for this function:

◆ updateForce()

void GxUnitChainBase::updateForce ( f32 updateRatio,
f32 updateRatioOld )
overrideprotectedvirtual

各質点にかかる力の算出

Parameters
updateRatio[in] 更新比率
updateRatioOld[in] 前回の更新比率

Implements GxUnitSoftbodyBase.

Here is the call graph for this function:

◆ updateInitialize()

void GxUnitChainBase::updateInitialize ( void )
overrideprotectedvirtual

毎フレームの初期化

Implements GxUnitSoftbodyBase.

Reimplemented in GxUnitChainModel.

Here is the call graph for this function:

The documentation for this class was generated from the following files: