예제 #1
0
        public override AnimationFrameBase FrameForTime(int time, AnimationFrameBase startKeyFrameBase, AnimationFrameBase endKeyFrameBase)
        {
            var startKeyFrame = startKeyFrameBase as AnimationFrame;
            var endKeyFrame   = endKeyFrameBase as AnimationFrame;

            AnimationFrame animationFrame = new AnimationFrame();

            animationFrame.Transform     = new Transform3D();
            animationFrame.Transform.M34 = startKeyFrame.Transform.M34;



            //if (startKeyFrame.Transform.Translate != null) {
            Transform3DTranslate translate = new Transform3DTranslate();

            translate.Tx = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Translate.Tx, endKeyFrame.Transform.Translate.Tx, time);
            translate.Ty = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Translate.Ty, endKeyFrame.Transform.Translate.Ty, time);
            translate.Tz = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Translate.Tz, endKeyFrame.Transform.Translate.Tz, time);
            animationFrame.Transform.Translate = translate;
            //}

            //if (startKeyFrame.Transform.Rotate != null) {
            Transform3DRotate rotate = new Transform3DRotate();

            rotate.Angle = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Rotate.Angle, endKeyFrame.Transform.Rotate.Angle, time);
            rotate.X     = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Rotate.X, endKeyFrame.Transform.Rotate.X, time);
            rotate.Y     = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Rotate.Y, endKeyFrame.Transform.Rotate.Y, time);
            rotate.Z     = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Rotate.Z, endKeyFrame.Transform.Rotate.Z, time);
            animationFrame.Transform.Rotate = rotate;
            //}


            //if (startKeyFrame.Transform.Scale != null) {
            Transform3DScale scale = new Transform3DScale();

            scale.Sx = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Scale.Sx, endKeyFrame.Transform.Scale.Sx, time);
            scale.Sy = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Scale.Sy, endKeyFrame.Transform.Scale.Sy, time);
            scale.Sz = TweenValueForStartTime(startKeyFrame.Time, endKeyFrame.Time, startKeyFrame.Transform.Scale.Sz, endKeyFrame.Transform.Scale.Sz, time);
            animationFrame.Transform.Scale = scale;
            //}
            return(animationFrame);
        }
 public Transform3D()
 {
     Scale = new Transform3DScale()
     {
         Sx = 1.0f,
         Sy = 1.0f,
         Sz = 1.0f
     };
     Rotate = new Transform3DRotate()
     {
         Angle = 0.0f,
         X     = 1.0f,
         Y     = 1.0f,
         Z     = -1.0f
     };
     Translate = new Transform3DTranslate()
     {
         Tx = 0.0f,
         Ty = 0.0f,
         Tz = 50.0f
     };
     M34 = 0.3f;
 }