Implemented basic keyframes

This commit is contained in:
Robert committed 2020-01-09 16:56:46 +01:00
1 parent b734fa2f8f
commit 8a1759a575
41 files changed
+951 -123

No files matched your search

@@ -10,10 +10,14 @@ namespace Artemis.Core.Models.Profile.KeyframeEngines
{
public sealed override List<Type> CompatibleTypes { get; } = new List<Type> {typeof(SKPoint)};
public override object GetCurrentValue()
protected override object GetInterpolatedValue()
{
// Nothing fancy for now, just return the base value
return ((LayerProperty<SKPoint>) LayerProperty).Value;
var currentKeyframe = (Keyframe<SKPoint>) CurrentKeyframe;
var nextKeyframe = (Keyframe<SKPoint>) NextKeyframe;
var xDiff = nextKeyframe.Value.X - currentKeyframe.Value.X;
var yDiff = nextKeyframe.Value.Y - currentKeyframe.Value.Y;
return new SKPoint(currentKeyframe.Value.X + xDiff * KeyframeProgress, currentKeyframe.Value.Y + yDiff * KeyframeProgress);
}
}
}