summaryrefslogtreecommitdiff
path: root/include/JSystem/J3DGraphLoader
diff options
context:
space:
mode:
authorTakaRikka <takarikka@outlook.com>2022-10-04 21:17:53 -0700
committerTakaRikka <takarikka@outlook.com>2022-10-04 21:17:53 -0700
commit74c248990c5cc991aff8f119efd8b733770178a7 (patch)
tree6f44f0e2711ebc8e59f3780ea78fe2ba89c452bd /include/JSystem/J3DGraphLoader
parenta3578d0c7c64b11258260bee1148d33195542c4f (diff)
move jasper's jsystem work over
Diffstat (limited to 'include/JSystem/J3DGraphLoader')
-rw-r--r--include/JSystem/J3DGraphLoader/J3DJointFactory.h45
1 files changed, 44 insertions, 1 deletions
diff --git a/include/JSystem/J3DGraphLoader/J3DJointFactory.h b/include/JSystem/J3DGraphLoader/J3DJointFactory.h
index 2e992b48f3..98409802a7 100644
--- a/include/JSystem/J3DGraphLoader/J3DJointFactory.h
+++ b/include/JSystem/J3DGraphLoader/J3DJointFactory.h
@@ -1,6 +1,49 @@
#ifndef J3DJOINTFACTORY_H
#define J3DJOINTFACTORY_H
+#include "JSystem/J3DGraphBase/J3DTransform.h"
+#include "JSystem/JGeometry.h"
#include "dolphin/types.h"
-#endif /* J3DJOINTFACTORY_H */
+struct J3DJoint;
+struct ResNTAB;
+
+struct J3DJointInitData {
+ /* 0x00 */ u16 mKind;
+ /* 0x02 */ bool mScaleCompensate;
+ /* 0x04 */ J3DTransformInfo mTransformInfo;
+ /* 0x24 */ f32 mRadius;
+ /* 0x28 */ Vec mMin;
+ /* 0x2C */ Vec mMax;
+}; // Size: 0x30
+
+struct J3DJointBlock {
+ /* 0x00 */ u8 mMagic[4];
+ /* 0x04 */ u32 mSize;
+
+ /* 0x08 */ u16 mJointNum;
+ /* 0x0A */ u16 _pad;
+
+ /* 0x0C */ J3DJointInitData* mJointInitData;
+ /* 0x10 */ u16* mIndexTable;
+ /* 0x14 */ ResNTAB* mNameTable;
+};
+
+struct J3DJointFactory {
+ /* 80337178 */ J3DJointFactory(J3DJointBlock const&);
+ /* 803371D0 */ J3DJoint* create(int);
+
+ J3DJointInitData* mJointInitData;
+ u16* mIndexTable;
+
+ u16 getKind(int no) const { return mJointInitData[mIndexTable[no]].mKind; }
+ u8 getScaleCompensate(int no) const { return mJointInitData[mIndexTable[no]].mScaleCompensate; }
+ const J3DTransformInfo& getTransformInfo(int no) const {
+ return mJointInitData[mIndexTable[no]].mTransformInfo;
+ }
+ f32 getRadius(int no) const { return mJointInitData[mIndexTable[no]].mRadius; }
+ Vec& getMin(int no) const { return mJointInitData[mIndexTable[no]].mMin; }
+ Vec& getMax(int no) const { return mJointInitData[mIndexTable[no]].mMax; }
+};
+
+#endif /* J3DJOINTFACTORY_H */ \ No newline at end of file