summaryrefslogtreecommitdiff
path: root/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp')
-rw-r--r--src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp b/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp
index d3faa6b894..4fab18c4f6 100644
--- a/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp
+++ b/src/JSystem/J3DGraphAnimator/J3DMtxBuffer.cpp
@@ -248,7 +248,24 @@ static u8 J3DUnit01[8] = {
/* 803268D4-80326ACC 321214 01F8+00 0/0 1/1 0/0 .text calcWeightEnvelopeMtx__12J3DMtxBufferFv */
void J3DMtxBuffer::calcWeightEnvelopeMtx() {
- // NONMATCHING
+ int max = mJointTree->getWEvlpMtxNum();
+ u16* indices = mJointTree->getWEvlpMixIndex();
+ f32* weights = mJointTree->getWEvlpMixWeight();
+ for (int i = -1; i < max; i++) {
+ u8* scaleFlags = mpEvlpScaleFlagArr;
+ scaleFlags[i] = 1;
+ Mtx* weightAnmMtx = &mpWeightEvlpMtx[i];
+ int mixNum = mJointTree->getWEvlpMixMtxNum(i);
+ for (int j = 0; j < mixNum; j++) {
+ u16 idx = indices[j];
+ f32 weight = weights[j];
+ Mtx& invMtx = mJointTree->getInvJointMtx(idx);
+ Mtx& worldMtx = mpUserAnmMtx[idx];
+ // I think it's this but as ASM? maybe?
+ MTXConcat(invMtx, worldMtx, *weightAnmMtx);
+ scaleFlags[i] &= mpScaleFlagArr[j];
+ }
+ }
}
/* 80326ACC-80326D3C 32140C 0270+00 0/0 1/1 0/0 .text