コード例 #1
0
ファイル: Keyframe.cs プロジェクト: qoh/TISFAT-Zero
 public KeyframeChangeInterpModeAction(Layer l, Frameset f, Keyframe frame, EntityInterpolationMode target)
 {
     LayerIndex    = Program.ActiveProject.Layers.IndexOf(l);
     FramesetIndex = l.Framesets.IndexOf(f);
     KeyframeIndex = f.Keyframes.IndexOf(frame);
     TargetMode    = target;
 }
コード例 #2
0
        public static float Interpolate(float t, float a, float b, EntityInterpolationMode mode)
        {
            switch (mode)
            {
            case EntityInterpolationMode.None:
                return(None(t, a, b));

            case EntityInterpolationMode.Linear:
                return(Linear(t, a, b));

            case EntityInterpolationMode.QuadInOut:
                return(QuadInOut(t, a, b));

            case EntityInterpolationMode.ExpoInOut:
                return(ExpoInOut(t, a, b));

            case EntityInterpolationMode.BounceOut:
                return(BounceOut(t, a, b));

            case EntityInterpolationMode.BackOut:
                return(BackOut(t, a, b));

            default:
                throw new System.ArgumentException("EntityInterpolationmode not valid.");
            }
        }
コード例 #3
0
 public void ChangeInterpolationMode(EntityInterpolationMode mode)
 {
     if (SelectedKeyframe != null)
     {
         Program.Form_Main.Do(new KeyframeChangeInterpModeAction(SelectedLayer, SelectedFrameset, SelectedKeyframe, mode));
     }
 }
コード例 #4
0
 public static Color Interpolate(float t, Color a, Color b, EntityInterpolationMode mode)
 {
     return(Color.FromArgb(
                (int)Interpolate(t, a.A, b.A, mode),
                (int)Interpolate(t, a.R, b.R, mode),
                (int)Interpolate(t, a.G, b.G, mode),
                (int)Interpolate(t, a.B, b.B, mode)));
 }
コード例 #5
0
ファイル: Interpolation.cs プロジェクト: noshbar/TISFAT-Zero
 public static Color Interpolate(float t, Color a, Color b, EntityInterpolationMode mode)
 {
     return Color.FromArgb(
     (int)Interpolate(t, a.A, b.A, mode),
     (int)Interpolate(t, a.R, b.R, mode),
     (int)Interpolate(t, a.G, b.G, mode),
     (int)Interpolate(t, a.B, b.B, mode));
 }
コード例 #6
0
ファイル: Interpolation.cs プロジェクト: noshbar/TISFAT-Zero
 public static RectangleF Interpolate(float t, RectangleF a, RectangleF b, EntityInterpolationMode mode)
 {
     return new RectangleF(
         Interpolate(t, a.X, b.X, mode),
         Interpolate(t, a.Y, b.Y, mode),
         Interpolate(t, a.Width, b.Width, mode),
         Interpolate(t, a.Height, b.Height, mode));
 }
コード例 #7
0
 public static RectangleF Interpolate(float t, RectangleF a, RectangleF b, EntityInterpolationMode mode)
 {
     return(new RectangleF(
                Interpolate(t, a.X, b.X, mode),
                Interpolate(t, a.Y, b.Y, mode),
                Interpolate(t, a.Width, b.Width, mode),
                Interpolate(t, a.Height, b.Height, mode)));
 }
コード例 #8
0
ファイル: Keyframe.cs プロジェクト: qoh/TISFAT-Zero
        public bool Do()
        {
            PrevMode = Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode;

            Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode = TargetMode;

            Program.MainTimeline.GLContext.Invalidate();
            return(true);
        }
コード例 #9
0
ファイル: Keyframe.cs プロジェクト: noshbar/TISFAT-Zero
 public void Read(BinaryReader reader, UInt16 version)
 {
     Time = reader.ReadUInt32();
     Type type = FileFormat.ResolveEntityStateID(reader.ReadUInt16());
     InterpMode = version >= 2 ? (EntityInterpolationMode)Enum.Parse(typeof(EntityInterpolationMode), reader.ReadString()) : EntityInterpolationMode.Linear;
     Type[] args = { };
     object[] values = { };
     State = (IEntityState)type.GetConstructor(args).Invoke(values);
     State.Read(reader, version);
 }
コード例 #10
0
ファイル: Keyframe.cs プロジェクト: qoh/TISFAT-Zero
        public void Read(BinaryReader reader, UInt16 version)
        {
            Time = reader.ReadUInt32();
            Type type = FileFormat.ResolveEntityStateID(reader.ReadUInt16());

            InterpMode = version >= 2 ? (EntityInterpolationMode)Enum.Parse(typeof(EntityInterpolationMode), reader.ReadString()) : EntityInterpolationMode.Linear;
            Type[]   args   = { };
            object[] values = { };
            State = (IEntityState)type.GetConstructor(args).Invoke(values);
            State.Read(reader, version);
        }
コード例 #11
0
                public static State Interpolate(float t, State current, State target, EntityInterpolationMode mode)
                {
                    State state = new State(current.Parent);
                    state.BitmapIndex = current.BitmapIndex;

                    state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode);
                    state.JointColor = Interpolation.Interpolate(t, current.JointColor, target.JointColor, mode);
                    state.Thickness = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode);

                    for (var i = 0; i < current.Children.Count; i++)
                    {
                        state.Children.Add(Interpolate(t, current.Children[i], target.Children[i], mode));
                    }

                    return state;
                }
コード例 #12
0
ファイル: Interpolation.cs プロジェクト: noshbar/TISFAT-Zero
        public static float Interpolate(float t, float a, float b, EntityInterpolationMode mode)
        {
            switch (mode)
            {
                case EntityInterpolationMode.None:
                    return None(t, a, b);
                case EntityInterpolationMode.Linear:
                    return Linear(t, a, b);
                case EntityInterpolationMode.QuadInOut:
                    return QuadInOut(t, a, b);
                case EntityInterpolationMode.ExpoInOut:
                    return ExpoInOut(t, a, b);
                case EntityInterpolationMode.BounceOut:
                    return BounceOut(t, a, b);
                case EntityInterpolationMode.BackOut:
                    return BackOut(t, a, b);

                default:
                    throw new System.ArgumentException("EntityInterpolationmode not valid.");
            }
        }
コード例 #13
0
ファイル: Interpolation.cs プロジェクト: noshbar/TISFAT-Zero
 public static Vector3 Interpolate(float t, Vector3 a, Vector3 b, EntityInterpolationMode mode)
 {
     return new Vector3(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode), Interpolate(t, a.Z, b.Z, mode));
 }
コード例 #14
0
ファイル: Keyframe.cs プロジェクト: noshbar/TISFAT-Zero
 public Keyframe(UInt32 time, IEntityState state, EntityInterpolationMode interpMode)
 {
     Time = time;
     State = state;
     InterpMode = interpMode;
 }
コード例 #15
0
 public static PointF Interpolate(float t, PointF a, PointF b, EntityInterpolationMode mode)
 {
     return(new PointF(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode)));
 }
コード例 #16
0
                public static State Interpolate(float t, State current, State target, EntityInterpolationMode mode)
                {
                    State state = new State(current.Parent);

                    state.BitmapIndex = current.BitmapIndex;

                    state.Location   = Interpolation.Interpolate(t, current.Location, target.Location, mode);
                    state.JointColor = Interpolation.Interpolate(t, current.JointColor, target.JointColor, mode);
                    state.Thickness  = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode);

                    for (var i = 0; i < current.Children.Count; i++)
                    {
                        state.Children.Add(Interpolate(t, current.Children[i], target.Children[i], mode));
                    }

                    return(state);
                }
コード例 #17
0
ファイル: Keyframe.cs プロジェクト: qoh/TISFAT-Zero
 public Keyframe()
 {
     Time       = 0;
     State      = null;
     InterpMode = EntityInterpolationMode.Linear;
 }
コード例 #18
0
ファイル: Interpolation.cs プロジェクト: noshbar/TISFAT-Zero
 public static PointF Interpolate(float t, PointF a, PointF b, EntityInterpolationMode mode)
 {
     return new PointF(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode));
 }
コード例 #19
0
ファイル: TextObject.cs プロジェクト: noshbar/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target = _target as State;
            State state = new State();

            state.Bounds = Interpolation.Interpolate(t, current.Bounds, target.Bounds, mode);

            state.Text = current.Text;
            state.TextAlignment = current.TextAlignment;
            state.TextFont = current.TextFont;
            state.TextColor = Interpolation.Interpolate(t, current.TextColor, target.TextColor, mode);

            return state;
        }
コード例 #20
0
 public IEntityState Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
 {
     return(_Interpolate(t, _current, _target, mode));
 }
コード例 #21
0
ファイル: PolyObject.cs プロジェクト: noshbar/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target = _target as State;
            State state = new State();

            state.Points = new List<Joint>();

            for (int i = 0; i < current.Points.Count; i++)
            {
                state.Points.Add(current.Points[i].Copy());
                state.Points[i].Location = Interpolation.Interpolate(t, current.Points[i].Location, target.Points[i].Location, mode);
            }

            state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode);

            return state;
        }
コード例 #22
0
ファイル: Timeline.cs プロジェクト: noshbar/TISFAT-Zero
 public void ChangeInterpolationMode(EntityInterpolationMode mode)
 {
     if (SelectedKeyframe != null)
         Program.Form_Main.Do(new KeyframeChangeInterpModeAction(SelectedLayer, SelectedFrameset, SelectedKeyframe, mode));
 }
コード例 #23
0
ファイル: LineObject.cs プロジェクト: noshbar/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target = _target as State;
            State state = new State();

            state.Handle1 = Interpolation.Interpolate(t, current.Handle1, target.Handle1, mode);
            state.Handle2 = Interpolation.Interpolate(t, current.Handle2, target.Handle2, mode);
            state.Thickness = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode);
            state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode);

            return state;
        }
コード例 #24
0
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target  = _target as State;
            State state   = new State();

            state.Root = Joint.State.Interpolate(t, current.Root, target.Root, mode);
            return(state);
        }
コード例 #25
0
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target  = _target as State;
            State state   = new State();

            state.Handle1   = Interpolation.Interpolate(t, current.Handle1, target.Handle1, mode);
            state.Handle2   = Interpolation.Interpolate(t, current.Handle2, target.Handle2, mode);
            state.Thickness = Interpolation.Interpolate(t, current.Thickness, target.Thickness, mode);
            state.Color     = Interpolation.Interpolate(t, current.Color, target.Color, mode);

            return(state);
        }
コード例 #26
0
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target  = _target as State;
            State state   = new State();

            state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode);
            state.Size     = Interpolation.Interpolate(t, current.Size, target.Size, mode);
            state.Color    = Interpolation.Interpolate(t, current.Color, target.Color, mode);

            return(state);
        }
コード例 #27
0
ファイル: PointLight.cs プロジェクト: qoh/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target  = _target as State;
            State state   = new State();

            state.Location         = Interpolation.Interpolate(t, current.Location, target.Location, mode);
            state.LightRadius      = Interpolation.Interpolate(t, current.LightRadius, target.LightRadius, mode);
            state.LightColor       = Interpolation.Interpolate(t, current.LightColor, target.LightColor, mode);
            state.LightAttenuation = Interpolation.Interpolate(t, current.LightAttenuation, target.LightAttenuation, mode);

            return(state);
        }
コード例 #28
0
ファイル: PolyObject.cs プロジェクト: qoh/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target  = _target as State;
            State state   = new State();

            state.Points = new List <Joint>();

            for (int i = 0; i < current.Points.Count; i++)
            {
                state.Points.Add(current.Points[i].Copy());
                state.Points[i].Location = Interpolation.Interpolate(t, current.Points[i].Location, target.Points[i].Location, mode);
            }

            state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode);

            return(state);
        }
コード例 #29
0
ファイル: TextObject.cs プロジェクト: noshbar/TISFAT-Zero
 public IEntityState Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
 {
     return _Interpolate(t, _current, _target, mode);
 }
コード例 #30
0
ファイル: PointLight.cs プロジェクト: noshbar/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target = _target as State;
            State state = new State();

            state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode);
            state.LightRadius = Interpolation.Interpolate(t, current.LightRadius, target.LightRadius, mode);
            state.LightColor = Interpolation.Interpolate(t, current.LightColor, target.LightColor, mode);
            state.LightAttenuation = Interpolation.Interpolate(t, current.LightAttenuation, target.LightAttenuation, mode);

            return state;
        }
コード例 #31
0
ファイル: Keyframe.cs プロジェクト: noshbar/TISFAT-Zero
 public KeyframeChangeInterpModeAction(Layer l, Frameset f, Keyframe frame, EntityInterpolationMode target)
 {
     LayerIndex = Program.ActiveProject.Layers.IndexOf(l);
     FramesetIndex = l.Framesets.IndexOf(f);
     KeyframeIndex = f.Keyframes.IndexOf(frame);
     TargetMode = target;
 }
コード例 #32
0
ファイル: Keyframe.cs プロジェクト: noshbar/TISFAT-Zero
        public bool Do()
        {
            PrevMode = Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode;

            Program.ActiveProject.Layers[LayerIndex].Framesets[FramesetIndex].Keyframes[KeyframeIndex].InterpMode = TargetMode;

            Program.MainTimeline.GLContext.Invalidate();
            return true;
        }
コード例 #33
0
ファイル: Keyframe.cs プロジェクト: qoh/TISFAT-Zero
 public Keyframe(UInt32 time, IEntityState state, EntityInterpolationMode interpMode)
 {
     Time       = time;
     State      = state;
     InterpMode = interpMode;
 }
コード例 #34
0
ファイル: Keyframe.cs プロジェクト: noshbar/TISFAT-Zero
 public Keyframe()
 {
     Time = 0;
     State = null;
     InterpMode = EntityInterpolationMode.Linear;
 }
コード例 #35
0
ファイル: BitmapObject.cs プロジェクト: qoh/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target  = _target as State;
            State state   = new State();

            state.Bounds      = Interpolation.Interpolate(t, current.Bounds, target.Bounds, mode);
            state.Rotation    = Interpolation.Interpolate(t, current.Rotation, target.Rotation, mode);
            state.BitmapAlpha = (int)Interpolation.Interpolate(t, current.BitmapAlpha, target.BitmapAlpha, mode);

            return(state);
        }
コード例 #36
0
 public static Vector3 Interpolate(float t, Vector3 a, Vector3 b, EntityInterpolationMode mode)
 {
     return(new Vector3(Interpolate(t, a.X, b.X, mode), Interpolate(t, a.Y, b.Y, mode), Interpolate(t, a.Z, b.Z, mode)));
 }
コード例 #37
0
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target  = _target as State;
            State state   = new State();

            state.Bounds = Interpolation.Interpolate(t, current.Bounds, target.Bounds, mode);

            state.Text          = current.Text;
            state.TextAlignment = current.TextAlignment;
            state.TextFont      = current.TextFont;
            state.TextColor     = Interpolation.Interpolate(t, current.TextColor, target.TextColor, mode);

            return(state);
        }
コード例 #38
0
ファイル: CircleObject.cs プロジェクト: noshbar/TISFAT-Zero
        private static IEntityState _Interpolate(float t, IEntityState _current, IEntityState _target, EntityInterpolationMode mode)
        {
            State current = _current as State;
            State target = _target as State;
            State state = new State();

            state.Location = Interpolation.Interpolate(t, current.Location, target.Location, mode);
            state.Size = Interpolation.Interpolate(t, current.Size, target.Size, mode);
            state.Color = Interpolation.Interpolate(t, current.Color, target.Color, mode);

            return state;
        }