A curve or 2D graph represented by an array of values. The array index represents the horizontal (X) and the value of each represents the vertical (Y) of the graph. More...
Public Member Functions | |
plyCurve (int valuesCount, int yMin, int yMax) | |
Constructor. More... | |
plyCurve (plyCurve c) | |
Copy constructor. More... | |
void | Create (int valuesCount, int yMin, int yMax) |
Creates a new curve and destroys old values. More... | |
void | Reset () |
Resets the curve, removing any manual changes made to values. More... | |
int | GetYValue (int xValue) |
Same as calling values[xValue], returning the vertical value from graph. More... | |
int | GetXValue (float yValue) |
Returns the horizontal value from graph that is close to the given vertical value. More... | |
Public Attributes | |
int | yMin = 0 |
The minimum for a vertical value. | |
int | yMax = 100 |
The maximum a vertical value can reach. | |
int[] | values = new int[100] |
the Y (Vertical) value for each position of X (horizontal). (X always starts at 0) | |
plyUtil.EasingType | easingType = plyUtil.EasingType.Linear |
float | acceleration = 1f |
A curve or 2D graph represented by an array of values. The array index represents the horizontal (X) and the value of each represents the vertical (Y) of the graph.
plyCommon.plyCurve.plyCurve | ( | int | valuesCount, |
int | yMin, | ||
int | yMax | ||
) |
Constructor.
valuesCount | Number of values to init curve to. |
yMin | The minimum. |
yMax | The maximum. |
void plyCommon.plyCurve.Create | ( | int | valuesCount, |
int | yMin, | ||
int | yMax | ||
) |
Creates a new curve and destroys old values.
valuesCount | Number of values to init curve to. |
yMin | The minimum. |
yMax | The maximum. |
int plyCommon.plyCurve.GetXValue | ( | float | yValue | ) |
Returns the horizontal value from graph that is close to the given vertical value.
yValue | The value to lookup |
int plyCommon.plyCurve.GetYValue | ( | int | xValue | ) |
Same as calling values[xValue], returning the vertical value from graph.
xValue | The value. |
void plyCommon.plyCurve.Reset | ( | ) |
Resets the curve, removing any manual changes made to values.