Struct ExponentialCurve
Assembly: fwt.hexterrains.dll
Syntax
[Serializable]
[BurstCompile]
public struct ExponentialCurve
Fields
CurveFactor
Declaration
[Tooltip("Curve factor. 1 means linear, more than 1 - Convex curve, Between 0 and 1 - Concave curvee")]
public float CurveFactor
Field Value
IsInverted
Declaration
[Tooltip("If true, the output value will be inverted (1 - value) after curve calculation and before applying scale and offset")]
public bool IsInverted
Field Value
MaxValue
Declaration
[Tooltip("Maximum value for the curve calculation. When input value is equals or more than this, the output is one")]
public float MaxValue
Field Value
MinValue
Declaration
[Tooltip("Minimum value for the curve calculation. When input value is below or equals this, the output is zero")]
public float MinValue
Field Value
OutputValueOffset
Declaration
[Tooltip("Offset added to the output value after curve calculation")]
public float OutputValueOffset
Field Value
OutputValueScale
Declaration
[Tooltip("Scale applied to the output value after curve calculation and adding offset")]
public float OutputValueScale
Field Value
Properties
Default
Declaration
public static ExponentialCurve Default { get; }
Property Value
Methods
CalculateCurve(float, float, float, float, out float)
Declaration
[BurstCompile]
public static void CalculateCurve(float value, float minValue, float maxValue, float curveFactor, out float result)
Parameters
CurvePow(float, float, out float)
Applies logical curve: progress^curveFactor
Declaration
[BurstCompile]
public static void CurvePow(float progress, float curveFactor, out float result)
Parameters
| Type |
Name |
Description |
| float |
progress |
Progress along the curve (x axis)
|
| float |
curveFactor |
1 means straight line from 0 to 1 with progress. More than 1 - Convex curve, Between 0 and 1 - Concave curve, negative - inversed curve
|
| float |
result |
|
Evaluate(float)
Calculates curved value for the given input value.
Declaration
[BurstCompile]
public float Evaluate(float inputValue)
Parameters
| Type |
Name |
Description |
| float |
inputValue |
|
Returns
Evaluate(float, out float)
Calculates curved value for the given input value.
Declaration
[BurstCompile]
public void Evaluate(float inputValue, out float result)
Parameters
| Type |
Name |
Description |
| float |
inputValue |
|
| float |
result |
|
Normalize01(float, float, float, out float)
Normalizes value between min and max to 0-1 range. Values below min return 0, values above max return 1.
Declaration
[BurstCompile]
public static void Normalize01(float value, float minValue, float maxValue, out float result)
Parameters
| Type |
Name |
Description |
| float |
value |
value to normalize between min and max to 0-1 range.
|
| float |
minValue |
if value is below or equals to this, the result is 0
|
| float |
maxValue |
if value is above or equals to this, the result is 1
|
| float |
result |
|
Extension Methods