water interpolation fix

This commit is contained in:
Jasper St. Pierre
2026-04-18 22:17:19 -07:00
parent b069f0312e
commit 872b1a5dcb
10 changed files with 108 additions and 7 deletions
@@ -97,6 +97,14 @@ s32 J3DModel::entryModelData(J3DModelData* pModelData, u32 mdlFlags, u32 mtxNum)
return kJ3DError_Success;
}
#if TARGET_PC
void J3DModel::interp_callback(void* pUserWork) {
J3DModel* i_this = static_cast<J3DModel*>(pUserWork);
i_this->calcMaterial();
i_this->diff();
}
#endif
s32 J3DModel::createShapePacket(J3DModelData* pModelData) {
J3D_ASSERTMSG(173, pModelData != NULL, "Error : null pointer.");
@@ -283,6 +291,11 @@ void J3DModel::calcMaterial() {
material->calc(getAnmMtx(material->getJoint()->getJntNo()));
}
#if TARGET_PC
if (mModelData->needsInterpCallBack())
dusk::frame_interp::add_interpolation_callback(&J3DModel::interp_callback, this);
#endif
}
void J3DModel::calcDiffTexMtx() {
@@ -84,6 +84,15 @@ void J3DModelData::simpleCalcMaterial(u16 idx, Mtx param_1) {
}
}
#if TARGET_PC
bool J3DModelData::needsInterpCallBack() const {
for (u16 i = 0, n = getMaterialNum(); i < n; i++)
if (getMaterialNodePointer(i)->needsInterpCallBack())
return true;
return false;
}
#endif
void J3DModelData::syncJ3DSysPointers() const {
j3dSys.setTexture(getTexture());
j3dSys.setVtxPos(getVtxPosArray(), getVtxNum());