Color legend plain property method
The base of every shaping function: a curve that takes an input from 0 to 1 and gives an output.
An abstract class. Every function of the library derives from it, and so does a custom function. The catalog page shows its properties in context.
Names are colored by what they are: a property or a method; values and fields keep the plain color.
Properties
Category →
ShapingFunctionCategory · Read-only. The family the function belongs to: the category the catalog lists it under. Custom for a custom function.
HasVariableOrder →
bool · Read-only. Whether the function has a settable order N: whether it implements INOrder. true for DoubleOddPolynomialSeat and DoublePolynomialSigmoid.
Id →
ShapingFunctionId · Read-only. Which function it is: ShapingFunctionFactory.Create(fn.Id) creates another of it, with its parameters at their defaults. Custom for a custom function.
Name →
string · Read-only. A name to show, such as "Cubic EaseInOut". Each function of the library has its own. Save the Id, not the name.
Order →
int? · Read-only. The degree of the polynomials the curve is made of: 1 for Linear, 2 for the quadratics, Bounce and BezierQuadratic, 3 for the cubics, Back and BezierCubic, 4, 5 and 6 for the quartics, the quintics and Blinn-Wyvill. null for the curves that aren’t polynomials, and for the NOrder functions, whose degree is set by N.
ParameterCount →
int · Read-only. How many of the parameters A, B, C and D the function takes, 0 to 4, read from the parameter interface it implements. N isn’t counted: see HasVariableOrder.
Parametric →
bool · Read-only. Whether the function has any parameter, A to D or N: ParameterCount above 0 or HasVariableOrder.
Fields
ParameterEpsilon →
float · Protected constant. 0.00001: the margin that keeps a parameter away from 0 and 1 where its curve would divide by 0. Outside the Béziers, the library keeps A within 0.00001 to 0.99999 with it.
Methods
BaseShapingFunction() →
BaseShapingFunction(string name, int? order = null) · Protected. The constructor of a custom function. Its Id and Category are Custom; the library’s own functions use a constructor that only the library can call, so every other ID names a function of the library.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The Name to show. |
order |
int? |
The Order: the degree of the curve’s polynomials, or null, the default, when it has none. |
CalculateCore() →
CalculateCore(float input) · Protected, abstract. The curve itself, which every function overrides. Called by CalculateOutput with the input already clamped to 0 to 1, or NaN. Returns the output.
| Parameter | Type | Description |
|---|---|---|
input |
float |
From 0 to 1, or NaN. |
CalculateOutput() →
CalculateOutput(float input) · The output of the curve for the input. Clamps the input to 0 to 1 first, so −0.5 gives the output of 0 and 2 that of 1; NaN gives NaN. The library’s functions give exactly 0 for 0 and exactly 1 for 1, whatever their parameters. Changes nothing, so the same input always gives the same output.
| Parameter | Type | Description |
|---|---|---|
input |
float |
How far along, usually from 0 to 1. |
ClampParameter() →
ClampParameter(float value, float min = 0, float max = 1) · Protected, static. The value clamped to min to max, for a parameter’s setter. Throws ArgumentOutOfRangeException for NaN, which would pass through a clamp and spoil every output after it.
| Parameter | Type | Description |
|---|---|---|
value |
float |
The value being set. |
min |
float |
The lowest value, 0 by default. |
max |
float |
The highest value, 1 by default. |