Skip to content

Easing functions that allowed compile-time calculation with constexpr (C++ 11 or later)

License

Notifications You must be signed in to change notification settings

GOB52/gob_easing

Repository files navigation

gob_easing

日本語

Overview

This is an implementation of a basic easing function.
They are all constexpr functions. So compile-time computation can be used.
It is in the form of a PlatformIO and ArduinoIDE library, but can be used with other system in C++11 or later.
This is header-only library.

See also https://easings.net/

How to install

Install in an appropriate way depending on your environment.

  • git clone or download zip, and extract into place
  • PlatformIO platformio.ini
lib_deps = https://github.com/GOB52/gob_easing.git
  • Use library manager on ArduinoIDE

How to use

Just include gob_easing.hpp.
namespace is goblib::easing.

#include <gob_easing.hpp>

void foo()
{
    for(int i=0; i <= 100; ++i)
    {
        float t = (float)i / 100; // Clamp [0.0 - 1.0]
        float v = goblib::easing::inBack(t);  //Use this value for what you want to do.
    }
}

See examples for details.

Document

Can be created from a configuration file and shell script for Doxygen.
Output is to doc/html

bash doc/doxy.sh

or See also GitHub Pages

About

Easing functions that allowed compile-time calculation with constexpr (C++ 11 or later)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages