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

Method clipBySphere

src/Kaneshige/ExModel.cpp:619–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619void ExModel::clipBySphere(u32 viewNo, J3DUClipper *clipper, const Mtx m, f32 r) {
620 J3DModelData *mdlData0 = mModelData[0];
621
622 if (mdlData0) {
623 if (mModel[0]) {
624 for (u16 i = 0; i < mdlData0->getJointNum(); i++) {
625 int doClip = 0;
626 if (sClippingOn) {
627 if (mdlData0->getJointNodePointer(i)->getKind() != 0)
628 continue;
629
630 JGeometry::TVec3f point;
631 point.x = mModel[0]->getAnmMtx(i)[0][3];
632 point.y = mModel[0]->getAnmMtx(i)[1][3];
633 point.z = mModel[0]->getAnmMtx(i)[2][3];
634 doClip = clipper->clip(m, point, mdlData0->getJointNodePointer(i)->getRadius() * r);
635 }
636
637 clipJoint(viewNo, i, doClip == 0);
638 }
639 }
640 else {
641 int clipped = 0;
642 if (sClippingOn) {
643 JGeometry::TVec3f point;
644 point.x = mBaseTRMtx[0][3];
645 point.y = mBaseTRMtx[1][3];
646 point.z = mBaseTRMtx[2][3];
647 clipped = clipper->clip(m, point, mdlData0->getJointNodePointer(0)->getRadius() * r);
648 }
649
650 if (clipped == 0) {
651 _1a &= ~(1 << viewNo);
652 }
653 else {
654 _1a |= 1 << viewNo;
655 }
656
657 }
658 }
659}
660
661void ExModel::clipJoint(u32 viewNo, u16 nodeIdx, bool showPkt) {
662 if (isAvailable()) {

Callers 3

DoLodMethod · 0.80
viewCalcMethod · 0.80
drawSimpleModelMethod · 0.80

Calls 5

getJointNumMethod · 0.45
getKindMethod · 0.45
getJointNodePointerMethod · 0.45
clipMethod · 0.45
getRadiusMethod · 0.45

Tested by

no test coverage detected