mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 08:27:42 +00:00
New code style refactor
This commit is contained in:
@@ -5,55 +5,50 @@
|
||||
#include "CSkinBank.hpp"
|
||||
#include "CFactoryMgr.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
class CPoseAsTransforms;
|
||||
class CModel;
|
||||
|
||||
struct SSkinWeighting
|
||||
{
|
||||
CSegId m_id;
|
||||
float m_weight;
|
||||
explicit SSkinWeighting(CInputStream& in)
|
||||
: m_id(in), m_weight(in.readFloatBig()) {}
|
||||
struct SSkinWeighting {
|
||||
CSegId m_id;
|
||||
float m_weight;
|
||||
explicit SSkinWeighting(CInputStream& in) : m_id(in), m_weight(in.readFloatBig()) {}
|
||||
};
|
||||
|
||||
class CVirtualBone
|
||||
{
|
||||
std::vector<SSkinWeighting> m_weights;
|
||||
public:
|
||||
explicit CVirtualBone(CInputStream& in)
|
||||
{
|
||||
u32 weightCount = in.readUint32Big();
|
||||
m_weights.reserve(weightCount);
|
||||
for (u32 i=0 ; i<weightCount ; ++i)
|
||||
m_weights.emplace_back(in);
|
||||
}
|
||||
class CVirtualBone {
|
||||
std::vector<SSkinWeighting> m_weights;
|
||||
|
||||
const std::vector<SSkinWeighting>& GetWeights() const { return m_weights; }
|
||||
public:
|
||||
explicit CVirtualBone(CInputStream& in) {
|
||||
u32 weightCount = in.readUint32Big();
|
||||
m_weights.reserve(weightCount);
|
||||
for (u32 i = 0; i < weightCount; ++i)
|
||||
m_weights.emplace_back(in);
|
||||
}
|
||||
|
||||
const std::vector<SSkinWeighting>& GetWeights() const { return m_weights; }
|
||||
};
|
||||
|
||||
class CSkinRules
|
||||
{
|
||||
std::vector<CSkinBank> x0_skinBanks;
|
||||
//u32 x10_vertexCount;
|
||||
//u32 x14_normalCount;
|
||||
std::vector<CVirtualBone> m_virtualBones;
|
||||
std::vector<u32> m_poolToSkinIdx;
|
||||
class CSkinRules {
|
||||
std::vector<CSkinBank> x0_skinBanks;
|
||||
// u32 x10_vertexCount;
|
||||
// u32 x14_normalCount;
|
||||
std::vector<CVirtualBone> m_virtualBones;
|
||||
std::vector<u32> m_poolToSkinIdx;
|
||||
|
||||
public:
|
||||
explicit CSkinRules(CInputStream& in);
|
||||
explicit CSkinRules(CInputStream& in);
|
||||
|
||||
void GetBankTransforms(std::vector<const zeus::CTransform*>& out,
|
||||
const CPoseAsTransforms& pose, int skinBankIdx) const
|
||||
{ x0_skinBanks[skinBankIdx].GetBankTransforms(out, pose); }
|
||||
void GetBankTransforms(std::vector<const zeus::CTransform*>& out, const CPoseAsTransforms& pose,
|
||||
int skinBankIdx) const {
|
||||
x0_skinBanks[skinBankIdx].GetBankTransforms(out, pose);
|
||||
}
|
||||
|
||||
void TransformVerticesCPU(std::vector<std::pair<zeus::CVector3f, zeus::CVector3f>>& vnOut,
|
||||
const CPoseAsTransforms& pose, const CModel& model) const;
|
||||
void TransformVerticesCPU(std::vector<std::pair<zeus::CVector3f, zeus::CVector3f>>& vnOut,
|
||||
const CPoseAsTransforms& pose, const CModel& model) const;
|
||||
};
|
||||
|
||||
CFactoryFnReturn FSkinRulesFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& params,
|
||||
CObjectReference* selfRef);
|
||||
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user