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

モーション再生クラス More...

#include <GxMotionPlayer.h>

Inheritance diagram for GxMotionPlayer:
Collaboration diagram for GxMotionPlayer:

Public Member Functions

初期化
 GxMotionPlayer (void)
 デフォルトコンストラクタ
 
 ~GxMotionPlayer (void) override
 デストラクタ
 
void initialize (GxResMotionPackage *pResource)
 初期化
 
virtual void reset (void)
 リセット
 
- Public Member Functions inherited from GxClassBase
constexpr GxClassBase (void)
 コンストラクタ
 
constexpr GxClassBase (const GxClassBase &base)
 コピーコンストラクタ
 
 ~GxClassBase (void) override
 デストラクタ
 
- 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の取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

Friends

定義
class GxModUnitMotionBlend
 

メンバ変数


s32 _ikChainCount
 モーションデータのなかのIKチェーン数
 
u32 _updateIkChainCount
 取得したい関節のIKチェーンだけの数
 
u32 _ikEffecterTargetCount
 IKエフェクタのターゲット数
 
GxVector3_pIkEffecterTargetArray
 IKエフェクタのターゲット配列
 
GxIkChain_pIkChainArray
 IKチェーン配列
 
GxJointDataArray _originDataArray
 補間の前の関節データを保存する行列
 
GxJointDataArray _interpolateDataArray
 補間された関節データを保存する行列
 
b32 _interpolatingMotion
 モーション補間中かどうか
 
f32 _interpolateFrameElapsed
 補間のフレームカウント
 
b32 _isEnableInterpolateDataArray
 _interpolateDataArray配列に入っている値が有効かどうか
 
GxVector3 _rootPosition
 ユーザーが欲しいルート座標
 

操作

virtual GX_FORCE_INLINE b32 isExistScale (const GxMotionJointData *pJoint) const
 関節にスケールがあるか無いかの判定
 
void updateFrame (void)
 モーションフレームの更新
 
void updateJointLocalData (void)
 モーションの関節のローカルデータを更新
 
b32 change (s32 motionNumber=static_cast< s32 >(GxModUnitMotionBase::MOTION_INDEX::BEGIN), f32 startFrame=0.f, f32 speedRatio=1.f, f32 transitionFrameNumber=0.f, u32 playbackFlags=0)
 オプションを設定して再生
 
b32 changeMotion (s32 motionNumber=static_cast< s32 >(GxModUnitMotionBase::MOTION_INDEX::BEGIN))
 モーション番号だけを設定して前のオプションで再生
 
void updateJointMatrices (u32 jointStartNumber, u32 jointCount)
 各関節のモーションマトリクスを更新
 
GX_FORCE_INLINE void updateJoints (void)
 各関節を更新
 
b32 loadBasepose (void const *pBasePoseData)
 ベースポーズのロードと関節行列のアロケート
 
virtual void allocateJointArray (void)
 関節配列をアロケート
 
virtual void updateRootPosition (void)
 ルート座標のポジションを更新
 
GxMatrixAffinecalculateJointMatrix (GxMotionJoint const *pFinalJoint, GxMatrixAffine &jointMatrix)
 指定された関節のモーションマトリクスだけ計算
 
virtual void calculateInterpolation (void)
 モーション補間時の関節の計算
 
void calculateLocalData2BonesIK (u32 chainStartJointNumber)
 指定されたIKチェーンが始まる関節の子関節(+その子になるエフェクタ関節)のローカルデータ(回転)を計算
 
void calculateMotionDataMatrices2BonesIK (u32 chainStartJointNumber)
 指定されたモーションデータの「IKチェーン」を始まる関節の子関節(+その子になるエフェクタ関節)のマトリクスを計算
 

アクセサ

void setMotionNumber (s32 motionNumber)
 モーション番号を設定 - 有効な番号か確認しない - フレームを0.fにリセット
 
virtual GX_FORCE_INLINE f32 getFrame (void) const
 現在のフレーム数を取得
 
void setFrame (f32 frame)
 現在のフレーム数を設定
 
virtual GX_FORCE_INLINE f32 getFrameNumber (f32 milliSeconds) const
 ミリ秒からフレーム数を取得
 
virtual GX_FORCE_INLINE f32 getMilliSeconds (f32 frameNumber) const
 フレーム数からミリ秒を取得
 
virtual GX_FORCE_INLINE f32 getSpeed (void) const
 スピードを取得
 
constexpr void setSpeed (f32 speed)
 スピードを設定
 
virtual GX_FORCE_INLINE u32 getPlaybackFlags (void) const
 再生フラグを取得
 
virtual GX_FORCE_INLINE b32 isPlaybackFlag (MOTION_PLAYBACK_FLAG flag) const
 再生フラグの判定
 
void setPlaybackFlags (u32 playbackFlags)
 再生フラグを設定
 
void setPlaybackFlag (MOTION_PLAYBACK_FLAG flag, b32 value)
 一つだけの再生フラグを設定
 
constexpr f32 getDeltaTime (void) const
 デルタタイムを取得
 
constexpr f32 getDeltaTimeRatio (void) const
 デルタタイム比率を取得
 
constexpr void setDeltaTime (f32 deltaTime)
 デルタタイムを設定
 
constexpr void setDeltaTimeRatio (f32 deltaTimeRatio)
 デルタタイム比率を設定
 
constexpr s32 getMotionNumber (void) const
 現在のモーション番号を取得
 
constexpr u32 getMotionNumberMin (void) const
 最小番号を取得
 
constexpr u32 getMotionNumberMax (void) const
 最大番号を取得
 
u16 getMotionFrameCount (u32 motionNumber) const
 指定モーションのフレーム数を取得
 
GX_FORCE_INLINE u16 getMotionFrameCount (void) const
 設定中モーションのフレーム数を取得
 
GX_FORCE_INLINE f32 getFrameMax (void) const
 設定中モーションの最大フレーム数を取得
 
GX_FORCE_INLINE f32 getFrameMax (u32 motionNumber) const
 指定モーションの最大フレーム数を取得
 
b32 isFinish (void) const
 終了判定
 
b32 isFinishNextFrame (void) const
 次のフレームの終了判定
 
b32 isLoopTiming (void) const
 setFrame()が前回呼び出された時、ループしたかを判断 - setFrame()を呼び出した後、setMotionNumber()、setSpeed()を呼び出した場合、戻り値が無効になります。
 
constexpr u32 getMotionCount (void) const
 モーション数を取得
 
constexpr f32 getMotionRotateY (void) const
 rot_y関節の回転値を取得
 
constexpr f32 getMotionTranslateY (void) const
 rot_y関節の移動値を取得
 
constexpr f32 getStartFrame (void) const
 モーション再生を開始したフレームを取得
 
constexpr void setDecodeType (GxMotionCurvesContainerQuaternion::DECODE_TYPE type)
 データの展開タイプを設定(GxMotionCurvesContainerQuaternionのときのみ有効)
 
GX_FORCE_INLINE void enableLinearInterpolation (b32 flag)
 フレーム間のsrt各要素の線形補間をon offできるAPI。デフォルトはtrue, モーションの初期化(setMotionNumber)前のみ有効
 
void forceEnableLinearInterpolation (b32 flag)
 フレーム間srt各要素の線形補間on/offフラグをモーション初期化後に強制的に書き換える
 
constexpr GxResMotionPackagegetResMotionPackage (void)
 モーションアドレスを取得
 
GX_FORCE_INLINE GxMotionJointgetJointRaw (const u32 id) const
 間接を取得(更新チェックなしの生アクセス用)
 
GxMotionJoint const * getJointArray (void) const
 関節ポインタの取得
 
GxMotionJoint const * getJoint (const u32 id) const
 関節ポインタの取得(constあり)
 
GxMotionJointgetJoint (const u32 id)
 関節ポインタの取得(constなし)
 
constexpr s32 getJointCount (void) const
 関節数を取得
 
GX_FORCE_INLINE void getUpdateJoint (void *pValue, u32 index)
 関節配列を取得
 
void updateJointMatricesNoIK (u32 jointStartNumber, u32 jointCount)
 各関節のモーションマトリクスを更新(IK計算なし)
 
GX_FORCE_INLINE b32 isJointArrayUpToDate (void) const
 関節配列が更新されたか判定
 
GX_FORCE_INLINE void checkJointsLocalData (void)
 テストをして関節配列を更新
 
virtual void changeTransitionSettings (f32 transitionFrameNumber, INTERPOLATE interpolateType, f32 transitionCurvature)
 補間のパラメータを一括で設定
 
virtual GX_FORCE_INLINE void setInterpolateFrameNumber (f32 interpolateFrameNumber)
 補間フレーム数を設定
 
virtual GX_FORCE_INLINE f32 getInterpolateFrameNumber (void) const
 補間フレーム数を取得
 
virtual GX_FORCE_INLINE void setInterpolateType (INTERPOLATE interpolateType)
 補間のタイプを設定
 
virtual GX_FORCE_INLINE INTERPOLATE getInterpolateType (void)
 補間のタイプを取得
 
virtual GX_FORCE_INLINE void setInterpolateCurvature (f32 interpolateCurvature)
 補間の曲率を設定
 
virtual GX_FORCE_INLINE f32 getInterpolateCurvature (void) const
 補間の曲率を取得
 
constexpr GxResMotionInterpolationSettings const * getInterpolationSettings (void) const
 モーション補間設定リソースを取得
 
constexpr void setInterpolationSettings (GxResMotionInterpolationSettings const *pResInterpolateSettings)
 モーション補間設定リソースを設定
 
GX_FORCE_INLINE f32 getInterpolationRatio (f32 frameElapsed)
 比率を計算
 
constexpr GxIkChain const * getIkChainArray (void) const
 IKチェーン配列の取得
 
GX_FORCE_INLINE GxIkChain const * getIkChain (u32 index) const
 IKチェーンの取得(const あり)
 
GX_FORCE_INLINE GxIkChaingetIkChain (u32 index)
 IKチェーンの取得(const なし)
 
constexpr u32 getIkChainCount (void) const
 IKチェーンの数を取得
 
GX_FORCE_INLINE GxJointDataArraygetInterpolationOriginArray (void)
 補間前行列の取得
 
constexpr void setInterpolateFrameElapsed (f32 value)
 補間フレーム数の設定
 
constexpr u32 const * getMotionPackageData (void) const
 モーションアドレスを取得
 
u32 const * getMotionData (s32 index) const
 モーションアドレスを取得
 
GX_FORCE_INLINE b32 isPlayDifferenceMotion (void)
 差分モーションを再生中かどうかを取得
 
GX_FORCE_INLINE void setPlayDifferenceMotion (b32 isPlayDifferenceMotion)
 差分モーションを再生中かどうかを設定
 
constexpr GxIkChaingetIkChainArray (void)
 関節ポインタの取得
 
virtual void setTranslateRotateToJointArray (void)
 全関節に位置と回転値を設定
 
void setTranslateRotateQuatToOneJoint (GxMotionCurvesContainerQuaternion *pMotionCurvesContainerQuaternion, u32 jointIndex)
 関節に位置と回転値を設定
 
f32 const * setTranslateRotateEulerToOneJoint (GxMotionJointData *pJointToSet, f32 const *pMotionDataReader, b32 isRootLocator)
 関節に位置と回転値を設定
 
constexpr void setDummyValueIndex (const void *, u32)
 ダミー値インデックスを設定
 
constexpr void setDummySize (u32)
 ダミーサイズを設定
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 

Detailed Description

モーション再生クラス

Member Function Documentation

◆ calculateJointMatrix()

GxMatrixAffine & GxMotionPlayer::calculateJointMatrix ( GxMotionJoint const * pFinalJoint,
GxMatrixAffine & jointMatrix )
protected

指定された関節のモーションマトリクスだけ計算

Parameters
pFinalJoint[in] 最後の関節
jointMatrix[in] 関節マトリクス
Returns
計算後のマトリクス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateLocalData2BonesIK()

void GxMotionPlayer::calculateLocalData2BonesIK ( u32 chainStartJointNumber)
protected

指定されたIKチェーンが始まる関節の子関節(+その子になるエフェクタ関節)のローカルデータ(回転)を計算

Parameters
chainStartJointNumber[in] モーション番号
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculateMotionDataMatrices2BonesIK()

void GxMotionPlayer::calculateMotionDataMatrices2BonesIK ( u32 chainStartJointNumber)
protected

指定されたモーションデータの「IKチェーン」を始まる関節の子関節(+その子になるエフェクタ関節)のマトリクスを計算

Parameters
chainStartJointNumber[in] IKチェーンの開始関節番号
Here is the call graph for this function:
Here is the caller graph for this function:

◆ change()

b32 GxMotionPlayer::change ( s32 motionNumber = static_cast<s32>(GxModUnitMotionBase::MOTION_INDEX::BEGIN),
f32 startFrame = 0.f,
f32 speedRatio = 1.f,
f32 transitionFrameNumber = 0.f,
u32 playbackFlags = 0 )

オプションを設定して再生

Parameters
startFrame[in] 開始フレーム
speedRatio [in] 毎フレーム(エンジン側)のモーションフレーム増加分 - increment used to update motion every frame
transitionFrameNumber[in] 補間フレーム数 - 警告!無視されます(使いたいなら、GxMotionPlayerを使用)
playbackFlags  [in] 再生オプションフラグ
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ changeMotion()

b32 GxMotionPlayer::changeMotion ( s32 motionNumber = static_cast<s32>(GxModUnitMotionBase::MOTION_INDEX::BEGIN))

モーション番号だけを設定して前のオプションで再生

Parameters
motionNumber [in]モーション番号
Returns
成功ならtrue
Here is the call graph for this function:

◆ changeTransitionSettings()

void GxMotionPlayer::changeTransitionSettings ( f32 transitionFrameNumber,
INTERPOLATE transitionType,
f32 transitionCurvature )
virtual

補間のパラメータを一括で設定

Parameters
transitionFrameNumber[in] 補間フレーム番号
transitionType[in] 補間タイプ
transitionCurvature[in] 補間曲率

◆ forceEnableLinearInterpolation()

void GxMotionPlayer::forceEnableLinearInterpolation ( b32 flag)

フレーム間srt各要素の線形補間on/offフラグをモーション初期化後に強制的に書き換える

Parameters
flag[in] フラグ
Here is the call graph for this function:

◆ getJoint() [1/2]

GxMotionJoint * GxMotionPlayer::getJoint ( const u32 id)

関節ポインタの取得(constなし)

Parameters
idモーションデータ上の関節番号
Here is the call graph for this function:

◆ getJoint() [2/2]

const GxMotionJoint * GxMotionPlayer::getJoint ( const u32 id) const

関節ポインタの取得(constあり)

Parameters
id[in] モーションデータ上の関節番号
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getJointArray()

const GxMotionJoint * GxMotionPlayer::getJointArray ( void ) const

関節ポインタの取得

Returns
関節
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMotionData()

const u32 * GxMotionPlayer::getMotionData ( s32 index) const
protected

モーションアドレスを取得

Parameters
index[in] インデックス
Returns
モーションアドレス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMotionFrameCount()

u16 GxMotionPlayer::getMotionFrameCount ( u32 motionNumber) const

指定モーションのフレーム数を取得

Parameters
motionNumber[in] モーション番号
Returns
モーションのフレーム数
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void GxMotionPlayer::initialize ( GxResMotionPackage * pResource)

初期化

Parameters
pResource[in] リソース
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isFinish()

b32 GxMotionPlayer::isFinish ( void ) const

終了判定

Returns
再生終了ならtrue
Here is the call graph for this function:

◆ isFinishNextFrame()

b32 GxMotionPlayer::isFinishNextFrame ( void ) const

次のフレームの終了判定

Returns
終了ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLoopTiming()

b32 GxMotionPlayer::isLoopTiming ( void ) const

setFrame()が前回呼び出された時、ループしたかを判断 - setFrame()を呼び出した後、setMotionNumber()、setSpeed()を呼び出した場合、戻り値が無効になります。

Returns
ループならtrue

◆ loadBasepose()

b32 GxMotionPlayer::loadBasepose ( void const * pBasePoseData)
protected

ベースポーズのロードと関節行列のアロケート

Parameters
pBasePoseData[in] ベースポーズのローデータ
Returns
常にtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFrame()

void GxMotionPlayer::setFrame ( f32 frame)

現在のフレーム数を設定

Parameters
frame[in] フレーム
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMotionNumber()

void GxMotionPlayer::setMotionNumber ( s32 motionNumber)

モーション番号を設定 - 有効な番号か確認しない - フレームを0.fにリセット

Parameters
motionNumber[in] モーション番号
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPlaybackFlag()

void GxMotionPlayer::setPlaybackFlag ( MOTION_PLAYBACK_FLAG flag,
b32 value )

一つだけの再生フラグを設定

Parameters
flag[in] 再生フラグ
value[in] 値
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPlaybackFlags()

void GxMotionPlayer::setPlaybackFlags ( u32 playbackFlags)

再生フラグを設定

Parameters
playbackFlags[in] 再生フラグ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTranslateRotateEulerToOneJoint()

const f32 * GxMotionPlayer::setTranslateRotateEulerToOneJoint ( GxMotionJointData * pJointToSet,
f32 const * pMotionDataReader,
b32 isRootLocator )
protected

関節に位置と回転値を設定

Parameters
pJointToSet[in/out] 設定したい関節
pMotionDataReader[in] モーションカーブのデータ
isRootLocator[in] ルートロケーターかどうか
Returns
モーションデータで次の値に更新されたポインタ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTranslateRotateQuatToOneJoint()

void GxMotionPlayer::setTranslateRotateQuatToOneJoint ( GxMotionCurvesContainerQuaternion * pMotionCurvesContainerQuaternion,
u32 jointIndex )
protected

関節に位置と回転値を設定

Parameters
pMotionCurvesContainerQuaternion[in] カーブコンテナの回転
jointIndex[in] 関節インデックス
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateJointLocalData()

void GxMotionPlayer::updateJointLocalData ( void )

モーションの関節のローカルデータを更新

Note
GMPパッケージの中には、IK設定を使ったとき、IKにきく関節の通常ローカル移動値、回転値は入っていないです!
と言うことは、この関数が呼ばれた後、IKが利く関節(中関節とエフェクタ関節)のローカルデータはここで更新
されていません(エフェクタのターゲットのみ更新されます)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateJointMatrices()

void GxMotionPlayer::updateJointMatrices ( u32 jointStartNumber,
u32 jointCount )

各関節のモーションマトリクスを更新

Parameters
jointStartNumber[in] 開始関節番号
jointCount[in] 関節数
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateJointMatricesNoIK()

void GxMotionPlayer::updateJointMatricesNoIK ( u32 jointStartNumber,
u32 jointCount )

各関節のモーションマトリクスを更新(IK計算なし)

Parameters
jointStartNumber[in] 開始関節番号
jointCount[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: