UNPKG

@threlte/rapier

Version:

Components and hooks to use the Rapier physics engine in Threlte

17 lines (16 loc) 826 B
import { type Key, type ThrelteUseTask, type ThrelteUseTaskOptions } from '@threlte/core'; /** * Adds a handler to the physics simulation. The handler is always executed as * part of the simulation stage and before the simulation task. * * `start` and `stop` functions are returned and the options allow setting the * handler to not start automatically. * * Use the options `after` and `before` to control the order of execution. * * @param {(delta: number) => void} fn callback function * @param {ThrelteUseTaskOptions} options options * @returns {ThrelteUseTask} */ export declare function usePhysicsTask(fn: (delta: number) => void, options?: ThrelteUseTaskOptions): ThrelteUseTask; export declare function usePhysicsTask(key: Key, fn: (delta: number) => void, options?: ThrelteUseTaskOptions): ThrelteUseTask;