Class Curve<T, K>
The curve class.
Inherited Members
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 or not.
Declaration
public bool IsCached { get; set; }
Property Value
Type | Description |
---|---|
bool |
Keyframes
Gets the key frames.
Declaration
public List<K> Keyframes { get; }
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 lerp. |
T | value | The key value. |
CreateKey(float, T)
Cretes a new key element.
Declaration
protected abstract K CreateKey(float lerp, T value)
Parameters
Type | Name | Description |
---|---|---|
float | lerp | The lerp. |
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 2 curves.
Declaration
protected abstract T Lerp(T value1, T value2, float amount)
Parameters
Type | Name | Description |
---|---|---|
T | value1 | The value 1. |
T | value2 | The value 2. |
float | amount | The lerp 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. |