2022-03-21 21:54:48 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "OtherStructs/SkinLimbStructs.h"
|
|
|
|
#include "ZDisplayList.h"
|
|
|
|
#include "ZFile.h"
|
|
|
|
|
|
|
|
enum class ZLimbType
|
|
|
|
{
|
|
|
|
Invalid,
|
|
|
|
Standard,
|
|
|
|
LOD,
|
|
|
|
Skin,
|
|
|
|
Curve,
|
|
|
|
Legacy,
|
|
|
|
};
|
|
|
|
|
2023-05-07 19:58:50 -04:00
|
|
|
class ZLimbTable;
|
|
|
|
|
2022-03-21 21:54:48 -04:00
|
|
|
class ZLimb : public ZResource
|
|
|
|
{
|
|
|
|
public:
|
2023-05-07 19:58:50 -04:00
|
|
|
std::string enumName;
|
|
|
|
ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete!
|
|
|
|
|
2022-03-21 21:54:48 -04:00
|
|
|
ZLimbType type = ZLimbType::Standard;
|
|
|
|
|
|
|
|
ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_0; // Skin only
|
|
|
|
segptr_t skinSegment = 0; // Skin only
|
2022-05-11 13:18:24 -04:00
|
|
|
Struct_800A5E28 segmentStruct = {0}; // Skin only
|
2022-03-21 21:54:48 -04:00
|
|
|
|
|
|
|
// Legacy only
|
2022-05-11 13:18:24 -04:00
|
|
|
float legTransX = 0, legTransY = 0, legTransZ = 0; // Vec3f
|
|
|
|
uint16_t rotX = 0, rotY = 0, rotZ = 0; // Vec3s
|
|
|
|
segptr_t childPtr = 0; // LegacyLimb*
|
|
|
|
segptr_t siblingPtr = 0; // LegacyLimb*
|
2022-03-21 21:54:48 -04:00
|
|
|
|
|
|
|
segptr_t dListPtr = 0;
|
|
|
|
segptr_t dList2Ptr = 0; // LOD and Curve Only
|
|
|
|
|
2022-05-11 13:18:24 -04:00
|
|
|
int16_t transX = 0, transY = 0, transZ = 0;
|
|
|
|
uint8_t childIndex = 0, siblingIndex = 0;
|
2022-03-21 21:54:48 -04:00
|
|
|
|
2023-05-07 19:58:50 -04:00
|
|
|
uint8_t limbIndex = 0;
|
|
|
|
|
2022-03-21 21:54:48 -04:00
|
|
|
ZLimb(ZFile* nParent);
|
|
|
|
|
|
|
|
void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nType);
|
|
|
|
|
|
|
|
void ParseXML(tinyxml2::XMLElement* reader) override;
|
|
|
|
void ParseRawData() override;
|
|
|
|
void DeclareReferences(const std::string& prefix) override;
|
|
|
|
|
|
|
|
std::string GetBodySourceCode() const override;
|
|
|
|
std::string GetDefaultName(const std::string& prefix) const override;
|
|
|
|
|
|
|
|
size_t GetRawDataSize() const override;
|
|
|
|
std::string GetSourceTypeName() const override;
|
|
|
|
ZResourceType GetResourceType() const override;
|
|
|
|
|
|
|
|
ZLimbType GetLimbType();
|
|
|
|
void SetLimbType(ZLimbType value);
|
|
|
|
static const char* GetSourceTypeName(ZLimbType limbType);
|
|
|
|
static ZLimbType GetTypeByAttributeName(const std::string& attrName);
|
|
|
|
|
2023-05-07 19:58:50 -04:00
|
|
|
void SetLimbIndex(uint8_t nLimbIndex);
|
|
|
|
|
2022-03-21 21:54:48 -04:00
|
|
|
protected:
|
|
|
|
void DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix,
|
|
|
|
const std::string& limbSuffix);
|
|
|
|
};
|