Skip to main content

Module ffi

Module ffi 

Source
Expand description

A C ABI over the engine, so it can be called from outside Rust.

This exists for the preview: the engine is built for wasm32 and driven from the page, which means what you tune in a browser is this code and not a copy of it in JavaScript. A copy would drift the first time either changed, and the drift would be invisible — the page would still animate plausibly.

Only f64 and integers cross the boundary, so there is nothing to allocate, free or get wrong about ownership.

Functions§

curve 🔒
The curve at index in Curve::all, or the default if out of range.
solium_curve_at
A curve’s value at normalised time t.
solium_curve_count
How many curves there are, so a caller can enumerate them.
solium_progress
Progress of a fixed-duration animation, for callers that would rather not divide by the duration themselves.
solium_spring_at
A spring’s value seconds after it was released.
solium_spring_settle_ms
How long a spring takes to settle, in milliseconds.
spring 🔒