Archive 17/01/2023.

:fallen_leaf: Polynomials & Harmonics

Modanung

I’ve implemented some classes for polynomials and harmonics, which I think might be useful to others as well. It’s still unpolished, but functional. Should also work well as ValueAnimation interpolation mode, with key frame time used as scalars.

Feel free to provide feedback on the implementation.
Here’s a little demo of what it can do, and a preview of what’s to come:

For the particle system I intend to add some extremity pruning, which should - for the most part - replace particle lifetime limitations.

Modanung

Driven by one TypedPolynomial<Vector3>:

Constructed from these Polynomials:

{ { 0.f,  1.f,  1.f },        { 0.f, .8f, }, PT_HARMONIC_SIN }
{ { .5f, -.2f, 1.5f, -0.5f }, { .5f, .2f, }, PT_HARMONIC_SIN }
{ { 0.f,  1.f,  1.f },        { 0.f, .8f, }, PT_HARMONIC_COS }
Modanung

One simple usecase for the TypedPolynomial might be calculating the trajectory of a projectile:

typedPolynomial.SetCoefficient(0, node_->GetWorldPosition());
typedPolynomial.SetCoefficient(1, rigidBody_->GetLinearVelocity());
typedPolynomial.SetCoefficient(2, gravity);
Modanung

And of course they lend themselves well for sound synthesis.

Modanung
Modanung