Class StepResponse<T>
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Assembly-CSharp.dll
A response curve with a step response.
public class StepResponse<T> : ResponseCurveBase<T>, IResponseCurve<T>
Type Parameters
T
- Inheritance
-
StepResponse<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
StepResponse(IEnumerable<float>, IEnumerable<T>, StepType)
public StepResponse(IEnumerable<float> inputSamples, IEnumerable<T> outputSamples, StepResponse.StepType stepType = StepType.Left)
Parameters
inputSamplesIEnumerable<float>outputSamplesIEnumerable<T>stepTypeStepResponse.StepType
Methods
GetStep(float, T, T)
Gets the step response that returns y0 for all inputs less than x, and y1 for all inputs greater than or equal to x.
public static StepResponse<T> GetStep(float x, T y0, T y1)
Parameters
xfloatThe x.
y0TThe y0.
y1TThe y1.
Returns
- StepResponse<T>
StepResponse.
Lerp(T, T, float)
Linearly interpolates between the two given samples.
protected override T Lerp(T outputSampleMin, T outputSampleMax, float t)
Parameters
outputSampleMinTThe value when t is less than or equal to 0.
outputSampleMaxTThe value when t is greater than or equal to 1.
tfloatThe fraction of the minimum sample to use.
Returns
- T