Files
sbox-public/game/editor/MovieMaker/Code/Signals/Operations/Interpolate.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

17 lines
530 B
C#

using Sandbox.MovieMaker;
namespace Editor.MovieMaker;
#nullable enable
public abstract record InterpolateOperation<T>( PropertySignal<T> First, PropertySignal<T> Second ) : BinaryOperation<T>( First, Second )
{
[SkipHotload]
private static readonly IInterpolator<T> _interpolator = Interpolator.GetDefaultOrThrow<T>();
public abstract float GetAlpha( MovieTime time );
public override T GetValue( MovieTime time ) =>
_interpolator.Interpolate( First.GetValue( time ), Second.GetValue( time ), GetAlpha( time ) );
}