window.kaolin
    Preparing search index...

    Namespace fps

    FPS tracking for interactive Kaolin viewers.

    Key classes / hooks:

    • InteractiveFps — framework-agnostic burst-aware sliding-window tracker. Measures FPS only over the most recent activity burst; returns null while idle so overlays never show a stale or misleading rate.
    • InteractiveFpsProvider — React context provider that owns (or wraps an external) InteractiveFps instance and re-renders consumers at a configurable refreshMs interval.
    • useFps — hook that subscribes to the current FpsValue snapshot.
    • useFrameReceiver — hook that returns a stable callback to call each time a frame arrives; does not itself cause a re-render.
    • FpsReadout — zero-config overlay component; shows an em dash while idle.

    Typical usage inside a viewer component:

    // Wrap the subtree that both produces and displays frames.
    <InteractiveFpsProvider windowMs={1000} idleThresholdMs={500} refreshMs={250}>
    <ViewportCanvas /> // calls useFrameReceiver() and notifies on each render
    <FpsReadout /> // re-renders at most once per refreshMs
    </InteractiveFpsProvider>

    // Inside ViewportCanvas:
    const frameReceived = useFrameReceiver();
    // ... after painting each frame:
    frameReceived();

    Classes

    InteractiveFps

    Functions

    useFps
    useFrameReceiver

    Interfaces

    InteractiveFpsOptions
    FpsValue
    InteractiveFpsProviderProps

    Variables

    InteractiveFpsProvider
    FpsReadout