2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CANIMDATA
|
|
|
|
#define _CANIMDATA
|
2022-08-13 01:26:00 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-08-14 18:38:41 +00:00
|
|
|
#include "MetroidPrime/CAdditiveAnimPlayback.hpp"
|
|
|
|
#include "MetroidPrime/CAnimPlaybackParms.hpp"
|
|
|
|
#include "MetroidPrime/CCharacterInfo.hpp"
|
|
|
|
#include "MetroidPrime/CHierarchyPoseBuilder.hpp"
|
|
|
|
#include "MetroidPrime/CPOINode.hpp"
|
|
|
|
#include "MetroidPrime/CParticleDatabase.hpp"
|
|
|
|
#include "MetroidPrime/CPoseAsTransforms.hpp"
|
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
#include "Kyoto/Animation/CSkinnedModel.hpp"
|
2022-09-18 06:05:46 +00:00
|
|
|
#include "Kyoto/TToken.hpp"
|
2022-08-14 18:38:41 +00:00
|
|
|
|
|
|
|
#include "rstl/reserved_vector.hpp"
|
|
|
|
|
|
|
|
class CAnimationManager;
|
|
|
|
class CAnimSysContext;
|
|
|
|
class CAnimTreeNode;
|
|
|
|
class CCharacterFactory;
|
|
|
|
class CCharLayoutInfo;
|
|
|
|
class CSkinnedModel;
|
|
|
|
class CSkinnedModelWithAvgNormals;
|
|
|
|
class CTransitionManager;
|
|
|
|
|
2022-08-13 01:26:00 +00:00
|
|
|
class CAnimData {
|
2022-08-14 18:38:41 +00:00
|
|
|
public:
|
|
|
|
enum EAnimDir {
|
|
|
|
kAD_Forward,
|
|
|
|
kAD_Backward,
|
|
|
|
};
|
|
|
|
|
2022-08-16 02:14:28 +00:00
|
|
|
void PreRender();
|
2022-09-18 05:55:13 +00:00
|
|
|
void EnableLooping(bool v) {
|
|
|
|
x220_25_loop = v;
|
|
|
|
x220_24_animating = true;
|
|
|
|
}
|
2022-09-18 06:05:46 +00:00
|
|
|
void SetIsAnimating(bool v) { x220_24_animating = v; }
|
2022-10-28 21:42:35 +00:00
|
|
|
void SetParticleEffectState(const rstl::string& name, bool active, CStateManager& mgr);
|
2022-08-14 18:38:41 +00:00
|
|
|
|
2022-09-05 04:01:13 +00:00
|
|
|
int GetCharacterIndex() const { return x204_charIdx; }
|
2022-10-09 05:37:23 +00:00
|
|
|
float GetAverageVelocity(int idx) const;
|
2022-08-14 18:38:41 +00:00
|
|
|
|
2022-09-05 04:01:13 +00:00
|
|
|
const CBoolPOINode* GetBoolPOIList(int& count) const {
|
2022-08-14 18:38:41 +00:00
|
|
|
count = x20c_passedBoolCount;
|
|
|
|
return mBoolPOINodes.data();
|
|
|
|
}
|
2022-09-05 04:01:13 +00:00
|
|
|
const CInt32POINode* GetInt32POIList(int& count) const {
|
2022-08-14 18:38:41 +00:00
|
|
|
count = x210_passedIntCount;
|
|
|
|
return mInt32POINodes.data();
|
|
|
|
}
|
2022-09-05 04:01:13 +00:00
|
|
|
const CParticlePOINode* GetParticlePOIList(int& count) const {
|
2022-08-14 18:38:41 +00:00
|
|
|
count = x214_passedParticleCount;
|
|
|
|
return mParticlePOINodes.data();
|
|
|
|
}
|
2022-09-05 04:01:13 +00:00
|
|
|
const CSoundPOINode* GetSoundPOIList(int& count) const {
|
2022-08-14 18:38:41 +00:00
|
|
|
count = x218_passedSoundCount;
|
|
|
|
return mSoundPOINodes.data();
|
|
|
|
}
|
2022-09-13 04:26:54 +00:00
|
|
|
CParticleDatabase& GetParticleDB() { return x120_particleDB; }
|
|
|
|
const CParticleDatabase& GetParticleDB() const { return x120_particleDB; }
|
2022-08-14 18:38:41 +00:00
|
|
|
// SetIsAnimating__9CAnimDataFb
|
|
|
|
// SetAnimDir__9CAnimDataFQ29CAnimData8EAnimDir
|
|
|
|
// GetBoundingBox__9CAnimDataCFv
|
|
|
|
// GetBoundingBox__9CAnimDataCFRC12CTransform4f
|
|
|
|
// GetLocatorSegId__9CAnimDataCFRCQ24rstl66basic_string
|
|
|
|
// ResetPOILists__9CAnimDataFv
|
|
|
|
// GetAverageVelocity__9CAnimDataCFi
|
|
|
|
// AdvanceParticles__9CAnimDataFRC12CTransform4ffRC9CVector3fR13CStateManager
|
|
|
|
// PoseSkinnedModel__9CAnimDataCFRC13CSkinnedModelRC17CPoseAsTransformsRCQ24rstl37optional_object<18CVertexMorphEffect>PCf
|
|
|
|
// DrawSkinnedModel__9CAnimDataCFRC13CSkinnedModelRC11CModelFlags
|
|
|
|
// InitializeCache__9CAnimDataFv
|
|
|
|
// FreeCache__9CAnimDataFv
|
|
|
|
// SetInfraModel__9CAnimDataFRC21TLockedToken<6CModel>RC26TLockedToken<10CSkinRules>
|
|
|
|
// SetXRayModel__9CAnimDataFRC21TLockedToken<6CModel>RC26TLockedToken<10CSkinRules>
|
|
|
|
// AdvanceAnim__9CAnimDataFR13CCharAnimTimeR9CVector3fR11CQuaternion
|
|
|
|
// AdvanceIgnoreParticles__9CAnimDataFfR9CRandom16b
|
|
|
|
// Advance__9CAnimDataFfRC9CVector3fR13CStateManagerb
|
|
|
|
// DoAdvance__9CAnimDataFfRbR9CRandom16b
|
2022-10-05 18:05:56 +00:00
|
|
|
void SetAnimation(const CAnimPlaybackParms& parms, bool noTrans);
|
2022-08-14 18:38:41 +00:00
|
|
|
// GetAnimationPrimitives__9CAnimDataCFRC18CAnimPlaybackParmsRQ24rstl72set<10CPrimitive,Q24rstl18less<10CPrimitive>,Q24rstl17rmemory_allocator>
|
|
|
|
// PrimitiveSetToTokenVector__9CAnimDataFRCQ24rstl72set<10CPrimitive,Q24rstl18less<10CPrimitive>,Q24rstl17rmemory_allocator>RQ24rstl42vector<6CToken,Q24rstl17rmemory_allocator>b
|
|
|
|
// BuildPose__9CAnimDataFv
|
|
|
|
// PreRender__9CAnimDataFv
|
|
|
|
// SetupRender__9CAnimDataCFRC13CSkinnedModelRCQ24rstl37optional_object<18CVertexMorphEffect>PCf
|
|
|
|
// Render__9CAnimDataCFRC13CSkinnedModelRC11CModelFlagsRCQ24rstl37optional_object<18CVertexMorphEffect>PCf
|
|
|
|
// RenderAuxiliary__9CAnimDataCFRC14CFrustumPlanes
|
|
|
|
// RecalcPoseBuilder__9CAnimDataCFPC13CCharAnimTime
|
2022-10-03 11:55:03 +00:00
|
|
|
float GetAnimationDuration(int animIn) const;
|
2022-08-14 18:38:41 +00:00
|
|
|
// GetAnimTimeRemaining__9CAnimDataCFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>
|
|
|
|
// IsAnimTimeRemaining__9CAnimDataCFfRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>
|
2022-10-06 20:34:27 +00:00
|
|
|
bool IsAnimTimeRemaining(float, const rstl::string&) const;
|
2022-08-14 18:38:41 +00:00
|
|
|
// GetLocatorTransform__9CAnimDataCFRCQ24rstl66basic_string<c,Q24rstl14char_traits<c>,Q24rstl17rmemory_allocator>PC13CCharAnimTime
|
|
|
|
// GetLocatorTransform__9CAnimDataCF6CSegIdPC13CCharAnimTime
|
|
|
|
// CalcPlaybackAlignmentParms__9CAnimDataFRC18CAnimPlaybackParmsRCQ24rstl25ncrc_ptr<13CAnimTreeNode>
|
|
|
|
// SetRandomPlaybackRate__9CAnimDataFR9CRandom16
|
2022-10-03 11:55:03 +00:00
|
|
|
void SetPlaybackRate(float set);
|
2022-10-20 15:43:17 +00:00
|
|
|
void MultiplyPlaybackRate(float scale);
|
2022-08-14 18:38:41 +00:00
|
|
|
// GetTimeOfUserEvent__9CAnimDataCF14EUserEventTypeRC13CCharAnimTime
|
|
|
|
// GetAdvancementDeltas__9CAnimDataCFRC13CCharAnimTimeRC13CCharAnimTime
|
|
|
|
// Touch__9CAnimDataCFRC13CSkinnedModeli
|
|
|
|
// InitializeEffects__9CAnimDataFR13CStateManagerRC9CVector3f
|
|
|
|
// SetPhase__9CAnimDataFf -> SetPhase__11IAnimReaderFf
|
2022-10-03 11:55:03 +00:00
|
|
|
void SetPhase(float ph);
|
2022-10-14 13:36:01 +00:00
|
|
|
void AddAdditiveAnimation(uint idx, float weight, bool active, bool fadeOut);
|
2022-10-28 12:33:10 +00:00
|
|
|
void DelAdditiveAnimation(uint idx);
|
2022-11-10 23:23:57 +00:00
|
|
|
bool IsAdditiveAnimation(uint idx) const;
|
2022-10-14 13:36:01 +00:00
|
|
|
const rstl::rc_ptr<CAnimTreeNode>& GetAdditiveAnimationTree(uint idx) const;
|
2022-08-14 18:38:41 +00:00
|
|
|
// GetAnimationTree__9CAnimDataCFv
|
|
|
|
// AnimationTree__9CAnimDataFv
|
|
|
|
// IsAdditiveAnimation__9CAnimDataCFUi
|
2022-10-28 12:33:10 +00:00
|
|
|
bool IsAdditiveAnimationAdded(uint idx) const;
|
2022-08-14 18:38:41 +00:00
|
|
|
// UpdateAdditiveAnims__9CAnimDataFf
|
|
|
|
// AdvanceAdditiveAnims__9CAnimDataFf
|
|
|
|
// AddAdditiveSegData__9CAnimDataCFRC10CSegIdListR16CSegStatementSet
|
|
|
|
// GetEventResourceIdForAnimResourceId__9CAnimDataCFi
|
|
|
|
// GetAnimationManager__9CAnimDataFv
|
|
|
|
// SetPoseValid__9CAnimDataFb
|
|
|
|
|
2022-11-10 18:50:42 +00:00
|
|
|
float GetAdditiveAnimationWeight(uint idx);
|
|
|
|
|
2022-10-09 05:37:23 +00:00
|
|
|
short GetDefaultAnimation() const { return x208_defaultAnim; }
|
2022-10-06 21:07:41 +00:00
|
|
|
const CCharacterInfo& GetCharacterInfo() const { return xc_charInfo; }
|
2022-08-14 18:38:41 +00:00
|
|
|
// GetCharLayoutInfo__9CAnimDataCFv
|
|
|
|
// GetDeltaRotation__9CAnimDataCFv
|
|
|
|
// GetDeltaOffset__9CAnimDataCFv
|
|
|
|
// IsDeltaOffsetInUse__9CAnimDataCFv
|
|
|
|
// GetAdvancementDeltas__19CAdvancementResultsCFv
|
|
|
|
// SetDeltaRotation__9CAnimDataFRC11CQuaternionb
|
|
|
|
// SetDeltaOffset__9CAnimDataFRC9CVector3fb
|
|
|
|
// SetDeltaOffsetInUse__9CAnimDataFv
|
|
|
|
// IsDeltaRotationInUse__9CAnimDataCFv
|
|
|
|
// IsDeltaOffsetPrimed__9CAnimDataCFv
|
|
|
|
// GetAnimDir__9CAnimDataCFv
|
|
|
|
// GetIsLoop__9CAnimDataCFv
|
|
|
|
// IsAnimating__9CAnimDataCFv
|
|
|
|
// SetPoseBuilderValid__9CAnimDataFb
|
|
|
|
// GetAnimationManager__9CAnimDataCFv
|
|
|
|
// GetPoseValid__9CAnimDataCFv
|
|
|
|
// GetPoseBuilderValid__9CAnimDataCFv
|
|
|
|
// GetAnimSysContext__9CAnimDataCFv
|
|
|
|
// CacheInt32PoiList__9CAnimDataFRC13CCharAnimTimeiRCQ24rstl25ncrc_ptr<13CAnimTreeNode>
|
|
|
|
|
|
|
|
// GetIceModel__9CAnimDataCFv
|
|
|
|
// GetPASDatabase__9CAnimDataCFv
|
|
|
|
// EnableLooping__9CAnimDataFb
|
|
|
|
// GetCurrentAnimation__9CAnimDataCFv
|
|
|
|
// GetSkinnedModel__9CAnimDataCFv
|
|
|
|
// GetXRayModel__9CAnimDataCFv
|
|
|
|
// GetInfraModel__9CAnimDataCFv
|
|
|
|
// GetPose__9CAnimDataCFv
|
|
|
|
// PoseBuilder__9CAnimDataCFv
|
|
|
|
// GetPlaybackRate__9CAnimDataCFv
|
|
|
|
// Pose__9CAnimDataFv
|
|
|
|
// GetPoseBuilder__9CAnimDataCFv
|
|
|
|
|
|
|
|
// CacheSoundPoiList__9CAnimDataFRCQ24rstl25ncrc_ptr<13CAnimTreeNode>RC13CCharAnimTimei
|
|
|
|
// CacheParticlePoiList__9CAnimDataFRCQ24rstl25ncrc_ptr<13CAnimTreeNode>RC13CCharAnimTimei
|
|
|
|
// CacheBoolPoiList__9CAnimDataFRCQ24rstl25ncrc_ptr<13CAnimTreeNode>RC13CCharAnimTimei
|
|
|
|
// CacheInt32PoiList__9CAnimDataFRCQ24rstl25ncrc_ptr<13CAnimTreeNode>RC13CCharAnimTimei
|
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
static void InitializeCache();
|
|
|
|
static void FreeCache();
|
|
|
|
|
2022-08-14 18:38:41 +00:00
|
|
|
private:
|
|
|
|
TLockedToken< CCharacterFactory > x0_charFactory;
|
|
|
|
CCharacterInfo xc_charInfo;
|
|
|
|
TLockedToken< CCharLayoutInfo > xcc_layoutData;
|
|
|
|
TLockedToken< CSkinnedModel > xd8_modelData;
|
|
|
|
rstl::optional_object< TLockedToken< CSkinnedModelWithAvgNormals > > xe4_iceModelData;
|
|
|
|
rstl::rc_ptr< CSkinnedModel > xf4_xrayModel;
|
|
|
|
rstl::rc_ptr< CSkinnedModel > xf8_infraModel;
|
|
|
|
rstl::rc_ptr< CAnimSysContext > xfc_animCtx;
|
|
|
|
rstl::rc_ptr< CAnimationManager > x100_animMgr;
|
|
|
|
EAnimDir x104_animDir;
|
|
|
|
CAABox x108_aabb;
|
|
|
|
CParticleDatabase x120_particleDB;
|
|
|
|
CAssetId x1d8_selfId;
|
|
|
|
CVector3f x1dc_alignPos;
|
|
|
|
CQuaternion x1e8_alignRot;
|
|
|
|
rstl::rc_ptr< CAnimTreeNode > x1f8_animRoot;
|
|
|
|
rstl::rc_ptr< CTransitionManager > x1fc_transMgr;
|
2022-10-09 05:37:23 +00:00
|
|
|
float x200_speedScale;
|
2022-09-05 04:01:13 +00:00
|
|
|
int x204_charIdx;
|
2022-10-09 05:37:23 +00:00
|
|
|
short x208_defaultAnim;
|
|
|
|
short x20a_padding;
|
2022-09-05 04:01:13 +00:00
|
|
|
int x20c_passedBoolCount;
|
|
|
|
int x210_passedIntCount;
|
|
|
|
int x214_passedParticleCount;
|
|
|
|
int x218_passedSoundCount;
|
|
|
|
int x21c_particleLightIdx;
|
2022-10-09 05:37:23 +00:00
|
|
|
uchar x220_24_animating : 1;
|
|
|
|
uchar x220_25_loop : 1;
|
|
|
|
uchar x220_26_aligningPos : 1;
|
|
|
|
uchar x220_27_ : 1;
|
|
|
|
uchar x220_28_ : 1;
|
|
|
|
uchar x220_29_animationJustStarted : 1;
|
|
|
|
uchar x220_30_poseBuilt : 1;
|
|
|
|
uchar x220_31_poseCached : 1;
|
2022-08-14 18:38:41 +00:00
|
|
|
CPoseAsTransforms x224_pose;
|
|
|
|
CHierarchyPoseBuilder x2fc_poseBuilder;
|
|
|
|
CAnimPlaybackParms x40c_playbackParms;
|
2022-09-05 04:01:13 +00:00
|
|
|
rstl::reserved_vector< rstl::pair< int, CAdditiveAnimPlayback >, 8 > x434_additiveAnims;
|
2022-08-14 18:38:41 +00:00
|
|
|
|
|
|
|
static rstl::reserved_vector< CBoolPOINode, 8 > mBoolPOINodes;
|
|
|
|
static rstl::reserved_vector< CInt32POINode, 16 > mInt32POINodes;
|
|
|
|
static rstl::reserved_vector< CParticlePOINode, 20 > mParticlePOINodes;
|
|
|
|
static rstl::reserved_vector< CSoundPOINode, 20 > mSoundPOINodes;
|
|
|
|
// in cpp -> rstl::reserved_vector< CInt32POINode, 16 > sInt32TransientCache;
|
2022-08-13 01:26:00 +00:00
|
|
|
};
|
2022-08-14 18:38:41 +00:00
|
|
|
CHECK_SIZEOF(CAnimData, 0x434 + 0x144)
|
2022-08-13 01:26:00 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CANIMDATA
|