J3DModel inlines

This commit is contained in:
LagoLunatic
2025-08-26 17:43:02 -04:00
parent 993431d0f8
commit d9c2ffe619
7 changed files with 15 additions and 17 deletions
@@ -71,8 +71,10 @@ public:
u32 getModelDataType() const { return mJointTree.getModelDataType(); }
const J3DModelHierarchy* getHierarchy() const { return mJointTree.getHierarchy(); }
void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); }
J3DMtxCalc* getBasicMtxCalc() { return mJointTree.getBasicMtxCalc(); }
void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); }
void setModelDataType(u32 type) { mJointTree.setModelDataType(type); }
J3DJoint* getRootNode() { return mJointTree.getRootNode(); }
GXColor* getVtxColorArray(u8 idx) const { return mVertexData.getVtxColorArray(idx); }
bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
u32 getFlag() const { return mFlags; }
@@ -109,10 +111,6 @@ public:
}
const void* getBinary() { return mBinary; }
// TODO
void getBasicMtxCalc() {}
void getRootNode() {}
private:
friend class J3DModelLoader;
+2 -2
View File
@@ -484,14 +484,14 @@ s32 J3DModel::setSkinDeform(J3DSkinDeform* pSkinDeform, u32 flags) {
/* 802EE5D8-802EE67C .text calcAnmMtx__8J3DModelFv */
void J3DModel::calcAnmMtx() {
j3dSys.setModel(this);
j3dSys.setCurrentMtxCalc(getModelData()->getJointTree().getBasicMtxCalc());
j3dSys.setCurrentMtxCalc(getModelData()->getBasicMtxCalc());
if (checkFlag(J3DMdlFlag_Unk00002))
j3dSys.getCurrentMtxCalc()->init(j3dDefaultScale, j3dDefaultMtx);
else
j3dSys.getCurrentMtxCalc()->init(mBaseScale, mBaseTransformMtx);
getModelData()->getJointTree().getBasicMtxCalc()->recursiveCalc(getModelData()->getJointTree().getRootNode());
getModelData()->getBasicMtxCalc()->recursiveCalc(getModelData()->getRootNode());
}
/* 802EE67C-802EE874 .text calcWeightEnvelopeMtx__8J3DModelFv */
+2 -2
View File
@@ -612,7 +612,7 @@ static BOOL daBb_Draw(bb_class* i_this) {
i_this->mpMorf->entryDL();
J3DModelData* modelData = model->getModelData();
modelData->getMaterialTable().removeTexNoAnimator(i_this->mBtpAnm.getBtpAnm());
i_this->mBtpAnm.remove(modelData);
daBb_shadowDraw(i_this);
tail_draw(i_this);
#if VERSION == VERSION_DEMO
@@ -2715,7 +2715,7 @@ static cPhs_State daBb_Create(fopAc_ac_c* a_this) {
for (u16 i = 0; i < model->getModelData()->getJointNum(); i++) {
if (callback_check_index[i] >= 0) {
model->getModelData()->getJointTree().getJointNodePointer(i)->setCallBack(nodeCallBack);
model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack);
}
}
+1 -1
View File
@@ -988,7 +988,7 @@ cPhs_State daBoko_c::create() {
mStts.Init(10, 0xff, this);
if (type == Type_BOKO_STICK_e) {
mpModel->getModelData()->getJointTree().getJointNodePointer(2)->getMesh()->getShape()->hide();
mpModel->getModelData()->getJointNodePointer(2)->getMesh()->getShape()->hide();
}
mSph.Set(sph_src);
mSph.SetStts(&mStts);
+1 -1
View File
@@ -1467,7 +1467,7 @@ BOOL daObj_Ikada_c::_createHeap() {
case 1:
case 2:
case 3:
modelData->getJointTree().getJointNodePointer(i)->setCallBack(nodeControl_CB);
modelData->getJointNodePointer(i)->setCallBack(nodeControl_CB);
break;
}
}
+6 -6
View File
@@ -4596,7 +4596,7 @@ cPhs_State daShip_c::create() {
for (u16 jno = 0; jno < pModelData->getJointNum(); jno++) {
if ((jno == 10) || (jno == 5) || (jno == 7) || (jno == 6)) {
pModelData->getJointTree().getJointNodePointer(jno)->setCallBack(daShip_bodyJointCallBack);
pModelData->getJointNodePointer(jno)->setCallBack(daShip_bodyJointCallBack);
}
}
@@ -4621,7 +4621,7 @@ cPhs_State daShip_c::create() {
for (u16 jno = 0; jno < pModelData->getJointNum(); jno++) {
if (jno == 8 || jno == 10) {
pModelData->getJointTree().getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack0);
pModelData->getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack0);
}
else if (
!(jno != 2 && jno != 3 && jno != 4 && jno != 5 && jno != 6) || (jno == 7)
@@ -4629,7 +4629,7 @@ cPhs_State daShip_c::create() {
// jno == 2 || jno == 3 || jno == 4 || jno == 5 || jno == 6 || jno == 7
// But the compiler optimizes that differently
) {
pModelData->getJointTree().getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack1);
pModelData->getJointNodePointer(jno)->setCallBack(daShip_headJointCallBack1);
}
}
@@ -4637,11 +4637,11 @@ cPhs_State daShip_c::create() {
pModelData = mpCannonModel->getModelData();
pModelData->getJointTree().getJointNodePointer(1)->setCallBack(daShip_cannonJointCallBack);
pModelData->getJointTree().getJointNodePointer(2)->setCallBack(daShip_cannonJointCallBack);
pModelData->getJointNodePointer(1)->setCallBack(daShip_cannonJointCallBack);
pModelData->getJointNodePointer(2)->setCallBack(daShip_cannonJointCallBack);
mpSalvageArmModel->setUserArea(reinterpret_cast<u32>(this));
mpSalvageArmModel->getModelData()->getJointTree().getJointNodePointer(1)->setCallBack(daShip_craneJointCallBack);
mpSalvageArmModel->getModelData()->getJointNodePointer(1)->setCallBack(daShip_craneJointCallBack);
m034B = fopAcM_GetParam(this);
mPart = PART_WAIT_e;
+1 -1
View File
@@ -159,7 +159,7 @@ bool daShopItem_c::_draw() {
if(!chkDraw()) return true;
if(m_itemNo == WATER_STATUE || m_itemNo == POSTMAN_STATUE) {
mpModel->getModelData()->getJointTree().getJointNodePointer(0)->setMtxCalc(0);
mpModel->getModelData()->getJointNodePointer(0)->setMtxCalc(0);
}
DrawBase();