Fix build errors

This commit is contained in:
KillzXGaming 2019-11-26 18:01:39 -05:00
parent 8f81c561f3
commit b9d5eb03da
2 changed files with 46 additions and 0 deletions

View file

@ -16,12 +16,37 @@ namespace Toolbox.Library.Animations
public bool HasKeys => KeyFrames.Count > 0;
public STAnimationTrack() { }
public STAnimationTrack(STInterpoaltionType interpolation) {
InterpolationType = interpolation;
}
public bool IsKeyed(float frame)
{
var matches = KeyFrames.Where(p => p.Frame == frame);
return matches != null && matches.Count() > 0;
}
public STKeyFrame[] GetFrame(float frame)
{
if (KeyFrames.Count == 0) return null;
STKeyFrame k1 = (STKeyFrame)KeyFrames[0], k2 = (STKeyFrame)KeyFrames[0];
foreach (STKeyFrame k in KeyFrames)
{
if (k.Frame < frame)
{
k1 = k;
}
else
{
k2 = k;
break;
}
}
return new STKeyFrame[] { k1, k2 };
}
//Key frame setup based on
//https://github.com/gdkchan/SPICA/blob/42c4181e198b0fd34f0a567345ee7e75b54cb58b/SPICA/Formats/CtrH3D/Animation/H3DFloatKeyFrameGroup.cs
public float GetFrameValue(float frame, float startFrame = 0)

View file

@ -13,9 +13,30 @@ namespace Toolbox.Library.Animations
public virtual float Slope { get; set; }
public STKeyFrame() { }
public STKeyFrame(int frame, float value) {
Frame = frame;
Value = value;
}
public STKeyFrame(float frame, float value) {
Frame = frame;
Value = value;
}
}
public class STCubicKeyFrame : STKeyFrame
{
public virtual float Coef0 { get; set; }
public virtual float Coef1 { get; set; }
public virtual float Coef2 { get; set; }
public virtual float Coef3 { get; set; }
}
public class STHermiteKeyFrame : STKeyFrame
{
public virtual float TangentIn { get; set; }
public virtual float TangentOut { get; set; }
}
}