cbounce is an experimental C99 single-header port of Bounce, a C++ 3D physics
engine by Irlan Robson.
This current release is intentionally small. It contains the generated single-header API and one self-checking example.
Try it at https://cstaavetti.github.io/cbounce/
This is v0.1.0. There is no documented known functional parity gap against the
covered Bounce behavior, but broader randomized and long-running solver/contact
stress coverage is still pending. Treat this as an integration trial release,
not a stability guarantee.
Initial tests seem to indicate that this port is more performant and slightly more accurate in some of the originals tests.
Include cbounce.h normally for declarations. In exactly one C translation
unit, define CBOUNCE_IMPLEMENTATION before including it:
#define CBOUNCE_IMPLEMENTATION
#include "cbounce.h"Build with the math library:
cc your_file.c -I. -std=c99 -Wall -Wextra -pedantic -O2 -lm -o your_appRun the self-checking example:
make exampleBoth targets build examples/example.c into build/example.
Build the browser FPS collapse demo:
make webThis writes a static site to build/web/site. To run the smoke test:
make web-testTo play it locally:
make web-serveThen open http://localhost:8000.
The demo uses cbounce compiled to WebAssembly for physics and loads Three.js
from a pinned jsDelivr CDN URL for rendering.
cbounce.h- generated single-header release artifact.examples/example.c- self-checking single-header usage example.examples/web/- WebAssembly FPS collapse demo.license.txt- zlib-style license from Bounce.