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

モデル対応シミュレーション統合ユニットクラス More...

#include <GxUnitSoftbodySimulation.h>

Inheritance diagram for GxUnitSoftbodySimulation:
Collaboration diagram for GxUnitSoftbodySimulation:

Public Member Functions

初期化
 GxUnitSoftbodySimulation (void)
 デフォルトコンストラクタ
 
virtual u32 initialize (GxResSoftbodySimulation *pResource, GxUnitModelBase *pParent, u32 unitProcessNumber, u32 unitListNumber, GxRtti &chainUnitRtti, GxRtti &clothUnitRtti)
 初期化関数、コンストラクタの直後に呼ぶこと
 
void cleanup (void) override
 解放処理
 
アクセサ
void updateMatrix (GxUnitModelBase::GxJoint *pNow)
 指定ジョイント以下の全ジョイントの行列を更新
 
constexpr u32 getChainCount (void) const
 鎖ユニットの個数取得
 
constexpr GxUnitChainModelgetChainUnit (u32 index) const
 指定番号の鎖ユニット取得
 
GxUnitChainModelgetChainUnitFromID (u32 id) const
 指定番号の鎖ユニット取得
 
constexpr u32 getClothCount (void) const
 布ユニットの個数取得
 
constexpr GxUnitClothModelgetClothUnit (u32 index) const
 指定番号の布ユニット取得
 
GxUnitClothModelgetClothUnitFromID (u32 id) const
 指定番号の布ユニット取得
 
GxUnitSoftbodyCollisiongetCollision (void) const
 コリジョンユニット取得
 
void setCollision (GxUnitSoftbodyCollision *pCollision)
 コリジョンユニット設定
 
b32 isSimulation (void) const
 有効判定
 
b32 isSimulationChain (u32 index) const
 鎖有効判定
 
b32 isSimulationCloth (u32 index) const
 布有効判定
 
void setIsSimulation (b32 enable)
 有効設定(シミュレーションとモーションを補間して遷移)
 
b32 isInterpolateToMotion (void) const
 シミュレーションからモーションへ補間している状態か判定
 
b32 isInterpolateToMotionChain (u32 index) const
 鎖がシミュレーションからモーションへ補間している状態か判定
 
b32 isInterpolateToMotionCloth (u32 index) const
 布がシミュレーションからモーションへ補間している状態か判定
 
void forceDisableSimulation (void)
 シミュレーションを強制終了してモーションへ(補間しない)
 
f32 getInterpolateTime (void) const
 補間時間の取得(シミュレーション→モーションの補間にかける時間)
 
void setInterpolateTime (f32 time)
 補間時間の設定(シミュレーション→モーションの補間にかける時間)
 
b32 isMotionGravity (void) const
 重力を修正してモーションへ収束させるか設定
 
void setIsMotionGravity (b32 enable)
 重力を修正してモーションへ収束させるか設定
 
void setMotionGravity (b32 enable, f32 gravityForce, const GxVector3 &gravityDirection=-GxVector3::AXIS_Y)
 重力を修正してモーションへ収束させるか設定 - パラメータ変更込み
 
GX_FORCE_INLINE GxVector3 getGravity (void) const
 重力取得
 
void setGravity (const GxVector3 &gravity)
 重力設定
 
f32 getGravityForce (void) const
 重力取得(大きさのみ)
 
void setGravityForce (f32 force)
 重力設定(大きさのみ)
 
const GxVector3getGravityDirection (void) const
 重力取得(方向のみ)
 
void setGravityDirection (const GxVector3 &direction)
 重力設定(方向のみ)
 
GX_FORCE_INLINE GxVector3 getWind (void) const
 風取得
 
void setWind (const GxVector3 &wind)
 風設定
 
f32 getWindForce (void) const
 風力取得
 
void setWindForce (f32 force)
 風力設定
 
const GxVector3getWindDirection (void) const
 風向取得
 
void setWindDirection (const GxVector3 &direction)
 風向設定
 
GX_FORCE_INLINE b32 isUpdateAllMatrix (void) const
 重力を修正してモーションへ収束させるか設定
 
GX_FORCE_INLINE void setIsUpdateAllMatrix (b32 is)
 重力を修正してモーションへ収束させるか設定
 
- 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)
 子ユニットを追加作成
 
- 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)
 デフォルトオブジェクト判定
 

Protected Attributes

メンバ変数
GxResSoftbodySimulation_pResource
 シミュレーションリソース
 
GxUnitModelBase_pParentModel
 シミュレートするモデル
 
GxUnitChainModel ** _ppChainList
 チェーンシミュレーションユニットリスト
 
GxUnitClothModel ** _ppClothList
 クロスシミュレーションユニットリスト
 
u32 _chainCount
 チェーンシミュレーション数
 
u32 _clothCount
 クロスシミュレーション数
 
b32 _isUpdateAllMatrix
 全関節行列更新するかフラグ // for 枝分かれ関節
 
GxUnitSoftbodyCollision_pCollision
 シミュレーションが使用するコリジョン
 
- Protected Attributes inherited from GxClassBaseReference
s32 _referenceCount
 参照カウンタ
 
s32 _delayReleaseCount
 遅延解放カウンタ
 

操作

void kill (void) override
 ユニットの消去リクエスト
 
void asyncUpdate (void) override
 非同期更新
 
void sequentialUpdate (void) override
 同期更新
 

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の取得
 
- Static Public Attributes inherited from GxClassBaseReference
static constexpr s32 DELAY_RELEASE_COUNT_INFINITY = -1
 遅延解放の無限待ち定義
 
- Protected Member Functions inherited from GxUnitBase
virtual b32 setup (void)
 セットアップ(初回にasyncUpdate前に一回呼ばれる)
 
virtual void preAsyncUpdate (void)
 並列更新(asyncUpdateの前に実行される)
 
virtual void postAsyncUpdate (void)
 並列更新(asyncUpdateの後に実行される)
 
virtual void forceAsyncUpdate (void)
 強制並列更新(pause中も実行)
 
virtual void render (void)
 描画
 
virtual b32 setRenderMaterial (GxRenderMaterial *pMaterial, const GxResModel::GxMeshGroup *pMeshGroup)
 マテリアルの描画設定
 
template<typename T >
T * addModule (void)
 モジュールを作成
 
template<typename T >
void removeModule (void)
 モジュールを削除
 

Detailed Description

モデル対応シミュレーション統合ユニットクラス

Member Function Documentation

◆ asyncUpdate()

void GxUnitSoftbodySimulation::asyncUpdate ( void )
overrideprotectedvirtual

非同期更新

Reimplemented from GxUnitBase.

Here is the call graph for this function:

◆ cleanup()

void GxUnitSoftbodySimulation::cleanup ( void )
overridevirtual

解放処理

Reimplemented from GxUnitBase.

◆ getChainUnitFromID()

GxUnitChainModel * GxUnitSoftbodySimulation::getChainUnitFromID ( u32 id) const

指定番号の鎖ユニット取得

Parameters
id[in] ID
Returns

◆ getClothUnitFromID()

GxUnitClothModel * GxUnitSoftbodySimulation::getClothUnitFromID ( u32 id) const

指定番号の布ユニット取得

Parameters
id[in] ID
Returns

◆ getGravityDirection()

const GxVector3 & GxUnitSoftbodySimulation::getGravityDirection ( void ) const

重力取得(方向のみ)

Returns
重力方向
Here is the call graph for this function:

◆ getGravityForce()

f32 GxUnitSoftbodySimulation::getGravityForce ( void ) const

重力取得(大きさのみ)

Returns
重力
Here is the call graph for this function:

◆ getInterpolateTime()

f32 GxUnitSoftbodySimulation::getInterpolateTime ( void ) const

補間時間の取得(シミュレーション→モーションの補間にかける時間)

Parameters
補間時間
Here is the call graph for this function:

◆ getWindForce()

f32 GxUnitSoftbodySimulation::getWindForce ( void ) const

風力取得

Returns
風力
Here is the call graph for this function:

◆ initialize()

u32 GxUnitSoftbodySimulation::initialize ( GxResSoftbodySimulation * pResource,
GxUnitModelBase * pParent,
u32 unitProcessNumber,
u32 unitListNumber,
GxRtti & chainUnitRtti,
GxRtti & clothUnitRtti )
virtual

初期化関数、コンストラクタの直後に呼ぶこと

Parameters
pResource[in] シミュレーションリソース
pParent[in] シミュレーションさせるモデル
unitProcessNumber[in] シミュレーションユニットを登録する処理番号
unitListNumber[in] シミュレーションユニットを登録するリスト番号
chainUnitRtti[in] 鎖ユニットのRTTI
clothUnitRtti[in] 布ユニットのRTTI
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInterpolateToMotionChain()

b32 GxUnitSoftbodySimulation::isInterpolateToMotionChain ( u32 index) const

鎖がシミュレーションからモーションへ補間している状態か判定

Parameters
index[in] インデックス
Returns
補間しているならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInterpolateToMotionCloth()

b32 GxUnitSoftbodySimulation::isInterpolateToMotionCloth ( u32 index) const

布がシミュレーションからモーションへ補間している状態か判定

Parameters
index[in] インデックス
Returns
補間しているならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isMotionGravity()

b32 GxUnitSoftbodySimulation::isMotionGravity ( void ) const

重力を修正してモーションへ収束させるか設定

Parameters
重力が変動してモーションへ収束するならtrue
Here is the call graph for this function:

◆ isSimulation()

b32 GxUnitSoftbodySimulation::isSimulation ( void ) const

有効判定

Returns
有効ならtrue
Here is the call graph for this function:

◆ isSimulationChain()

b32 GxUnitSoftbodySimulation::isSimulationChain ( u32 index) const

鎖有効判定

Parameters
index[in] インデックス
Returns
有効ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSimulationCloth()

b32 GxUnitSoftbodySimulation::isSimulationCloth ( u32 index) const

布有効判定

Parameters
index[in] インデックス
Returns
有効ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kill()

void GxUnitSoftbodySimulation::kill ( void )
overridevirtual

ユニットの消去リクエスト

Reimplemented from GxUnitBase.

◆ sequentialUpdate()

void GxUnitSoftbodySimulation::sequentialUpdate ( void )
overrideprotectedvirtual

同期更新

Reimplemented from GxUnitBase.

Here is the call graph for this function:

◆ setCollision()

void GxUnitSoftbodySimulation::setCollision ( GxUnitSoftbodyCollision * pCollision)

コリジョンユニット設定

Parameters
pCollision[in] コリジョン
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGravity()

void GxUnitSoftbodySimulation::setGravity ( const GxVector3 & gravity)

重力設定

Parameters
gravity[in] 重力
Here is the call graph for this function:

◆ setGravityDirection()

void GxUnitSoftbodySimulation::setGravityDirection ( const GxVector3 & direction)

重力設定(方向のみ)

Parameters
direction[in] 重力方向
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGravityForce()

void GxUnitSoftbodySimulation::setGravityForce ( f32 force)

重力設定(大きさのみ)

Parameters
force[in] 重力
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInterpolateTime()

void GxUnitSoftbodySimulation::setInterpolateTime ( f32 time)

補間時間の設定(シミュレーション→モーションの補間にかける時間)

Parameters
time[in] 補間時間
Here is the call graph for this function:

◆ setIsMotionGravity()

void GxUnitSoftbodySimulation::setIsMotionGravity ( b32 enable)

重力を修正してモーションへ収束させるか設定

Parameters
enable[in] 有効ならtrue
Here is the call graph for this function:

◆ setIsSimulation()

void GxUnitSoftbodySimulation::setIsSimulation ( b32 enable)

有効設定(シミュレーションとモーションを補間して遷移)

正確には、モーションからシミュレーションに切り替わる際は、モーションの姿勢を初期値とするため補間はない
シミュレーションからモーションへ切り替える場合のみ現在の姿勢からモーションの姿勢まで回転を時間線形に球面補間する

Parameters
enable[in] 有効ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMotionGravity()

void GxUnitSoftbodySimulation::setMotionGravity ( b32 enable,
f32 gravityForce,
const GxVector3 & gravityDirection = -GxVector3::AXIS_Y )

重力を修正してモーションへ収束させるか設定 - パラメータ変更込み

setMotionGravity の第一引数に true を与えると、重力方向は設定パラメータに因らず、 モデル関節のモーションで指定された方向へ重力を向ける
大きさは第二引数で与えられた値を用いる
また、第一引数に false が与えられた場合、第三引数で鉛直方向以外の重力方向を設定可能
この方向は、すべての質点に同等の向きを与える(個別設定不可)

Parameters
enable[in] 有効ならtrue
gravityForce[in] 重力
gravityDirection[in] 重力方向
Here is the call graph for this function:

◆ setWind()

void GxUnitSoftbodySimulation::setWind ( const GxVector3 & wind)

風設定

Parameters
wind[in] 風向き
Here is the call graph for this function:

◆ setWindDirection()

void GxUnitSoftbodySimulation::setWindDirection ( const GxVector3 & direction)

風向設定

Parameters
direction[in] 風向き
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWindForce()

void GxUnitSoftbodySimulation::setWindForce ( f32 force)

風力設定

Parameters
force[in] 風力
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateMatrix()

void GxUnitSoftbodySimulation::updateMatrix ( GxUnitModelBase::GxJoint * pJointNow)

指定ジョイント以下の全ジョイントの行列を更新

Parameters
pJointNow[in] 関節
Here is the call graph for this function:
Here is the caller graph for this function:

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