metaforce/Runtime/Character/CCharLayoutInfo.hpp

52 lines
1.3 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "Runtime/CFactoryMgr.hpp"
#include "Runtime/Streams/IOStreams.hpp"
#include "Runtime/Character/CSegId.hpp"
#include "Runtime/Character/CSegIdList.hpp"
#include "Runtime/Character/TSegIdMap.hpp"
#include <zeus/CVector3f.hpp>
2016-04-09 16:19:17 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
2018-12-07 21:30:43 -08:00
class CCharLayoutNode {
2016-04-09 16:19:17 -07:00
public:
2018-12-07 21:30:43 -08:00
struct Bone {
CSegId x0_parentId;
zeus::CVector3f x4_origin;
std::vector<CSegId> x10_children;
void read(CInputStream& in);
};
2016-04-09 16:19:17 -07:00
private:
2018-12-07 21:30:43 -08:00
TSegIdMap<Bone> x0_boneMap;
2016-04-09 16:19:17 -07:00
public:
explicit CCharLayoutNode(CInputStream& in);
2018-12-07 21:30:43 -08:00
const TSegIdMap<Bone>& GetBoneMap() const { return x0_boneMap; }
2016-04-09 16:19:17 -07:00
};
2018-12-07 21:30:43 -08:00
class CCharLayoutInfo {
std::shared_ptr<CCharLayoutNode> x0_node;
CSegIdList x8_segIdList;
std::map<std::string, CSegId, std::less<>> x18_segIdMap;
2018-12-07 21:30:43 -08:00
2016-04-09 16:19:17 -07:00
public:
explicit CCharLayoutInfo(CInputStream& in);
2018-12-07 21:30:43 -08:00
const std::shared_ptr<CCharLayoutNode>& GetRootNode() const { return x0_node; }
const CSegIdList& GetSegIdList() const { return x8_segIdList; }
zeus::CVector3f GetFromParentUnrotated(const CSegId& id) const;
zeus::CVector3f GetFromRootUnrotated(const CSegId& id) const;
CSegId GetSegIdFromString(std::string_view name) const;
};
2018-12-07 21:30:43 -08:00
CFactoryFnReturn FCharLayoutInfo(const SObjectTag&, CInputStream&, const CVParamTransfer&, CObjectReference* selfRef);
2021-04-10 01:42:06 -07:00
} // namespace metaforce