Class Curve<T, K>
The Curve class.
Namespace: Evergine.Common.Curves
Assembly: Evergine.Common.dll
Syntax
public abstract class Curve<T, K> where K : CurveKeyframe<T>
Type Parameters
Name | Description |
---|---|
T | The type of the curve. |
K | The type of the keyframe. |
Constructors
Curve()
Initializes a new instance of the Curve<T, K> class.
Declaration
public Curve()
Properties
CacheSize
Gets or sets the cache size.
Declaration
public int CacheSize { get; set; }
Property Value
Type | Description |
---|---|
int |
HasValues
Gets a value indicating whether the curve has values.
Declaration
public bool HasValues { get; }
Property Value
Type | Description |
---|---|
bool |
IsCached
Gets or sets a value indicating whether the curve is cached.
Declaration
public bool IsCached { get; set; }
Property Value
Type | Description |
---|---|
bool |
Keyframes
Gets or sets the keyframes.
Declaration
public List<K> Keyframes { get; set; }
Property Value
Type | Description |
---|---|
List<K> |
Methods
AddKey(float, T)
Adds a key to the curve.
Declaration
public void AddKey(float lerp, T value)
Parameters
Type | Name | Description |
---|---|---|
float | lerp | The interpolation value. |
T | value | The key value. |
CreateKey(float, T)
Creates a new key element.
Declaration
protected abstract K CreateKey(float lerp, T value)
Parameters
Type | Name | Description |
---|---|---|
float | lerp | The lerp value. |
T | value | The value. |
Returns
Type | Description |
---|---|
K | The keyframe. |
GetValue(float)
Gets the value of the curve in a specific lerp.
Declaration
public T GetValue(float lerp)
Parameters
Type | Name | Description |
---|---|---|
float | lerp | The lerp. |
Returns
Type | Description |
---|---|
T | The value. |
Lerp(T, T, float)
Obtains an interpolated value between two curves.
Declaration
protected abstract T Lerp(T value1, T value2, float amount)
Parameters
Type | Name | Description |
---|---|---|
T | value1 | The first value. |
T | value2 | The second value. |
float | amount | The interpolation amount. |
Returns
Type | Description |
---|---|
T | The interpolated value. |
RemoveKey(K)
Removes a key.
Declaration
public void RemoveKey(K key)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key to remove. |