示例#1
0
        /// <summary>
        /// Set this chain state to the blended version of the passed start and end states.
        /// </summary>
        /// <param name="start">The start state.</param>
        /// <param name="end">The end state.</param>
        /// <param name="blendAmount">The amount to blend.</param>
        public void setToBlendOf(FKChainState start, FKChainState end, float blendAmount)
        {
            if (blendAmount < 0.0f)
            {
                blendAmount = 0.0f;
            }
            else if (blendAmount > 1.0f)
            {
                blendAmount = 1.0f;
            }

            foreach (var stateName in start.ChainStateNames)
            {
                FKLinkState startState = start[stateName];
                FKLinkState endState   = end[stateName];

                Vector3    trans = startState.getBlendedLocalTranslation(endState, blendAmount);
                Quaternion rot   = startState.getBlendedLocalRotation(endState, blendAmount);

                setLinkState(stateName, trans, rot);
            }
        }