|
Nebula
|
#include <envelopecurve.h>
An Attack/Sustain/Release envelope curve class with optional sine/cosine modulation.
Used for animated particle emitter attributes.
Public Types | |
| enum | ModFunc { Sine = 0 , Cosine } |
| modulation enumerator More... | |
Public Member Functions | |
| EnvelopeCurve () | |
| default constructor | |
| void | Setup (float val0, float val1, float val2, float val3, float keyPos0, float keyPos1, float freq, float amp, ModFunc mod) |
| set parameters | |
| float | Sample (float t) const |
| sample at specific time (0..1) | |
| void | PreSample (float *sampleBuffer, SizeT numSamples, SizeT sampleStride) const |
| sample from t=0 to t=1 into array of values | |
| float | GetMaxValue () const |
| get the max of val0, val1, val2, val3 | |
| float | GetMinValue () const |
| get the min of val0, v1l, val2, val3 | |
| const float * | GetValues () const |
| get values | |
| void | SetValues (float v0, float v1, float v2, float v3) |
| set values | |
| const float * | GetLimits () const |
| get limits in y | |
| void | SetLimits (float min, float max) |
| set limits in y | |
| const float | GetKeyPos0 () const |
| get keypos0 | |
| void | SetKeyPos0 (float f) |
| set keypos0 | |
| const float | GetKeyPos1 () const |
| get keypos1 | |
| void | SetKeyPos1 (float f) |
| set keypos1 | |
| const float | GetFrequency () const |
| get frequency | |
| void | SetFrequency (float f) |
| set frequency | |
| const float | GetAmplitude () const |
| get amplitude | |
| void | SetAmplitude (float f) |
| set amplitude | |
| const int | GetModFunc () const |
| get modFunction | |
| void | SetModFunc (int func) |
| set mod function | |
Private Attributes | |
| float | values [4] |
| float | limits [2] |
| float | keyPos0 |
| float | keyPos1 |
| float | frequency |
| float | amplitude |
| ModFunc | modFunction: 1 |
| Particles::EnvelopeCurve::EnvelopeCurve | ( | ) |
default constructor
|
inline |
get amplitude
|
inline |
get frequency
|
inline |
get keypos0
|
inline |
get keypos1
|
inline |
get limits in y
| float Particles::EnvelopeCurve::GetMaxValue | ( | ) | const |
get the max of val0, val1, val2, val3
| float Particles::EnvelopeCurve::GetMinValue | ( | ) | const |
get the min of val0, v1l, val2, val3
|
inline |
get modFunction
|
inline |
get values
| void Particles::EnvelopeCurve::PreSample | ( | float * | sampleBuffer, |
| SizeT | numSamples, | ||
| SizeT | sampleStride ) const |
sample from t=0 to t=1 into array of values
This samples N values from t=0 to t=1 into an array.
The array can then be used as a lookup table.
| float Particles::EnvelopeCurve::Sample | ( | float | t | ) | const |
sample at specific time (0..1)
NOTE: Sampling a single value is relatively expensive.
Consider pre-sampling into a lookup table!
|
inline |
set amplitude
|
inline |
set frequency
|
inline |
set keypos0
|
inline |
set keypos1
|
inline |
set limits in y
|
inline |
set mod function
| void Particles::EnvelopeCurve::Setup | ( | float | val0, |
| float | val1, | ||
| float | val2, | ||
| float | val3, | ||
| float | keyPos0, | ||
| float | keyPos1, | ||
| float | freq, | ||
| float | amp, | ||
| ModFunc | mod ) |
set parameters
|
inline |
set values
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |