2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-05 01:51:25 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/CFactoryMgr.hpp"
|
|
|
|
#include "Runtime/Character/CSkinBank.hpp"
|
2022-02-01 00:06:54 +00:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2016-04-09 23:19:17 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2016-08-21 20:39:18 +00:00
|
|
|
class CPoseAsTransforms;
|
2017-08-21 05:46:59 +00:00
|
|
|
class CModel;
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct SSkinWeighting {
|
2022-02-01 00:06:54 +00:00
|
|
|
CSegId x0_id;
|
|
|
|
float x4_weight;
|
2022-02-18 07:37:54 +00:00
|
|
|
explicit SSkinWeighting(CInputStream& in) : x0_id(in), x4_weight(in.ReadFloat()) {}
|
2017-08-21 05:46:59 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CVirtualBone {
|
2022-02-01 00:06:54 +00:00
|
|
|
rstl::reserved_vector<SSkinWeighting, 3> x0_weights;
|
|
|
|
u32 x1c_vertexCount;
|
|
|
|
zeus::CTransform x20_xf;
|
|
|
|
zeus::CMatrix3f x50_mtx;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2017-08-21 05:46:59 +00:00
|
|
|
public:
|
2022-02-01 00:06:54 +00:00
|
|
|
explicit CVirtualBone(CInputStream& in);
|
|
|
|
|
|
|
|
[[nodiscard]] const rstl::reserved_vector<SSkinWeighting, 3>& GetWeights() const { return x0_weights; }
|
2017-08-21 05:46:59 +00:00
|
|
|
};
|
2016-04-05 01:51:25 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CSkinRules {
|
2022-02-01 00:06:54 +00:00
|
|
|
std::vector<CVirtualBone> x0_bones;
|
2022-02-21 00:03:38 +00:00
|
|
|
u32 x10_vertexCount = 0;
|
|
|
|
u32 x14_normalCount = 0;
|
2017-08-21 05:46:59 +00:00
|
|
|
|
2016-04-09 23:19:17 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
explicit CSkinRules(CInputStream& in);
|
2017-08-21 05:46:59 +00:00
|
|
|
|
2022-02-01 00:06:54 +00:00
|
|
|
// void GetBankTransforms(std::vector<const zeus::CTransform*>& out, const CPoseAsTransforms& pose,
|
|
|
|
// int skinBankIdx) const {
|
|
|
|
// // FIXME: This is definitely not proper behavior, this is here to fix the phazon suit crashing
|
|
|
|
// if (x0_skinBanks.size() <= skinBankIdx) {
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// x0_skinBanks[skinBankIdx].GetBankTransforms(out, pose);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// void TransformVerticesCPU(std::vector<std::pair<zeus::CVector3f, zeus::CVector3f>>& vnOut,
|
|
|
|
// const CPoseAsTransforms& pose, const CModel& model) const;
|
2016-04-05 01:51:25 +00:00
|
|
|
};
|
|
|
|
|
2016-09-02 19:32:57 +00:00
|
|
|
CFactoryFnReturn FSkinRulesFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& params,
|
|
|
|
CObjectReference* selfRef);
|
2016-04-12 22:28:08 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|