2020-01-15 07:07:48 -05:00
|
|
|
#include "Runtime/Character/CSegStatementSet.hpp"
|
|
|
|
|
|
|
|
|
|
#include "Runtime/Character/CCharLayoutInfo.hpp"
|
|
|
|
|
#include "Runtime/Character/CSegIdList.hpp"
|
2016-04-15 17:24:25 -10:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2016-04-15 17:24:25 -10:00
|
|
|
|
2018-12-07 19:30:43 -10:00
|
|
|
void CSegStatementSet::Add(const CSegIdList& list, const CCharLayoutInfo& layout, const CSegStatementSet& other,
|
|
|
|
|
float weight) {
|
|
|
|
|
for (const CSegId& id : list.GetList()) {
|
|
|
|
|
x4_segData[id].x0_rotation *=
|
2019-02-23 21:15:54 -10:00
|
|
|
zeus::CQuaternion::slerp(zeus::CQuaternion(), other.x4_segData[id].x0_rotation, weight);
|
2018-12-07 19:30:43 -10:00
|
|
|
if (other.x4_segData[id].x1c_hasOffset && x4_segData[id].x1c_hasOffset) {
|
|
|
|
|
zeus::CVector3f off = other.x4_segData[id].x10_offset - layout.GetFromParentUnrotated(id);
|
|
|
|
|
x4_segData[id].x10_offset += off * weight;
|
2016-04-15 17:24:25 -10:00
|
|
|
}
|
2018-12-07 19:30:43 -10:00
|
|
|
}
|
2016-04-15 17:24:25 -10:00
|
|
|
}
|
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|