MCPcopy Create free account
hub / github.com/doldecomp/mkdd / fixChain

Method fixChain

src/Shiraiwa/MapObjWanwan.cpp:695–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695void TMapObjWanwan::fixChain() {
696 static f32 addf = F_HALF_PI;
697
698 f32 f = (mNumChains & 1) ? 0.0f : addf;
699
700 JGeometry::TVec3f pos, nextPos, posDiff;
701 for (u32 i = 0; i < mNumChains - 1; i++) {
702 mpStringNodeMgr->getNodePos(i, &pos);
703 mpStringNodeMgr->getNodePos(i + 1, &nextPos);
704
705 posDiff.sub(pos, nextPos);
706 posDiff.normalize();
707
708 setChainPosition(mpaChain[i], pos, posDiff, f);
709 f += addf;
710 }
711
712 mpStringNodeMgr->getNodePos(mNumChains - 1, &pos);
713 posDiff.sub(mPos, mObjData->position);
714 posDiff.y = 0.0f;
715 posDiff.normalize();
716 setChainPosition(mpaChain[mNumChains - 1], pos, posDiff, f);
717}
718
719void TMapObjWanwan::setChainPosition(TMapObjWanwanChain *pChain, JGeometry::TVec3f &rPos, JGeometry::TVec3f &rPosDiff, f32 f) {
720

Callers

nothing calls this directly

Calls 3

getNodePosMethod · 0.80
subMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected