summaryrefslogtreecommitdiff
path: root/include/JSystem/J3DGraphAnimator/J3DModelData.h
blob: 17557f4495ee5e7479f9aafbd930c26c914282d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef J3DMODELDATA_H
#define J3DMODELDATA_H

#include "JSystem/J3DGraphAnimator/J3DJointTree.h"
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
#include "JSystem/J3DGraphAnimator/J3DShapeTable.h"
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "JSystem/J3DGraphBase/J3DVertex.h"

typedef struct _GXColor GXColor;
class JUTNameTab;

/**
 * @ingroup jsystem-j3d
 * 
 */
class J3DModelData {
public:
    /* 80325D88 */ void clear();
    /* 80325DA0 */ J3DModelData();
    /* 80325E14 */ s32 newSharedDisplayList(u32);
    /* 80325EC8 */ void indexToPtr();
    /* 80325F94 */ void makeSharedDL();
    /* 8032600C */ void simpleCalcMaterial(u16, f32 (*)[4]);
    /* 803260CC */ void syncJ3DSysPointers() const;
    /* 803260F8 */ void syncJ3DSysFlags() const;

    /* 8032617C */ virtual ~J3DModelData();

    J3DMaterialTable& getMaterialTable() { return mMaterialTable; }
    JUTNameTab* getMaterialName() const { return mMaterialTable.getMaterialName(); }
    J3DVertexData& getVertexData() { return mVertexData; }
    u16 getShapeNum() const { return mShapeTable.getShapeNum(); }
    u16 getMaterialNum() const { return mMaterialTable.getMaterialNum(); }
    u16 getJointNum() const { return mJointTree.getJointNum(); }
    u16 getDrawMtxNum() const { return mJointTree.getDrawMtxNum(); }
    J3DMaterial* getMaterialNodePointer(u16 idx) const {
        return mMaterialTable.getMaterialNodePointer(idx);
    }
    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); }
    J3DDrawMtxData* getDrawMtxData() { return mJointTree.getDrawMtxData(); }
    J3DShapeTable* getShapeTable() { return &mShapeTable; }
    J3DShape* getShapeNodePointer(u16 idx) const { return mShapeTable.getShapeNodePointer(idx); }
    J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); }
    J3DJointTree& getJointTree() { return mJointTree; }
    J3DModelHierarchy const* getHierarchy() { return mJointTree.getHierarchy(); }
    void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); }
    void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); }
    JUTNameTab* getJointName() const { return mJointTree.getJointName(); }
    Mtx& getInvJointMtx(s32 idx) const { return mJointTree.getInvJointMtx(idx); }
    J3DTexture* getTexture() const { return mMaterialTable.getTexture(); }
    JUTNameTab* getTextureName() const { return mMaterialTable.getTextureName(); }
    u16 getWEvlpMtxNum() const { return mJointTree.getWEvlpMtxNum(); }
    u16* getWEvlpMixMtxIndex() const { return mJointTree.getWEvlpMixIndex(); }
    f32* getWEvlpMixWeight() const { return mJointTree.getWEvlpMixWeight(); }
    u8 getWEvlpMixMtxNum(u16 idx) const { return mJointTree.getWEvlpMixMtxNum(idx); }
    u16* getWEvlpImportantMtxIndex() const { return mJointTree.getWEvlpImportantMtxIndex(); }
    u32 getModelDataType() const { return mJointTree.getModelDataType(); }
    void setModelDataType(u32 type) { mJointTree.setModelDataType(type); }
    void* getVtxPosArray() const { return mVertexData.getVtxPosArray(); }
    void* getVtxNrmArray() const { return mVertexData.getVtxNrmArray(); }
    GXColor* getVtxColorArray(u8 idx) const { return mVertexData.getVtxColorArray(idx); }
    bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
    u32 getFlag() const { return mFlags; }
    void const* getRawData() const { return mpRawData; }
    u16 checkBumpFlag() const { return mbHasBumpArray; }
    void setBumpFlag(u32 flag) { mbHasBumpArray = flag; }
    bool checkBBoardFlag() const { return mbHasBillboard == 1; }
    bool isLocked() { return mMaterialTable.isLocked(); }
    void entryTexMtxAnimator(J3DAnmTextureSRTKey* anm) { mMaterialTable.entryTexMtxAnimator(anm); }
    void entryTevRegAnimator(J3DAnmTevRegKey* anm) { mMaterialTable.entryTevRegAnimator(anm); }
    void entryTexNoAnimator(J3DAnmTexPattern* anm) { mMaterialTable.entryTexNoAnimator(anm); }
    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);
    }
    void syncJ3DSys() {
        syncJ3DSysFlags();
        syncJ3DSysPointers();
    }
    void makeHierarchy(J3DJoint* joint, J3DModelHierarchy const** hierarchy) {
        mJointTree.makeHierarchy(joint, hierarchy, &mMaterialTable, &mShapeTable);
        mShapeTable.initShapeNodes(getDrawMtxData(), &getVertexData());
    }

private:
    friend class J3DModelLoader;

    /* 0x04 */ void const* mpRawData;
    /* 0x08 */ u32 mFlags;
    /* 0x0C */ u16 mbHasBumpArray;
    /* 0x0E */ u16 mbHasBillboard;
    /* 0x10 */ J3DJointTree mJointTree;
    /* 0x58 */ J3DMaterialTable mMaterialTable;
    /* 0x78 */ J3DShapeTable mShapeTable;
    /* 0x88 */ J3DVertexData mVertexData;
};  // Size: 0xE4

#endif /* J3DMODELDATA_H */