AnimEngineDemo is built on top of MiaoAnimEngine
The demo (src/main.cpp) contrasts the two animation models AnimEngine
provides, using raylib only for visualization:
- Tween vs Spring, side by side — two balls chase the same target on the X
axis. Press
SPACEto flip the target and watch how each model reacts.- RED (Tween) — fixed-duration easing (
EaseInOut). Re-targeting mid-flight has to restart the animation, producing a visible snap. - BLUE (Spring) — physics-based, interruptible. Re-targeting keeps the current velocity and smoothly redirects, with no restart.
- RED (Tween) — fixed-duration easing (
- 3D perspective camera, grid, and an on-screen HUD showing each ball's position and the spring's live velocity.
- CMake 3.16 or higher
- C++17 compiler
- Dependencies are included as git submodules under
external/
mkdir build
cd build
cmake ..
cmake --build . --config ReleaseThe executable will be generated at build\Release\demo.exe
mkdir build
cd build
cmake ..
make -j$(nproc) # Linux
# or
cmake --build . # GenericThe executable will be generated at build/demo
If using CLion, Visual Studio, or other CMake-compatible IDEs:
- Open the project root directory
- The IDE will automatically detect CMakeLists.txt
- Select build configuration (Debug/Release)
- Click the build button
- The project automatically compiles
external/raylibandexternal/AnimEnginedependencies - raylib examples and games are disabled (
BUILD_EXAMPLES OFF) to speed up compilation - If git submodules are not initialized, run:
git submodule update --init --recursive