Helper class for blending multiple animations based on a parameter vector.
More...
#include <Animation/CGradientBandInterpolation.h>
|
| struct | SSample |
| | Represents an animation sample point with its associated weight. More...
|
|
| core::array< SSample * > & | getSamples () |
| | Gets the list of animation samples.
|
| SSample * | addSample (int id, const core::vector3df &vector) |
| | Adds a new animation sample point.
|
| void | removeSample (SSample *sample) |
| | Removes a specific animation sample.
|
|
void | clear () |
| | Removes all animation samples.
|
| void | sampleWeightsPolar (const core::vector3df &vector) |
| | Calculates blending weights using polar gradient band interpolation.
|
| void | sampleWeightsCartesian (const core::vector3df &vector) |
| | Calculates blending weights using Cartesian gradient band interpolation.
|
|
|
core::array< SSample * > | m_samples |
| | List of all animation samples.
|
Helper class for blending multiple animations based on a parameter vector.
This is typically used for locomotion systems (e.g., blending Idle, Walk, Run based on velocity). Reference: https://github.com/runevision/LocomotionSystem
Example: Locomotion blending
CGradientBandInterpolation blending;
blending.
addSample(ID_IDLE, core::vector3df(0, 0, 0));
blending.
addSample(ID_WALK, core::vector3df(0, 0, 1.5f));
blending.
addSample(ID_RUN, core::vector3df(0, 0, 5.0f));
core::vector3df velocity(0, 0, 3.0f);
animController->getSkeleton(sample->Id)->getTimeline().Weight = sample->Weight;
}
void sampleWeightsPolar(const core::vector3df &vector)
Calculates blending weights using polar gradient band interpolation.
core::array< SSample * > & getSamples()
Gets the list of animation samples.
Definition CGradientBandInterpolation.h:95
SSample * addSample(int id, const core::vector3df &vector)
Adds a new animation sample point.
◆ addSample()
| SSample * Skylicht::CGradientBandInterpolation::addSample |
( |
int | id, |
|
|
const core::vector3df & | vector ) |
Adds a new animation sample point.
- Parameters
-
| id | The sample ID. |
| vector | The position in parameter space. |
- Returns
- Pointer to the newly created sample.
◆ getSamples()
| core::array< SSample * > & Skylicht::CGradientBandInterpolation::getSamples |
( |
| ) |
|
|
inline |
Gets the list of animation samples.
- Returns
- Reference to the samples array.
◆ removeSample()
| void Skylicht::CGradientBandInterpolation::removeSample |
( |
SSample * | sample | ) |
|
Removes a specific animation sample.
- Parameters
-
| sample | Pointer to the sample to remove. |
◆ sampleWeightsCartesian()
| void Skylicht::CGradientBandInterpolation::sampleWeightsCartesian |
( |
const core::vector3df & | vector | ) |
|
Calculates blending weights using Cartesian gradient band interpolation.
Best suited for 2D/3D parameter spaces without directional wrapping.
- Parameters
-
| vector | The input parameter vector. |
◆ sampleWeightsPolar()
| void Skylicht::CGradientBandInterpolation::sampleWeightsPolar |
( |
const core::vector3df & | vector | ) |
|
Calculates blending weights using polar gradient band interpolation.
Best suited for parameters like direction and speed.
- Parameters
-
| vector | The input parameter vector (e.g., target velocity). |
The documentation for this class was generated from the following file: