2016-04-11 03:59:54 +00:00
|
|
|
#include "IAnimReader.hpp"
|
|
|
|
#include "CCharAnimTime.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
2018-01-04 04:17:44 +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)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-04-11 07:47:21 +00:00
|
|
|
SAdvancementResults
|
|
|
|
IAnimReader::VGetAdvancementResults(const CCharAnimTime& a, const CCharAnimTime& b) const
|
2016-04-11 03:59:54 +00:00
|
|
|
{
|
|
|
|
SAdvancementResults ret;
|
2016-04-11 07:10:28 +00:00
|
|
|
ret.x0_remTime = a;
|
2016-04-11 03:59:54 +00:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-04-11 07:47:21 +00:00
|
|
|
u32 IAnimReader::GetBoolPOIList(const CCharAnimTime& time, CBoolPOINode* listOut,
|
|
|
|
u32 capacity, u32 iterator, u32 unk) const
|
2016-04-11 07:10:28 +00:00
|
|
|
{
|
2016-04-11 07:47:21 +00:00
|
|
|
if (time.GreaterThanZero())
|
|
|
|
return VGetBoolPOIList(time, listOut, capacity, iterator, unk);
|
|
|
|
return 0;
|
2016-04-11 07:10:28 +00:00
|
|
|
}
|
|
|
|
|
2016-04-11 07:47:21 +00:00
|
|
|
u32 IAnimReader::GetInt32POIList(const CCharAnimTime& time, CInt32POINode* listOut,
|
|
|
|
u32 capacity, u32 iterator, u32 unk) const
|
2016-04-11 07:10:28 +00:00
|
|
|
{
|
2016-04-11 07:47:21 +00:00
|
|
|
if (time.GreaterThanZero())
|
|
|
|
return VGetInt32POIList(time, listOut, capacity, iterator, unk);
|
|
|
|
return 0;
|
2016-04-11 07:10:28 +00:00
|
|
|
}
|
|
|
|
|
2016-04-11 07:47:21 +00:00
|
|
|
u32 IAnimReader::GetParticlePOIList(const CCharAnimTime& time, CParticlePOINode* listOut,
|
|
|
|
u32 capacity, u32 iterator, u32 unk) const
|
2016-04-11 07:10:28 +00:00
|
|
|
{
|
2016-04-11 07:47:21 +00:00
|
|
|
if (time.GreaterThanZero())
|
|
|
|
return VGetParticlePOIList(time, listOut, capacity, iterator, unk);
|
|
|
|
return 0;
|
2016-04-11 07:10:28 +00:00
|
|
|
}
|
|
|
|
|
2016-04-11 07:47:21 +00:00
|
|
|
u32 IAnimReader::GetSoundPOIList(const CCharAnimTime& time, CSoundPOINode* listOut,
|
|
|
|
u32 capacity, u32 iterator, u32 unk) const
|
2016-04-11 07:10:28 +00:00
|
|
|
{
|
2016-04-11 07:47:21 +00:00
|
|
|
if (time.GreaterThanZero())
|
|
|
|
return VGetSoundPOIList(time, listOut, capacity, iterator, unk);
|
|
|
|
return 0;
|
2016-04-11 07:10:28 +00:00
|
|
|
}
|
|
|
|
|
2016-04-11 03:59:54 +00:00
|
|
|
}
|