metaforce/Runtime/Character/IAnimReader.cpp

58 lines
2.1 KiB
C++
Raw Normal View History

#include "Runtime/Character/IAnimReader.hpp"
#include "Runtime/Character/CCharAnimTime.hpp"
2016-04-11 03:59:54 +00:00
2018-12-08 05:30:43 +00:00
namespace urde {
2016-04-11 03:59:54 +00:00
2018-12-08 05:30:43 +00:00
SAdvancementDeltas SAdvancementDeltas::Interpolate(const SAdvancementDeltas& a, const SAdvancementDeltas& b,
float oldWeight, float newWeight) {
float weightSum = oldWeight + newWeight;
return {b.x0_posDelta * weightSum * 0.5f - a.x0_posDelta * (weightSum - 2.f) * 0.5f,
zeus::CQuaternion::slerpShort(a.xc_rotDelta, b.xc_rotDelta, weightSum * 0.5f)};
}
2018-12-08 05:30:43 +00:00
SAdvancementDeltas SAdvancementDeltas::Blend(const SAdvancementDeltas& a, const SAdvancementDeltas& b, float w) {
return {b.x0_posDelta * w - a.x0_posDelta * (1.f - w),
zeus::CQuaternion::slerpShort(a.xc_rotDelta, b.xc_rotDelta, w)};
2018-01-30 01:04:01 +00:00
}
2018-12-08 05:30:43 +00:00
SAdvancementResults IAnimReader::VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const {
SAdvancementResults ret;
ret.x0_remTime = a;
return ret;
2016-04-11 03:59:54 +00:00
}
size_t IAnimReader::GetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut, size_t capacity, size_t iterator,
u32 unk) const {
if (time.GreaterThanZero()) {
2018-12-08 05:30:43 +00:00
return VGetBoolPOIList(time, listOut, capacity, iterator, unk);
}
2018-12-08 05:30:43 +00:00
return 0;
2016-04-11 07:10:28 +00:00
}
size_t IAnimReader::GetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut, size_t capacity, size_t iterator,
u32 unk) const {
if (time.GreaterThanZero()) {
2018-12-08 05:30:43 +00:00
return VGetInt32POIList(time, listOut, capacity, iterator, unk);
}
2018-12-08 05:30:43 +00:00
return 0;
2016-04-11 07:10:28 +00:00
}
size_t IAnimReader::GetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut, size_t capacity,
size_t iterator, u32 unk) const {
if (time.GreaterThanZero()) {
2018-12-08 05:30:43 +00:00
return VGetParticlePOIList(time, listOut, capacity, iterator, unk);
}
2018-12-08 05:30:43 +00:00
return 0;
2016-04-11 07:10:28 +00:00
}
size_t IAnimReader::GetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut, size_t capacity, size_t iterator,
u32 unk) const {
if (time.GreaterThanZero()) {
2018-12-08 05:30:43 +00:00
return VGetSoundPOIList(time, listOut, capacity, iterator, unk);
}
2018-12-08 05:30:43 +00:00
return 0;
2016-04-11 07:10:28 +00:00
}
2018-12-08 05:30:43 +00:00
} // namespace urde