Пример #1
0
    //---------------------------------------------------------------------
    void VertexPoseKeyFrame::_applyBaseKeyFrame(const VertexPoseKeyFrame* base)
    {
        // We subtract the matching pose influences in the base keyframe from the
        // influences in this keyframe
        for (PoseRefList::iterator i = mPoseRefs.begin(); i != mPoseRefs.end(); ++i)
        {
            PoseRef& myPoseRef = *i;

            VertexPoseKeyFrame::ConstPoseRefIterator basePoseIt = base->getPoseReferenceIterator();
            Real baseInfluence = 0.0f;
            while (basePoseIt.hasMoreElements())
            {
                const VertexPoseKeyFrame::PoseRef& basePoseRef = basePoseIt.getNext();
                if (basePoseRef.poseIndex == myPoseRef.poseIndex)
                {
                    baseInfluence = basePoseRef.influence;
                    break;
                }
            }

            myPoseRef.influence -= baseInfluence;

        }

    }
Пример #2
0
	//---------------------------------------------------------------------
	bool VertexAnimationTrack::hasNonZeroKeyFrames(void) const
	{
		if (mAnimationType == VAT_MORPH)
		{
			return !mKeyFrames.empty();
		}
		else
		{

			KeyFrameList::const_iterator i = mKeyFrames.begin();
			for (; i != mKeyFrames.end(); ++i)
			{
				// look for keyframes which have a pose influence which is non-zero
				const VertexPoseKeyFrame* kf = static_cast<const VertexPoseKeyFrame*>(*i);
				VertexPoseKeyFrame::ConstPoseRefIterator poseIt
					= kf->getPoseReferenceIterator();
				while (poseIt.hasMoreElements())
				{
					const VertexPoseKeyFrame::PoseRef& poseRef = poseIt.getNext();
					if (poseRef.influence > 0.0f)
						return true;
				}

			}

			return false;
		}
	}