示例#1
0
// IIsClosestAnim -------------------------------------------------------------------
// ---------------
bool IIsClosestAnim(const char *animName, hsMatrix44 &sitGoal, float &closestDist,
                    hsPoint3 curPosition, const plArmatureMod *avatar)
{
    plAGAnim *anim = avatar->FindCustomAnim(animName);
    if(anim)
    {
        hsMatrix44 animEndToStart;
        // The sit target is the position we want to be at the END of the sit animation.
        // We have several animations to choose from, each starting from a different
        // position.
        // This will look at one of those animations and figure out how far we are from
        // its starting position.
        // The first step is to get the transform from the end to the beginning of the
        // animation. That's what this next line is doing. It's a bit unintuitive
        // until you look at the parameter definitions.
        GetStartToEndTransform(anim, nil, &animEndToStart, "Handle");
        hsMatrix44 candidateGoal = sitGoal * animEndToStart;
        hsPoint3 distP = candidateGoal.GetTranslate() - curPosition;
        hsVector3 distV(distP.fX, distP.fY, distP.fZ);
        float dist = distP.Magnitude();
        if(closestDist == 0.0 || dist < closestDist)
        {
            closestDist = dist;
            return true;
        }
    } else {
        hsAssert(false, ST::format("Missing sit animation: {}", animName).c_str());
    }
    return false;
}
示例#2
0
Void IntMbTempData::loadChromaData( IntMbTempData& rcMbTempData )
{
  ::memcpy( get(CIdx(0)), rcMbTempData.get(CIdx(0)), sizeof(TCoeff)*128);
  setChromaPredMode( rcMbTempData.getChromaPredMode() );
  IntYuvMbBuffer::loadChroma( rcMbTempData );
  distU()  = rcMbTempData.distU();
  distV()  = rcMbTempData.distV();
  getTempYuvMbBuffer().loadChroma( rcMbTempData.getTempYuvMbBuffer() );
}