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

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