1
0
mirror of synced 2024-11-14 19:17:39 +01:00
Switch-Toolbox/Switch_Toolbox_Library/Animations/AnimationRewrite/InterpolationHelper.cs
KillzXGaming 644d94090f A big layout editor update.
Added support for previewing layout animations.
This includes pane SRT, tex SRT, material color (white/black blending), texture patterns, pane visibilty, and vertex colors.
Added textbox previewing.  The scaling will be off, and more features is planned (caching font data to disk for faster loading, improve rendering, etc).
Rotations now render correctly for X/Y axis.
Added game window preview. This removes any editor only drawn objects and also fits the layout to the screen (aka root pane) size.
Add support for rendering custom blending with layout materials.
Add support for loading character icons for mk8d. These are hardcoded and have been manually set. Note these will only load if within the menu.szs.
2019-09-28 17:27:48 -04:00

27 lines
688 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Toolbox.Library.Animations
{
public class InterpolationHelper
{
public static float Lerp(float LHS, float RHS, float Weight)
{
return LHS * (1 - Weight) + RHS * Weight;
}
public static float Herp(float LHS, float RHS, float LS, float RS, float Diff, float Weight)
{
float Result;
Result = LHS + (LHS - RHS) * (2 * Weight - 3) * Weight * Weight;
Result += (Diff * (Weight - 1)) * (LS * (Weight - 1) + RS * Weight);
return Result;
}
}
}