Table of Contents

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

inputSamples IEnumerable<float>
outputSamples IEnumerable<T>
stepType StepResponse.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

x float

The x.

y0 T

The y0.

y1 T

The 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

outputSampleMin T

The value when t is less than or equal to 0.

outputSampleMax T

The value when t is greater than or equal to 1.

t float

The fraction of the minimum sample to use.

Returns

T

See Also