| 574 | } |
| 575 | |
| 576 | void TSShapeInstance::handleBlendSequence(TSThread * thread, S32 a, S32 b) |
| 577 | { |
| 578 | S32 jrot=0; |
| 579 | S32 jtrans=0; |
| 580 | S32 jscale=0; |
| 581 | |
| 582 | const TSShape::Sequence* threadSequence = thread->getSequence(); |
| 583 | |
| 584 | TSIntegerSet nodeMatters = threadSequence->translationMatters; |
| 585 | nodeMatters.overlap(threadSequence->rotationMatters); |
| 586 | nodeMatters.overlap(threadSequence->scaleMatters); |
| 587 | nodeMatters.takeAway(mHandsOffNodes); |
| 588 | S32 start = nodeMatters.start(); |
| 589 | S32 end = b; |
| 590 | for (S32 nodeIndex=start; nodeIndex<end; nodeMatters.next(nodeIndex)) |
| 591 | { |
| 592 | // skip nodes outside of this detail |
| 593 | if (start<a || mDisableBlendNodes.test(nodeIndex)) |
| 594 | { |
| 595 | if (threadSequence->rotationMatters.test(nodeIndex)) |
| 596 | jrot++; |
| 597 | if (threadSequence->translationMatters.test(nodeIndex)) |
| 598 | jtrans++; |
| 599 | if (threadSequence->scaleMatters.test(nodeIndex)) |
| 600 | jscale++; |
| 601 | continue; |
| 602 | } |
| 603 | |
| 604 | MatrixF mat(true); |
| 605 | if (threadSequence->rotationMatters.test(nodeIndex)) |
| 606 | { |
| 607 | QuatF q1,q2; |
| 608 | mShape->getRotation(*threadSequence,thread->keyNum1,jrot,&q1); |
| 609 | mShape->getRotation(*threadSequence,thread->keyNum2,jrot,&q2); |
| 610 | QuatF quat; |
| 611 | TSTransform::interpolate(q1,q2,thread->keyPos,&quat); |
| 612 | TSTransform::setMatrix(quat,&mat); |
| 613 | jrot++; |
| 614 | } |
| 615 | |
| 616 | if (threadSequence->translationMatters.test(nodeIndex)) |
| 617 | { |
| 618 | const Point3F & p1 = mShape->getTranslation(*threadSequence,thread->keyNum1,jtrans); |
| 619 | const Point3F & p2 = mShape->getTranslation(*threadSequence,thread->keyNum2,jtrans); |
| 620 | Point3F p; |
| 621 | TSTransform::interpolate(p1,p2,thread->keyPos,&p); |
| 622 | mat.setColumn(3,p); |
| 623 | jtrans++; |
| 624 | } |
| 625 | |
| 626 | if (threadSequence->scaleMatters.test(nodeIndex)) |
| 627 | { |
| 628 | if (threadSequence->animatesUniformScale()) |
| 629 | { |
| 630 | F32 s1 = mShape->getUniformScale(*threadSequence,thread->keyNum1,jscale); |
| 631 | F32 s2 = mShape->getUniformScale(*threadSequence,thread->keyNum2,jscale); |
| 632 | F32 scale = TSTransform::interpolate(s1,s2,thread->keyPos); |
| 633 | TSTransform::applyScale(scale,&mat); |
nothing calls this directly
no test coverage detected