mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Fix build errors
This commit is contained in:
parent
8f81c561f3
commit
b9d5eb03da
2 changed files with 46 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue