CAnimSourceReader: Fixes in VGetAdvancementResults, VAdvanceView, VReverseView

This commit is contained in:
Luke Street 2022-05-12 12:10:01 -04:00
parent cf952906b8
commit a9680126b9
2 changed files with 11 additions and 5 deletions

View File

@ -250,7 +250,7 @@ SAdvancementResults CAnimSourceReader::VGetAdvancementResults(const CCharAnimTim
if (x54_source->HasOffset(3)) { if (x54_source->HasOffset(3)) {
zeus::CVector3f ta = x54_source->GetOffset(3, prevTime); zeus::CVector3f ta = x54_source->GetOffset(3, prevTime);
zeus::CVector3f tb = x54_source->GetOffset(3, accum); zeus::CVector3f tb = x54_source->GetOffset(3, accum);
ret.x8_deltas.x0_posDelta = zeus::CMatrix3f(rb) * (tb - ta); ret.x8_deltas.x0_posDelta = zeus::CMatrix3f(rb.inverse()) * (tb - ta);
} }
return ret; return ret;
@ -274,6 +274,7 @@ SAdvancementResults CAnimSourceReader::VReverseView(const CCharAnimTime& dt) {
SAdvancementResults ret; SAdvancementResults ret;
if (xc_curTime.EqualsZero()) { if (xc_curTime.EqualsZero()) {
xc_curTime = x54_source->GetDuration();
ret.x0_remTime = dt; ret.x0_remTime = dt;
return ret; return ret;
} else if (dt.EqualsZero()) { } else if (dt.EqualsZero()) {
@ -298,7 +299,7 @@ SAdvancementResults CAnimSourceReader::VReverseView(const CCharAnimTime& dt) {
if (x54_source->HasOffset(3)) { if (x54_source->HasOffset(3)) {
zeus::CVector3f ta = x54_source->GetOffset(3, prevTime); zeus::CVector3f ta = x54_source->GetOffset(3, prevTime);
zeus::CVector3f tb = x54_source->GetOffset(3, xc_curTime); zeus::CVector3f tb = x54_source->GetOffset(3, xc_curTime);
ret.x8_deltas.x0_posDelta = zeus::CMatrix3f(rb) * (tb - ta); ret.x8_deltas.x0_posDelta = zeus::CMatrix3f(rb.inverse()) * (tb - ta);
} }
return ret; return ret;
@ -319,7 +320,12 @@ void CAnimSourceReader::VGetSegStatementSet(const CSegIdList& list, CSegStatemen
SAdvancementResults CAnimSourceReader::VAdvanceView(const CCharAnimTime& dt) { SAdvancementResults CAnimSourceReader::VAdvanceView(const CCharAnimTime& dt) {
SAdvancementResults ret; SAdvancementResults ret;
if (xc_curTime >= x54_source->GetDuration()) { if (xc_curTime == x54_source->GetDuration()) {
xc_curTime = {};
x14_passedBoolCount = 0;
x18_passedIntCount = 0;
x1c_passedParticleCount = 0;
x20_passedSoundCount = 0;
ret.x0_remTime = dt; ret.x0_remTime = dt;
return ret; return ret;
} else if (dt.EqualsZero()) { } else if (dt.EqualsZero()) {
@ -344,7 +350,7 @@ SAdvancementResults CAnimSourceReader::VAdvanceView(const CCharAnimTime& dt) {
if (x54_source->HasOffset(3)) { if (x54_source->HasOffset(3)) {
zeus::CVector3f ta = x54_source->GetOffset(3, prevTime); zeus::CVector3f ta = x54_source->GetOffset(3, prevTime);
zeus::CVector3f tb = x54_source->GetOffset(3, xc_curTime); zeus::CVector3f tb = x54_source->GetOffset(3, xc_curTime);
ret.x8_deltas.x0_posDelta = zeus::CMatrix3f(rb) * (tb - ta); ret.x8_deltas.x0_posDelta = zeus::CMatrix3f(rb.inverse()) * (tb - ta);
} }
return ret; return ret;

2
extern/zeus vendored

@ -1 +1 @@
Subproject commit f3e649716af215157b1d64a0f25de8e1d7f185fa Subproject commit 8e4dfb022a97aee2c245d8a2ec9b92ce3d865fbd