Esempio n. 1
0
        public NullSkeletonNodeAnimation AppendAnimationNode()
        {
            NullSkeletonNodeAnimation animation = new NullSkeletonNodeAnimation(CurrentVersion, mFrameTimes.Count);

            mNodeAnimationArray.Add(animation);
            return(animation);
        }
Esempio n. 2
0
        protected bool RotateAnimation(NullSkeletonAnimation animation, float angle)
        {
            if (animation == null || animation.GetFrameCount() == 0 || angle == 0.0f)
            {
                return(false);
            }
            //rotate root node only
            NullSkeletonNodeAnimation node   = animation[0];
            List <Vector3>            poses  = node.GetPosition();
            List <Quaternion>         quates = node.GetQuat();

            for (int i = 0; i < animation.GetFrameCount(); i++)
            {
                Vector3    newPos  = Vector3.zero;
                Quaternion newQuat = Quaternion.identity;
                Vector3RotateCalculation(angle, poses[i], ref newPos, false);
                QuaternionRotateCalculation(angle, quates[i], ref newQuat);
                node.SetPosition(i, newPos);
                node.SetQuaternion(i, newQuat);
            }
            return(true);
        }