mirror of https://github.com/PrimeDecomp/prime.git
Minor CActor/CModelData fixes, add matching CActor::UpdateAnimation
Former-commit-id: 8e90988b5c
This commit is contained in:
parent
94e27faee8
commit
9675db47b4
|
@ -246,8 +246,9 @@ public:
|
||||||
bool GetMuted() const { return xe5_26_muted; }
|
bool GetMuted() const { return xe5_26_muted; }
|
||||||
bool HasAnimation() const { return x64_modelData && x64_modelData->GetAnimationData(); }
|
bool HasAnimation() const { return x64_modelData && x64_modelData->GetAnimationData(); }
|
||||||
bool HasModelData() const { return x64_modelData && (x64_modelData->GetAnimationData() || x64_modelData->HasNormalModel()); }
|
bool HasModelData() const { return x64_modelData && (x64_modelData->GetAnimationData() || x64_modelData->HasNormalModel()); }
|
||||||
CModelData* GetModelData() const { return x64_modelData.get(); }
|
CModelData* ModelData() { return x64_modelData.get(); }
|
||||||
CAnimData* AnimationData() { return GetModelData()->GetAnimationData(); }
|
const CModelData* GetModelData() const { return x64_modelData.get(); }
|
||||||
|
CAnimData* AnimationData() { return ModelData()->AnimationData(); }
|
||||||
const CAnimData* GetAnimationData() const { return GetModelData()->GetAnimationData(); }
|
const CAnimData* GetAnimationData() const { return GetModelData()->GetAnimationData(); }
|
||||||
f32 GetAverageAnimVelocity(s32 anim);
|
f32 GetAverageAnimVelocity(s32 anim);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,8 @@ public:
|
||||||
SAdvancementDeltas AdvanceAnimation(float dt, CStateManager& mgr, TAreaId aid, bool advTree);
|
SAdvancementDeltas AdvanceAnimation(float dt, CStateManager& mgr, TAreaId aid, bool advTree);
|
||||||
void AdvanceParticles(const CTransform4f& xf, float dt, CStateManager& mgr);
|
void AdvanceParticles(const CTransform4f& xf, float dt, CStateManager& mgr);
|
||||||
|
|
||||||
CAnimData* GetAnimationData() const { return xc_animData.get(); }
|
const CAnimData* GetAnimationData() const { return xc_animData.get(); }
|
||||||
|
CAnimData* AnimationData() { return xc_animData.get(); }
|
||||||
CAABox GetBounds(const CTransform4f& xf) const;
|
CAABox GetBounds(const CTransform4f& xf) const;
|
||||||
CAABox GetBounds() const;
|
CAABox GetBounds() const;
|
||||||
|
|
||||||
|
@ -63,4 +64,4 @@ private:
|
||||||
rstl::optional_object< TCachedToken< CModel > > x3c_infraModel;
|
rstl::optional_object< TCachedToken< CModel > > x3c_infraModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -88,10 +88,9 @@ CActor::CActor(TUniqueId uid, bool active, const rstl::string& name, const CEnti
|
||||||
|
|
||||||
CActor::~CActor() { RemoveEmitter(); }
|
CActor::~CActor() { RemoveEmitter(); }
|
||||||
|
|
||||||
// TODO nonmatching https://decomp.me/scratch/hQjHM
|
|
||||||
SAdvancementDeltas CActor::UpdateAnimation(float dt, CStateManager& mgr, bool advTree) {
|
SAdvancementDeltas CActor::UpdateAnimation(float dt, CStateManager& mgr, bool advTree) {
|
||||||
SAdvancementDeltas result = GetModelData()->AdvanceAnimation(dt, mgr, GetAreaId(), advTree);
|
SAdvancementDeltas result = ModelData()->AdvanceAnimation(dt, mgr, GetAreaId(), advTree);
|
||||||
GetModelData()->AdvanceParticles(GetTransform(), dt, mgr);
|
ModelData()->AdvanceParticles(GetTransform(), dt, mgr);
|
||||||
UpdateSfxEmitters();
|
UpdateSfxEmitters();
|
||||||
if (HasAnimation()) {
|
if (HasAnimation()) {
|
||||||
u16 maxVol = xd4_maxVol;
|
u16 maxVol = xd4_maxVol;
|
||||||
|
@ -101,8 +100,11 @@ SAdvancementDeltas CActor::UpdateAnimation(float dt, CStateManager& mgr, bool ad
|
||||||
const CVector3f origin = GetTranslation();
|
const CVector3f origin = GetTranslation();
|
||||||
const CVector3f toCamera = camera->GetTranslation() - origin;
|
const CVector3f toCamera = camera->GetTranslation() - origin;
|
||||||
|
|
||||||
|
const CInt32POINode* intNode = nullptr;
|
||||||
|
const CSoundPOINode* soundNode = nullptr;
|
||||||
|
const CParticlePOINode* particleNode = nullptr;
|
||||||
|
|
||||||
s32 soundNodeCount = 0;
|
s32 soundNodeCount = 0;
|
||||||
const CSoundPOINode* soundNode;
|
|
||||||
if (HasAnimation()) {
|
if (HasAnimation()) {
|
||||||
soundNode = GetAnimationData()->GetSoundPOIList(soundNodeCount);
|
soundNode = GetAnimationData()->GetSoundPOIList(soundNodeCount);
|
||||||
} else {
|
} else {
|
||||||
|
@ -115,14 +117,12 @@ SAdvancementDeltas CActor::UpdateAnimation(float dt, CStateManager& mgr, bool ad
|
||||||
continue;
|
continue;
|
||||||
if (charIdx != -1 && GetAnimationData()->GetCharacterIndex() != charIdx)
|
if (charIdx != -1 && GetAnimationData()->GetCharacterIndex() != charIdx)
|
||||||
continue;
|
continue;
|
||||||
// if (soundNode->GetPoiType() == kPT_Sound && !GetMuted() && (charIdx == -1 || GetAnimationData()->GetCharacterIndex() == charIdx))
|
|
||||||
ProcessSoundEvent(soundNode->GetSoundId(), soundNode->GetWeight(), soundNode->GetFlags(), soundNode->GetFallOff(),
|
ProcessSoundEvent(soundNode->GetSoundId(), soundNode->GetWeight(), soundNode->GetFlags(), soundNode->GetFallOff(),
|
||||||
soundNode->GetMaxDistance(), 20, maxVol, toCamera, origin, aid, mgr, true);
|
soundNode->GetMaxDistance(), 20, maxVol, toCamera, origin, aid, mgr, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 intNodeCount = 0;
|
s32 intNodeCount = 0;
|
||||||
const CInt32POINode* intNode;
|
|
||||||
if (HasAnimation()) {
|
if (HasAnimation()) {
|
||||||
intNode = GetAnimationData()->GetInt32POIList(intNodeCount);
|
intNode = GetAnimationData()->GetInt32POIList(intNodeCount);
|
||||||
} else {
|
} else {
|
||||||
|
@ -142,7 +142,6 @@ SAdvancementDeltas CActor::UpdateAnimation(float dt, CStateManager& mgr, bool ad
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 particleNodeCount = 0;
|
s32 particleNodeCount = 0;
|
||||||
const CParticlePOINode* particleNode;
|
|
||||||
if (HasAnimation()) {
|
if (HasAnimation()) {
|
||||||
particleNode = GetAnimationData()->GetParticlePOIList(particleNodeCount);
|
particleNode = GetAnimationData()->GetParticlePOIList(particleNodeCount);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue