Files
tp/include/JSystem/J3DGraphAnimator/J3DModelData.h
T

118 lines
5.3 KiB
C++
Raw Normal View History

2021-03-28 22:49:05 +02:00
#ifndef J3DMODELDATA_H
#define J3DMODELDATA_H
2020-12-25 18:03:10 -08:00
2021-10-11 09:38:53 -07:00
#include "JSystem/J3DGraphAnimator/J3DJointTree.h"
2024-12-06 06:47:30 -08:00
#include "JSystem/J3DGraphBase/J3DMaterial.h"
2021-10-11 09:38:53 -07:00
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
#include "JSystem/J3DGraphAnimator/J3DShapeTable.h"
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "JSystem/J3DGraphBase/J3DVertex.h"
2020-12-25 18:03:10 -08:00
2023-05-12 12:10:14 -07:00
class JUTNameTab;
2024-04-12 00:10:30 -06:00
/**
* @ingroup jsystem-j3d
*
*/
class J3DModelData {
2021-10-11 09:38:53 -07:00
public:
2025-11-30 14:23:42 -08:00
void clear();
J3DModelData();
s32 newSharedDisplayList(u32);
void indexToPtr();
void makeSharedDL();
void simpleCalcMaterial(u16, Mtx);
void syncJ3DSysPointers() const;
void syncJ3DSysFlags() const;
2021-10-11 09:38:53 -07:00
2025-11-30 14:23:42 -08:00
virtual ~J3DModelData() {}
2021-10-11 09:38:53 -07:00
void simpleCalcMaterial(Mtx mtx) { simpleCalcMaterial(0, mtx); }
2021-10-11 09:38:53 -07:00
J3DMaterialTable& getMaterialTable() { return mMaterialTable; }
2023-01-03 17:43:38 -08:00
JUTNameTab* getMaterialName() const { return mMaterialTable.getMaterialName(); }
2021-10-11 09:38:53 -07:00
J3DVertexData& getVertexData() { return mVertexData; }
u16 getShapeNum() const { return mShapeTable.getShapeNum(); }
u16 getMaterialNum() const { return mMaterialTable.getMaterialNum(); }
2021-12-06 06:51:53 -05:00
u16 getJointNum() const { return mJointTree.getJointNum(); }
u16 getDrawMtxNum() const { return mJointTree.getDrawMtxNum(); }
2021-10-11 09:38:53 -07:00
J3DMaterial* getMaterialNodePointer(u16 idx) const {
return mMaterialTable.getMaterialNodePointer(idx);
}
2023-07-14 11:30:07 +03:00
u32 getVtxNum() const { return mVertexData.getVtxNum(); }
u32 getNrmNum() const { return mVertexData.getNrmNum(); }
u8 getDrawMtxFlag(u16 idx) const { return mJointTree.getDrawMtxFlag(idx); }
u16 getDrawMtxIndex(u16 idx) const { return mJointTree.getDrawMtxIndex(idx); }
2023-11-08 22:56:00 -05:00
J3DDrawMtxData* getDrawMtxData() { return mJointTree.getDrawMtxData(); }
J3DShapeTable* getShapeTable() { return &mShapeTable; }
2021-10-11 09:38:53 -07:00
J3DShape* getShapeNodePointer(u16 idx) const { return mShapeTable.getShapeNodePointer(idx); }
J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); }
J3DJointTree& getJointTree() { return mJointTree; }
2023-11-08 22:56:00 -05:00
J3DModelHierarchy const* getHierarchy() { return mJointTree.getHierarchy(); }
void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); }
void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); }
2022-10-18 05:15:45 -07:00
JUTNameTab* getJointName() const { return mJointTree.getJointName(); }
2025-04-16 00:09:31 +03:00
Mtx& getInvJointMtx(int idx) { return mJointTree.getInvJointMtx(idx); }
2021-10-11 09:38:53 -07:00
J3DTexture* getTexture() const { return mMaterialTable.getTexture(); }
2022-01-25 12:24:14 -08:00
JUTNameTab* getTextureName() const { return mMaterialTable.getTextureName(); }
2021-10-11 09:38:53 -07:00
u16 getWEvlpMtxNum() const { return mJointTree.getWEvlpMtxNum(); }
2024-10-15 16:59:31 -04:00
u16* getWEvlpMixMtxIndex() const { return mJointTree.getWEvlpMixMtxIndex(); }
2023-07-14 11:30:07 +03:00
f32* getWEvlpMixWeight() const { return mJointTree.getWEvlpMixWeight(); }
u8 getWEvlpMixMtxNum(u16 idx) const { return mJointTree.getWEvlpMixMtxNum(idx); }
2023-12-12 23:42:38 -05:00
u16* getWEvlpImportantMtxIndex() const { return mJointTree.getWEvlpImportantMtxIndex(); }
u32 getModelDataType() const { return mJointTree.getModelDataType(); }
2023-11-08 22:56:00 -05:00
void setModelDataType(u32 type) { mJointTree.setModelDataType(type); }
2021-10-11 09:38:53 -07:00
void* getVtxPosArray() const { return mVertexData.getVtxPosArray(); }
void* getVtxNrmArray() const { return mVertexData.getVtxNrmArray(); }
2022-04-23 22:17:28 -07:00
GXColor* getVtxColorArray(u8 idx) const { return mVertexData.getVtxColorArray(idx); }
2022-12-31 10:44:40 -08:00
bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
u32 getFlag() const { return mFlags; }
2023-11-08 22:56:00 -05:00
void const* getRawData() const { return mpRawData; }
2025-09-04 07:56:59 -07:00
bool checkBumpFlag() const { return mbHasBumpArray == 1; }
2022-12-31 10:44:40 -08:00
void setBumpFlag(u32 flag) { mbHasBumpArray = flag; }
2021-12-06 06:51:53 -05:00
bool checkBBoardFlag() const { return mbHasBillboard == 1; }
bool isLocked() { return mMaterialTable.isLocked(); }
void entryTexMtxAnimator(J3DAnmTextureSRTKey* anm) { mMaterialTable.entryTexMtxAnimator(anm); }
2024-10-12 15:11:17 -07:00
int entryTevRegAnimator(J3DAnmTevRegKey* anm) { return mMaterialTable.entryTevRegAnimator(anm); }
2022-12-19 11:06:32 -08:00
void entryTexNoAnimator(J3DAnmTexPattern* anm) { mMaterialTable.entryTexNoAnimator(anm); }
2022-06-01 04:23:39 -07:00
int removeTexNoAnimator(J3DAnmTexPattern* anm) {
return mMaterialTable.removeTexNoAnimator(anm);
}
int removeTexMtxAnimator(J3DAnmTextureSRTKey* anm) {
return mMaterialTable.removeTexMtxAnimator(anm);
}
int removeTevRegAnimator(J3DAnmTevRegKey* anm) {
return mMaterialTable.removeTevRegAnimator(anm);
}
int removeMatColorAnimator(J3DAnmColor* anm) {
return mMaterialTable.removeMatColorAnimator(anm);
}
2023-08-11 05:04:50 +03:00
void syncJ3DSys() {
syncJ3DSysFlags();
syncJ3DSysPointers();
}
2023-11-08 22:56:00 -05:00
void makeHierarchy(J3DJoint* joint, J3DModelHierarchy const** hierarchy) {
mJointTree.makeHierarchy(joint, hierarchy, &mMaterialTable, &mShapeTable);
mShapeTable.initShapeNodes(getDrawMtxData(), &getVertexData());
}
2025-07-06 03:07:33 -07:00
void show() {
mShapeTable.show();
}
void hide() {
mShapeTable.hide();
}
2021-10-11 09:38:53 -07:00
private:
2023-11-08 22:56:00 -05:00
friend class J3DModelLoader;
/* 0x04 */ void const* mpRawData;
2021-10-11 09:38:53 -07:00
/* 0x08 */ u32 mFlags;
2021-12-06 06:51:53 -05:00
/* 0x0C */ u16 mbHasBumpArray;
/* 0x0E */ u16 mbHasBillboard;
2021-10-11 09:38:53 -07:00
/* 0x10 */ J3DJointTree mJointTree;
/* 0x58 */ J3DMaterialTable mMaterialTable;
/* 0x78 */ J3DShapeTable mShapeTable;
/* 0x88 */ J3DVertexData mVertexData;
}; // Size: 0xE4
2021-03-28 22:49:05 +02:00
#endif /* J3DMODELDATA_H */